summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/SETUP.sh2
-rw-r--r--client/CMakeLists.txt2
-rw-r--r--client/Makefile.am11
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysql_upgrade.c15
-rw-r--r--client/mysqladmin.cc3
-rw-r--r--client/mysqlbinlog.cc4
-rw-r--r--client/mysqlcheck.c2
-rw-r--r--client/mysqldump.c2
-rw-r--r--client/mysqltest.cc15
-rw-r--r--client/sql_string.h3
-rw-r--r--cmake/plugin.cmake4
-rw-r--r--config.h.cmake2
-rw-r--r--config/ac-macros/libevent.m42
-rw-r--r--configure.in12
-rw-r--r--dbug/dbug.c6
-rw-r--r--extra/CMakeLists.txt2
-rw-r--r--extra/replace.c2
-rw-r--r--include/hash.h5
-rw-r--r--include/keycache.h2
-rw-r--r--include/m_ctype.h8
-rw-r--r--include/m_string.h6
-rw-r--r--include/my_atomic.h2
-rw-r--r--include/my_bit.h2
-rw-r--r--include/my_bitmap.h3
-rw-r--r--include/my_global.h7
-rw-r--r--include/my_pthread.h14
-rw-r--r--include/my_sys.h12
-rw-r--r--include/my_valgrind.h2
-rw-r--r--include/myisamchk.h2
-rw-r--r--include/mysql.h.pp2
-rw-r--r--include/mysql/plugin.h2
-rw-r--r--include/mysql/plugin_audit.h.pp29
-rw-r--r--include/mysql/plugin_auth.h.pp45
-rw-r--r--include/mysql/plugin_ftparser.h10
-rw-r--r--include/mysql/plugin_ftparser.h.pp29
-rw-r--r--include/mysql/psi/mysql_thread.h8
-rw-r--r--include/mysql_com.h3
-rw-r--r--include/thr_lock.h4
-rw-r--r--include/wqueue.h2
-rw-r--r--libmysql/CMakeLists.txt2
-rw-r--r--libmysql/Makefile.shared2
-rw-r--r--libmysql/client_settings.h2
-rw-r--r--libmysql/libmysql.c10
-rw-r--r--libmysqld/CMakeLists.txt2
-rw-r--r--libmysqld/Makefile.am2
-rw-r--r--libmysqld/lib_sql.cc23
-rw-r--r--mysql-test/extra/rpl_tests/rpl_innodb.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_start_stop_slave.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test1
-rw-r--r--mysql-test/include/ctype_numconv.inc2
-rw-r--r--mysql-test/include/diff_tables.inc2
-rw-r--r--mysql-test/include/have_dynamic_loading.inc9
-rw-r--r--mysql-test/include/have_example_plugin.inc7
-rw-r--r--mysql-test/include/have_innodb.opt2
-rw-r--r--mysql-test/include/have_semisync_plugin.inc10
-rw-r--r--mysql-test/include/have_simple_parser.inc7
-rw-r--r--mysql-test/include/have_udf.inc8
-rw-r--r--mysql-test/include/have_xtradb.inc9
-rw-r--r--mysql-test/include/mysqld--help.inc2
-rw-r--r--mysql-test/lib/mtr_cases.pm12
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl1
-rwxr-xr-xmysql-test/mysql-test-run.pl21
-rw-r--r--mysql-test/r/archive.result12
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/ctype_binary.result1
-rw-r--r--mysql-test/r/ctype_cp1251.result1
-rw-r--r--mysql-test/r/ctype_latin1.result1
-rw-r--r--mysql-test/r/ctype_ucs.result8
-rw-r--r--mysql-test/r/ctype_utf16.result1
-rw-r--r--mysql-test/r/ctype_utf32.result1
-rw-r--r--mysql-test/r/ctype_utf8.result2
-rw-r--r--mysql-test/r/func_math.result4
-rw-r--r--mysql-test/r/grant.result6
-rw-r--r--mysql-test/r/index_merge_innodb.result38
-rw-r--r--mysql-test/r/information_schema.result14
-rw-r--r--mysql-test/r/innodb-lock.result57
-rw-r--r--mysql-test/r/innodb-semi-consistent.result47
-rw-r--r--mysql-test/r/innodb-zip.result421
-rw-r--r--mysql-test/r/innodb.result3305
-rw-r--r--mysql-test/r/innodb_bug36172.result1
-rw-r--r--mysql-test/r/innodb_bug47167.result24
-rw-r--r--mysql-test/r/innodb_file_format.result44
-rw-r--r--mysql-test/r/join_cache.result3
-rw-r--r--mysql-test/r/join_optimizer.result2
-rw-r--r--mysql-test/r/join_outer_jcl6.result15
-rw-r--r--mysql-test/r/log_slow.result7
-rw-r--r--mysql-test/r/log_tables_upgrade.result1
-rw-r--r--mysql-test/r/merge_debug.result4
-rw-r--r--mysql-test/r/myisam.result2
-rw-r--r--mysql-test/r/mysql_upgrade.result8
-rw-r--r--mysql-test/r/mysql_upgrade_ssl.result16
-rw-r--r--mysql-test/r/mysqld--help-notwin.result93
-rw-r--r--mysql-test/r/not_partition.result2
-rw-r--r--mysql-test/r/optimizer_switch.result99
-rw-r--r--mysql-test/r/optimizer_switch_eng_cond_pushdown1.result2
-rw-r--r--mysql-test/r/optimizer_switch_eng_cond_pushdown2.result2
-rw-r--r--mysql-test/r/partition_innodb.result3
-rw-r--r--mysql-test/r/partition_key_cache.result4
-rw-r--r--mysql-test/r/partition_pruning.result2
-rw-r--r--mysql-test/r/plugin.result6
-rw-r--r--mysql-test/r/ps.result4
-rw-r--r--mysql-test/r/query_cache.result9
-rw-r--r--mysql-test/r/query_cache_debug.result12
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/select_jcl6.result153
-rw-r--r--mysql-test/r/select_pkeycache.result153
-rw-r--r--mysql-test/r/show_check.result2
-rw-r--r--mysql-test/r/single_delete_update.result54
-rw-r--r--mysql-test/r/sp.result6
-rw-r--r--mysql-test/r/status_user.result1
-rw-r--r--mysql-test/r/subselect.result55
-rw-r--r--mysql-test/r/subselect3.result7
-rw-r--r--mysql-test/r/subselect3_jcl6.result56
-rw-r--r--mysql-test/r/subselect4.result29
-rw-r--r--mysql-test/r/subselect_cache.result232
-rw-r--r--mysql-test/r/subselect_no_mat.result337
-rw-r--r--mysql-test/r/subselect_no_opts.result337
-rw-r--r--mysql-test/r/subselect_no_semijoin.result337
-rw-r--r--mysql-test/r/subselect_sj2.result7
-rw-r--r--mysql-test/r/subselect_sj2_jcl6.result9
-rw-r--r--mysql-test/r/table_options.result46
-rw-r--r--mysql-test/r/type_datetime.result6
-rw-r--r--mysql-test/r/type_varchar.result2
-rw-r--r--mysql-test/r/warnings.result2
-rw-r--r--mysql-test/r/xtradb_mrr.result (renamed from mysql-test/r/innodb_mrr.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result4
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_index-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_old_versions.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test4
-rw-r--r--mysql-test/suite/federated/federated_debug.result5
-rw-r--r--mysql-test/suite/federated/federated_plugin-master.opt1
-rw-r--r--mysql-test/suite/innodb/combinations12
-rw-r--r--mysql-test/suite/innodb/r/innodb.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53591.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result2
-rw-r--r--mysql-test/suite/innodb/suite.pm19
-rw-r--r--mysql-test/suite/innodb/t/disabled.def1
-rw-r--r--mysql-test/suite/innodb/t/innodb-analyze.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-44030.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-optimize.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test14
-rw-r--r--mysql-test/suite/innodb/t/innodb-consistent.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-index_ucs2.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-replace.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-semi-consistent.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-system-table-view.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-timeout.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-ucs2.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-use-sys-malloc.test24
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb.test19
-rw-r--r--mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug21704.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30919.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug34053.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug34300.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug35220.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36169.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36172.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug38231.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug39438.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug40360.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug40565.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug41904.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42419.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44032.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44369.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44571.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug45357.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug46000.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug46676.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47167.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47621.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47622.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47777.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug48024.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug49164.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug51378.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug51920.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52199.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52663.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52745.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53290.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53591.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53592.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53674.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug54044.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug54679.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56716.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug57255.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_gis.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_information_schema.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_multi_update.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql_rbk.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_notembedded.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_timeout_rollback.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_trx_weight.test1
-rw-r--r--mysql-test/suite/maria/r/compat_aliases.result4
-rw-r--r--mysql-test/suite/maria/r/maria-connect.result12
-rw-r--r--mysql-test/suite/maria/r/maria-no-logging.result4
-rw-r--r--mysql-test/suite/maria/r/maria-recovery-rtree-ft.result12
-rw-r--r--mysql-test/suite/maria/r/maria-recovery.result2
-rw-r--r--mysql-test/suite/maria/r/maria-recovery2.result6
-rw-r--r--mysql-test/suite/maria/r/maria-recovery3.result2
-rw-r--r--mysql-test/suite/maria/r/maria.result109
-rw-r--r--mysql-test/suite/maria/r/maria2.result1
-rw-r--r--mysql-test/suite/maria/r/maria3.result11
-rw-r--r--mysql-test/suite/maria/r/ps_maria.result396
-rw-r--r--mysql-test/suite/maria/t/maria-connect.test2
-rw-r--r--mysql-test/suite/maria/t/maria-no-logging.test2
-rw-r--r--mysql-test/suite/maria/t/maria-preload-master.opt1
-rw-r--r--mysql-test/suite/maria/t/maria-recovery-rtree-ft.test2
-rw-r--r--mysql-test/suite/maria/t/maria-recovery.test2
-rw-r--r--mysql-test/suite/maria/t/maria-recovery2.test2
-rw-r--r--mysql-test/suite/maria/t/maria-recovery3.test2
-rw-r--r--mysql-test/suite/maria/t/maria.test15
-rw-r--r--mysql-test/suite/maria/t/maria2.test1
-rw-r--r--mysql-test/suite/maria/t/maria3.test2
-rw-r--r--mysql-test/suite/parts/r/partition_repair_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result4
-rw-r--r--mysql-test/suite/parts/t/partition_debug_innodb.test1
-rw-r--r--mysql-test/suite/parts/t/partition_debug_myisam-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_debug_myisam.test1
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb-master.opt2
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.test2
-rw-r--r--mysql-test/suite/percona/percona_innodb_doublewrite_file.test2
-rw-r--r--mysql-test/suite/percona/percona_innodb_use_sys_stats_table-master.opt2
-rw-r--r--mysql-test/suite/percona/percona_innodb_use_sys_stats_table.test2
-rw-r--r--mysql-test/suite/percona/percona_xtradb_admin_command.test2
-rw-r--r--mysql-test/suite/percona/percona_xtradb_bug317074.test2
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade.result180
-rw-r--r--mysql-test/suite/perfschema/t/no_threads-master.opt2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ddl.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_maria.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test12
-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-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.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_maria.test2
-rw-r--r--mysql-test/suite/sys_vars/r/all_vars.result2
-rw-r--r--mysql-test/suite/sys_vars/r/aria_block_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/aria_checkpoint_interval_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/aria_force_start_after_recovery_failures_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/aria_group_commit_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/aria_group_commit_interval_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/aria_log_file_size_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/aria_log_purge_type_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/aria_max_sort_file_size_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/aria_page_checksum_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/r/aria_pagecache_age_threshold_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/aria_pagecache_division_limit_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/aria_recover_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/aria_repair_threads_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/aria_stats_method_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/aria_sync_log_dir_basic.result45
-rw-r--r--mysql-test/suite/sys_vars/r/aria_used_for_temp_tables_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/deadlock_search_depth_long_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/deadlock_search_depth_short_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/deadlock_timeout_long_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/deadlock_timeout_short_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/debug_crc_break_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/r/default_storage_engine_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/extra_max_connections_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/extra_port_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/join_cache_level_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_segments_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_filter_basic.result96
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/r/maria_block_size_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/maria_checkpoint_interval_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/maria_force_start_after_recovery_failures_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/maria_group_commit_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/maria_group_commit_interval_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/maria_log_file_size_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/maria_log_purge_type_basic.result49
-rw-r--r--mysql-test/suite/sys_vars/r/maria_max_sort_file_size_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/maria_page_checksum_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/maria_pagecache_age_threshold_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/maria_pagecache_buffer_size_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/maria_pagecache_division_limit_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/maria_recover_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/maria_repair_threads_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/maria_sort_buffer_size_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/maria_stats_method_basic.result52
-rw-r--r--mysql-test/suite/sys_vars/r/maria_sync_log_dir_basic.result49
-rw-r--r--mysql-test/suite/sys_vars/r/maria_used_for_temp_tables_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/mrr_buffer_size_basic.result50
-rw-r--r--mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_use_mrr_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/plugin_dir_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/plugin_maturity_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/rowid_merge_buff_size_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/storage_engine_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/thread_stack_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/userstat_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars.test59
-rw-r--r--mysql-test/suite/sys_vars/t/aria_block_size_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/aria_checkpoint_interval_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/aria_force_start_after_recovery_failures_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/aria_group_commit_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_group_commit_interval_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/aria_log_file_size_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_log_purge_type_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_max_sort_file_size_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_page_checksum_basic.test39
-rw-r--r--mysql-test/suite/sys_vars/t/aria_pagecache_age_threshold_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_pagecache_buffer_size_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/aria_pagecache_division_limit_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/aria_recover_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/aria_repair_threads_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/aria_stats_method_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/aria_sync_log_dir_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/aria_used_for_temp_tables_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/deadlock_search_depth_long_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/deadlock_search_depth_short_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/deadlock_timeout_long_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/deadlock_timeout_short_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/debug_crc_break_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/default_storage_engine_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def3
-rw-r--r--mysql-test/suite/sys_vars/t/extra_max_connections_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/extra_port_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/join_cache_level_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_segments_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_filter_basic.test69
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test53
-rw-r--r--mysql-test/suite/sys_vars/t/maria_block_size_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/maria_checkpoint_interval_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/maria_force_start_after_recovery_failures_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/maria_group_commit_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/maria_group_commit_interval_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/maria_log_file_size_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/maria_log_purge_type_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/maria_max_sort_file_size_basic.test49
-rw-r--r--mysql-test/suite/sys_vars/t/maria_page_checksum_basic.test39
-rw-r--r--mysql-test/suite/sys_vars/t/maria_pagecache_age_threshold_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/maria_pagecache_buffer_size_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/maria_pagecache_division_limit_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/maria_recover_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/maria_repair_threads_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/maria_sort_buffer_size_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/maria_stats_method_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/maria_sync_log_dir_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/mrr_buffer_size_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_use_mrr_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_maturity_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/rowid_merge_buff_size_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/storage_engine_basic.test6
-rw-r--r--mysql-test/suite/sys_vars/t/userstat_basic.test38
-rw-r--r--mysql-test/suite/vcol/inc/vcol_keys.inc4
-rw-r--r--mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc2
-rw-r--r--mysql-test/suite/vcol/r/vcol_archive.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_blackhole.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_csv.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result20
-rw-r--r--mysql-test/suite/vcol/r/vcol_keys_myisam.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_memory.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_merge.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_select_myisam.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_view_myisam.result4
-rw-r--r--mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_handler_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_keys_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_partition_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_select_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_view_innodb.test2
-rw-r--r--mysql-test/t/archive_plugin-master.opt1
-rw-r--r--mysql-test/t/blackhole_plugin-master.opt1
-rw-r--r--mysql-test/t/bootstrap-master.opt2
-rw-r--r--mysql-test/t/bootstrap.test2
-rw-r--r--mysql-test/t/crash_commit_before-master.opt2
-rw-r--r--mysql-test/t/ctype_utf16.test2
-rw-r--r--mysql-test/t/ctype_utf32.test2
-rw-r--r--mysql-test/t/ctype_utf8.test3
-rw-r--r--mysql-test/t/delayed.test2
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/events_logs_tests.test2
-rw-r--r--mysql-test/t/fulltext_plugin.test2
-rw-r--r--mysql-test/t/information_schema_all_engines-master.opt1
-rw-r--r--mysql-test/t/information_schema_all_engines.test2
-rw-r--r--mysql-test/t/information_schema_parameters.test2
-rw-r--r--mysql-test/t/information_schema_routines.test2
-rw-r--r--mysql-test/t/innodb-lock.test102
-rw-r--r--mysql-test/t/innodb-master.opt1
-rw-r--r--mysql-test/t/innodb-semi-consistent-master.opt1
-rw-r--r--mysql-test/t/innodb-semi-consistent.test68
-rw-r--r--mysql-test/t/innodb-zip.test347
-rw-r--r--mysql-test/t/innodb.test2565
-rw-r--r--mysql-test/t/innodb_bug36172.test33
-rw-r--r--mysql-test/t/innodb_bug47167.test45
-rw-r--r--mysql-test/t/innodb_file_format.test31
-rw-r--r--mysql-test/t/lock.test2
-rw-r--r--mysql-test/t/log_slow.test2
-rw-r--r--mysql-test/t/merge_debug.test2
-rw-r--r--mysql-test/t/myisam-master.opt1
-rw-r--r--mysql-test/t/mysql_upgrade.test2
-rw-r--r--mysql-test/t/mysql_upgrade_ssl.test2
-rw-r--r--mysql-test/t/mysqld_option_err.test14
-rw-r--r--mysql-test/t/not_partition.test2
-rw-r--r--mysql-test/t/optimizer_switch.test113
-rw-r--r--mysql-test/t/partition_innodb.test6
-rw-r--r--mysql-test/t/pool_of_threads.cnf1
-rw-r--r--mysql-test/t/query_cache.test13
-rw-r--r--mysql-test/t/query_cache_debug.test12
-rw-r--r--mysql-test/t/select.test1
-rw-r--r--mysql-test/t/status_user.test4
-rw-r--r--mysql-test/t/subselect_cache.test2
-rw-r--r--mysql-test/t/subselect_sj2.test8
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--mysql-test/t/trigger_notembedded.test2
-rw-r--r--mysql-test/t/udf.test12
-rw-r--r--mysql-test/t/unsafe_binlog_innodb-master.opt2
-rw-r--r--mysql-test/t/variables.test2
-rw-r--r--mysql-test/t/xtradb_mrr.test (renamed from mysql-test/t/innodb_mrr.test)2
-rw-r--r--mysys/Makefile.am12
-rw-r--r--mysys/charset-def.c1
-rw-r--r--mysys/checksum.c4
-rw-r--r--mysys/mf_iocache2.c49
-rw-r--r--mysys/mf_keycache.c19
-rw-r--r--mysys/my_compress.c2
-rw-r--r--mysys/my_copy.c2
-rw-r--r--mysys/my_error.c23
-rw-r--r--mysys/my_getopt.c7
-rw-r--r--mysys/my_handler.c2
-rw-r--r--mysys/my_init.c2
-rw-r--r--mysys/my_safehash.c2
-rw-r--r--mysys/my_static.c13
-rw-r--r--mysys/my_thr_init.c6
-rw-r--r--mysys/my_wincond.c1
-rw-r--r--mysys/my_winthread.c2
-rw-r--r--mysys/mysys_priv.h1
-rw-r--r--mysys/thr_alarm.c2
-rw-r--r--mysys/thr_lock.c26
-rw-r--r--mysys/thr_mutex.c36
-rw-r--r--mysys/wqueue.c10
-rw-r--r--plugin/fulltext/plugin_example.c4
-rw-r--r--sql-common/client.c21
-rw-r--r--sql-common/client_plugin.c2
-rw-r--r--sql/CMakeLists.txt3
-rw-r--r--sql/create_options.cc1
-rw-r--r--sql/create_options.h3
-rw-r--r--sql/datadict.h1
-rw-r--r--sql/events.h1
-rw-r--r--sql/filesort.cc2
-rw-r--r--sql/gstream.h3
-rw-r--r--sql/handler.cc43
-rw-r--r--sql/handler.h6
-rw-r--r--sql/item.cc12
-rw-r--r--sql/item.h78
-rw-r--r--sql/item_create.cc8
-rw-r--r--sql/item_func.cc4
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/item_subselect.cc10
-rw-r--r--sql/item_subselect.h2
-rw-r--r--sql/item_sum.cc7
-rw-r--r--sql/keycaches.cc7
-rw-r--r--sql/keycaches.h4
-rw-r--r--sql/lock.cc34
-rw-r--r--sql/log.cc37
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/log_slow.h9
-rw-r--r--sql/mdl.h1
-rw-r--r--sql/multi_range_read.cc2
-rw-r--r--sql/mysqld.cc159
-rw-r--r--sql/mysqld.h30
-rw-r--r--sql/net_serv.cc7
-rw-r--r--sql/opt_index_cond_pushdown.cc2
-rw-r--r--sql/opt_range.cc13
-rw-r--r--sql/opt_range.h3
-rw-r--r--sql/opt_range_mrr.cc4
-rw-r--r--sql/opt_subselect.cc7
-rw-r--r--sql/opt_subselect.h4
-rw-r--r--sql/opt_table_elimination.cc1
-rw-r--r--sql/procedure.h3
-rw-r--r--sql/records.cc6
-rw-r--r--sql/rpl_filter.cc2
-rw-r--r--sql/rpl_handler.cc10
-rw-r--r--sql/rpl_mi.cc7
-rw-r--r--sql/scheduler.cc72
-rw-r--r--sql/scheduler.h34
-rw-r--r--sql/set_var.h2
-rw-r--r--sql/slave.h5
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sql_acl.cc19
-rw-r--r--sql/sql_admin.cc12
-rw-r--r--sql/sql_audit.cc2
-rw-r--r--sql/sql_base.cc13
-rw-r--r--sql/sql_bitmap.h2
-rw-r--r--sql/sql_cache.cc3
-rw-r--r--sql/sql_callback.h8
-rw-r--r--sql/sql_class.cc21
-rw-r--r--sql/sql_class.h134
-rw-r--r--sql/sql_connect.cc65
-rw-r--r--sql/sql_connect.h8
-rw-r--r--sql/sql_db.h2
-rw-r--r--sql/sql_delete.cc1
-rw-r--r--sql/sql_error.h2
-rw-r--r--sql/sql_expression_cache.cc12
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_join_cache.cc3
-rw-r--r--sql/sql_lex.cc84
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_list.cc1
-rw-r--r--sql/sql_list.h7
-rw-r--r--sql/sql_parse.cc20
-rw-r--r--sql/sql_parse.h2
-rw-r--r--sql/sql_partition.cc83
-rw-r--r--sql/sql_partition_admin.cc1
-rw-r--r--sql/sql_plugin.cc10
-rw-r--r--sql/sql_plugin.h5
-rw-r--r--sql/sql_prepare.cc4
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_select.cc33
-rw-r--r--sql/sql_select.h13
-rw-r--r--sql/sql_show.cc112
-rw-r--r--sql/sql_sort.h2
-rw-r--r--sql/sql_string.cc58
-rw-r--r--sql/sql_string.h1
-rw-r--r--sql/sql_table.cc19
-rw-r--r--sql/sql_table.h1
-rw-r--r--sql/sql_test.cc19
-rw-r--r--sql/sql_trigger.cc3
-rw-r--r--sql/sql_yacc.yy3
-rw-r--r--sql/strfunc.h2
-rw-r--r--sql/structs.h1
-rw-r--r--sql/sys_vars.cc47
-rw-r--r--sql/sys_vars.h16
-rw-r--r--sql/table.cc71
-rw-r--r--sql/table.h3
-rw-r--r--sql/thr_malloc.h1
-rw-r--r--storage/federated/CMakeLists.txt2
-rw-r--r--storage/federatedx/federatedx_io.cc2
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc9
-rw-r--r--storage/federatedx/federatedx_io_null.cc2
-rw-r--r--storage/federatedx/federatedx_txn.cc14
-rw-r--r--storage/federatedx/ha_federatedx.cc50
-rw-r--r--storage/federatedx/ha_federatedx.h15
-rw-r--r--storage/innobase/CMakeLists.txt2
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
-rw-r--r--storage/maria/CMakeLists.txt5
-rw-r--r--storage/maria/ha_maria.cc221
-rw-r--r--storage/maria/ha_maria.h7
-rw-r--r--storage/maria/lockman.c4
-rw-r--r--storage/maria/ma_bitmap.c2
-rw-r--r--storage/maria/ma_blockrec.c52
-rw-r--r--storage/maria/ma_changed.c2
-rw-r--r--storage/maria/ma_check.c94
-rw-r--r--storage/maria/ma_check_standalone.h24
-rw-r--r--storage/maria/ma_checkpoint.c14
-rw-r--r--storage/maria/ma_close.c14
-rw-r--r--storage/maria/ma_create.c18
-rw-r--r--storage/maria/ma_dbug.c36
-rw-r--r--storage/maria/ma_delete.c6
-rw-r--r--storage/maria/ma_delete_all.c4
-rw-r--r--storage/maria/ma_dynrec.c14
-rw-r--r--storage/maria/ma_ft_boolean_search.c55
-rw-r--r--storage/maria/ma_ft_nlq_search.c6
-rw-r--r--storage/maria/ma_ft_parser.c28
-rw-r--r--storage/maria/ma_ft_update.c3
-rw-r--r--storage/maria/ma_ftdefs.h10
-rw-r--r--storage/maria/ma_info.c2
-rw-r--r--storage/maria/ma_init.c10
-rw-r--r--storage/maria/ma_key.c2
-rw-r--r--storage/maria/ma_locking.c4
-rw-r--r--storage/maria/ma_loghandler.c37
-rw-r--r--storage/maria/ma_open.c26
-rw-r--r--storage/maria/ma_packrec.c17
-rw-r--r--storage/maria/ma_pagecache.c185
-rw-r--r--storage/maria/ma_pagecache.h4
-rw-r--r--storage/maria/ma_preload.c4
-rw-r--r--storage/maria/ma_recovery.c30
-rw-r--r--storage/maria/ma_recovery_util.c2
-rw-r--r--storage/maria/ma_rsame.c4
-rw-r--r--storage/maria/ma_rt_index.c2
-rw-r--r--storage/maria/ma_rt_test.c2
-rw-r--r--storage/maria/ma_search.c2
-rw-r--r--storage/maria/ma_sort.c26
-rw-r--r--storage/maria/ma_sp_key.c2
-rw-r--r--storage/maria/ma_sp_test.c8
-rw-r--r--storage/maria/ma_state.c18
-rw-r--r--storage/maria/ma_static.c22
-rw-r--r--storage/maria/ma_statrec.c2
-rw-r--r--storage/maria/ma_test1.c19
-rw-r--r--storage/maria/ma_test2.c11
-rw-r--r--storage/maria/ma_test3.c15
-rw-r--r--storage/maria/ma_unique.c6
-rw-r--r--storage/maria/ma_update.c4
-rw-r--r--storage/maria/ma_write.c9
-rw-r--r--storage/maria/maria_chk.c90
-rw-r--r--storage/maria/maria_def.h21
-rw-r--r--storage/maria/maria_ftdump.c6
-rw-r--r--storage/maria/maria_pack.c272
-rw-r--r--storage/maria/maria_read_log.c10
-rw-r--r--storage/maria/plug.in2
-rw-r--r--storage/maria/tablockman.c16
-rw-r--r--storage/maria/trnman.c4
-rw-r--r--storage/maria/unittest/ma_control_file-t.c8
-rw-r--r--storage/maria/unittest/ma_pagecache_consist.c8
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist.c8
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist2.c8
-rw-r--r--storage/maria/unittest/ma_pagecache_single.c12
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_first_lsn-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_max_lsn-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multigroup-t.c4
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c8
-rw-r--r--storage/maria/unittest/ma_test_loghandler_noflush-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_nologs-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_pagecache-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_purge-t.c2
-rw-r--r--storage/maria/unittest/test_file.c2
-rw-r--r--storage/maria/unittest/trnman-t.c3
-rw-r--r--storage/myisam/ft_boolean_search.c59
-rw-r--r--storage/myisam/ft_nlq_search.c6
-rw-r--r--storage/myisam/ft_parser.c41
-rw-r--r--storage/myisam/ft_stopwords.c21
-rw-r--r--storage/myisam/ftdefs.h14
-rw-r--r--storage/myisam/ha_myisam.cc11
-rw-r--r--storage/myisam/mi_check.c2
-rw-r--r--storage/myisam/mi_create.c2
-rw-r--r--storage/myisam/mi_extra.c2
-rw-r--r--storage/myisam/mi_locking.c10
-rw-r--r--storage/myisam/mi_open.c4
-rw-r--r--storage/myisam/mi_rkey.c4
-rw-r--r--storage/myisam/mi_rnext.c2
-rw-r--r--storage/myisam/mi_rprev.c2
-rw-r--r--storage/myisam/mi_test2.c2
-rw-r--r--storage/myisam/myisamchk.c2
-rw-r--r--storage/myisam/myisamdef.h5
-rw-r--r--storage/myisammrg/ha_myisammrg.cc4
-rw-r--r--storage/ndb/include/ndbapi/NdbDictionary.hpp2
-rw-r--r--storage/ndb/include/util/NdbSqlUtil.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp2
-rw-r--r--storage/oqgraph/CMakeLists.txt10
-rw-r--r--storage/oqgraph/ha_oqgraph.cc34
-rw-r--r--storage/oqgraph/ha_oqgraph.h6
-rw-r--r--storage/pbxt/src/datadic_xt.cc2
-rw-r--r--storage/pbxt/src/datalog_xt.cc2
-rw-r--r--storage/pbxt/src/discover_xt.cc28
-rw-r--r--storage/pbxt/src/discover_xt.h3
-rw-r--r--storage/pbxt/src/ha_pbxt.cc40
-rw-r--r--storage/pbxt/src/ha_pbxt.h3
-rw-r--r--storage/pbxt/src/ha_xtsys.h2
-rw-r--r--storage/pbxt/src/index_xt.cc3
-rw-r--r--storage/pbxt/src/myxt_xt.cc10
-rwxr-xr-xstorage/pbxt/src/pthread_xt.h33
-rw-r--r--storage/pbxt/src/restart_xt.cc2
-rw-r--r--storage/pbxt/src/systab_xt.cc2
-rw-r--r--storage/pbxt/src/systab_xt.h2
-rw-r--r--storage/pbxt/src/table_xt.cc2
-rw-r--r--storage/pbxt/src/xt_config.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc18
-rw-r--r--storage/sphinx/CMakeLists.txt10
-rw-r--r--storage/sphinx/ha_sphinx.cc51
-rw-r--r--storage/sphinx/ha_sphinx.h3
-rw-r--r--storage/sphinx/snippets_udf.cc6
-rw-r--r--storage/xtradb/CMakeLists.txt.disabled (renamed from storage/xtradb/CMakeLists.txt)0
-rw-r--r--storage/xtradb/handler/ha_innodb.cc87
-rw-r--r--storage/xtradb/handler/ha_innodb.h10
-rw-r--r--storage/xtradb/handler/handler0alter.cc4
-rw-r--r--storage/xtradb/handler/i_s.cc2
-rw-r--r--storage/xtradb/handler/mysql_addons.cc2
-rw-r--r--storage/xtradb/include/handler0alter.h4
-rw-r--r--storage/xtradb/include/row0merge.h2
-rw-r--r--storage/xtradb/include/row0types.h2
-rw-r--r--storage/xtradb/os/os0thread.c4
-rw-r--r--storage/xtradb/plug.in5
-rw-r--r--storage/xtradb/row/row0merge.c12
-rw-r--r--strings/Makefile.am2
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-simple.c1
-rw-r--r--strings/ctype-uca.c94
-rw-r--r--strings/ctype-ucs2.c20
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c35
738 files changed, 9203 insertions, 10969 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 44e5ed74ab7..2744545e138 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -161,7 +161,7 @@ base_configs="--prefix=$prefix --enable-assembler "
base_configs="$base_configs --with-extra-charsets=complex "
base_configs="$base_configs --enable-thread-safe-client "
base_configs="$base_configs --with-big-tables $maintainer_mode"
-base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --without-plugin-innodb_plugin"
+base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables"
# Compile our client programs with static libraries to allow them to be moved
base_configs="$base_configs --with-mysqld-ldflags=-static --with-client-ldflags=-static"
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 52fd378689e..80c5bbd1c9f 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -74,5 +74,3 @@ PROPERTIES HAS_CXX TRUE)
ADD_DEFINITIONS(-DHAVE_DLOPEN)
-INSTALL(TARGETS mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow
- mysqlbinlog mysqladmin mysqlslap echo DESTINATION bin COMPONENT runtime)
diff --git a/client/Makefile.am b/client/Makefile.am
index 96e763772dd..97ced5fbfb7 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -63,6 +63,7 @@ mysqlbinlog_SOURCES = mysqlbinlog.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 \
@@ -102,14 +103,8 @@ DEFS = -DMYSQL_CLIENT_NO_THREADS \
-DDEFAULT_MYSQL_HOME='"$(prefix)"' \
-DMYSQL_DATADIR='"$(localstatedir)"'
-sql_src=log_event.h sql_priv.h rpl_constants.h \
- rpl_tblmap.h rpl_tblmap.cc \
- log_event.cc my_decimal.h my_decimal.cc \
- log_event_old.h log_event_old.cc \
- rpl_record_old.h rpl_record_old.cc \
- rpl_utility.h rpl_utility.cc \
- transaction.h sql_const.h \
- sql_list.h rpl_filter.h sql_list.cc rpl_filter.cc
+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:
diff --git a/client/mysql.cc b/client/mysql.cc
index 208b5b3288c..d0c35e63536 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -4327,7 +4327,7 @@ extern "C" char *mysql_authentication_dialog_ask(MYSQL *mysql, int type,
s= get_tty_password("");
strnmov(buf, s, buf_len);
buf[buf_len-1]= 0;
- my_free(s, MYF(0));
+ my_free(s);
}
else
{
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index cd1c9bb27d3..5045ee0f8cb 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -35,10 +35,10 @@
static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN];
-static my_bool opt_force, debug_info_flag, debug_check_flag,
+static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag,
opt_systables_only;
-static my_bool opt_not_used; /* For compatiblity */
-static uint my_end_arg= 0, opt_verbose;
+static my_bool opt_not_used, opt_silent;
+static uint my_end_arg= 0;
static char *opt_user= (char*)"root";
static DYNAMIC_STRING ds_args;
@@ -59,6 +59,8 @@ static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
static my_bool opt_write_binlog;
+#define OPT_SILENT OPT_MAX_CLIENT_OPTION
+
static struct my_option my_long_options[]=
{
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
@@ -118,7 +120,7 @@ static struct my_option my_long_options[]=
"Base name of shared memory.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"silent", 's', "Print less information", &opt_silent,
+ {"silent", OPT_SILENT, "Print less information", &opt_silent,
&opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "The socket file to use for connection.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -282,10 +284,13 @@ get_one_option(int optid, const struct my_option *opt,
}
add_option= 0;
break;
- case 's':
+ case OPT_SILENT:
opt_verbose= 0;
add_option= 0;
break;
+ case 's':
+ add_option= 0;
+ break;
case 'f': /* --force */
add_option= FALSE;
break;
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index f164a7d039f..83b034a61b5 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -663,7 +663,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
REFRESH_MASTER | REFRESH_TABLE_STATS |
REFRESH_INDEX_STATS |
REFRESH_USER_STATS |
- REFRESH_SLOW_QUERY_LOG |
REFRESH_CLIENT_STATS)))
{
my_printf_error(0, "refresh failed; error: '%s'", error_flags,
@@ -869,7 +868,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
case ADMIN_FLUSH_SLOW_LOG:
{
- if (mysql_query(mysql,"flush slow query logs"))
+ if (mysql_query(mysql,"flush slow logs"))
{
my_printf_error(0, "flush failed; error: '%s'", error_flags,
mysql_error(mysql));
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index a8f96a1089d..4b62bd12ceb 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -28,6 +28,7 @@
#define MYSQL_CLIENT
#undef MYSQL_SERVER
+#define TABLE TABLE_CLIENT
#include "client_priv.h"
#include <my_time.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
@@ -1136,7 +1137,7 @@ static struct my_option my_long_options[] =
0, 0},
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"server-id", OPT_SERVER_ID,
+ {"server-id", 0,
"Extract only binlog entries created by the server having the given id.",
&server_id, &server_id, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -2247,6 +2248,7 @@ void *sql_alloc(size_t size)
the server
*/
+#undef TABLE
#include "my_decimal.h"
#include "decimal.c"
#include "my_decimal.cc"
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index aeaead924c9..f5a2c4600f8 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -777,7 +777,7 @@ static void print_result()
we have to run upgrade on it. In this case we write a nicer message
than "Please do "REPAIR TABLE""...
*/
- if (!strcmp(row[2],"error") && strinstr(row[3],"REPAIR TABLE") != 0)
+ if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE"))
printf("%-50s %s", row[0], "Needs upgrade");
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 626ce1dede7..34055f3db67 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -4207,7 +4207,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root)
}
mysql_free_result(table_res);
}
- DBUG_PRINT("exit", ("new_table_name: %s", val_or_null(name)));
+ DBUG_PRINT("exit", ("new_table_name: %s", name));
DBUG_RETURN(name);
}
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 3eea6b997c8..802e94b8d7c 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -103,7 +103,6 @@ static int opt_max_connect_retries;
static int opt_result_format_version;
static int opt_max_connections= DEFAULT_MAX_CONN;
static my_bool opt_compress= 0, silent= 0, verbose= 0;
-static int opt_connect_timeout= -1;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool tty_password= 0;
static my_bool opt_mark_progress= 0;
@@ -556,8 +555,7 @@ public:
void open(const char* dir, const char* name, const char* ext)
{
DBUG_ENTER("LogFile::open");
- DBUG_PRINT("enter", ("dir: '%s', name: '%s'",
- val_or_null(dir), val_or_null(name)));
+ DBUG_PRINT("enter", ("dir: '%s', name: '%s'", dir, name));
if (!name)
{
m_file= stdout;
@@ -648,9 +646,8 @@ public:
DBUG_VOID_RETURN;
}
- IF_DBUG(buf[bytes]= '\0';)
- DBUG_PRINT("info", ("Read %lu bytes from file, buf: %s",
- (unsigned long)bytes, buf));
+ DBUG_PRINT("info", ("Read %zu bytes from file, buf: %.*s",
+ bytes, (int)bytes, buf));
char* show_from= buf + bytes;
while(show_from > buf && lines > 0 )
@@ -5420,9 +5417,6 @@ void do_connect(struct st_command *command)
if (opt_charsets_dir)
mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
- if (opt_connect_timeout >= 0)
- mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
- &opt_connect_timeout);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl || con_ssl)
@@ -6249,9 +6243,6 @@ static struct my_option my_long_options[] =
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
{"test-file", 'x', "Read test from/in this file (default stdin).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"connect-timeout", OPT_MY_CONNECT_TIMEOUT, "Client connection timeout",
- (uchar**) &opt_connect_timeout, (uchar**) &opt_connect_timeout, 0,
- GET_INT, REQUIRED_ARG, -1, -1, 0, 0, 0, 0},
{"timer-file", 'm', "File where the timing in microseconds is stored.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Temporary directory where sockets are put.",
diff --git a/client/sql_string.h b/client/sql_string.h
index b51e6b07e01..bafc287c73e 100644
--- a/client/sql_string.h
+++ b/client/sql_string.h
@@ -18,9 +18,6 @@
/* This file is originally from the mysql distribution. Coded by monty */
-#ifndef CLIENT_SQL_STRING_H
-#define CLIENT_SQL_STRING_H
-
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 138901dfa8a..31e1fceec23 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -135,11 +135,11 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_MANDATORY)
SET (mysql_mandatory_plugins
- "${mysql_mandatory_plugins} builtin_${target}_plugin,"
+ "${mysql_mandatory_plugins} builtin_maria_${target}_plugin,"
PARENT_SCOPE)
ELSE()
SET (mysql_optional_plugins
- "${mysql_optional_plugins} builtin_${target}_plugin,"
+ "${mysql_optional_plugins} builtin_maria_${target}_plugin,"
PARENT_SCOPE)
ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
diff --git a/config.h.cmake b/config.h.cmake
index c484edb65a5..e96b003fcff 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -594,6 +594,8 @@
#if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY)
# define HAVE_NDB_BINLOG 1
#endif
+#cmakedefine WITH_ARIA_STORAGE_ENGINE 1
+#cmakedefine USE_ARIA_FOR_TMP_TABLES 1
#cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@"
#cmakedefine SHAREDIR "@SHAREDIR@"
diff --git a/config/ac-macros/libevent.m4 b/config/ac-macros/libevent.m4
index 73fa59a1d3c..90ac89cc74c 100644
--- a/config/ac-macros/libevent.m4
+++ b/config/ac-macros/libevent.m4
@@ -88,7 +88,7 @@ AC_DEFUN([MYSQL_CHECK_LIBEVENT], [
AC_SUBST(libevent_libs)
AC_SUBST(libevent_includes)
AC_SUBST(libevent_test_option)
- AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
+ 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/configure.in b/configure.in
index 017518c5fb7..934f5f9e92b 100644
--- a/configure.in
+++ b/configure.in
@@ -40,7 +40,6 @@ AC_CANONICAL_SYSTEM
# 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])
-AC_PROG_LIBTOOL
AM_CONFIG_HEADER([include/config.h])
@@ -229,6 +228,7 @@ 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
@@ -1713,8 +1713,8 @@ AC_SYS_RESTARTABLE_SYSCALLS
# First check for gcc and g++
if test "$GCC" = "yes"
then
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC="-O"
+ DEBUG_CFLAGS="-ggdb3"
+ DEBUG_OPTIMIZE_CC=""
OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
else
DEBUG_CFLAGS="-g"
@@ -1730,8 +1730,8 @@ else
fi
if test "$GXX" = "yes"
then
- DEBUG_CXXFLAGS="-g"
- DEBUG_OPTIMIZE_CXX="-O"
+ DEBUG_CXXFLAGS="-ggdb3"
+ DEBUG_OPTIMIZE_CXX=""
OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
else
DEBUG_OPTIMIZE_CXX=""
@@ -1764,7 +1764,7 @@ AC_ARG_WITH(debug,
[AS_HELP_STRING([--with-debug], [Add debug code @<:@default=no@:>@])],
[with_debug=$withval],
[with_debug=no])
-if test "$with_debug" = "yes"
+if test "$with_debug" != "no"
then
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes])
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 696e8ca714d..b85004822bb 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -84,7 +84,6 @@
in pthread_mutex_lock
*/
-#undef SAFE_MUTEX
#include <my_global.h>
#undef SAFE_MUTEX
#include <m_string.h>
@@ -374,7 +373,7 @@ static CODE_STATE *code_state(void)
if (!init_done)
{
init_done=TRUE;
- pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&THR_LOCK_dbug, NULL);
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
@@ -500,6 +499,7 @@ int DbugParse(CODE_STATE *cs, const char *control)
if (control[0] == '-' && control[1] == '#')
control+=2;
+
rel= control[0] == '+' || control[0] == '-';
if ((!rel || (!stack->out_file && !stack->next)))
{
@@ -879,6 +879,7 @@ void _db_push_(const char *control)
FixTraceFlags(old_fflags, cs);
}
+
/**
Returns TRUE if session-local settings have been set.
*/
@@ -1233,7 +1234,6 @@ 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);
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index ef2a8bedcbb..61c3e62440a 100644
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -78,5 +78,3 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
ENDIF()
-MESSAGE("TODO: Support libevent")
-
diff --git a/extra/replace.c b/extra/replace.c
index 1f091555b66..c1f27eab695 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
}
}
free_buffer();
- my_free(replace, MYF(0));
+ my_free(replace);
my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
exit(error ? 2 : 0);
return 0; /* No compiler warning */
diff --git a/include/hash.h b/include/hash.h
index f3d9d82f187..ae3f017a03e 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -27,11 +27,6 @@
typedef declarations, even when identical, the definition may not be
repeated.
*/
-#ifndef CHARSET_INFO_DEFINED
-#define CHARSET_INFO_DEFINED
-typedef struct charset_info_st CHARSET_INFO;
-#endif /* CHARSET_INFO_DEFINED */
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/keycache.h b/include/keycache.h
index 6220f6266fa..bc14bdef0bf 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -195,7 +195,7 @@ extern my_bool multi_key_cache_set(const uchar *key, uint length,
extern void multi_key_cache_change(KEY_CACHE *old_data,
KEY_CACHE *new_data);
extern int reset_key_cache_counters(const char *name,
- KEY_CACHE *key_cache);
+ KEY_CACHE *key_cache, void *);
extern int repartition_key_cache(KEY_CACHE *keycache,
uint key_cache_block_size,
size_t use_mem,
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 93c7e84e8a0..6332962f000 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -54,7 +54,6 @@ extern "C" {
#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
#endif
-typedef const struct charset_info_st CHARSET_INFO;
typedef const struct my_charset_handler_st MY_CHARSET_HANDLER;
typedef const struct my_collation_handler_st MY_COLLATION_HANDLER;
@@ -286,13 +285,6 @@ struct my_charset_handler_st
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
-
-/*
- We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
- typedef in hash.c, which will cause a compiler error.
-*/
-#define CHARSET_INFO_DEFINED
-
/* See strings/CHARSET_INFO.txt about information on this structure */
struct charset_info_st
{
diff --git a/include/m_string.h b/include/m_string.h
index c8200ba33ed..e2d649d0bcd 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -207,13 +207,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
}
#endif
-/*
- LEX_STRING -- a pair of a C-string and its length.
- (it's part of the plugin API as a MYSQL_LEX_STRING)
-*/
-
#include <mysql/plugin.h>
-typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 48bbe8c2946..849b54f3532 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -1,3 +1,5 @@
+#ifndef MY_ATOMIC_INCLUDED
+#define MY_ATOMIC_INCLUDED
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
diff --git a/include/my_bit.h b/include/my_bit.h
index b396b84b0d8..7e733d9d581 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -1,6 +1,8 @@
#ifndef MY_BIT_INCLUDED
#define MY_BIT_INCLUDED
+#include <my_global.h>
+
/*
Some useful bit functions
*/
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index cd082cc1ada..c92f28630e2 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -19,6 +19,9 @@
#define MY_BIT_NONE (~(uint) 0)
#include <m_string.h>
+#ifdef THREAD
+#include <my_pthread.h>
+#endif
typedef uint32 my_bitmap_map;
diff --git a/include/my_global.h b/include/my_global.h
index ad8607de2a3..5d874d9f5f8 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -880,6 +880,7 @@ typedef long long my_ptrdiff_t;
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A), sizeof(double)))
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
+#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
/*
Custom version of standard offsetof() macro which can be used to get
@@ -1007,6 +1008,10 @@ typedef unsigned long my_off_t;
typedef ulonglong table_map; /* Used for table bits in join */
typedef ulong nesting_map; /* Used for flags of nesting constructs */
+/* often used type names - opaque declarations */
+typedef const struct charset_info_st CHARSET_INFO;
+typedef struct st_mysql_lex_string LEX_STRING;
+
#if defined(__WIN__)
#define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR
@@ -1444,6 +1449,8 @@ do { doubleget_union _tmp; \
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
+#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
+
/*
Only Linux is known to need an explicit sync of the directory to make sure a
file creation/deletion/renaming in(from,to) this directory durable.
diff --git a/include/my_pthread.h b/include/my_pthread.h
index ddf1d58ff8f..8a7976bb334 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -480,8 +480,7 @@ typedef struct st_safe_mutex_info_t
#endif /* SAFE_MUTEX_DETECT_DESTROY */
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
- const char *name, myf my_flags,
- const char *file, uint line);
+ const char *name, const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
@@ -509,10 +508,8 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef pthread_mutex_trylock
-#define my_pthread_mutex_init(A,B,C,D) safe_mutex_init((A),(B),(C),(D),__FILE__,__LINE__)
-#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),#A,0,__FILE__,__LINE__)
-#define pthread_mutex_lock(A) safe_mutex_lock((A), 0, __FILE__, __LINE__)
-#define my_pthread_mutex_lock(A,B) safe_mutex_lock((A), (B), __FILE__, __LINE__)
+#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),#A,__FILE__,__LINE__)
+#define pthread_mutex_lock(A) safe_mutex_lock((A),0,__FILE__, __LINE__)
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
@@ -527,7 +524,6 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
! pthread_equal(pthread_self(), (mp)->thread))
#else
#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B))
-#define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A)
#define safe_mutex_assert_owner(mp) do {} while(0)
#define safe_mutex_assert_not_owner(mp) do {} while(0)
#define safe_mutex_free_deadlock_data(mp) do {} while(0)
@@ -767,11 +763,9 @@ struct st_my_thread_var
my_bool init;
struct st_my_thread_var *next,**prev;
void *opt_info;
- //uint lock_type; /* used by conditional release the queue */
+ uint lock_type; /* used by conditional release the queue */
void *stack_ends_here;
safe_mutex_t *mutex_in_use;
- void (*scheduler_before_lock_wait)(void);
- void (*scheduler_after_lock_wait)(void);
#ifndef DBUG_OFF
void *dbug;
char name[THREAD_NAME_SIZE+1];
diff --git a/include/my_sys.h b/include/my_sys.h
index e3aa7ed8d7c..ecb478818ac 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -17,6 +17,7 @@
#define _my_sys_h
#include "my_global.h" /* C_MODE_START, C_MODE_END */
+#include "my_valgrind.h"
C_MODE_START
@@ -102,7 +103,9 @@ extern int my_errno; /* Last error in mysys */
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
-#define ME_FATALERROR 1024 /* Fatal statement error */
+#define ME_JUST_INFO 1024 /**< not error but just info */
+#define ME_JUST_WARNING 2048 /**< not error but just warning */
+#define ME_FATALERROR 4096 /* Fatal statement error */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
@@ -191,7 +194,7 @@ extern void my_large_free(uchar *ptr);
#endif /* HAVE_ALLOCA */
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(MY_FAE)))
-#define my_safe_afree(ptr, size, min_length) ((size <= min_length) ? (void)0 : my_free(ptr)
+#define my_safe_afree(ptr, size, min_length) ((size <= min_length) ? (void)0 : my_free(ptr))
#ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE
@@ -547,7 +550,7 @@ my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
*(info)->current_pos)
typedef uint32 ha_checksum;
-extern ha_checksum my_crc_dbug_check;
+extern ulong my_crc_dbug_check;
/* Define the type of function to be passed to process_default_option_files */
typedef int (*Process_option_func)(void *ctx, const char *group_name,
@@ -764,9 +767,6 @@ extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
-extern int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
- const char *default_val);
-extern int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
const char *prefix, size_t cache_size,
myf cache_myflags);
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
index 63e185ebc53..dd8f4b22e21 100644
--- a/include/my_valgrind.h
+++ b/include/my_valgrind.h
@@ -29,7 +29,7 @@
#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, B, 0x8F)
+# 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)
diff --git a/include/myisamchk.h b/include/myisamchk.h
index f6acaa7cf00..ca81c689f3d 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -155,7 +155,7 @@ typedef struct st_handler_check_param
IO_CACHE read_cache;
enum_handler_stats_method stats_method;
#ifdef THREAD
- pthread_mutex_t print_msg_mutex;
+ mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock;
#endif
} HA_CHECK;
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index a2300dca112..31c4f5e5781 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -28,7 +28,7 @@ typedef struct st_net {
unsigned char reading_or_writing;
char save_char;
char net_skip_rest_factor;
- my_bool unused;
+ my_bool unused1;
my_bool compress;
my_bool unused3;
unsigned char *unused;
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 04463c19090..f77dfbcc8d5 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -591,7 +591,7 @@ char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
void thd_inc_row_count(MYSQL_THD thd);
#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
-const char *set_thd_proc_info(MYSQL_THD, const char * info, const char *func,
+const char *set_thd_proc_info(void *, const char * info, const char *func,
const char *file, const unsigned int line);
/**
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index b48cbca2e87..ad8ca389d34 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -95,6 +95,22 @@ 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
@@ -124,16 +140,16 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- char *doc, int doc_len);
+ const char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- char *word, int word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
- struct charset_info_st *cs;
- char *doc;
+ const struct charset_info_st *cs;
+ const char *doc;
int length;
- int flags;
+ unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
struct st_mysql_ftparser
@@ -171,13 +187,14 @@ 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);
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index b0d5daf4c64..bbd91a84f33 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -31,6 +31,27 @@ void *thd_memdup(void* thd, const void* str, unsigned int size);
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
const char *str, unsigned int size,
int allocate_lex_string);
+#include <mysql/service_thd_wait.h>
+typedef enum _thd_wait_type_e {
+ THD_WAIT_MUTEX= 1,
+ THD_WAIT_DISKIO= 2,
+ THD_WAIT_ROW_TABLE_LOCK= 3,
+ THD_WAIT_GLOBAL_LOCK= 4
+} thd_wait_type;
+extern struct thd_wait_service_st {
+ void (*thd_wait_begin_func)(void*, thd_wait_type);
+ void (*thd_wait_end_func)(void*);
+} *thd_wait_service;
+void thd_wait_begin(void* thd, thd_wait_type wait_type);
+void thd_wait_end(void* thd);
+#include <mysql/service_thread_scheduler.h>
+struct scheduler_functions;
+extern struct my_thread_scheduler_service {
+ int (*set)(struct scheduler_functions *scheduler);
+ int (*reset)();
+} *my_thread_scheduler_service;
+int my_thread_scheduler_set(struct scheduler_functions *scheduler);
+int my_thread_scheduler_reset();
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -90,6 +111,8 @@ struct st_maria_plugin
const char *version_info;
unsigned int maturity;
};
+#include "plugin_ftparser.h"
+#include "plugin.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
@@ -114,19 +137,18 @@ typedef struct st_mysql_ftparser_boolean_info
char prev;
char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO;
-typedef int mysql_ft_size_t;
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- const unsigned char *doc, mysql_ft_size_t doc_len);
+ const char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- const unsigned char *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
const struct charset_info_st *cs;
- const unsigned char *doc;
- mysql_ft_size_t length;
+ const char *doc;
+ int length;
unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
@@ -137,31 +159,36 @@ struct st_mysql_ftparser
int (*init)(MYSQL_FTPARSER_PARAM *param);
int (*deinit)(MYSQL_FTPARSER_PARAM *param);
};
-struct st_mysql_storage_engine
+struct st_mysql_daemon
{
int interface_version;
};
-struct handlerton;
-struct st_mysql_daemon
+struct st_mysql_information_schema
{
int interface_version;
};
-struct st_mysql_information_schema
+struct st_mysql_storage_engine
{
int interface_version;
};
+struct handlerton;
+ struct Mysql_replication {
+ int interface_version;
+ };
struct st_mysql_value
{
int (*value_type)(struct st_mysql_value *);
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
int (*val_real)(struct st_mysql_value *, double *realbuf);
int (*val_int)(struct st_mysql_value *, long long *intbuf);
+ int (*is_unsigned)(struct st_mysql_value *);
};
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);
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);
diff --git a/include/mysql/plugin_ftparser.h b/include/mysql/plugin_ftparser.h
index 7f9bde3a6a0..37bc96b0e08 100644
--- a/include/mysql/plugin_ftparser.h
+++ b/include/mysql/plugin_ftparser.h
@@ -177,16 +177,16 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- char *doc, int doc_len);
+ const char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- char *word, int word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
- struct charset_info_st *cs;
- char *doc;
+ const struct charset_info_st *cs;
+ const char *doc;
int length;
- int flags;
+ unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 2c2c1adbf88..0d6a70ec19c 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -95,6 +95,22 @@ 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"
struct st_mysql_daemon
{
@@ -124,13 +140,14 @@ 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);
@@ -168,16 +185,16 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- char *doc, int doc_len);
+ const char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- char *word, int word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
- struct charset_info_st *cs;
- char *doc;
+ const struct charset_info_st *cs;
+ const char *doc;
int length;
- int flags;
+ unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
struct st_mysql_ftparser
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index 60b4f5d6ef4..389c73d09e9 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -235,7 +235,7 @@ typedef struct st_mysql_cond mysql_cond_t;
#ifdef HAVE_PSI_INTERFACE
#ifdef SAFE_MUTEX
#define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__)
+ inline_mysql_mutex_init(K, M, A, #M, __FILE__, __LINE__)
#else
#define mysql_mutex_init(K, M, A) \
inline_mysql_mutex_init(K, M, A)
@@ -243,7 +243,7 @@ typedef struct st_mysql_cond mysql_cond_t;
#else
#ifdef SAFE_MUTEX
#define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(M, A, __FILE__, __LINE__)
+ inline_mysql_mutex_init(M, A, #M, __FILE__, __LINE__)
#else
#define mysql_mutex_init(K, M, A) \
inline_mysql_mutex_init(M, A)
@@ -585,7 +585,7 @@ static inline int inline_mysql_mutex_init(
mysql_mutex_t *that,
const pthread_mutexattr_t *attr
#ifdef SAFE_MUTEX
- , const char *src_file, uint src_line
+ , const char *src_name, const char *src_file, uint src_line
#endif
)
{
@@ -596,7 +596,7 @@ static inline int inline_mysql_mutex_init(
that->m_psi= NULL;
#endif
#ifdef SAFE_MUTEX
- return safe_mutex_init(&that->m_mutex, attr, src_file, src_line);
+ return safe_mutex_init(&that->m_mutex, attr, src_name, src_file, src_line);
#else
return pthread_mutex_init(&that->m_mutex, attr);
#endif
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 19888a492ed..4154b620208 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -474,9 +474,6 @@ struct my_rnd_struct;
enum Item_result
{
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT
-#ifdef MYSQL_SERVER
- ,IMPOSSIBLE_RESULT /* Yes, we know this is ugly, don't tell us */
-#endif
};
typedef struct st_udf_args
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 562ed30afd7..531575e9e9f 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -149,8 +149,6 @@ enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
uint count, THR_LOCK_INFO *owner,
ulong lock_wait_timeout);
void thr_multi_unlock(THR_LOCK_DATA **data,uint count, uint unlock_flags);
-#error keep both thr_merge* or what?
-void thr_lock_merge_status(THR_LOCK_DATA **data, uint count);
void thr_merge_locks(THR_LOCK_DATA **data, uint org_count, uint new_count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
@@ -162,6 +160,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type);
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
ulong lock_wait_timeout);
+void thr_set_lock_wait_callback(void (*before_wait)(void),
+ void (*after_wait)(void));
#ifdef __cplusplus
}
#endif
diff --git a/include/wqueue.h b/include/wqueue.h
index 658f3d66f12..96115c4db3c 100644
--- a/include/wqueue.h
+++ b/include/wqueue.h
@@ -18,7 +18,7 @@ void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread);
void wqueue_add_and_wait(WQUEUE *wqueue,
struct st_my_thread_var *thread,
- pthread_mutex_t *lock);
+ mysql_mutex_t *lock);
void wqueue_release_queue(WQUEUE *wqueue);
void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue);
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 4f9ea6c4b57..84dd3fa4b43 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -149,7 +149,7 @@ ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
DTRACE_INSTRUMENT(clientlib)
ADD_DEPENDENCIES(clientlib GenError)
-SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
+SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 34627cb09c0..09f597444f4 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -47,7 +47,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.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
+ ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo dtoa.lo \
strmov_overlapp.lo
mystringsextra= strto.c
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index da6b90be853..5204d03e5af 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -28,7 +28,7 @@ extern char * mysql_unix_port;
CLIENT_PROTOCOL_41 | \
CLIENT_SECURE_CONNECTION | \
CLIENT_MULTI_RESULTS | \
- CLIENT_PS_MULTI_RESULTS \
+ CLIENT_PS_MULTI_RESULTS | \
CLIENT_PLUGIN_AUTH)
sig_handler my_pipe_sig_handler(int sig);
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 78a9cd8b9b5..f5286b8fa50 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -384,9 +384,9 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
if (rc == 0)
{
/* Free old connect information */
- my_free(saved_user, MYF(MY_ALLOW_ZERO_PTR));
- my_free(saved_passwd, MYF(MY_ALLOW_ZERO_PTR));
- my_free(saved_db, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(saved_user);
+ my_free(saved_passwd);
+ my_free(saved_db);
/* alloc new connect information */
mysql->user= my_strdup(mysql->user, MYF(MY_WME));
@@ -986,8 +986,8 @@ mysql_get_server_info(MYSQL *mysql)
my_bool STDCALL mariadb_connection(MYSQL *mysql)
{
- return (strinstr(mysql->server_version, "MariaDB") != 0 ||
- strinstr(mysql->server_version, "-maria-") != 0);
+ return (strstr(mysql->server_version, "MariaDB") ||
+ strstr(mysql->server_version, "-maria-"));
}
const char * STDCALL
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 7866e60016b..4d9785a4f35 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -69,7 +69,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
../sql/sql_binlog.cc ../sql/sql_manager.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
- ../sql/debug_sync.cc
+ ../sql/debug_sync.cc ../sql/opt_table_elimination.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_select.cc ../sql/sql_servers.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 7e784cc51f4..98674552812 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -80,7 +80,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.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
+ sql_partition_admin.cc \
create_options.cc opt_table_elimination.cc \
multi_range_read.cc opt_index_cond_pushdown.cc \
sql_expression_cache.cc
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b41bd50b2c6..847b1fd7ad9 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -1241,26 +1241,3 @@ int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
return 0;
}
-
-bool Protocol::net_store_data(const uchar *from, size_t length,
- CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
-{
- uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
- uint dummy_error;
- char *field_buf;
- if (!thd->mysql) // bootstrap file handling
- return false;
-
- if (!(field_buf= (char*) alloc_root(alloc, conv_length + sizeof(uint) + 1)))
- return true;
- *next_field= field_buf + sizeof(uint);
- length= copy_and_convert(*next_field, conv_length, to_cs,
- (const char*) from, length, from_cs, &dummy_error);
- *(uint *) field_buf= length;
- (*next_field)[length]= 0;
- if (next_mysql_field->max_length < length)
- next_mysql_field->max_length= length;
- ++next_field;
- ++next_mysql_field;
- return false;
-}
diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test
index 8b9b7e7ff39..2eee3402da9 100644
--- a/mysql-test/extra/rpl_tests/rpl_innodb.test
+++ b/mysql-test/extra/rpl_tests/rpl_innodb.test
@@ -94,6 +94,7 @@ SELECT COUNT(*) FROM mysqltest1.t1;
INSERT INTO mysqltest1.t1 SET f1= 2;
CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
ROLLBACK;
+--replace_result MyISAM InnoDB
SHOW CREATE TABLE mysqltest1.tmp2;
--echo ######### Must return no rows here #########
SELECT COUNT(*) FROM mysqltest1.t1;
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 c5b1102327f..f7e4f204afa 100644
--- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
@@ -1,5 +1,5 @@
# Slow test, don't run during staging part
-source include/not_staging.inc
+source include/not_staging.inc;
#
# Bug#6148 ()
diff --git a/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test b/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
index cb1639a04ac..9cf287281a0 100644
--- a/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
@@ -157,4 +157,3 @@ INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t1;
---sync_slave_with_master
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index 06a9107e963..e32ed4103b5 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1,3 +1,5 @@
+SET TIME_ZONE = _latin1 '+03:00';
+
--echo #
--echo # Start of WL#2649 Number-to-string conversions
--echo #
diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc
index 1013f81d6f3..28ed6a1d137 100644
--- a/mysql-test/include/diff_tables.inc
+++ b/mysql-test/include/diff_tables.inc
@@ -54,12 +54,10 @@
--echo Comparing tables $diff_table_1 and $diff_table_2
disable_query_log;
-disable_warnings;
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
-enable_warnings;
let $_diff_table=$diff_table_2;
diff --git a/mysql-test/include/have_dynamic_loading.inc b/mysql-test/include/have_dynamic_loading.inc
deleted file mode 100644
index 3ce9641d87c..00000000000
--- a/mysql-test/include/have_dynamic_loading.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Whether server supports dynamic loading.
-#
-if (`SELECT @@have_dynamic_loading != 'YES'`) {
- --skip The test requires dynamic loading
-}
-disable_query_log;
-show variables like 'have_dynamic_loading';
-enable_query_log;
diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc
index 21e3c33865e..bb84313eb4d 100644
--- a/mysql-test/include/have_example_plugin.inc
+++ b/mysql-test/include/have_example_plugin.inc
@@ -8,7 +8,6 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
#
# Check if the variable HA_EXAMPLE_SO is set
#
---require r/have_example_plugin.require
-disable_query_log;
-eval select LENGTH('$HA_EXAMPLE_SO') > 0 as 'have_example_plugin';
-enable_query_log;
+if (`SELECT LENGTH('$HA_EXAMPLE_SO') = 0`) {
+ --skip Need example plugin
+}
diff --git a/mysql-test/include/have_innodb.opt b/mysql-test/include/have_innodb.opt
index 4fb96229a7b..5d9121b3dc3 100644
--- a/mysql-test/include/have_innodb.opt
+++ b/mysql-test/include/have_innodb.opt
@@ -1,2 +1,2 @@
--loose-innodb
---plugin-load=$HA_XTRADB_SO
+--plugin-load=$HA_INNODB_SO
diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc
index d3b42dbf5fb..62dbf878825 100644
--- a/mysql-test/include/have_semisync_plugin.inc
+++ b/mysql-test/include/have_semisync_plugin.inc
@@ -6,16 +6,10 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
}
#
-# Check if the variable SEMISYNC_MASTER_PLUGIN is set
+# Check if the variable SEMISYNC_MASTER_SO is set
#
-if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`)
+if (`select LENGTH('$SEMISYNC_MASTER_SO') = 0`)
{
skip Need semisync plugins;
}
-#
-# Check if --plugin-dir was setup for semisync
-#
-if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) {
- --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use)
-}
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
index 008116cd8cb..100c8fc7a5a 100644
--- a/mysql-test/include/have_simple_parser.inc
+++ b/mysql-test/include/have_simple_parser.inc
@@ -8,7 +8,6 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
#
# Check if the variable MYPLUGLIB_SO is set
#
---require r/have_simple_parser.require
-disable_query_log;
-eval select LENGTH('$MYPLUGLIB_SO') > 0 as 'have_simple_parser';
-enable_query_log;
+if (`SELECT LENGTH('$MYPLUGLIB_SO') = 0`) {
+ --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 1d0782746c4..1953cb4b303 100644
--- a/mysql-test/include/have_udf.inc
+++ b/mysql-test/include/have_udf.inc
@@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
#
# Check if the variable UDF_EXAMPLE_SO is set
#
---require r/have_udf_example.require
-disable_query_log;
-eval select LENGTH('$UDF_EXAMPLE_SO') > 0 as 'have_udf_example_lib';
-enable_query_log;
+#
+if (`SELECT LENGTH('$UDF_EXAMPLE_SO') = 0`) {
+ --skip Need udf example
+}
diff --git a/mysql-test/include/have_xtradb.inc b/mysql-test/include/have_xtradb.inc
index 6c2fc5155a9..5832267375c 100644
--- a/mysql-test/include/have_xtradb.inc
+++ b/mysql-test/include/have_xtradb.inc
@@ -1,4 +1,5 @@
-disable_query_log;
---require r/true.require
-SELECT (plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
-enable_query_log;
+if (!`SELECT count(*) FROM information_schema.plugins WHERE
+ plugin_name = 'innodb' AND plugin_status = 'active' AND
+ plugin_description LIKE '%xtradb%'`){
+ skip Needs XtraDB engine;
+}
diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc
index 3c50e50ac0e..36e9af6d429 100644
--- a/mysql-test/include/mysqld--help.inc
+++ b/mysql-test/include/mysqld--help.inc
@@ -14,7 +14,7 @@ perl;
log-slow-queries pid-file slow-query-log-file
datadir slave-load-tmpdir tmpdir/;
@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/;
+ 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 /;
$re1=join('|', @skipvars, @plugins);
$re2=join('|', @plugins);
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index ebdc8fa9f98..631a5d8c348 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -982,6 +982,17 @@ sub collect_one_test_case {
}
}
+ if ( $tinfo->{'need_ipv6'} )
+ {
+ # This is a test that needs ssl
+ if ( ! $::have_ipv6 ) {
+ # IPv6 is not supported, skip it
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No IPv6";
+ return $tinfo;
+ }
+ }
+
# ----------------------------------------------------------------------
# Find config file to use if not already selected in <testname>.opt file
# ----------------------------------------------------------------------
@@ -1075,6 +1086,7 @@ my @tags=
["include/have_example_plugin.inc", "example_plugin_test", 1],
["include/have_oqgraph_engine.inc", "oqgraph_test", 1],
["include/have_ssl.inc", "need_ssl", 1],
+ ["include/check_ipv6.inc", "need_ipv6", 1],
);
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index e4743c73d6b..1d72303b839 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -2158,7 +2158,6 @@ sub environment_setup () {
# ----------------------------------------------------
$ENV{'MY_PERROR'}= mtr_native_path($exe_perror);
-#warning remove the below
# ----------------------------------------------------
# Add the path where mysqld will find udf_example.so
# ----------------------------------------------------
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index bfe2c07896b..04833d58fd3 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -160,7 +160,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,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx,perfschema";
+my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,maria,parts,innodb,percona,ndb,vcol,oqgraph,sphinx,perfschema";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -182,6 +182,7 @@ my $opt_ssl;
my $opt_skip_ssl;
my @opt_skip_test_list;
our $opt_ssl_supported;
+our $have_ipv6;
my $opt_ps_protocol;
my $opt_sp_protocol;
my $opt_cursor_protocol;
@@ -377,6 +378,7 @@ sub main {
}
check_ndbcluster_support(\%mysqld_variables);
check_ssl_support(\%mysqld_variables);
+ check_ipv6_support();
check_debug_support(\%mysqld_variables);
executable_setup();
@@ -2428,7 +2430,8 @@ sub setup_vardir() {
}
else
{
- for (<../storage/*/.libs/*.so>,<../plugin/*/.libs/*.so>,<../sql/.libs/*.so>)
+ for (<../storage/*/.libs/*.so>,<../plugin/*/.libs/*.so>,<../sql/.libs/*.so>,
+ <../storage/*/*.so>,<../plugin/*/*.so>,<../sql/*.so>)
{
my $pname=basename($_);
symlink rel2abs($_), "$plugindir/$pname";
@@ -2516,6 +2519,11 @@ sub check_ssl_support ($) {
$opt_ssl_supported= 1;
}
+sub check_ipv6_support {
+ use Socket;
+ $have_ipv6 = socket SOCK, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
+ close SOCK;
+}
sub check_debug_support ($) {
my $mysqld_variables= shift;
@@ -4377,6 +4385,9 @@ sub extract_warning_lines ($) {
qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|,
qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|,
qr|InnoDB: Error: table 'test/bug39438'|,
+ qr|'user' entry '.*' ignored in --skip-name-resolve mode|,
+ qr|mysqld got signal 6|,
+ qr|Error while setting value 'pool-of-threads' to 'thread_handling'|,
);
my $matched_lines= [];
@@ -4868,8 +4879,8 @@ sub mysqld_arguments ($$$) {
if (!using_extern() and $mysql_version_id >= 50106 && !$opt_user_args)
{
- # Turn on logging to file and tables
- mtr_add_arg($args, "%s--log-output=table,file");
+ # Turn on logging to file
+ mtr_add_arg($args, "%s--log-output=file");
}
# Check if "extra_opt" contains --log-bin
@@ -5285,7 +5296,7 @@ sub start_servers($) {
for (all_servers()) {
next unless $_->{WAIT} and started($_);
if ($_->{WAIT}->($_)) {
- $tinfo->{comment}= "Failed to start ".$_->name();
+ $tinfo->{comment}= "Failed to start ".$_->name()."\n";
return 1;
}
}
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 55776565f78..0983e9fa8cf 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12736,7 +12736,8 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value");
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair status OK
+test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+test.t1 repair status Table is already up to date
DROP TABLE t1;
#
# BUG#48757 - missing .ARZ file causes server crash
@@ -12800,12 +12801,3 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
DROP TABLE t1;
-select * from t1;
-ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
-repair table t1;
-Table Op Msg_type Msg_text
-test.t1 repair status OK
-select sum(length(a)),sum(b) from t1;
-sum(length(a)) sum(b)
-8670 187
-drop table t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index c977b0cd30c..0b3ced6cf7f 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1882,7 +1882,7 @@ drop table if exists t1,t2,t3;
# Fix modified for MariaDB: we support this syntax
create table t1 (a int) transactional=0;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
create table t2 (a int) page_checksum=1;
create table t3 (a int) row_format=page;
drop table t1,t2,t3;
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
index 0e8fe328589..4eab57e4d81 100644
--- a/mysql-test/r/ctype_binary.result
+++ b/mysql-test/r/ctype_binary.result
@@ -2,6 +2,7 @@ set names binary;
#
# Start of 5.5 tests
#
+SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
#
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index b1e9ff38d26..a9ced3e89bf 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -84,6 +84,7 @@ DROP TABLE t1;
#
# Start of 5.5 tests
#
+SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 6216819d172..b97e6e695af 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -412,6 +412,7 @@ End of 5.0 tests
#
# Start of 5.5 tests
#
+SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
#
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 02c3e348f2a..8d35cf445e8 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -1239,7 +1239,9 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests
-Start of 5.1 tests
+#
+# Start of 5.1 tests
+#
SET NAMES utf8;
CREATE TABLE t1 (
a varchar(10) CHARACTER SET ucs2 COLLATE ucs2_czech_ci,
@@ -1284,10 +1286,14 @@ hex(a)
0064017E
DROP TABLE t1;
#
+# End of 5.1 tests
+#
+#
# Start of 5.5 tests
#
SET NAMES latin1;
SET collation_connection=ucs2_general_ci;
+SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
#
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index 7cee15aecef..0d5280950df 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -1,3 +1,4 @@
+SET TIME_ZONE='+03:00';
DROP TABLE IF EXISTS t1;
#
# Start of 5.5 tests
diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
index 37d5aa98be3..cca4efd1571 100644
--- a/mysql-test/r/ctype_utf32.result
+++ b/mysql-test/r/ctype_utf32.result
@@ -1,3 +1,4 @@
+SET TIME_ZONE = '+03:00';
DROP TABLE IF EXISTS t1;
#
# Start of 5.5 tests
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 295716f48b6..4c3b661ce90 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1,3 +1,4 @@
+SET TIME_ZONE='+03:00';
drop table if exists t1,t2,t3,t4;
drop database if exists mysqltest;
drop table if exists t1,t2;
@@ -2090,6 +2091,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET NAMES utf8;
+SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
#
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 307f1714132..ffd6d2fc5b2 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -383,9 +383,9 @@ SELECT b DIV 900 y FROM t1 GROUP BY y;
y
0
Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row 0
Warning 1292 Truncated incorrect DECIMAL value: 'str1'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row 0
Warning 1292 Truncated incorrect DECIMAL value: 'str2'
SELECT c DIV 900 y FROM t1 GROUP BY y;
y
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 2ae533afa60..e80dcd9793f 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -14,7 +14,7 @@ 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 SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
@@ -45,14 +45,14 @@ 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 10 0 0 0
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
select * from mysql.user where user="mysqltest_1";
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv 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 10 20 30 0
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index 3d3f0e433d5..98647cd369c 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -255,6 +255,24 @@ WHERE
`RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND
`TESTID`='' AND `UCCHECK`='';
drop table t1;
+#
+# Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
+#
+CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (2);
+CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
+PRIMARY KEY (f1), KEY (f2), KEY (f3) );
+INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
+SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+f1
+2
+EXPLAIN SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
+2 DEPENDENT SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index
+DROP TABLE t1,t2;
#
# BUG#56862/640419: Wrong result with sort_union index merge when one
# of the merged index scans is the primary key scan
@@ -291,7 +309,7 @@ SELECT COUNT(*) FROM
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 11419 Using sort_union(idx,PRIMARY); Using where
+2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 6144 Using sort_union(idx,PRIMARY); Using where
SELECT COUNT(*) FROM
(SELECT * FROM t1
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
@@ -310,21 +328,3 @@ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
COUNT(*)
6145
DROP TABLE t1;
-#
-# Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
-#
-CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
-INSERT INTO t1 VALUES (2);
-CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
-PRIMARY KEY (f1), KEY (f2), KEY (f3) );
-INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
-SELECT t1.f1 FROM t1
-WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
-f1
-2
-EXPLAIN SELECT t1.f1 FROM t1
-WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
-2 DEPENDENT SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index
-DROP TABLE t1,t2;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index e6771f7c563..9ed397bbe1e 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -42,8 +42,8 @@ insert into t5 values (10);
create view v1 (c) as
SELECT table_name FROM information_schema.TABLES
WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
-table_name not like 'ndb_%' AND table_name not like 'innodb_%';
-and table_name not like 'pbxt%'
+table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND
+table_name not like 'pbxt_%' AND table_name not like 'xtradb_%';
select * from v1;
c
CHARACTER_SETS
@@ -81,8 +81,6 @@ TRIGGERS
USER_PRIVILEGES
USER_STATISTICS
VIEWS
-XTRADB_ADMIN_COMMAND
-XTRADB_ENHANCEMENTS
columns_priv
db
event
@@ -827,8 +825,6 @@ TABLES CREATE_TIME datetime
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
@@ -870,8 +866,6 @@ COLUMNS TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select
FILES TABLE_NAME select
INDEX_STATISTICS TABLE_NAME select
-INNODB_INDEX_STATS table_name select
-INNODB_TABLE_STATS table_name select
KEY_COLUMN_USAGE TABLE_NAME select
PARTITIONS TABLE_NAME select
REFERENTIAL_CONSTRAINTS TABLE_NAME select
@@ -1256,12 +1250,12 @@ DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
MAX(table_name)
-XTRADB_ENHANCEMENTS
+VIEWS
SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name)
FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'));
table_name
-XTRADB_ENHANCEMENTS
+VIEWS
DROP TABLE IF EXISTS bug23037;
DROP FUNCTION IF EXISTS get_value;
SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result
deleted file mode 100644
index 4ace4065c34..00000000000
--- a/mysql-test/r/innodb-lock.result
+++ /dev/null
@@ -1,57 +0,0 @@
-set global innodb_table_locks=1;
-select @@innodb_table_locks;
-@@innodb_table_locks
-1
-drop table if exists t1;
-set @@innodb_table_locks=1;
-create table t1 (id integer, x integer) engine=INNODB;
-insert into t1 values(0, 0);
-set autocommit=0;
-SELECT * from t1 where id = 0 FOR UPDATE;
-id x
-0 0
-set autocommit=0;
-lock table t1 write;
-update t1 set x=1 where id = 0;
-select * from t1;
-id x
-0 1
-commit;
-update t1 set x=2 where id = 0;
-commit;
-unlock tables;
-select * from t1;
-id x
-0 2
-commit;
-drop table t1;
-set @@innodb_table_locks=0;
-create table t1 (id integer primary key, x integer) engine=INNODB;
-insert into t1 values(0, 0),(1,1),(2,2);
-commit;
-SELECT * from t1 where id = 0 FOR UPDATE;
-id x
-0 0
-set autocommit=0;
-set @@innodb_table_locks=0;
-lock table t1 write;
-update t1 set x=10 where id = 2;
-SELECT * from t1 where id = 2;
-id x
-2 2
-UPDATE t1 set x=3 where id = 2;
-commit;
-SELECT * from t1;
-id x
-0 0
-1 1
-2 3
-commit;
-unlock tables;
-commit;
-select * from t1;
-id x
-0 0
-1 1
-2 10
-drop table t1;
diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/r/innodb-semi-consistent.result
deleted file mode 100644
index bfebd3dcacc..00000000000
--- a/mysql-test/r/innodb-semi-consistent.result
+++ /dev/null
@@ -1,47 +0,0 @@
-drop table if exists t1,t2;
-set binlog_format=mixed;
-set session transaction isolation level repeatable read;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-set autocommit=0;
-select * from t1 where a=3 lock in share mode;
-a
-3
-set binlog_format=mixed;
-set session transaction isolation level repeatable read;
-set autocommit=0;
-update t1 set a=10 where a=5;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-set session transaction isolation level read committed;
-update t1 set a=10 where a=5;
-select * from t1 where a=2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-select * from t1 where a=2 limit 1 for update;
-a
-2
-update t1 set a=11 where a=6;
-update t1 set a=12 where a=2;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-update t1 set a=13 where a=1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-update t1 set a=14 where a=1;
-commit;
-select * from t1;
-a
-14
-2
-3
-4
-10
-11
-7
-drop table t1;
-create table t1 (a int, b int) engine=myisam;
-create table t2 (c int, d int, key (c)) engine=innodb;
-insert into t1 values (1,1);
-insert into t2 values (1,2);
-set session transaction isolation level read committed;
-delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);
-drop table t1, t2;
diff --git a/mysql-test/r/innodb-zip.result b/mysql-test/r/innodb-zip.result
deleted file mode 100644
index 21396d81ba8..00000000000
--- a/mysql-test/r/innodb-zip.result
+++ /dev/null
@@ -1,421 +0,0 @@
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-create table t0(a int primary key) engine=innodb row_format=compressed;
-Warnings:
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-Warnings:
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t0 Compact
-test t00 Compact
-test t1 Compact
-test t10 Dynamic
-test t11 Compressed
-test t12 Compressed
-test t13 Compressed
-test t14 Compact
-test t2 Redundant
-test t3 Compact
-test t4 Compact
-test t5 Redundant
-test t6 Redundant
-test t7 Redundant
-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';
-table_schema table_name row_format
-test t1 Dynamic
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
-alter table t1 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 Redundant
-drop table t1;
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-insert into t1 select 1, b from t2;
-commit;
-begin;
-update t1 set b=repeat('B',100);
-select a,left(b,40) from t1 natural join t2;
-a left(b,40)
-1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-rollback;
-select a,left(b,40) from t1 natural join t2;
-a left(b,40)
-1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t2 Compact
-drop table t1,t2;
-SET SESSION innodb_strict_mode = off;
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-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 t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-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 t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-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 t1(c TEXT, PRIMARY KEY (c(438)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
-primary key(c1, c2(22), c3(22)))
-engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
-repeat('C', 20000));
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-select count(*) from t1 where c2 = repeat('A', 20000);
-count(*)
-1
-select count(*) from t1 where c3 = repeat('D', 20000);
-count(*)
-1
-select count(*) from t1 where c4 = repeat('C', 20000);
-count(*)
-1
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=`2`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`-1`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format=`Cheetah`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`abc`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`1a`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=``;
-ERROR HY000: Incorrect arguments to SET
-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;
-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.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-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 t10 Compact
-test t11 Redundant
-test t3 Compressed
-test t4 Compressed
-test t5 Compressed
-test t6 Compressed
-test t7 Compressed
-test t8 Compressed
-test t9 Dynamic
-drop table 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
-key_block_size = 8 row_format = redundant;
-ERROR HY000: Can't create table 'test.t2' (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.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-ERROR HY000: Can't create table 'test.t3' (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.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t4' (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.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;
-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)
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-set global innodb_file_per_table = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-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 t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (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.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (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.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (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.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (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.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (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.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (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.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (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 t8 Compact
-test t9 Redundant
-drop table t8, t9;
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-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 t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (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.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (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.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (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.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (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.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (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.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (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.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (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 t8 Compact
-test t9 Redundant
-drop table t8, t9;
-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_check=`Antelope`;
-create table normal_table (
-c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-create table zip_table (
-c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-show table status;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-drop table normal_table, zip_table;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
deleted file mode 100644
index ea0972a6a43..00000000000
--- a/mysql-test/r/innodb.result
+++ /dev/null
@@ -1,3305 +0,0 @@
-drop table if exists t1,t2,t3,t4;
-drop database if exists mysqltest;
-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;
-id code name
-1 1 Tim
-2 1 Monty
-3 2 David
-4 2 Erik
-5 3 Sasha
-6 3 Jeremy
-7 4 Matt
-update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
-select id, code, name from t1 order by id;
-id code name
-2 1 Monty
-3 2 David
-4 2 Erik
-5 3 Sasha
-6 3 Jeremy
-7 4 Matt
-8 1 Sinisa
-update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
-select id, code, name from t1 order by id;
-id code name
-3 2 David
-4 2 Erik
-5 3 Sasha
-6 3 Jeremy
-7 4 Matt
-8 1 Sinisa
-12 1 Ralph
-drop table t1;
-CREATE TABLE t1 (
-id int(11) NOT NULL auto_increment,
-parent_id int(11) DEFAULT '0' NOT NULL,
-level tinyint(4) DEFAULT '0' NOT NULL,
-PRIMARY KEY (id),
-KEY parent_id (parent_id),
-KEY level (level)
-) engine=innodb;
-INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
-update t1 set parent_id=parent_id+100;
-select * from t1 where parent_id=102;
-id parent_id level
-8 102 2
-9 102 2
-15 102 2
-update t1 set id=id+1000;
-update t1 set id=1024 where id=1009;
-Got one of the listed errors
-select * from t1;
-id parent_id level
-1001 100 0
-1002 101 1
-1003 101 1
-1004 101 1
-1005 101 1
-1006 101 1
-1007 101 1
-1008 102 2
-1009 102 2
-1015 102 2
-1016 103 2
-1017 103 2
-1018 103 2
-1019 103 2
-1020 103 2
-1021 104 2
-1022 104 2
-1024 104 2
-1025 105 2
-1026 105 2
-1027 105 2
-1028 105 2
-1029 105 2
-1030 105 2
-1031 106 2
-1032 106 2
-1033 106 2
-1034 106 2
-1035 106 2
-1036 107 2
-1037 107 2
-1038 107 2
-1040 107 2
-1157 100 0
-1179 105 2
-1183 104 2
-1193 105 2
-1202 107 2
-1203 107 2
-update ignore t1 set id=id+1;
-select * from t1;
-id parent_id level
-1001 100 0
-1002 101 1
-1003 101 1
-1004 101 1
-1005 101 1
-1006 101 1
-1007 101 1
-1008 102 2
-1010 102 2
-1015 102 2
-1016 103 2
-1017 103 2
-1018 103 2
-1019 103 2
-1020 103 2
-1021 104 2
-1023 104 2
-1024 104 2
-1025 105 2
-1026 105 2
-1027 105 2
-1028 105 2
-1029 105 2
-1030 105 2
-1031 106 2
-1032 106 2
-1033 106 2
-1034 106 2
-1035 106 2
-1036 107 2
-1037 107 2
-1039 107 2
-1041 107 2
-1158 100 0
-1180 105 2
-1184 104 2
-1194 105 2
-1202 107 2
-1204 107 2
-update ignore t1 set id=1023 where id=1010;
-select * from t1 where parent_id=102;
-id parent_id level
-1008 102 2
-1010 102 2
-1015 102 2
-explain select level from t1 where level=1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref level level 1 const # Using index
-explain select level,id from t1 where level=1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref level level 1 const # Using index
-explain select level,id,parent_id from t1 where level=1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref level level 1 const #
-select level,id from t1 where level=1;
-level id
-1 1002
-1 1003
-1 1004
-1 1005
-1 1006
-1 1007
-select level,id,parent_id from t1 where level=1;
-level id parent_id
-1 1002 101
-1 1003 101
-1 1004 101
-1 1005 101
-1 1006 101
-1 1007 101
-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 keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 id A # NULL NULL BTREE
-t1 1 parent_id 1 parent_id A # NULL NULL BTREE
-t1 1 level 1 level A # NULL NULL BTREE
-drop table t1;
-CREATE TABLE t1 (
-gesuchnr int(11) DEFAULT '0' NOT NULL,
-benutzer_id int(11) DEFAULT '0' NOT NULL,
-PRIMARY KEY (gesuchnr,benutzer_id)
-) engine=innodb;
-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);
-select * from t1;
-gesuchnr benutzer_id
-1 1
-2 1
-drop table t1;
-create table t1 (a int) engine=innodb;
-insert into t1 values (1), (2);
-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
-delete from t1 where a = 1;
-select * from t1;
-a
-2
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-drop table t1;
-create table t1 (a int,b varchar(20)) engine=innodb;
-insert into t1 values (1,""), (2,"testing");
-delete from t1 where a = 1;
-select * from t1;
-a b
-2 testing
-create index skr on t1 (a);
-insert into t1 values (3,""), (4,"testing");
-analyze table t1;
-Table Op Msg_type Msg_text
-test.t1 analyze status OK
-show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 skr 1 a A # NULL NULL YES BTREE
-drop table t1;
-create table t1 (a int,b varchar(20),key(a)) engine=innodb;
-insert into t1 values (1,""), (2,"testing");
-select * from t1 where a = 1;
-a b
-1
-drop table t1;
-create table t1 (n int not null primary key) engine=innodb;
-set autocommit=0;
-insert into t1 values (4);
-rollback;
-select n, "after rollback" from t1;
-n after rollback
-insert into t1 values (4);
-commit;
-select n, "after commit" from t1;
-n after commit
-4 after commit
-commit;
-insert into t1 values (5);
-insert into t1 values (4);
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-commit;
-select n, "after commit" from t1;
-n after commit
-4 after commit
-5 after commit
-set autocommit=1;
-insert into t1 values (6);
-insert into t1 values (4);
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-select n from t1;
-n
-4
-5
-6
-set autocommit=0;
-begin;
-savepoint `my_savepoint`;
-insert into t1 values (7);
-savepoint `savept2`;
-insert into t1 values (3);
-select n from t1;
-n
-3
-4
-5
-6
-7
-savepoint savept3;
-rollback to savepoint savept2;
-rollback to savepoint savept3;
-ERROR 42000: SAVEPOINT savept3 does not exist
-rollback to savepoint savept2;
-release savepoint `my_savepoint`;
-select n from t1;
-n
-4
-5
-6
-7
-rollback to savepoint `my_savepoint`;
-ERROR 42000: SAVEPOINT my_savepoint does not exist
-rollback to savepoint savept2;
-ERROR 42000: SAVEPOINT savept2 does not exist
-insert into t1 values (8);
-savepoint sv;
-commit;
-savepoint sv;
-set autocommit=1;
-rollback;
-drop table t1;
-create table t1 (n int not null primary key) engine=innodb;
-start transaction;
-insert into t1 values (4);
-flush tables with read lock;
-commit;
-unlock tables;
-commit;
-select * from t1;
-n
-4
-drop table t1;
-create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb;
-begin;
-insert into t1 values(1,'hamdouni');
-select id as afterbegin_id,nom as afterbegin_nom from t1;
-afterbegin_id afterbegin_nom
-1 hamdouni
-rollback;
-select id as afterrollback_id,nom as afterrollback_nom from t1;
-afterrollback_id afterrollback_nom
-set autocommit=0;
-insert into t1 values(2,'mysql');
-select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
-afterautocommit0_id afterautocommit0_nom
-2 mysql
-rollback;
-select id as afterrollback_id,nom as afterrollback_nom from t1;
-afterrollback_id afterrollback_nom
-set autocommit=1;
-drop table t1;
-CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
-insert into t1 values ('pippo', 12);
-insert into t1 values ('pippo', 12);
-ERROR 23000: Duplicate entry 'pippo' for key 'PRIMARY'
-delete from t1;
-delete from t1 where id = 'pippo';
-select * from t1;
-id val
-insert into t1 values ('pippo', 12);
-set autocommit=0;
-delete from t1;
-rollback;
-select * from t1;
-id val
-pippo 12
-delete from t1;
-commit;
-select * from t1;
-id val
-drop table t1;
-create table t1 (a integer) engine=innodb;
-start transaction;
-rename table t1 to t2;
-create table t1 (b integer) engine=innodb;
-insert into t1 values (1);
-rollback;
-drop table t1;
-rename table t2 to t1;
-drop table t1;
-set autocommit=1;
-CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb;
-INSERT INTO t1 VALUES (1, 'Jochen');
-select * from t1;
-ID NAME
-1 Jochen
-drop table t1;
-CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb;
-set autocommit=0;
-INSERT INTO t1 SET _userid='marc@anyware.co.uk';
-COMMIT;
-SELECT * FROM t1;
-_userid
-marc@anyware.co.uk
-SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
-_userid
-marc@anyware.co.uk
-drop table t1;
-set autocommit=1;
-CREATE TABLE t1 (
-user_id int(10) DEFAULT '0' NOT NULL,
-name varchar(100),
-phone varchar(100),
-ref_email varchar(100) DEFAULT '' NOT NULL,
-detail varchar(200),
-PRIMARY KEY (user_id,ref_email)
-)engine=innodb;
-INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar');
-select * from t1 where user_id=10292;
-user_id name phone ref_email detail
-10292 sanjeev 29153373 sansh777@hotmail.com xxx
-10292 shirish 2333604 shirish@yahoo.com ddsds
-10292 sonali 323232 sonali@bolly.com filmstar
-INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds');
-select * from t1 where user_id=10292;
-user_id name phone ref_email detail
-10292 sanjeev 29153373 sansh777@hotmail.com xxx
-10292 shirish 2333604 shirish@yahoo.com ddsds
-10292 sonali 323232 sonali@bolly.com filmstar
-select * from t1 where user_id>=10292;
-user_id name phone ref_email detail
-10292 sanjeev 29153373 sansh777@hotmail.com xxx
-10292 shirish 2333604 shirish@yahoo.com ddsds
-10292 sonali 323232 sonali@bolly.com filmstar
-10293 shirish 2333604 shirish@yahoo.com ddsds
-select * from t1 where user_id>10292;
-user_id name phone ref_email detail
-10293 shirish 2333604 shirish@yahoo.com ddsds
-select * from t1 where user_id<10292;
-user_id name phone ref_email detail
-10291 sanjeev 29153373 sansh777@hotmail.com xxx
-drop table t1;
-CREATE TABLE t1 (a int not null, b int not null,c int not null,
-key(a),primary key(a,b), unique(c),key(a),unique(b));
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 a A # NULL NULL BTREE
-t1 0 PRIMARY 2 b A # NULL NULL BTREE
-t1 0 c 1 c A # NULL NULL BTREE
-t1 0 b 1 b A # NULL NULL BTREE
-t1 1 a 1 a A # NULL NULL BTREE
-t1 1 a_2 1 a A # NULL NULL BTREE
-drop table t1;
-create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
-alter table t1 engine=innodb;
-insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
-select * from t1;
-col1 col2
-1 1
-2 3
-3 4
-4 4
-5 2
-update t1 set col2='7' where col1='4';
-select * from t1;
-col1 col2
-1 1
-2 3
-3 4
-4 7
-5 2
-alter table t1 add co3 int not null;
-select * from t1;
-col1 col2 co3
-1 1 0
-2 3 0
-3 4 0
-4 7 0
-5 2 0
-update t1 set col2='9' where col1='2';
-select * from t1;
-col1 col2 co3
-1 1 0
-2 9 0
-3 4 0
-4 7 0
-5 2 0
-drop table t1;
-create table t1 (a int not null , b int, primary key (a)) engine = innodb;
-create table t2 (a int not null , b int, primary key (a)) engine = myisam;
-insert into t1 VALUES (1,3) , (2,3), (3,3);
-select * from t1;
-a b
-1 3
-2 3
-3 3
-insert into t2 select * from t1;
-select * from t2;
-a b
-1 3
-2 3
-3 3
-delete from t1 where b = 3;
-select * from t1;
-a b
-insert into t1 select * from t2;
-select * from t1;
-a b
-1 3
-2 3
-3 3
-select * from t2;
-a b
-1 3
-2 3
-3 3
-drop table t1,t2;
-CREATE TABLE t1 (
-user_name varchar(12),
-password text,
-subscribed char(1),
-user_id int(11) DEFAULT '0' NOT NULL,
-quota bigint(20),
-weight double,
-access_date date,
-access_time time,
-approved datetime,
-dummy_primary_key int(11) NOT NULL auto_increment,
-PRIMARY KEY (dummy_primary_key)
-) ENGINE=innodb;
-INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
-INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
-INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
-INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
-INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
-select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
-user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key
-user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1
-user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2
-user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3
-user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4
-user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5
-drop table t1;
-CREATE TABLE t1 (
-id int(11) NOT NULL auto_increment,
-parent_id int(11) DEFAULT '0' NOT NULL,
-level tinyint(4) DEFAULT '0' NOT NULL,
-KEY (id),
-KEY parent_id (parent_id),
-KEY level (level)
-) engine=innodb;
-INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
-INSERT INTO t1 values (179,5,2);
-update t1 set parent_id=parent_id+100;
-select * from t1 where parent_id=102;
-id parent_id level
-8 102 2
-9 102 2
-15 102 2
-update t1 set id=id+1000;
-update t1 set id=1024 where id=1009;
-select * from t1;
-id parent_id level
-1001 100 0
-1003 101 1
-1004 101 1
-1008 102 2
-1024 102 2
-1017 103 2
-1022 104 2
-1024 104 2
-1028 105 2
-1029 105 2
-1030 105 2
-1031 106 2
-1032 106 2
-1033 106 2
-1203 107 2
-1202 107 2
-1020 103 2
-1157 100 0
-1193 105 2
-1040 107 2
-1002 101 1
-1015 102 2
-1006 101 1
-1034 106 2
-1035 106 2
-1016 103 2
-1007 101 1
-1036 107 2
-1018 103 2
-1026 105 2
-1027 105 2
-1183 104 2
-1038 107 2
-1025 105 2
-1037 107 2
-1021 104 2
-1019 103 2
-1005 101 1
-1179 105 2
-update ignore t1 set id=id+1;
-select * from t1;
-id parent_id level
-1002 100 0
-1004 101 1
-1005 101 1
-1009 102 2
-1025 102 2
-1018 103 2
-1023 104 2
-1025 104 2
-1029 105 2
-1030 105 2
-1031 105 2
-1032 106 2
-1033 106 2
-1034 106 2
-1204 107 2
-1203 107 2
-1021 103 2
-1158 100 0
-1194 105 2
-1041 107 2
-1003 101 1
-1016 102 2
-1007 101 1
-1035 106 2
-1036 106 2
-1017 103 2
-1008 101 1
-1037 107 2
-1019 103 2
-1027 105 2
-1028 105 2
-1184 104 2
-1039 107 2
-1026 105 2
-1038 107 2
-1022 104 2
-1020 103 2
-1006 101 1
-1180 105 2
-update ignore t1 set id=1023 where id=1010;
-select * from t1 where parent_id=102;
-id parent_id level
-1009 102 2
-1025 102 2
-1016 102 2
-explain select level from t1 where level=1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref level level 1 const # Using index
-select level,id from t1 where level=1;
-level id
-1 1004
-1 1005
-1 1003
-1 1007
-1 1008
-1 1006
-select level,id,parent_id from t1 where level=1;
-level id parent_id
-1 1004 101
-1 1005 101
-1 1003 101
-1 1007 101
-1 1008 101
-1 1006 101
-select level,id from t1 where level=1 order by id;
-level id
-1 1003
-1 1004
-1 1005
-1 1006
-1 1007
-1 1008
-delete from t1 where level=1;
-select * from t1;
-id parent_id level
-1002 100 0
-1009 102 2
-1025 102 2
-1018 103 2
-1023 104 2
-1025 104 2
-1029 105 2
-1030 105 2
-1031 105 2
-1032 106 2
-1033 106 2
-1034 106 2
-1204 107 2
-1203 107 2
-1021 103 2
-1158 100 0
-1194 105 2
-1041 107 2
-1016 102 2
-1035 106 2
-1036 106 2
-1017 103 2
-1037 107 2
-1019 103 2
-1027 105 2
-1028 105 2
-1184 104 2
-1039 107 2
-1026 105 2
-1038 107 2
-1022 104 2
-1020 103 2
-1180 105 2
-drop table t1;
-CREATE TABLE t1 (
-sca_code char(6) NOT NULL,
-cat_code char(6) NOT NULL,
-sca_desc varchar(50),
-lan_code char(2) NOT NULL,
-sca_pic varchar(100),
-sca_sdesc varchar(50),
-sca_sch_desc varchar(16),
-PRIMARY KEY (sca_code, cat_code, lan_code),
-INDEX sca_pic (sca_pic)
-) engine = innodb ;
-INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
-select count(*) from t1 where sca_code = 'PD';
-count(*)
-1
-select count(*) from t1 where sca_code <= 'PD';
-count(*)
-1
-select count(*) from t1 where sca_pic is null;
-count(*)
-2
-alter table t1 drop index sca_pic;
-alter table t1 add index sca_pic (cat_code, sca_pic);
-select count(*) from t1 where sca_code='PD' and sca_pic is null;
-count(*)
-1
-select count(*) from t1 where cat_code='E';
-count(*)
-0
-alter table t1 drop index sca_pic;
-alter table t1 add index (sca_pic, cat_code);
-select count(*) from t1 where sca_code='PD' and sca_pic is null;
-count(*)
-1
-select count(*) from t1 where sca_pic >= 'n';
-count(*)
-1
-select sca_pic from t1 where sca_pic is null;
-sca_pic
-NULL
-NULL
-update t1 set sca_pic="test" where sca_pic is null;
-delete from t1 where sca_code='pd';
-drop table t1;
-set @a:=now();
-CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
-insert into t1 (a) values(1),(2),(3);
-select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
-a
-1
-2
-3
-select a from t1 natural join t1 as t2 where b >= @a order by a;
-a
-1
-2
-3
-update t1 set a=5 where a=1;
-select a from t1;
-a
-2
-3
-5
-drop table t1;
-create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb;
-insert into t1 values("hello",1),("world",2);
-select * from t1 order by b desc;
-a b
-world 2
-hello 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 status OK
-show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 a A # NULL NULL BTREE
-drop table t1;
-create table t1 (i int, j int ) ENGINE=innodb;
-insert into t1 values (1,2);
-select * from t1 where i=1 and j=2;
-i j
-1 2
-create index ax1 on t1 (i,j);
-select * from t1 where i=1 and j=2;
-i j
-1 2
-drop table t1;
-CREATE TABLE t1 (
-a int3 unsigned NOT NULL,
-b int1 unsigned NOT NULL,
-UNIQUE (a, b)
-) ENGINE = innodb;
-INSERT INTO t1 VALUES (1, 1);
-SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
-MIN(B) MAX(b)
-1 1
-drop table t1;
-CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb;
-INSERT INTO t1 VALUES (1);
-SELECT * FROM t1;
-a
-1
-DROP TABLE t1;
-create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb;
-insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
-explain select * from t1 where a > 0 and a < 50;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL # Using where
-drop table t1;
-create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
-insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
-LOCK TABLES t1 WRITE;
-insert into t1 values (99,1,2,'D'),(1,1,2,'D');
-ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
-select id from t1;
-id
-0
-1
-2
-select id from t1;
-id
-0
-1
-2
-UNLOCK TABLES;
-DROP TABLE t1;
-create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
-insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
-LOCK TABLES t1 WRITE;
-begin;
-insert into t1 values (99,1,2,'D'),(1,1,2,'D');
-ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
-select id from t1;
-id
-0
-1
-2
-insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
-commit;
-select id,id3 from t1;
-id id3
-0 0
-1 1
-2 2
-100 2
-UNLOCK TABLES;
-DROP TABLE t1;
-create table t1 (a char(20), unique (a(5))) engine=innodb;
-drop table t1;
-create table t1 (a char(20), index (a(5))) engine=innodb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` char(20) DEFAULT NULL,
- KEY `a` (`a`(5))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb;
-insert into t1 values (NULL),(NULL),(NULL);
-delete from t1 where a=3;
-insert into t1 values (NULL);
-select * from t1;
-a
-1
-2
-4
-alter table t1 add b int;
-select * from t1;
-a b
-1 NULL
-2 NULL
-4 NULL
-drop table t1;
-create table t1
-(
-id int auto_increment primary key,
-name varchar(32) not null,
-value text not null,
-uid int not null,
-unique key(name,uid)
-) engine=innodb;
-insert into t1 values (1,'one','one value',101),
-(2,'two','two value',102),(3,'three','three value',103);
-set insert_id=5;
-replace into t1 (value,name,uid) values ('other value','two',102);
-delete from t1 where uid=102;
-set insert_id=5;
-replace into t1 (value,name,uid) values ('other value','two',102);
-set insert_id=6;
-replace into t1 (value,name,uid) values ('other value','two',102);
-select * from t1;
-id name value uid
-1 one one value 101
-3 three three value 103
-6 two other value 102
-drop table t1;
-create database mysqltest;
-create table mysqltest.t1 (a int not null) engine= innodb;
-insert into mysqltest.t1 values(1);
-create table mysqltest.t2 (a int not null) engine= myisam;
-insert into mysqltest.t2 values(1);
-create table mysqltest.t3 (a int not null) engine= heap;
-insert into mysqltest.t3 values(1);
-commit;
-drop database mysqltest;
-show tables from mysqltest;
-ERROR 42000: Unknown database 'mysqltest'
-set autocommit=0;
-create table t1 (a int not null) engine= innodb;
-insert into t1 values(1),(2);
-truncate table t1;
-commit;
-truncate table t1;
-truncate table t1;
-select * from t1;
-a
-insert into t1 values(1),(2);
-delete from t1;
-select * from t1;
-a
-commit;
-drop table t1;
-set autocommit=1;
-create table t1 (a int not null) engine= innodb;
-insert into t1 values(1),(2);
-truncate table t1;
-insert into t1 values(1),(2);
-select * from t1;
-a
-1
-2
-truncate table t1;
-insert into t1 values(1),(2);
-delete from t1;
-select * from t1;
-a
-drop table t1;
-create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb;
-insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
-explain select * from t1 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL #
-explain select * from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort
-explain select * from t1 order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort
-explain select a from t1 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index
-explain select b from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 4 NULL # Using index
-explain select a,b from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 4 NULL # Using index
-explain select a,b from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 4 NULL # Using index
-explain select a,b,c from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL #
-drop table t1;
-create table t1 (t int not null default 1, key (t)) engine=innodb;
-desc t1;
-Field Type Null Key Default Extra
-t int(11) NO MUL 1
-drop table t1;
-CREATE TABLE t1 (
-number bigint(20) NOT NULL default '0',
-cname char(15) NOT NULL default '',
-carrier_id smallint(6) NOT NULL default '0',
-privacy tinyint(4) NOT NULL default '0',
-last_mod_date timestamp NOT NULL,
-last_mod_id smallint(6) NOT NULL default '0',
-last_app_date timestamp NOT NULL,
-last_app_id smallint(6) default '-1',
-version smallint(6) NOT NULL default '0',
-assigned_scps int(11) default '0',
-status tinyint(4) default '0'
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1);
-INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
-INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1);
-INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
-INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
-INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
-CREATE TABLE t2 (
-number bigint(20) NOT NULL default '0',
-cname char(15) NOT NULL default '',
-carrier_id smallint(6) NOT NULL default '0',
-privacy tinyint(4) NOT NULL default '0',
-last_mod_date timestamp NOT NULL,
-last_mod_id smallint(6) NOT NULL default '0',
-last_app_date timestamp NOT NULL,
-last_app_id smallint(6) default '-1',
-version smallint(6) NOT NULL default '0',
-assigned_scps int(11) default '0',
-status tinyint(4) default '0'
-) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1);
-INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
-INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1);
-INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
-select * from t1;
-number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
-4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 0000-00-00 00:00:00 -1 2 3 1
-9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0
-650 San Francisco 0 0 2001-12-27 11:13:36 342 0000-00-00 00:00:00 -1 1 24 1
-302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0
-6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
-333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
-select * from t2;
-number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
-4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 0000-00-00 00:00:00 -1 2 3 1
-9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0
-650 San Francisco 90 0 2002-01-09 11:31:58 342 0000-00-00 00:00:00 -1 1 24 1
-333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
-delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
-select * from t1;
-number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
-6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
-333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
-select * from t2;
-number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
-333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
-select * from t2;
-number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
-333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
-drop table t1,t2;
-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;
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
-@@tx_isolation @@global.tx_isolation
-SERIALIZABLE REPEATABLE-READ
-insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
-select id, code, name from t1 order by id;
-id code name
-1 1 Tim
-2 1 Monty
-3 2 David
-COMMIT;
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
-select id, code, name from t1 order by id;
-id code name
-1 1 Tim
-2 1 Monty
-3 2 David
-4 2 Erik
-5 3 Sasha
-COMMIT;
-SET binlog_format='MIXED';
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
-select id, code, name from t1 order by id;
-id code name
-1 1 Tim
-2 1 Monty
-3 2 David
-4 2 Erik
-5 3 Sasha
-6 3 Jeremy
-7 4 Matt
-COMMIT;
-DROP TABLE t1;
-create table t1 (n int(10), d int(10)) engine=innodb;
-create table t2 (n int(10), d int(10)) engine=innodb;
-insert into t1 values(1,1),(1,2);
-insert into t2 values(1,10),(2,20);
-UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
-select * from t1;
-n d
-1 10
-1 10
-select * from t2;
-n d
-1 30
-2 20
-drop table t1,t2;
-drop table if exists t1, t2;
-CREATE TABLE t1 (a int, PRIMARY KEY (a));
-CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
-create trigger trg_del_t2 after delete on t2 for each row
-insert into t1 values (1);
-insert into t1 values (1);
-insert into t2 values (1),(2);
-delete t2 from t2;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
-count(*)
-2
-drop table t1, t2;
-drop table if exists t1, t2;
-CREATE TABLE t1 (a int, PRIMARY KEY (a));
-CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
-create trigger trg_del_t2 after delete on t2 for each row
-insert into t1 values (1);
-insert into t1 values (1);
-insert into t2 values (1),(2);
-delete t2 from t2;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
-count(*)
-2
-drop table t1, t2;
-create table t1 (a int, b int) engine=innodb;
-insert into t1 values(20,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a;
-b ifnull(t2.b,"this is null")
-NULL this is null
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-b ifnull(t2.b,"this is null")
-NULL this is null
-insert into t1 values(10,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-b ifnull(t2.b,"this is null")
-NULL this is null
-NULL this is null
-drop table t1;
-create table t1 (a varchar(10) not null) engine=myisam;
-create table t2 (b varchar(10) not null unique) engine=innodb;
-select t1.a from t1,t2 where t1.a=t2.b;
-a
-drop table t1,t2;
-create table t1 (a int not null, b int, primary key (a)) engine = innodb;
-create table t2 (a int not null, b int, primary key (a)) engine = innodb;
-insert into t1 values (10, 20);
-insert into t2 values (10, 20);
-update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
-drop table t1,t2;
-CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
-CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB;
-insert into t1 set id=1;
-insert into t2 set id=1, t1_id=1;
-delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
-select * from t1;
-id
-select * from t2;
-id t1_id
-drop table t2,t1;
-CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
-CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1, 1);
-SELECT * from t1;
-id
-1
-UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
-SELECT * from t1;
-id
-2
-UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
-SELECT * from t1;
-id
-3
-DROP TABLE t1,t2;
-set autocommit=0;
-CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
-CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
-CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB;
-INSERT INTO t3 VALUES("my-test-1", "my-test-2");
-COMMIT;
-INSERT INTO t1 VALUES("this-key", "will disappear");
-INSERT INTO t2 VALUES("this-key", "will also disappear");
-DELETE FROM t3 WHERE id1="my-test-1";
-SELECT * FROM t1;
-id value
-this-key will disappear
-SELECT * FROM t2;
-id value
-this-key will also disappear
-SELECT * FROM t3;
-id1 id2
-ROLLBACK;
-SELECT * FROM t1;
-id value
-SELECT * FROM t2;
-id value
-SELECT * FROM t3;
-id1 id2
-my-test-1 my-test-2
-SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
-id1 id2
-my-test-1 my-test-2
-COMMIT;
-set autocommit=1;
-DROP TABLE t1,t2,t3;
-CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb;
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
-SELECT * from t1;
-a b
-1 1
-102 2
-103 3
-4 4
-5 5
-6 6
-7 7
-8 8
-9 9
-drop table t1;
-CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb;
-CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb;
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
-INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-update t1,t2 set t1.a=t1.a+100;
-select * from t1;
-a b
-101 1
-102 2
-103 3
-104 4
-105 5
-106 6
-107 7
-108 8
-109 9
-110 10
-111 11
-112 12
-update t1,t2 set t1.a=t1.a+100 where t1.a=101;
-select * from t1;
-a b
-201 1
-102 2
-103 3
-104 4
-105 5
-106 6
-107 7
-108 8
-109 9
-110 10
-111 11
-112 12
-update t1,t2 set t1.b=t1.b+10 where t1.b=2;
-select * from t1;
-a b
-201 1
-103 3
-104 4
-105 5
-106 6
-107 7
-108 8
-109 9
-110 10
-111 11
-102 12
-112 12
-update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
-select * from t1;
-a b
-201 1
-103 5
-104 6
-106 6
-105 7
-107 7
-108 8
-109 9
-110 10
-111 11
-102 12
-112 12
-select * from t2;
-a b
-1 1
-2 2
-6 6
-7 7
-8 8
-9 9
-3 13
-4 14
-5 15
-drop table t1,t2;
-CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
-CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
-SET AUTOCOMMIT=0;
-INSERT INTO t1 ( B_ID ) VALUES ( 1 );
-INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SELECT * FROM t1;
-B_ID
-drop table t1,t2;
-create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb;
-insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
-select distinct parent,child from t1 order by parent;
-parent child
-0 4
-1 2
-1 3
-2 1
-drop table t1;
-create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb;
-create table t2 (a int not null auto_increment primary key, b int);
-insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
-insert into t2 (a) select b from t1;
-insert into t1 (b) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-select count(*) from t1;
-count(*)
-623
-explain select * from t1 where c between 1 and 2500;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL # Using index condition; Using MRR
-update t1 set c=a;
-explain select * from t1 where c between 1 and 2500;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL c NULL NULL NULL # Using where
-drop table t1,t2;
-create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
-insert into t1 (id) values (null),(null),(null),(null),(null);
-update t1 set fk=69 where fk is null order by id limit 1;
-SELECT * from t1;
-id fk
-2 NULL
-3 NULL
-4 NULL
-5 NULL
-1 69
-drop table t1;
-create table t1 (a int not null, b int not null, key (a));
-insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
-SET @tmp=0;
-update t1 set b=(@tmp:=@tmp+1) order by a;
-update t1 set b=99 where a=1 order by b asc limit 1;
-update t1 set b=100 where a=1 order by b desc limit 2;
-update t1 set a=a+10+b where a=1 order by b;
-select * from t1 order by a,b;
-a b
-2 4
-2 5
-2 6
-3 7
-3 8
-3 9
-3 10
-3 11
-3 12
-13 2
-111 100
-111 100
-drop table t1;
-create table t1 ( c char(8) not null ) engine=innodb;
-insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
-insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
-alter table t1 add b char(8) not null;
-alter table t1 add a char(8) not null;
-alter table t1 add primary key (a,b,c);
-update t1 set a=c, b=c;
-create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb;
-insert into t2 select * from t1;
-delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
-drop table t1,t2;
-SET AUTOCOMMIT=1;
-create table t1 (a integer auto_increment primary key) engine=innodb;
-insert into t1 (a) values (NULL),(NULL);
-truncate table t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-a
-1
-2
-drop table t1;
-CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
-CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
-drop table t2,t1;
-create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
-insert into `t1`values ( 1 ) ;
-create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
-insert into `t2`values ( 1 ) ;
-create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
-insert into `t3`values ( 1 ) ;
-delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`))
-update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`))
-update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-ERROR 42S22: Unknown column 't1.id' in 'where clause'
-drop table t3,t2,t1;
-create table t1(
-id int primary key,
-pid int,
-index(pid),
-foreign key(pid) references t1(id) on delete cascade) engine=innodb;
-insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
-(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
-delete from t1 where id=0;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `t1` (`id`) ON DELETE CASCADE)
-delete from t1 where id=15;
-delete from t1 where id=0;
-drop table t1;
-CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
-CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
-(stamp))ENGINE=InnoDB;
-insert into t1 values (1),(2),(3);
-insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
-Warnings:
-Warning 1265 Data truncated for column 'stamp' at row 3
-SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
-'20020204120000' GROUP BY col1;
-col1
-1
-2
-3
-4
-drop table t1,t2;
-CREATE TABLE t1 (
-`id` int(10) unsigned NOT NULL auto_increment,
-`id_object` int(10) unsigned default '0',
-`id_version` int(10) unsigned NOT NULL default '1',
-`label` varchar(100) NOT NULL default '',
-`description` text,
-PRIMARY KEY (`id`),
-KEY `id_object` (`id_object`),
-KEY `id_version` (`id_version`)
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
-CREATE TABLE t2 (
-`id` int(10) unsigned NOT NULL auto_increment,
-`id_version` int(10) unsigned NOT NULL default '1',
-PRIMARY KEY (`id`),
-KEY `id_version` (`id_version`)
-) ENGINE=InnoDB;
-INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
-SELECT t2.id, t1.`label` FROM t2 INNER JOIN
-(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
-ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
-id label
-3382 Test
-102 Le Pekin (Test)
-1794 Test de resto
-1822 Test 3
-3524 Societe Test
-3525 Fournisseur Test
-drop table t1,t2;
-create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
-create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
-create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
-insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
-insert t2 select * from t1;
-insert t3 select * from t1;
-checksum table t1, t2, t3, t4 quick;
-Table Checksum
-test.t1 3442722830
-test.t2 NULL
-test.t3 NULL
-test.t4 NULL
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
-checksum table t1, t2, t3, t4;
-Table Checksum
-test.t1 3442722830
-test.t2 3442722830
-test.t3 3442722830
-test.t4 NULL
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
-checksum table t1, t2, t3, t4 extended;
-Table Checksum
-test.t1 3442722830
-test.t2 3442722830
-test.t3 3442722830
-test.t4 NULL
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
-drop table t1,t2,t3;
-create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
-insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
-select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
-trim(name2)
-fff
-sss
-ttt
-first
-second
-third
-1
-2
-3
-drop table t1;
-create table t1 (a int) engine=innodb;
-create table t2 like t1;
-drop table t1,t2;
-create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
-create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- UNIQUE KEY `id` (`id`,`id2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- KEY `t1_id_fk` (`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-create index id on t2 (id);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- KEY `id` (`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-create index id2 on t2 (id);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- KEY `id` (`id`),
- KEY `id2` (`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop index id2 on t2;
-drop index id on t2;
-ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- KEY `id` (`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- KEY `t1_id_fk` (`id`,`id2`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-create unique index id on t2 (id,id2);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- UNIQUE KEY `id` (`id`,`id2`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- UNIQUE KEY `id` (`id`,`id2`),
- KEY `t1_id_fk` (`id2`,`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- UNIQUE KEY `id` (`id`,`id2`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `id2` int(11) NOT NULL,
- UNIQUE KEY `id` (`id`,`id2`),
- KEY `t1_id_fk` (`id2`,`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `id2` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `id` (`id`,`id2`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `id2` int(11) NOT NULL,
- KEY `t1_id_fk` (`id`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t2 add index id_test (id), add index id_test2 (id,id2);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `id2` int(11) NOT NULL,
- KEY `id_test` (`id`),
- KEY `id_test2` (`id`,`id2`),
- CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
-ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match
-create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) NOT NULL AUTO_INCREMENT,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b_2` (`b`),
- KEY `b` (`b`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) NOT NULL AUTO_INCREMENT,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b` (`b`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`),
- CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2, t1;
-create table t1 (c char(10), index (c,c)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c'
-create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10)) engine=innodb;
-alter table t1 add key (c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c2,c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c2,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c1,c2);
-ERROR 42S21: Duplicate column name 'c1'
-drop table t1;
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-concat(a, b)
-11113333
-drop table t1;
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-ERROR HY000: The used table type doesn't support FULLTEXT indexes
-DROP TABLE t1;
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
-CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-a_id b_list
-1 1,2,3
-2 4,5
-3 NULL
-DROP TABLE t2;
-DROP TABLE t1;
-create temporary table t1 (a int) engine=innodb;
-insert into t1 values (4711);
-truncate t1;
-insert into t1 values (42);
-select * from t1;
-a
-42
-drop table t1;
-create table t1 (a int) engine=innodb;
-insert into t1 values (4711);
-truncate t1;
-insert into t1 values (42);
-select * from t1;
-a
-42
-drop table t1;
-create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
-insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
-select * from t1 order by a,b,c,d;
-a b c d e
-1 1 a 1 1
-2 2 b 2 2
-3 3 ab 3 3
-explain select * from t1 order by a,b,c,d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
-drop table t1;
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-min(a)
-4
-select min(b) from t1 where a='8';
-min(b)
-6
-drop table t1;
-create table t1 (x bigint unsigned not null primary key) engine=innodb;
-insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
-select * from t1;
-x
-18446744073709551600
-18446744073709551601
-select count(*) from t1 where x>0;
-count(*)
-2
-select count(*) from t1 where x=0;
-count(*)
-0
-select count(*) from t1 where x<0;
-count(*)
-0
-select count(*) from t1 where x < -16;
-count(*)
-0
-select count(*) from t1 where x = -16;
-count(*)
-0
-explain select count(*) from t1 where x > -16;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
-select count(*) from t1 where x > -16;
-count(*)
-2
-select * from t1 where x > -16;
-x
-18446744073709551600
-18446744073709551601
-select count(*) from t1 where x = 18446744073709551601;
-count(*)
-1
-drop table t1;
-SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
-variable_value
-8191
-SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
-variable_value
-16384
-SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
-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
-1084
-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
-885
-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
-SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
-variable_value - @innodb_row_lock_current_waits_orig
-0
-SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
-variable_value - @innodb_row_lock_time_orig
-0
-SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
-variable_value - @innodb_row_lock_time_max_orig
-0
-SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
-variable_value - @innodb_row_lock_time_avg_orig
-0
-SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
-show variables like "innodb_sync_spin_loops";
-Variable_name Value
-innodb_sync_spin_loops 30
-set global innodb_sync_spin_loops=1000;
-show variables like "innodb_sync_spin_loops";
-Variable_name Value
-innodb_sync_spin_loops 1000
-set global innodb_sync_spin_loops=0;
-show variables like "innodb_sync_spin_loops";
-Variable_name Value
-innodb_sync_spin_loops 0
-set global innodb_sync_spin_loops=20;
-show variables like "innodb_sync_spin_loops";
-Variable_name Value
-innodb_sync_spin_loops 20
-set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
-SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
-show variables like "innodb_thread_concurrency";
-Variable_name Value
-innodb_thread_concurrency 0
-set global innodb_thread_concurrency=1001;
-Warnings:
-Warning 1292 Truncated incorrect thread_concurrency value: '1001'
-show variables like "innodb_thread_concurrency";
-Variable_name Value
-innodb_thread_concurrency 1000
-set global innodb_thread_concurrency=0;
-show variables like "innodb_thread_concurrency";
-Variable_name Value
-innodb_thread_concurrency 0
-set global innodb_thread_concurrency=16;
-show variables like "innodb_thread_concurrency";
-Variable_name Value
-innodb_thread_concurrency 16
-SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
-show variables like "innodb_concurrency_tickets";
-Variable_name Value
-innodb_concurrency_tickets 500
-set global innodb_concurrency_tickets=1000;
-show variables like "innodb_concurrency_tickets";
-Variable_name Value
-innodb_concurrency_tickets 1000
-set global innodb_concurrency_tickets=0;
-Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
-show variables like "innodb_concurrency_tickets";
-Variable_name Value
-innodb_concurrency_tickets 1
-set global innodb_concurrency_tickets=500;
-show variables like "innodb_concurrency_tickets";
-Variable_name Value
-innodb_concurrency_tickets 500
-show variables like "innodb_thread_sleep_delay";
-Variable_name Value
-innodb_thread_sleep_delay 10000
-set global innodb_thread_sleep_delay=100000;
-show variables like "innodb_thread_sleep_delay";
-Variable_name Value
-innodb_thread_sleep_delay 100000
-set global innodb_thread_sleep_delay=0;
-show variables like "innodb_thread_sleep_delay";
-Variable_name Value
-innodb_thread_sleep_delay 0
-set global innodb_thread_sleep_delay=10000;
-show variables like "innodb_thread_sleep_delay";
-Variable_name Value
-innodb_thread_sleep_delay 10000
-set storage_engine=INNODB;
-drop table if exists t1,t2,t3;
---- Testing varchar ---
---- Testing varchar ---
-create table t1 (v varchar(10), c char(10), t text);
-insert into t1 values('+ ', '+ ', '+ ');
-set @a=repeat(' ',20);
-insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
-Warnings:
-Note 1265 Data truncated for column 'v' at row 1
-select concat('*',v,'*',c,'*',t,'*') from t1;
-concat('*',v,'*',c,'*',t,'*')
-*+ *+*+ *
-*+ *+*+ *
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-create table t2 like t1;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-create table t3 select * from t1;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 modify c varchar(10);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(10) DEFAULT NULL,
- `c` varchar(10) DEFAULT NULL,
- `t` text
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 modify v char(10);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` char(10) DEFAULT NULL,
- `c` varchar(10) DEFAULT NULL,
- `t` text
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 modify t varchar(10);
-Warnings:
-Note 1265 Data truncated for column 't' at row 2
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` char(10) DEFAULT NULL,
- `c` varchar(10) DEFAULT NULL,
- `t` varchar(10) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select concat('*',v,'*',c,'*',t,'*') from t1;
-concat('*',v,'*',c,'*',t,'*')
-*+*+*+ *
-*+*+*+ *
-drop table t1,t2,t3;
-create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text,
- KEY `v` (`v`),
- KEY `c` (`c`),
- KEY `t` (`t`(10))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select count(*) from t1;
-count(*)
-270
-insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
-select count(*) from t1 where v='a';
-count(*)
-10
-select count(*) from t1 where c='a';
-count(*)
-10
-select count(*) from t1 where t='a';
-count(*)
-10
-select count(*) from t1 where v='a ';
-count(*)
-10
-select count(*) from t1 where c='a ';
-count(*)
-10
-select count(*) from t1 where t='a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-count(*)
-10
-select count(*) from t1 where v like 'a%';
-count(*)
-11
-select count(*) from t1 where c like 'a%';
-count(*)
-11
-select count(*) from t1 where t like 'a%';
-count(*)
-11
-select count(*) from t1 where v like 'a %';
-count(*)
-9
-explain select count(*) from t1 where v='a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 13 const # Using where; Using index
-explain select count(*) from t1 where c='a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c c 11 const # Using where; Using index
-explain select count(*) from t1 where t='a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref t t 13 const # Using where
-explain select count(*) from t1 where v like 'a%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 13 NULL # Using where; Using index
-explain select count(*) from t1 where v between 'a' and 'a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 13 const # Using where; Using index
-explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 13 const # Using where; Using index
-alter table t1 add unique(v);
-ERROR 23000: Duplicate entry '{ ' for key 'v_2'
-alter table t1 add key(v);
-select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
-qq
-*a*a*a*
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-*a *a*a *
-explain select * from t1 where v='a';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v,v_2 # 13 const # Using index condition
-select v,count(*) from t1 group by v limit 10;
-v count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select v,count(c) from t1 group by v limit 10;
-v count(c)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result v,count(c) from t1 group by v limit 10;
-v count(c)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select c,count(*) from t1 group by c limit 10;
-c count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select c,count(t) from t1 group by c limit 10;
-c count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result c,count(t) from t1 group by c limit 10;
-c count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select t,count(*) from t1 group by t limit 10;
-t count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select t,count(t) from t1 group by t limit 10;
-t count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result t,count(t) from t1 group by t limit 10;
-t count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(300) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text,
- KEY `c` (`c`),
- KEY `t` (`t`(10)),
- KEY `v` (`v`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select count(*) from t1 where v='a';
-count(*)
-10
-select count(*) from t1 where v='a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-count(*)
-10
-select count(*) from t1 where v like 'a%';
-count(*)
-11
-select count(*) from t1 where v like 'a %';
-count(*)
-9
-explain select count(*) from t1 where v='a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 303 const # Using where; Using index
-explain select count(*) from t1 where v like 'a%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 303 NULL # Using where; Using index
-explain select count(*) from t1 where v between 'a' and 'a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 303 const # Using where; Using index
-explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 303 const # Using where; Using index
-explain select * from t1 where v='a';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 303 const # Using index condition
-select v,count(*) from t1 group by v limit 10;
-v count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-alter table t1 drop key v, add key v (v(30));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(300) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text,
- KEY `c` (`c`),
- KEY `t` (`t`(10)),
- KEY `v` (`v`(30))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select count(*) from t1 where v='a';
-count(*)
-10
-select count(*) from t1 where v='a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ';
-count(*)
-10
-select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-count(*)
-10
-select count(*) from t1 where v like 'a%';
-count(*)
-11
-select count(*) from t1 where v like 'a %';
-count(*)
-9
-explain select count(*) from t1 where v='a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 33 const # Using where
-explain select count(*) from t1 where v like 'a%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 33 NULL # Using where
-explain select count(*) from t1 where v between 'a' and 'a ';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 33 const # Using where
-explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 33 const # Using where
-explain select * from t1 where v='a';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 33 const # Using where
-select v,count(*) from t1 group by v limit 10;
-v count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-alter table t1 modify v varchar(600), drop key v, add key v (v);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(600) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text,
- KEY `c` (`c`),
- KEY `t` (`t`(10)),
- KEY `v` (`v`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select v,count(*) from t1 group by v limit 10;
-v count(*)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-select sql_big_result v,count(t) from t1 group by v limit 10;
-v count(t)
-a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
-drop table t1;
-create table t1 (a char(10), unique (a));
-insert into t1 values ('a ');
-insert into t1 values ('a ');
-ERROR 23000: Duplicate entry 'a' for key 'a'
-alter table t1 modify a varchar(10);
-insert into t1 values ('a '),('a '),('a '),('a ');
-ERROR 23000: Duplicate entry 'a ' for key 'a'
-insert into t1 values ('a ');
-ERROR 23000: Duplicate entry 'a ' for key 'a'
-insert into t1 values ('a ');
-ERROR 23000: Duplicate entry 'a ' for key 'a'
-insert into t1 values ('a ');
-ERROR 23000: Duplicate entry 'a ' for key 'a'
-update t1 set a='a ' where a like 'a%';
-select concat(a,'.') from t1;
-concat(a,'.')
-a .
-update t1 set a='abc ' where a like 'a ';
-select concat(a,'.') from t1;
-concat(a,'.')
-a .
-update t1 set a='a ' where a like 'a %';
-select concat(a,'.') from t1;
-concat(a,'.')
-a .
-update t1 set a='a ' where a like 'a ';
-select concat(a,'.') from t1;
-concat(a,'.')
-a .
-drop table t1;
-create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `t` text,
- KEY `v` (`v`(5)),
- KEY `c` (`c`(5)),
- KEY `t` (`t`(5))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1 (v char(10) character set utf8);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` char(10) CHARACTER SET utf8 DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1 (v varchar(10), c char(10)) row_format=fixed;
-Warnings:
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` varchar(10) DEFAULT NULL,
- `c` char(10) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
-insert into t1 values('a','a'),('a ','a ');
-select concat('*',v,'*',c,'*') from t1;
-concat('*',v,'*',c,'*')
-*a*a*
-*a *a*
-drop table t1;
-create table t1 (v varchar(65530), key(v(10)));
-insert into t1 values(repeat('a',65530));
-select length(v) from t1 where v=repeat('a',65530);
-length(v)
-65530
-drop table t1;
-create table t1(a int, b varchar(12), key ba(b, a));
-insert into t1 values (1, 'A'), (20, NULL);
-explain select * from t1 where a=20 and b is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref ba ba 20 const,const 1 Using where; Using index
-select * from t1 where a=20 and b is null;
-a b
-20 NULL
-drop table t1;
-create table t1 (v varchar(65530), key(v));
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-drop table t1;
-create table t1 (v varchar(65536));
-Warnings:
-Note 1246 Converting column 'v' from VARCHAR to TEXT
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` mediumtext
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1 (v varchar(65530) character set utf8);
-Warnings:
-Note 1246 Converting column 'v' from VARCHAR to TEXT
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `v` mediumtext CHARACTER SET utf8
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-set storage_engine=MyISAM;
-create table t1 (v varchar(16384)) engine=innodb;
-drop table t1;
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-min(a)
-4
-select min(b) from t1 where a='8';
-min(b)
-6
-drop table t1;
-CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2), (1), (3);
-select * from t1;
-a b
-3 1
-2 2
-4 3
-truncate table t1;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2);
-replace into t1 (b) values (1);
-replace into t1 (b) values (3);
-select * from t1;
-a b
-3 1
-2 2
-4 3
-drop table t1;
-create table t1 (rowid int not null auto_increment, val int not null,primary
-key (rowid), unique(val)) engine=innodb;
-replace into t1 (val) values ('1'),('2');
-replace into t1 (val) values ('1'),('2');
-insert into t1 (val) values ('1'),('2');
-ERROR 23000: Duplicate entry '1' for key 'val'
-select * from t1;
-rowid val
-3 1
-4 2
-drop table t1;
-create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
-insert into t1 (val) values (1);
-update t1 set a=2 where a=1;
-insert into t1 (val) values (1);
-ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
-select * from t1;
-a val
-2 1
-drop table t1;
-CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
-INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
-SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
-GRADE
-252
-SELECT GRADE FROM t1 WHERE GRADE= 151;
-GRADE
-151
-DROP TABLE t1;
-create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
-create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
-insert into t2 values ('aa','cc');
-insert into t1 values ('aa','bb'),('aa','cc');
-delete t1 from t1,t2 where f1=f3 and f4='cc';
-select * from t1;
-f1 f2
-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
-1
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-id
-1
-DELETE FROM t1;
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-id
-1
-DROP TABLE t2, t1;
-CREATE TABLE t1
-(
-id INT PRIMARY KEY
-) ENGINE=InnoDB;
-CREATE TEMPORARY TABLE t2
-(
-id INT NOT NULL PRIMARY KEY,
-b INT,
-FOREIGN KEY (b) REFERENCES test.t1(id)
-) ENGINE=InnoDB;
-Got one of the listed errors
-DROP TABLE t1;
-create table t1 (col1 varchar(2000), index (col1(767)))
-character set = latin1 engine = innodb;
-create table t2 (col1 char(255), index (col1))
-character set = latin1 engine = innodb;
-create table t3 (col1 binary(255), index (col1))
-character set = latin1 engine = innodb;
-create table t4 (col1 varchar(767), index (col1))
-character set = latin1 engine = innodb;
-create table t5 (col1 varchar(767) primary key)
-character set = latin1 engine = innodb;
-create table t6 (col1 varbinary(767) primary key)
-character set = latin1 engine = innodb;
-create table t7 (col1 text, index(col1(767)))
-character set = latin1 engine = innodb;
-create table t8 (col1 blob, index(col1(767)))
-character set = latin1 engine = innodb;
-create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
-character set = latin1 engine = innodb;
-show create table t9;
-Table Create Table
-t9 CREATE TABLE `t9` (
- `col1` varchar(512) DEFAULT NULL,
- `col2` varchar(512) DEFAULT NULL,
- KEY `col1` (`col1`,`col2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-create table t1 (col1 varchar(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `col1` varchar(768) DEFAULT NULL,
- KEY `col1` (`col1`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2, t3, t4;
-create table t1 (col1 varchar(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-CREATE TABLE t1
-(
-id INT PRIMARY KEY
-) ENGINE=InnoDB;
-CREATE TABLE t2
-(
-v INT,
-CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
-) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(2);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1);
-DELETE FROM t1 WHERE id = 1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-DROP TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE t1;
-SET FOREIGN_KEY_CHECKS=1;
-INSERT INTO t2 VALUES(3);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-DROP TABLE t2;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=0;
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-insert into t1 values(3);
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-commit;
-checksum table t1;
-Table Checksum
-test.t1 2050879373
-commit;
-drop table t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=1;
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-set autocommit=1;
-insert into t1 values(3);
-checksum table t1;
-Table Checksum
-test.t1 2050879373
-drop table t1;
-set foreign_key_checks=0;
-create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
-create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
-ERROR HY000: Can't create table 'test.t1' (errno: 150)
-set foreign_key_checks=1;
-drop table t2;
-set foreign_key_checks=0;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
-ERROR HY000: Can't create table 'test.t2' (errno: 150)
-set foreign_key_checks=1;
-drop table t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
-create table t1(a varchar(10) primary key) engine = innodb;
-alter table t1 modify column a int;
-Got one of the listed errors
-set foreign_key_checks=1;
-drop table t2,t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-alter table t1 convert to character set utf8;
-set foreign_key_checks=1;
-drop table t2,t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
-rename table t3 to t1;
-ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150)
-set foreign_key_checks=1;
-drop table t2,t3;
-create table t1(a int primary key) row_format=redundant engine=innodb;
-create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
-create table t3(a int primary key) row_format=compact engine=innodb;
-create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
-insert into t1 values(1);
-insert into t3 values(1);
-insert into t2 values(2);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-insert into t4 values(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`))
-insert into t2 values(1);
-insert into t4 values(1);
-update t1 set a=2;
-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`))
-update t2 set a=2;
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-update t3 set a=2;
-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`))
-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`))
-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`))
-truncate t2;
-truncate t4;
-truncate t1;
-truncate t3;
-drop table t4,t3,t2,t1;
-create table t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-key (a,b,c,d)) engine=innodb;
-drop table t1;
-create table t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-key (a,b,c,d,e)) engine=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
-create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
-create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
-create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
-create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
-insert into t1 values (0x41),(0x4120),(0x4100);
-insert into t2 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
-insert into t2 values (0x41),(0x4120);
-insert into t3 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY'
-insert into t3 values (0x41),(0x4100);
-insert into t4 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
-insert into t4 values (0x41),(0x4100);
-select hex(s1) from t1;
-hex(s1)
-41
-4100
-4120
-select hex(s1) from t2;
-hex(s1)
-4100
-4120
-select hex(s1) from t3;
-hex(s1)
-4100
-41
-select hex(s1) from t4;
-hex(s1)
-4100
-41
-drop table t1,t2,t3,t4;
-create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
-create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
-insert into t2 values(0x42);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-insert into t2 values(0x41);
-select hex(s1) from t2;
-hex(s1)
-4100
-update t1 set s1=0x123456 where a=2;
-select hex(s1) from t2;
-hex(s1)
-4100
-update t1 set s1=0x12 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x12345678 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x123457 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x1220 where a=1;
-select hex(s1) from t2;
-hex(s1)
-1220
-update t1 set s1=0x1200 where a=1;
-select hex(s1) from t2;
-hex(s1)
-1200
-update t1 set s1=0x4200 where a=1;
-select hex(s1) from t2;
-hex(s1)
-4200
-delete from t1 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-delete from t1 where a=2;
-update t2 set s1=0x4120;
-delete from t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-delete from t1 where a!=3;
-select a,hex(s1) from t1;
-a hex(s1)
-3 4120
-select hex(s1) from t2;
-hex(s1)
-4120
-drop table t2,t1;
-create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
-create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-insert into t1 values(1,0x4100),(2,0x41);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-hex(s1)
-41
-update t1 set s1=0x1234 where a=1;
-select hex(s1) from t2;
-hex(s1)
-41
-update t1 set s1=0x12 where a=2;
-select hex(s1) from t2;
-hex(s1)
-12
-delete from t1 where a=1;
-delete from t1 where a=2;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-select a,hex(s1) from t1;
-a hex(s1)
-2 12
-select hex(s1) from t2;
-hex(s1)
-12
-drop table t2,t1;
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
-CREATE TABLE t2(a INT) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
-ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- KEY `t2_ibfk_0` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2,t1;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-commit;
-set autocommit = 0;
-update t1 set b = 5 where a = 2;
-create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
-set autocommit = 0;
-insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
-(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
-(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
-(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
-(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
-commit;
-commit;
-drop trigger t1t;
-drop table t1;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-insert into t2(a) values (1),(2),(3);
-insert into t3(a) values (1),(2),(3);
-insert into t4(a) values (1),(2),(3);
-insert into t3(a) values (5),(7),(8);
-insert into t4(a) values (5),(7),(8);
-insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
-create trigger t1t before insert on t1 for each row begin
-INSERT INTO t2 SET a = NEW.a;
-end |
-create trigger t2t before insert on t2 for each row begin
-DELETE FROM t3 WHERE a = NEW.a;
-end |
-create trigger t3t before delete on t3 for each row begin
-UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
-end |
-create trigger t4t before update on t4 for each row begin
-UPDATE t5 SET b = b + 1 where a = NEW.a;
-end |
-commit;
-set autocommit = 0;
-update t1 set b = b + 5 where a = 1;
-update t2 set b = b + 5 where a = 1;
-update t3 set b = b + 5 where a = 1;
-update t4 set b = b + 5 where a = 1;
-insert into t5(a) values(20);
-set autocommit = 0;
-insert into t1(a) values(7);
-insert into t2(a) values(8);
-delete from t2 where a = 3;
-update t4 set b = b + 1 where a = 3;
-commit;
-drop trigger t1t;
-drop trigger t2t;
-drop trigger t3t;
-drop trigger t4t;
-drop table t1, t2, t3, t4, t5;
-CREATE TABLE t1 (
-field1 varchar(8) NOT NULL DEFAULT '',
-field2 varchar(8) NOT NULL DEFAULT '',
-PRIMARY KEY (field1, field2)
-) ENGINE=InnoDB;
-CREATE TABLE t2 (
-field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
-FOREIGN KEY (field1) REFERENCES t1 (field1)
-ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES ('old', 'somevalu');
-INSERT INTO t1 VALUES ('other', 'anyvalue');
-INSERT INTO t2 VALUES ('old');
-INSERT INTO t2 VALUES ('other');
-UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
-ERROR 23000: Upholding foreign key constraints for table 't1', entry 'other-somevalu', key 1 would lead to a duplicate entry
-DROP TABLE t2;
-DROP TABLE t1;
-create table t1 (
-c1 bigint not null,
-c2 bigint not null,
-primary key (c1),
-unique key (c2)
-) engine=innodb;
-create table t2 (
-c1 bigint not null,
-primary key (c1)
-) engine=innodb;
-alter table t1 add constraint c2_fk foreign key (c2)
-references t2(c1) on delete cascade;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(20) NOT NULL,
- `c2` bigint(20) NOT NULL,
- PRIMARY KEY (`c1`),
- UNIQUE KEY `c2` (`c2`),
- CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 drop foreign key c2_fk;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(20) NOT NULL,
- `c2` bigint(20) NOT NULL,
- PRIMARY KEY (`c1`),
- UNIQUE KEY `c2` (`c2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2;
-create table t1(a date) engine=innodb;
-create table t2(a date, key(a)) engine=innodb;
-insert into t1 values('2005-10-01');
-insert into t2 values('2005-10-01');
-select * from t1, t2
-where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
-a a
-2005-10-01 2005-10-01
-drop table t1, t2;
-create table t1 (id int not null, f_id int not null, f int not null,
-primary key(f_id, id)) engine=innodb;
-create table t2 (id int not null,s_id int not null,s varchar(200),
-primary key(id)) engine=innodb;
-INSERT INTO t1 VALUES (8, 1, 3);
-INSERT INTO t1 VALUES (1, 2, 1);
-INSERT INTO t2 VALUES (1, 0, '');
-INSERT INTO t2 VALUES (8, 1, '');
-commit;
-DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
-WHERE mm.id IS NULL;
-select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
-where mm.id is null lock in share mode;
-id f_id f
-drop table t1,t2;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
-commit;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t1 set b = 5 where b = 1;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-select * from t1 where a = 7 and b = 3 for update;
-a b
-7 3
-commit;
-commit;
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
-commit;
-set autocommit = 0;
-select * from t1 lock in share mode;
-a b
-1 1
-2 2
-3 1
-4 2
-5 1
-6 2
-update t1 set b = 5 where b = 1;
-set autocommit = 0;
-select * from t1 where a = 2 and b = 2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-commit;
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(d int not null, e int, primary key(d)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-d e
-3 1
-8 6
-12 1
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t1 select * from t2;
-update t1 set b = (select e from t2 where a = d);
-create table t3(d int not null, e int, primary key(d)) engine=innodb
-select * from t2;
-commit;
-commit;
-drop table t1, t2, t3;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(a int not null, b int, primary key(a)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-create table t3(d int not null, b int, primary key(d)) engine=innodb;
-insert into t3 values (8,6),(12,1),(3,1);
-create table t5(a int not null, b int, primary key(a)) engine=innodb;
-insert into t5 values (1,2),(5,3),(4,2);
-create table t6(d int not null, e int, primary key(d)) engine=innodb;
-insert into t6 values (8,6),(12,1),(3,1);
-create table t8(a int not null, b int, primary key(a)) engine=innodb;
-insert into t8 values (1,2),(5,3),(4,2);
-create table t9(d int not null, e int, primary key(d)) engine=innodb;
-insert into t9 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-a b
-3 1
-8 6
-12 1
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-insert into t1 select * from t2;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-update t3 set b = (select b from t2 where a = d);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t5 (select * from t2 lock in share mode);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t6 set e = (select b from t2 where a = d lock in share mode);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t8 (select * from t2 for update);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t9 set e = (select b from t2 where a = d for update);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-drop table t1, t2, t3, t5, t6, t8, t9;
-CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-ERROR 42000: Incorrect column name 'DB_ROW_ID'
-CREATE TABLE t1 (
-a BIGINT(20) NOT NULL,
-PRIMARY KEY (a)
-) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-CREATE TABLE t2 (
-a BIGINT(20) NOT NULL,
-b VARCHAR(128) NOT NULL,
-c TEXT NOT NULL,
-PRIMARY KEY (a,b),
-KEY idx_t2_b_c (b,c(200)),
-CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
-ON DELETE CASCADE
-) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1, 'bar', 'vbar');
-INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
-INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
-INSERT INTO t2 VALUES (1, 'customer_over', '1');
-SELECT * FROM t2 WHERE b = 'customer_over';
-a b c
-1 customer_over 1
-SELECT * FROM t2 WHERE BINARY b = 'customer_over';
-a b c
-1 customer_over 1
-SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
-a
-1
-/* Bang: Empty result set, above was expected: */
-SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-a
-1
-SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-a
-1
-drop table t2, t1;
-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 status OK
-DROP TABLE t1;
-CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
-CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
-CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
-ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
-DELETE CASCADE ON UPDATE CASCADE;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `f` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `f` (`f`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2, t1;
-CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
-CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
-ALTER TABLE t2 MODIFY a INT NOT NULL;
-ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
-DELETE FROM t1;
-DROP TABLE t2,t1;
-CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
-AUTO_INCREMENT=42;
-INSERT INTO t1 VALUES (0),(347),(0);
-SELECT * FROM t1;
-id
-42
-347
-348
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
-CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(42),(347),(348);
-ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`id`),
- CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
-DROP TABLE t1,t2;
-set innodb_strict_mode=on;
-CREATE TABLE t1 (
-c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
-c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
-c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
-c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
-c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
-c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
-c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
-c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
-) ENGINE = InnoDB;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-CREATE TABLE t1(
-id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(-10);
-SELECT * FROM t1;
-id
--10
-INSERT INTO t1 VALUES(NULL);
-SELECT * FROM t1;
-id
--10
-1
-DROP TABLE t1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-DROP TABLE IF EXISTS t1, t2;
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
-CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
-CREATE TABLE t2 LIKE t1;
-SELECT * FROM t2;
-a
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (1);
-COMMIT;
-SELECT * FROM t1 WHERE a=1;
-a
-1
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-SELECT * FROM t2;
-a
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (2);
-COMMIT;
-SELECT * FROM t1 WHERE a=2;
-a
-2
-SELECT * FROM t1 WHERE a=2;
-a
-2
-DROP TABLE t1;
-DROP TABLE t2;
-create table t1 (i int, j int) engine=innodb;
-insert into t1 (i, j) values (1, 1), (2, 2);
-update t1 set j = 2;
-affected rows: 1
-info: Rows matched: 2 Changed: 1 Warnings: 0
-drop table t1;
-create table t1 (id int) comment='this is a comment' engine=innodb;
-select table_comment, data_free > 0 as data_free_is_set
-from information_schema.tables
-where table_schema='test' and table_name = 't1';
-table_comment data_free_is_set
-this is a comment 1
-drop table t1;
-CREATE TABLE t1 (
-c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-c2 VARCHAR(128) NOT NULL,
-PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
-CREATE TABLE t2 (
-c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-c2 INT(10) UNSIGNED DEFAULT NULL,
-PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-AUTO_INCREMENT
-200
-ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-AUTO_INCREMENT
-200
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1 (c1 int default NULL,
-c2 int default NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-TRUNCATE TABLE t1;
-affected rows: 0
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-TRUNCATE TABLE t1;
-affected rows: 0
-DROP TABLE t1;
-Variable_name Value
-Handler_update 0
-Variable_name Value
-Handler_delete 0
-Variable_name Value
-Handler_update 1
-Variable_name Value
-Handler_delete 1
diff --git a/mysql-test/r/innodb_bug36172.result b/mysql-test/r/innodb_bug36172.result
deleted file mode 100644
index 195775f74c8..00000000000
--- a/mysql-test/r/innodb_bug36172.result
+++ /dev/null
@@ -1 +0,0 @@
-SET storage_engine=InnoDB;
diff --git a/mysql-test/r/innodb_bug47167.result b/mysql-test/r/innodb_bug47167.result
deleted file mode 100644
index cbec363d78f..00000000000
--- a/mysql-test/r/innodb_bug47167.result
+++ /dev/null
@@ -1,24 +0,0 @@
-set @old_innodb_file_format_check=@@innodb_file_format_check;
-select @old_innodb_file_format_check;
-@old_innodb_file_format_check
-Antelope
-set global innodb_file_format_check = Barracuda;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check = DEFAULT;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check = @old_innodb_file_format_check;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-set global innodb_file_format_check = cheetah;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format_check = Bear;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format_check = on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format_check = off;
-ERROR HY000: Incorrect arguments to SET
diff --git a/mysql-test/r/innodb_file_format.result b/mysql-test/r/innodb_file_format.result
deleted file mode 100644
index d58c4ce8b28..00000000000
--- a/mysql-test/r/innodb_file_format.result
+++ /dev/null
@@ -1,44 +0,0 @@
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
-set global innodb_file_format=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=default;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
-set global innodb_file_format_check=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=default;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=antelope;
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index 5437538023c..4e0ae5bf640 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -4114,6 +4114,9 @@ FROM t1 JOIN t2 ON t2.v
ORDER BY t2.v;
MAX(t1.i)
NULL
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'x'
+Warning 1292 Truncated incorrect INTEGER value: 'y'
EXPLAIN
SELECT MAX(t1.i)
diff --git a/mysql-test/r/join_optimizer.result b/mysql-test/r/join_optimizer.result
index 9e667506cfa..42c4c220e8c 100644
--- a/mysql-test/r/join_optimizer.result
+++ b/mysql-test/r/join_optimizer.result
@@ -33,5 +33,5 @@ SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt)
WHERE g.domain = 'queue' AND g.type = a.type;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL NULL NULL NULL 2
-1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using where
+1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using index condition
drop table t0,t1,t2,t3;
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 2f8a6ae93e0..b4a9bc7c4c2 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -946,25 +946,29 @@ group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));
@@ -1238,6 +1242,7 @@ show status like 'Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 5
+Handler_read_last 0
Handler_read_next 9
Handler_read_prev 0
Handler_read_rnd 3
@@ -1306,7 +1311,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,NULL AS `f2`,'3' AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL)) where ((coalesce('1',NULL),'3') in ((1,3),(2,2)))
+Note 1003 select '1' AS `f1`,NULL AS `f2`,'3' AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where ((coalesce('1',NULL),'3') in ((1,3),(2,2)))
SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
f1 f2 f3 f1 f2
diff --git a/mysql-test/r/log_slow.result b/mysql-test/r/log_slow.result
index b6341109556..62539566bfa 100644
--- a/mysql-test/r/log_slow.result
+++ b/mysql-test/r/log_slow.result
@@ -1,6 +1,6 @@
select @@log_slow_filter;
@@log_slow_filter
-
+admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
select @@log_slow_rate_limit;
@@log_slow_rate_limit
1
@@ -9,10 +9,9 @@ select @@log_slow_verbosity;
show variables like "log_slow%";
Variable_name Value
-log_slow_filter
+log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
log_slow_queries ON
log_slow_rate_limit 1
-log_slow_time 10.000000
log_slow_verbosity
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";
select @@log_slow_filter;
@@ -56,6 +55,6 @@ last_insert_id int(11) NO NULL
insert_id int(11) NO NULL
server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL
-flush slow query logs;
+flush slow logs;
set @@log_slow_filter=default;
set @@log_slow_verbosity=default;
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
index a9d1b41cf2c..850bdf5c2bd 100644
--- a/mysql-test/r/log_tables_upgrade.result
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -41,6 +41,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
diff --git a/mysql-test/r/merge_debug.result b/mysql-test/r/merge_debug.result
index b857ff597f2..869d9e7536c 100644
--- a/mysql-test/r/merge_debug.result
+++ b/mysql-test/r/merge_debug.result
@@ -10,11 +10,11 @@ INSERT INTO crashed VALUES (10);
INSERT INTO t2 VALUES (20);
INSERT INTO t3 VALUES (30);
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE;
-SET GLOBAL debug="+d,*,myisam_pretend_crashed_table_on_open";
+SET GLOBAL debug="+d,myisam_pretend_crashed_table_on_open";
CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29);
SET GLOBAL debug=@orig_debug;
INSERT INTO t4 VALUES (39);
-ERROR HY000: Table 't4' was not locked with LOCK TABLES
+ERROR HY000: Table 'crashed' was not locked with LOCK TABLES
INSERT INTO crashed VALUES (11);
ERROR HY000: Table 'crashed' was not locked with LOCK TABLES
INSERT INTO t2 VALUES (21);
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 06e345304de..dea4f2c1230 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -2258,7 +2258,7 @@ Key Start Len Index Type
DROP TABLE t1;
create table t1 (n int not null, c char(1)) transactional=1;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index c727e3b5b5a..7737dab49b2 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -28,6 +28,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -63,6 +64,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -98,6 +100,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -136,6 +139,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -177,6 +181,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -221,6 +226,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
@@ -231,3 +237,5 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, databases won't be touched.
+Phase 3/3: Running 'mysql_fix_privilege_tables'...
+OK
diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result
index f1229c4a405..23ad09dbd9c 100644
--- a/mysql-test/r/mysql_upgrade_ssl.result
+++ b/mysql-test/r/mysql_upgrade_ssl.result
@@ -1,15 +1,18 @@
#
# Bug#55672 mysql_upgrade dies with internal error
#
+Phase 1/3: Fixing table and database names
+Phase 2/3: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
+mysql
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
-mysql.general_log
-Error : You can't use locks with log tables.
-status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -20,9 +23,6 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
-mysql.slow_log
-Error : You can't use locks with log tables.
-status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -30,3 +30,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+performance_schema
+test
+Phase 3/3: Running 'mysql_fix_privilege_tables'...
+OK
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
index 025f67082ec..8cd8dc2b0dd 100644
--- a/mysql-test/r/mysqld--help-notwin.result
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -97,6 +97,16 @@ The following options may be given as the first argument:
--date-format=name The DATE format (ignored)
--datetime-format=name
The DATETIME format (ignored)
+ --deadlock-search-depth-long=#
+ Long search depth for the two-step deadlock detection
+ --deadlock-search-depth-short=#
+ Short search depth for the two-step deadlock detection
+ --deadlock-timeout-long=#
+ Long timeout for the two-step deadlock detection (in
+ microseconds)
+ --deadlock-timeout-short=#
+ Short timeout for the two-step deadlock detection (in
+ microseconds)
--default-storage-engine=name
The default storage engine for new tables
--default-time-zone=name
@@ -141,6 +151,11 @@ The following options may be given as the first argument:
With this option enabled you can run myisamchk to test
(not repair) tables while the MySQL server is running.
Disable with --skip-external-locking.
+ --extra-max-connections=#
+ The number of connections on extra-port
+ --extra-port=# Extra port number to use for tcp connections in a
+ one-thread-per-connection manner. 0 means don't use
+ another port
--flush Flush MyISAM tables to disk between SQL commands
--flush-time=# A dedicated thread is created to flush all tables at the
given interval
@@ -180,6 +195,10 @@ The following options may be given as the first argument:
interactive connection before closing it
--join-buffer-size=#
The size of the buffer that is used for full joins
+ --join-cache-level=#
+ Controls what join operations can be executed with join
+ buffers. Odd numbers are used for plain join buffers
+ while even numbers are used for linked buffers
--keep-files-on-create
Don't overwrite stale .MYD and .MYI even if no directory
is specified
@@ -197,6 +216,8 @@ The following options may be given as the first argument:
The default size of key cache blocks
--key-cache-division-limit=#
The minimum percentage of warm blocks in key cache
+ --key-cache-segments=#
+ The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
a full path. Deprecated. Use --lc-messages-dir instead.
--large-pages Enable support for large pages
@@ -243,15 +264,28 @@ The following options may be given as the first argument:
--log-slow-admin-statements
Log slow OPTIMIZE, ANALYZE, ALTER and other
administrative statements to the slow log if it is open.
+ --log-slow-filter=name
+ Log only certain types of queries. Multiple flags can be
+ specified, separated by commas. Valid values are admin,
+ slave, filesort, filesort_on_disk, full_join, full_scan,
+ query_cache, query_cache_miss, tmp_table,
+ tmp_table_on_disk
--log-slow-queries[=name]
Log slow queries to a table or log file. Defaults logging
to table mysql.slow_log or hostname-slow.log if
--log-output=file is used. Must be enabled to activate
other slow log options. Deprecated option, use
--slow-query-log/--slow-query-log-file instead.
+ --log-slow-rate-limit=#
+ Write to slow log every #th slow query. Set to 1 to log
+ everything. Increase it to reduce the size of the slow or
+ the performance impact of slow logging
--log-slow-slave-statements
Log slow statements executed by slave thread to the slow
log if it is open.
+ --log-slow-verbosity=name
+ log-slow-verbosity=[value[,value ...]] where value is one
+ of 'innodb', 'query_plan'
--log-tc=name Path to transaction coordinator log (used for
transactions that affect more than one storage engine,
when binary log is disabled).
@@ -327,8 +361,7 @@ The following options may be given as the first argument:
--min-examined-row-limit=#
Don't write queries to slow log that examine fewer rows
than that
- --multi-range-count=#
- Number of key ranges to request at once
+ --mrr-buffer-size=# Size of buffer to use when using MRR with range access
--myisam-block-size=#
Block size to be used for MyISAM index pages
--myisam-data-pointer-size=#
@@ -404,8 +437,15 @@ The following options may be given as the first argument:
optimizer_switch=option=val[,option=val...], where option
is one of {index_merge, index_merge_union,
index_merge_sort_union, index_merge_intersection,
- engine_condition_pushdown} and val is one of {on, off,
- default}
+ engine_condition_pushdown, index_condition_pushdown,
+ firstmatch, loosescan, materialization, semijoin,
+ partial_match_rowid_merge, partial_match_table_scan,
+ subquery_cache} and val is one of {on, off, default}
+ --optimizer-use-mrr=name
+ Whether the server should use multi-read-range
+ optimization when resolving queries, one of AUTO (as
+ appropriate), FORCE (always where applicable), DISABLE
+ (never)
--performance-schema
Enable the performance schema.
--performance-schema-events-waits-history-long-size=#
@@ -444,6 +484,9 @@ The following options may be given as the first argument:
where each plugin is identified as name=library, where
name is the plugin name and library is the plugin library
in plugin_dir.
+ --plugin-maturity=name
+ The lowest desirable plugin maturity. Plugins less mature
+ than that will not be installed or loaded.
-P, --port=# Port number to use for connection or 0 to default to,
my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
(3306), whatever comes first
@@ -578,6 +621,9 @@ The following options may be given as the first argument:
not sure, leave this option unset
--report-user=name The account user name of the slave to be reported to the
master during slave registration
+ --rowid-merge-buff-size=#
+ The size of the buffers used [NOT] IN evaluation via
+ partial matching
--rpl-recovery-rank=#
Unused, will be removed
--safe-mode Skip some optimize stages (for testing).
@@ -593,13 +639,14 @@ The following options may be given as the first argument:
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
+ --skip-bdb Deprecated option; Exist only for compatiblity with old
+ my.cnf files
--skip-grant-tables Start without grant tables. This gives all users FULL
ACCESS to all tables.
--skip-host-cache Don't cache host names.
--skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
'localhost'.
--skip-networking Don't allow connection with TCP/IP
- --skip-new Don't use new, possibly wrong routines.
--skip-show-database
Don't allow 'SHOW DATABASE' commands
--skip-slave-start If set, slave is not autostarted.
@@ -688,14 +735,14 @@ The following options may be given as the first argument:
How many threads we should keep in a cache for reuse
--thread-handling=name
Define threads usage for handling queries, one of
- one-thread-per-connection, no-threads, loaded-dynamically
+ one-thread-per-connection, no-threads
--thread-stack=# The stack size for each thread
--time-format=name The TIME format (ignored)
--timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
currently supported)
--tmp-table-size=# If an internal in-memory temporary table exceeds this
size, MySQL will automatically convert it to an on-disk
- MyISAM table
+ MyISAM or Aria table
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
separated by a colon (:), in this case they are used in a
round-robin fashion
@@ -715,6 +762,9 @@ The following options may be given as the first argument:
of the underlying table and the query uses a LIMIT clause
(usually get from GUI tools)
-u, --user=name Run mysqld daemon as user.
+ --userstat Enables statistics gathering for USER_STATISTICS,
+ CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS
+ tables in the INFORMATION_SCHEMA
-v, --verbose Used with --help option for detailed help.
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
@@ -746,7 +796,11 @@ connect-timeout 10
console FALSE
date-format %Y-%m-%d
datetime-format %Y-%m-%d %H:%i:%s
-default-storage-engine InnoDB
+deadlock-search-depth-long 15
+deadlock-search-depth-short 4
+deadlock-timeout-long 50000000
+deadlock-timeout-short 10000
+default-storage-engine myisam
default-time-zone (No default value)
default-week-format 0
delay-key-write ON
@@ -759,6 +813,8 @@ engine-condition-pushdown TRUE
event-scheduler OFF
expire-logs-days 0
external-locking FALSE
+extra-max-connections 1
+extra-port 0
flush FALSE
flush-time 0
ft-boolean-syntax + -><()~*:""&|
@@ -777,11 +833,13 @@ init-rpl-role MASTER
init-slave
interactive-timeout 28800
join-buffer-size 131072
+join-cache-level 1
keep-files-on-create FALSE
-key-buffer-size 8388608
+key-buffer-size 134217728
key-cache-age-threshold 300
key-cache-block-size 1024
key-cache-division-limit 100
+key-cache-segments 0
language MYSQL_SHAREDIR/
large-pages FALSE
lc-messages en_US
@@ -799,7 +857,10 @@ log-queries-not-using-indexes FALSE
log-short-format FALSE
log-slave-updates FALSE
log-slow-admin-statements FALSE
+log-slow-filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+log-slow-rate-limit 1
log-slow-slave-statements FALSE
+log-slow-verbosity
log-tc tc.log
log-tc-size 24576
log-warnings 1
@@ -829,12 +890,12 @@ max-user-connections 0
max-write-lock-count 18446744073709551615
memlock FALSE
min-examined-row-limit 0
-multi-range-count 256
+mrr-buffer-size 262144
myisam-block-size 1024
myisam-data-pointer-size 6
myisam-max-sort-file-size 9223372036853727232
myisam-mmap-size 18446744073709551615
-myisam-recover-options OFF
+myisam-recover-options DEFAULT
myisam-repair-threads 1
myisam-sort-buffer-size 8388608
myisam-stats-method nulls_unequal
@@ -850,7 +911,8 @@ old-passwords FALSE
old-style-user-limits FALSE
optimizer-prune-level 1
optimizer-search-depth 62
-optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
+optimizer-use-mrr force
performance-schema FALSE
performance-schema-events-waits-history-long-size 10000
performance-schema-events-waits-history-size 10
@@ -868,6 +930,7 @@ performance-schema-max-table-instances 50000
performance-schema-max-thread-classes 50
performance-schema-max-thread-instances 1000
plugin-load (No default value)
+plugin-maturity unknown
port 3306
port-open-timeout 0
preload-buffer-size 32768
@@ -894,6 +957,7 @@ report-host (No default value)
report-password (No default value)
report-port 3306
report-user (No default value)
+rowid-merge-buff-size 8388608
rpl-recovery-rank 0
safe-user-create FALSE
secure-auth FALSE
@@ -919,7 +983,7 @@ sporadic-binlog-dump-fail FALSE
sql-mode
symbolic-links FALSE
sync-binlog 0
-sync-frm TRUE
+sync-frm FALSE
sync-master-info 0
sync-relay-log 0
sync-relay-log-info 0
@@ -930,7 +994,7 @@ table-open-cache 400
tc-heuristic-recover COMMIT
thread-cache-size 0
thread-handling one-thread-per-connection
-thread-stack 262144
+thread-stack 294912
time-format %H:%i:%s
timed-mutexes FALSE
tmp-table-size 16777216
@@ -938,6 +1002,7 @@ transaction-alloc-block-size 8192
transaction-isolation REPEATABLE-READ
transaction-prealloc-size 4096
updatable-views-with-limit YES
+userstat FALSE
verbose TRUE
wait-timeout 28800
diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result
index 2c48f56d578..3c0523279a9 100644
--- a/mysql-test/r/not_partition.result
+++ b/mysql-test/r/not_partition.result
@@ -3,7 +3,7 @@ FLUSH TABLES;
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'partition'
TRUNCATE TABLE t1;
-ERROR 42000: Unknown storage engine 'partition'
+ERROR 42S02: Table 'test.t1' doesn't exist
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze Error Unknown storage engine 'partition'
diff --git a/mysql-test/r/optimizer_switch.result b/mysql-test/r/optimizer_switch.result
deleted file mode 100644
index 6bccefe54be..00000000000
--- a/mysql-test/r/optimizer_switch.result
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Generic @@optimizer_switch tests
-#
-#
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='index_merge=off,index_merge_union=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='index_merge_union=on';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,index_merge_sort_union=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch=4;
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4'
-set optimizer_switch=NULL;
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
-set optimizer_switch='default,index_merge';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
-set optimizer_switch='index_merge=index_merge';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=index_merge'
-set optimizer_switch='index_merge=on,but...';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'but...'
-set optimizer_switch='index_merge=';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge='
-set optimizer_switch='index_merge';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
-set optimizer_switch='on';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'on'
-set optimizer_switch='index_merge=on,index_merge=off';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off'
-set optimizer_switch='index_merge_union=on,index_merge_union=default';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge_union=default'
-set optimizer_switch='default,index_merge=on,index_merge=off,default';
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge=off,default'
-set optimizer_switch=default;
-set optimizer_switch='index_merge=off,index_merge_union=off,default';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch=default;
-select @@global.optimizer_switch;
-@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set @@global.optimizer_switch=default;
-select @@global.optimizer_switch;
-@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-#
-# Check index_merge's @@optimizer_switch flags
-#
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-
-BUG#37120 optimizer_switch allowable values not according to specification
-
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,materialization=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=off,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,semijoin=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,loosescan=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=off,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,semijoin=off,materialization=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=off,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,materialization=off,semijoin=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=off,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,semijoin=off,materialization=off,loosescan=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,semijoin=off,loosescan=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=off,materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch='default,materialization=off,loosescan=off';
-select @@optimizer_switch;
-@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_condition_pushdown=on,firstmatch=on,loosescan=off,materialization=off,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on
-set optimizer_switch=default;
diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
index a8313ec246c..ac69da6ebb5 100644
--- a/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
+++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
@@ -2,4 +2,4 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
index d7e84c57f42..2d67cebbe3c 100644
--- a/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
+++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
@@ -2,4 +2,4 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 148504bcc8b..bbd69083038 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -5,6 +5,8 @@ drop table if exists t1, t2;
#
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,
@@ -489,3 +491,4 @@ 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;
+set global default_storage_engine=default;
diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result
index c5241c6ea90..7dd74837511 100644
--- a/mysql-test/r/partition_key_cache.result
+++ b/mysql-test/r/partition_key_cache.result
@@ -52,7 +52,7 @@ SELECT COUNT(b) FROM t1 WHERE b >= 0;
COUNT(b)
2048
Zero key reads?
-No!
+Yes!
INSERT t2 SELECT a,b,c FROM t1;
reads vs requests
reads == requests
@@ -63,7 +63,7 @@ SELECT COUNT(b) FROM t2 WHERE b >= 0;
COUNT(b)
2048
Zero key reads?
-No!
+Yes!
FLUSH TABLES;
# Setting the default key cache to 1M
SET GLOBAL key_buffer_size = 1024*1024;
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index aab6606104f..3f49bf9cc9e 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1429,7 +1429,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using index
# Disabling warnings for the invalid date
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 831dbeaf029..1529a0dfe95 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -75,9 +75,9 @@ SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
#illegal value fixed
CREATE TABLE t1 (a int) ENGINE=example ULL=10000000000000000000 one_or_two='ttt' YESNO=SSS;
Warnings:
-Warning 1652 Incorrect value '10000000000000000000' for option 'ULL'
-Warning 1652 Incorrect value 'ttt' for option 'one_or_two'
-Warning 1652 Incorrect value 'SSS' for option 'YESNO'
+Warning 1708 Incorrect value '10000000000000000000' for option 'ULL'
+Warning 1708 Incorrect value 'ttt' for option 'one_or_two'
+Warning 1708 Incorrect value 'SSS' for option 'YESNO'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index ed68cd985c2..48a995f1b10 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3017,13 +3017,13 @@ PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
DEALLOCATE PREPARE stmt;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 4cf1e58e1ea..df167cf3bdb 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1265,15 +1265,6 @@ drop procedure f3;
drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
-set GLOBAL query_cache_size=100000;
-set SESSION query_cache_size=10000;
-ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-set global query_cache_limit=100;
-set global query_cache_size=100;
-set global query_cache_type=demand;
-set GLOBAL query_cache_type=default;
-set GLOBAL query_cache_limit=default;
-set GLOBAL query_cache_size=default;
End of 4.1 tests
SET GLOBAL query_cache_size=102400;
create table t1(a int);
diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result
index eb59e62c8ba..80c21add075 100644
--- a/mysql-test/r/query_cache_debug.result
+++ b/mysql-test/r/query_cache_debug.result
@@ -5,7 +5,7 @@ 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,wait_in_query_cache_insert';
+set session debug='+d,foobar,wait_in_query_cache_insert';
select SQL_CACHE * from t1;;
On a second connection; clear the query cache.
show status like 'Qcache_queries_in_cache';
@@ -32,7 +32,7 @@ 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,wait_after_query_cache_invalidate';
+SET SESSION debug='+d,foobar,wait_after_query_cache_invalidate';
# Send concurrent insert, will wait in the query cache table invalidate
INSERT INTO t1 VALUES (4);
# Switch to connection default
@@ -108,8 +108,8 @@ 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,wait_in_query_cache_invalidate1';
-SET SESSION debug='+d,wait_in_query_cache_invalidate2';
+SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate1';
+SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate2';
DELETE FROM t1 WHERE a like '%a%';;
=================================== Connection default
** Assert that the expect process status is obtained.
@@ -118,12 +118,12 @@ DELETE FROM t1 WHERE a like '%a%';;
** 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,wait_in_query_cache_insert';
+SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3;
=================================== Connection thd3
** On THD3: Insert another result into the cache and block on the same
** debug hook.
-SET SESSION debug='+d,wait_in_query_cache_insert';
+SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;;
=================================== Connection default
** Assert that the two SELECT-stmt threads to reach the hook.
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index a893cb03a42..b5716264f56 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4780,7 +4780,7 @@ b a
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
Warnings:
Note 1003 select '2' AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result
index fb09a62eb73..1ae56bc33fe 100644
--- a/mysql-test/r/select_jcl6.result
+++ b/mysql-test/r/select_jcl6.result
@@ -2090,10 +2090,10 @@ fld6 char(4) latin1_swedish_ci NO #
show full columns from t2 from test like 's%';
Field Type Collation Null Key Default Extra Privileges Comment
show keys from t2;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
-t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
-t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
@@ -2430,27 +2430,28 @@ city
London
DROP TABLE t1;
create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
+insert into t1 values (1,0), (1,1), (18446744073709551615,0);
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 3
select a-b from t1 order by 1;
a-b
0
1
-18446744073709551615
+4294967295
select a-b , (a-b < 0) from t1 order by 1;
a-b (a-b < 0)
0 0
1 0
-18446744073709551615 0
+4294967295 0
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
d (a-b >= 0) b
1 1 0
0 1 1
-18446744073709551615 1 2
select cast((a - b) as unsigned) from t1 order by 1;
cast((a - b) as unsigned)
0
1
-18446744073709551615
+4294967295
drop table t1;
create table t1 (a int(11));
select all all * from t1;
@@ -2788,26 +2789,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158;
max(key1)
-0.615800023078918
+0.6158000230789185
select max(key2) from t2 where key2 <= 1.6158;
max(key2)
-1.61580002307892
+1.6158000230789185
select min(key1) from t1 where key1 >= 0.3762;
min(key1)
-0.376199990510941
+0.37619999051094055
select min(key2) from t2 where key2 >= 1.3762;
min(key2)
-1.37619996070862
+1.3761999607086182
select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2)
-0.615800023078918 1.37619996070862
+0.6158000230789185 1.3761999607086182
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1)
-0.615800023078918
+0.6158000230789185
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
-0.376199990510941
+0.37619999051094055
DROP TABLE t1,t2;
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (10);
@@ -3423,6 +3424,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using MRR
DROP TABLE t1,t2;
+SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
@@ -3442,8 +3444,9 @@ Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
-255
+0
DROP TABLE t1;
+SET SQL_MODE=default;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
@@ -4171,9 +4174,10 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
set SQL_MODE=TRADITIONAL;
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
-0
+NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
@@ -4181,17 +4185,16 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
-0
+NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34:00'
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20'
-0
+NULL
Warnings:
-Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/09/01' at row 1
-Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/10/20' at row 1
+Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date
set SQL_MODE=DEFAULT;
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
@@ -4338,6 +4341,7 @@ SHOW STATUS LIKE 'Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
+Handler_read_last 0
Handler_read_next 10
Handler_read_prev 0
Handler_read_rnd 10
@@ -4426,7 +4430,7 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (2),(3);
# Should not crash
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
-ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
+ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1))
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
@@ -4457,7 +4461,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4468,7 +4472,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a TIMESTAMP NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4479,7 +4483,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4490,7 +4494,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4500,7 +4504,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 0
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 0
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
a b
2001-01-01 00:00:00 2001-01-01
@@ -4508,7 +4512,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4527,7 +4531,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE y system NULL NULL NULL NULL 1 100.00
1 SIMPLE z system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
#
# Bug #49897: crash in ptr_compare when char(0) NOT NULL
@@ -4641,7 +4645,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
+Note 1003 select '1' AS `a`,'1' AS `b` from dual where 1
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
a b
1 1
@@ -4742,6 +4746,72 @@ field2
15:13:38
drop table A,AA,B,BB;
#end of test for bug#45266
+#
+# Bug#33546: Slowdown on re-evaluation of constant expressions.
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1 HAVING a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+a b
+4 2
+EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,'2' AS `b` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(('2' + (1 + 1))))
+SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+b a
+2 3
+EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select '2' AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where 1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+SET @cnt := @cnt + 1;
+RETURN 1;
+END;|
+SET @cnt := 0;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(`f1`()))
+DROP TABLE t1, t2;
+DROP FUNCTION f1;
+# End of bug#33546
#
# BUG#48052: Valgrind warning - uninitialized value in init_read_record()
#
@@ -4801,6 +4871,25 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
1
DROP TABLE t1;
End of 5.1 tests
+#
+# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on
+# SELECT from VIEW with GROUP BY
+#
+CREATE TABLE t1 (
+col_int_key int DEFAULT NULL,
+KEY int_key (col_int_key)
+) ;
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW view_t1 AS
+SELECT t1.col_int_key AS col_int_key
+FROM t1;
+SELECT col_int_key FROM view_t1 GROUP BY col_int_key;
+col_int_key
+1
+2
+DROP VIEW view_t1;
+DROP TABLE t1;
+# End of test BUG#54515
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result
index 7722fbe5dcc..b5716264f56 100644
--- a/mysql-test/r/select_pkeycache.result
+++ b/mysql-test/r/select_pkeycache.result
@@ -2086,10 +2086,10 @@ fld6 char(4) latin1_swedish_ci NO #
show full columns from t2 from test like 's%';
Field Type Collation Null Key Default Extra Privileges Comment
show keys from t2;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
-t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
-t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
@@ -2426,27 +2426,28 @@ city
London
DROP TABLE t1;
create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
+insert into t1 values (1,0), (1,1), (18446744073709551615,0);
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 3
select a-b from t1 order by 1;
a-b
0
1
-18446744073709551615
+4294967295
select a-b , (a-b < 0) from t1 order by 1;
a-b (a-b < 0)
0 0
1 0
-18446744073709551615 0
+4294967295 0
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
d (a-b >= 0) b
1 1 0
0 1 1
-18446744073709551615 1 2
select cast((a - b) as unsigned) from t1 order by 1;
cast((a - b) as unsigned)
0
1
-18446744073709551615
+4294967295
drop table t1;
create table t1 (a int(11));
select all all * from t1;
@@ -2784,26 +2785,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158;
max(key1)
-0.615800023078918
+0.6158000230789185
select max(key2) from t2 where key2 <= 1.6158;
max(key2)
-1.61580002307892
+1.6158000230789185
select min(key1) from t1 where key1 >= 0.3762;
min(key1)
-0.376199990510941
+0.37619999051094055
select min(key2) from t2 where key2 >= 1.3762;
min(key2)
-1.37619996070862
+1.3761999607086182
select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2)
-0.615800023078918 1.37619996070862
+0.6158000230789185 1.3761999607086182
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1)
-0.615800023078918
+0.6158000230789185
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
-0.376199990510941
+0.37619999051094055
DROP TABLE t1,t2;
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (10);
@@ -3419,6 +3420,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using MRR
DROP TABLE t1,t2;
+SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
@@ -3438,8 +3440,9 @@ Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
-255
+0
DROP TABLE t1;
+SET SQL_MODE=default;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
@@ -4167,9 +4170,10 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
set SQL_MODE=TRADITIONAL;
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
-0
+NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
@@ -4177,17 +4181,16 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
-0
+NULL
Warnings:
-Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34:00'
+Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20'
-0
+NULL
Warnings:
-Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/09/01' at row 1
-Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/10/20' at row 1
+Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date
set SQL_MODE=DEFAULT;
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
@@ -4334,6 +4337,7 @@ SHOW STATUS LIKE 'Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -4422,7 +4426,7 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (2),(3);
# Should not crash
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
-ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
+ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1))
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
@@ -4453,7 +4457,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4464,7 +4468,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a TIMESTAMP NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4475,7 +4479,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4486,7 +4490,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4496,7 +4500,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 0
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 0
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
a b
2001-01-01 00:00:00 2001-01-01
@@ -4504,7 +4508,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4523,7 +4527,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE y system NULL NULL NULL NULL 1 100.00
1 SIMPLE z system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
#
# Bug #49897: crash in ptr_compare when char(0) NOT NULL
@@ -4637,7 +4641,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
+Note 1003 select '1' AS `a`,'1' AS `b` from dual where 1
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
a b
1 1
@@ -4738,6 +4742,72 @@ field2
15:13:38
drop table A,AA,B,BB;
#end of test for bug#45266
+#
+# Bug#33546: Slowdown on re-evaluation of constant expressions.
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1 HAVING a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+a b
+4 2
+EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,'2' AS `b` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(('2' + (1 + 1))))
+SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+b a
+2 3
+EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select '2' AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where 1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+SET @cnt := @cnt + 1;
+RETURN 1;
+END;|
+SET @cnt := 0;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(`f1`()))
+DROP TABLE t1, t2;
+DROP FUNCTION f1;
+# End of bug#33546
#
# BUG#48052: Valgrind warning - uninitialized value in init_read_record()
#
@@ -4797,3 +4867,22 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
1
DROP TABLE t1;
End of 5.1 tests
+#
+# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on
+# SELECT from VIEW with GROUP BY
+#
+CREATE TABLE t1 (
+col_int_key int DEFAULT NULL,
+KEY int_key (col_int_key)
+) ;
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW view_t1 AS
+SELECT t1.col_int_key AS col_int_key
+FROM t1;
+SELECT col_int_key FROM view_t1 GROUP BY col_int_key;
+col_int_key
+1
+2
+DROP VIEW view_t1;
+DROP TABLE t1;
+# End of test BUG#54515
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 135109cac88..073b0b331f0 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -254,11 +254,13 @@ drop table t1;
flush tables;
show open tables;
Database Table In_use Name_locked
+mysql general_log 0 0
create table t1(n int);
insert into t1 values (1);
show open tables;
Database Table In_use Name_locked
test t1 0 0
+mysql general_log 0 0
drop table t1;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
show create table t1;
diff --git a/mysql-test/r/single_delete_update.result b/mysql-test/r/single_delete_update.result
index 72419c6ec9d..00231d8377a 100644
--- a/mysql-test/r/single_delete_update.result
+++ b/mysql-test/r/single_delete_update.result
@@ -306,21 +306,21 @@ NULL 13 13
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_range 1
+Sort_range 0
Sort_rows 4
-Sort_scan 0
+Sort_scan 1
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 2
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 7
+Handler_read_next 0
Handler_read_prev 0
-Handler_read_rnd 4
-Handler_read_rnd_next 0
+Handler_read_rnd 0
+Handler_read_rnd_next 17
EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-x x x x x x x x x x Using sort_union(key1,key2); Using where; Using filesort
+x x x x x x x x x x Using where; Using filesort
Warnings:
x x x
FLUSH STATUS;
@@ -328,18 +328,18 @@ DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_range 1
+Sort_range 0
Sort_rows 4
-Sort_scan 0
+Sort_scan 1
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 2
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 7
+Handler_read_next 0
Handler_read_prev 0
-Handler_read_rnd 8
-Handler_read_rnd_next 0
+Handler_read_rnd 4
+Handler_read_rnd_next 17
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
i key1 key2
EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
@@ -850,21 +850,21 @@ NULL 13 13
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_range 1
+Sort_range 0
Sort_rows 4
-Sort_scan 0
+Sort_scan 1
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 2
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 7
+Handler_read_next 0
Handler_read_prev 0
-Handler_read_rnd 4
-Handler_read_rnd_next 0
+Handler_read_rnd 0
+Handler_read_rnd_next 17
EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-x x x x x x x x x x Using sort_union(key1,key2); Using where; Using filesort
+x x x x x x x x x x Using where; Using filesort
Warnings:
x x x
FLUSH STATUS;
@@ -872,18 +872,18 @@ UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_range 1
+Sort_range 0
Sort_rows 4
-Sort_scan 0
+Sort_scan 1
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 2
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 7
+Handler_read_next 0
Handler_read_prev 0
-Handler_read_rnd 8
-Handler_read_rnd_next 0
+Handler_read_rnd 4
+Handler_read_rnd_next 17
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
i key1 key2
123 10 10
@@ -892,7 +892,7 @@ i key1 key2
123 13 13
EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-x x x x x x x x x x Using sort_union(key1,key2); Using where; Using filesort
+x x x x x x x x x x Using where; Using filesort
Warnings:
x x x
DROP TABLE t2;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 5a1a35b2571..0f18e0e5d6f 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6528,16 +6528,16 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f1();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 1 Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM v1 WHERE c1=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using index
EXPLAIN SELECT * FROM v1 WHERE c1=f1();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 1 Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(10);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 1 Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
diff --git a/mysql-test/r/status_user.result b/mysql-test/r/status_user.result
index 636eeabfffc..ace8d9f26bf 100644
--- a/mysql-test/r/status_user.result
+++ b/mysql-test/r/status_user.result
@@ -102,6 +102,7 @@ Handler_discover 0
Handler_prepare 18
Handler_read_first 0
Handler_read_key 3
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 5b2176ac872..f4e07636467 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -734,7 +734,7 @@ id
2
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ref id id 5 const 1 100.00 Using index
+1 PRIMARY t2 ref id id 5 const 1 100.00 Using where; Using index
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
@@ -3561,6 +3561,30 @@ ORDER BY t1.t DESC LIMIT 1);
i1 i2 t i1 i2 t
24 1 2005-05-27 12:40:30 24 1 2006-06-20 12:29:40
DROP TABLE t1, t2;
+CREATE TABLE t1 (i INT);
+(SELECT i FROM t1) UNION (SELECT i FROM t1);
+i
+SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
+(
+(SELECT i FROM t1) UNION
+(SELECT i FROM t1)
+);
+i
+SELECT * FROM t1
+WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
+explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
+from t1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))
+from t1' at line 1
+explain select * from t1 where not exists
+((select t11.i from t1 t11) union (select t12.i from t1 t12));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
insert into t1 (a) select FLOOR(rand() * 100) from t1;
@@ -4248,6 +4272,35 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+2
+2
+2
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
+(SELECT 1 FROM t2 WHERE t1.a = t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))))
+DROP TABLE t1,t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(f11 int, f12 int);
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index 1fc9309da4f..15546f6c75c 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -882,7 +882,7 @@ Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
-Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM
+Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from dual group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM
(SELECT COUNT(b) FROM t1) AS x GROUP BY c
)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
DROP TABLE t1;
@@ -1280,6 +1280,8 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 100
set @save_optimizer_search_depth=@@optimizer_search_depth;
set @@optimizer_search_depth=63;
+Warnings:
+Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead
explain select * from t1 where (a,b) in (select a,b from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
@@ -1427,6 +1429,7 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
+End of 5.3 tests
#
# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
# in the select list
@@ -1474,6 +1477,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1
-Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,(select count(distinct `test`.`t1`.`i`) from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2`
+Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<expr_cache><`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`))) AS `subsel` from `test`.`t2`
DROP TABLE t1,t2;
End of 5.6 tests
diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result
index d24c1baa814..0019a82f2dd 100644
--- a/mysql-test/r/subselect3_jcl6.result
+++ b/mysql-test/r/subselect3_jcl6.result
@@ -121,6 +121,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -885,7 +886,7 @@ Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
-Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM
+Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from dual group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM
(SELECT COUNT(b) FROM t1) AS x GROUP BY c
)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
DROP TABLE t1;
@@ -1284,6 +1285,8 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 100
set @save_optimizer_search_depth=@@optimizer_search_depth;
set @@optimizer_search_depth=63;
+Warnings:
+Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead
explain select * from t1 where (a,b) in (select a,b from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
@@ -1431,6 +1434,57 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
+End of 5.3 tests
+#
+# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
+# in the select list
+#
+
+CREATE TABLE t1 (
+i int(11) DEFAULT NULL,
+v varchar(1) DEFAULT NULL
+);
+
+INSERT INTO t1 VALUES (8,'v');
+INSERT INTO t1 VALUES (9,'r');
+INSERT INTO t1 VALUES (NULL,'y');
+
+CREATE TABLE t2 (
+i int(11) DEFAULT NULL,
+v varchar(1) DEFAULT NULL,
+KEY i_key (i)
+);
+
+INSERT INTO t2 VALUES (NULL,'r');
+INSERT INTO t2 VALUES (0,'c');
+INSERT INTO t2 VALUES (0,'o');
+INSERT INTO t2 VALUES (2,'v');
+INSERT INTO t2 VALUES (7,'c');
+
+SELECT i, v, (SELECT COUNT(DISTINCT i)
+FROM t1
+WHERE v = t2.v) as subsel
+FROM t2;
+i v subsel
+NULL r 1
+0 c 0
+0 o 0
+2 v 1
+7 c 0
+
+EXPLAIN EXTENDED
+SELECT i, v, (SELECT COUNT(DISTINCT i)
+FROM t1
+WHERE v = t2.v) as subsel
+FROM t2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1
+Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,<expr_cache><`test`.`t2`.`v`>((select count(distinct `test`.`t1`.`i`) from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`))) AS `subsel` from `test`.`t2`
+DROP TABLE t1,t2;
+End of 5.6 tests
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index ea836bea76a..72fa5f23ab1 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -117,14 +117,14 @@ EXPLAIN
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
x PRIMARY x x x x x x x x
-x DEPENDENT SUBQUERY x x x x x x x x
+x SUBQUERY x x x x x x x x
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
a b
EXPLAIN
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
a b
1 NULL
@@ -147,28 +147,28 @@ EXPLAIN
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
id select_type table type possible_keys key key_len ref rows Extra
x PRIMARY x x x x x x x x
-x DEPENDENT SUBQUERY x x x x x x x x
+x SUBQUERY x x x x x x x x
SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
a b
EXPLAIN
SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
x PRIMARY x x x x x x x x
-x DEPENDENT SUBQUERY x x x x x x x x
+x SUBQUERY x x x x x x x x
SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
c d
EXPLAIN
SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
x PRIMARY x x x x x x x x
-x DEPENDENT SUBQUERY x x x x x x x x
+x SUBQUERY x x x x x x x x
SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
e f
EXPLAIN
SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
id select_type table type possible_keys key key_len ref rows Extra
x PRIMARY x x x x x x x x
-x DEPENDENT SUBQUERY x x x x x x x x
+x SUBQUERY x x x x x x x x
SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
c d
SELECT * FROM t1 WHERE ( a, b ) NOT IN
@@ -209,7 +209,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
-Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from `test`.`t1`
+Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from dual
first equivalent variant
SELECT (SELECT 1 FROM t2 WHERE d = IFNULL(c,NULL)) AS RESULT FROM t1 GROUP BY c ;
RESULT
@@ -220,7 +220,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
-Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from `test`.`t1` group by NULL
+Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from dual group by NULL
second equivalent variant
SELECT (SELECT 1 FROM t2 WHERE d = c) AS RESULT FROM t1 GROUP BY c ;
RESULT
@@ -231,7 +231,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
-Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from `test`.`t1` group by NULL
+Note 1003 select <expr_cache><NULL>((select 1 from `test`.`t2` where 0)) AS `RESULT` from dual group by NULL
DROP TABLE t1,t2;
#
# BUG#45928 "Differing query results depending on MRR and
@@ -252,6 +252,8 @@ set @old_optimizer_switch = @@session.optimizer_switch,
SET SESSION OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off';
SET SESSION optimizer_use_mrr = 'force';
SET SESSION engine_condition_pushdown = 1;
+Warnings:
+Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
SELECT `time_nokey` G1 FROM t1 WHERE ( `varchar_nokey` , `varchar_key` ) IN (
SELECT `varchar_nokey` , `varchar_nokey` ) AND `varchar_key` >= 'c' HAVING G1 ORDER
BY `pk` ;
@@ -259,6 +261,8 @@ G1
set @@session.optimizer_switch = @old_optimizer_switch,
@@session.optimizer_use_mrr = @old_optimizer_use_mrr,
@@session.engine_condition_pushdown = @old_engine_condition_pushdown;
+Warnings:
+Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
DROP TABLE t1;
#
# BUG#45863 "Assertion failed: (fixed == 0), function fix_fields(),
@@ -469,6 +473,8 @@ SELECT @old_icp:=@@engine_condition_pushdown;
@old_icp:=@@engine_condition_pushdown
#
SET SESSION engine_condition_pushdown = 'ON';
+Warnings:
+Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
SELECT pk
FROM t2
@@ -482,8 +488,13 @@ pk
9
# Restore old value for Index condition pushdown
SET SESSION engine_condition_pushdown=@old_icp;
+Warnings:
+Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
DROP TABLE t1,t2;
#
+# End of 5.3 tests.
+#
+#
# Bug#53236 Segfault in DTCollation::set(DTCollation&)
#
CREATE TABLE t1 (
diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result
index 7b9dc3c943f..2c7715f93ae 100644
--- a/mysql-test/r/subselect_cache.result
+++ b/mysql-test/r/subselect_cache.result
@@ -28,6 +28,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -54,6 +55,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -79,6 +81,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -103,6 +106,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -128,6 +132,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -152,6 +157,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -249,6 +255,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -345,6 +352,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -366,6 +374,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 17
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -386,6 +395,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 10
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -407,6 +417,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 17
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -427,6 +438,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 10
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -454,6 +466,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -480,6 +493,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -501,6 +515,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 7
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -521,6 +536,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 4
@@ -618,6 +634,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 70
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -714,6 +731,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1337,6 +1355,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 11
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1365,6 +1384,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 32
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1396,6 +1416,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1424,6 +1445,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 13
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1613,6 +1635,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 15
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 8
@@ -1637,6 +1660,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 21
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 8
@@ -1662,6 +1686,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 15
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 8
@@ -1686,6 +1711,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 22
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 8
@@ -1726,6 +1752,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 15
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1762,6 +1789,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1797,6 +1825,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 15
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -1832,6 +1861,7 @@ show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 18
+Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
@@ -2521,6 +2551,71 @@ WHERE table1 .`col_varchar_key` ) field10
1 NULL u
1 NULL w
1 NULL y
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
SET @@optimizer_switch='subquery_cache=on';
/* cache is on */ SELECT COUNT( DISTINCT table2 .`col_int_key` ) , (
SELECT SUBQUERY2_t1 .`col_int_key`
@@ -2547,6 +2642,71 @@ WHERE table1 .`col_varchar_key` ) field10
1 NULL u
1 NULL w
1 NULL y
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'c'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'o'
+Warning 1292 Truncated incorrect INTEGER value: 'd'
+Warning 1292 Truncated incorrect INTEGER value: 'd'
+Warning 1292 Truncated incorrect INTEGER value: 'd'
+Warning 1292 Truncated incorrect INTEGER value: 'd'
drop table t1,t2,t3,t4;
set @@optimizer_switch= default;
#launchpad BUG#609045
@@ -2970,6 +3130,8 @@ FROM t3 SUBQUERY2_t1 JOIN t2 ON SUBQUERY2_t1 .`col_int_key`
WHERE table1 .`col_varchar_key` ) field10
1 NULL d
1 NULL f
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'f'
SET @@optimizer_switch = 'subquery_cache=on';
/* cache is on */ SELECT COUNT( DISTINCT table2 .`col_int_key` ) , (
SELECT SUBQUERY2_t1 .`col_int_key`
@@ -2983,6 +3145,8 @@ FROM t3 SUBQUERY2_t1 JOIN t2 ON SUBQUERY2_t1 .`col_int_key`
WHERE table1 .`col_varchar_key` ) field10
1 NULL d
1 NULL f
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'f'
drop table t1,t2,t3,t4;
set @@optimizer_switch= default;
#launchpad BUG#611625
@@ -3270,6 +3434,71 @@ WHERE table3 .`col_varchar_key` IN (
SELECT `col_varchar_key`
FROM t2 ) AND table1 .`col_varchar_key` OR table1 .`pk` ;
col_varchar_nokey
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'w'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'k'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
+Warning 1292 Truncated incorrect DOUBLE value: 't'
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'u'
+Warning 1292 Truncated incorrect DOUBLE value: 'h'
+Warning 1292 Truncated incorrect DOUBLE value: 'o'
+Warning 1292 Truncated incorrect DOUBLE value: 'k'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+Warning 1292 Truncated incorrect DOUBLE value: 'n'
+Warning 1292 Truncated incorrect DOUBLE value: 't'
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'y'
+Warning 1292 Truncated incorrect DOUBLE value: 'f'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'v'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'y'
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'z'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+Warning 1292 Truncated incorrect DOUBLE value: 'h'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
+Warning 1292 Truncated incorrect DOUBLE value: 's'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+Warning 1292 Truncated incorrect DOUBLE value: 'f'
+Warning 1292 Truncated incorrect DOUBLE value: 'v'
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
+Warning 1292 Truncated incorrect DOUBLE value: 'w'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'k'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
+Warning 1292 Truncated incorrect DOUBLE value: 't'
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'u'
+Warning 1292 Truncated incorrect DOUBLE value: 'h'
+Warning 1292 Truncated incorrect DOUBLE value: 'o'
+Warning 1292 Truncated incorrect DOUBLE value: 'k'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+Warning 1292 Truncated incorrect DOUBLE value: 'n'
+Warning 1292 Truncated incorrect DOUBLE value: 't'
+Warning 1292 Truncated incorrect DOUBLE value: 'c'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'y'
+Warning 1292 Truncated incorrect DOUBLE value: 'f'
+Warning 1292 Truncated incorrect DOUBLE value: 'd'
+Warning 1292 Truncated incorrect DOUBLE value: 'w'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'm'
+Warning 1292 Truncated incorrect DOUBLE value: 'k'
+Warning 1292 Truncated incorrect DOUBLE value: 'r'
+Warning 1292 Truncated incorrect DOUBLE value: 't'
drop table t1,t2;
set @@optimizer_switch= default;
# LP BUG#615378 (incorrect NULL result returning in Item_cache)
@@ -3309,4 +3538,7 @@ WHERE ( table1 . `pk` < 5 ) OR ( table1 . `col_varchar_key` IS NOT NULL)
GROUP BY field3
HAVING (field3 <= 'h' AND field2 != 4) ;
field2 field3
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'v'
+Warning 1292 Truncated incorrect INTEGER value: 'r'
drop tables t1, t2, t3;
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index 78e6467ae62..bcde5a24fb9 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -57,7 +57,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having (<expr_cache><'1'>((select '1')) = 1)
+Note 1003 select 1 AS `1` from dual having (<expr_cache><'1'>((select '1')) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -210,7 +210,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from dual
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -321,7 +321,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from dual where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -738,11 +738,11 @@ id
2
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ref id id 5 const 1 100.00 Using index
+1 PRIMARY t2 ref id id 5 const 1 100.00 Using where; Using index
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
-Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = (1 + 1))
+Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1)))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index
@@ -929,7 +929,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
@@ -939,7 +939,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
@@ -1440,7 +1440,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from dual)
(select * from t1);
s1
tttt
@@ -1628,7 +1628,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
+Note 1003 select 'e' AS `s1` from dual where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
@@ -3565,6 +3565,30 @@ ORDER BY t1.t DESC LIMIT 1);
i1 i2 t i1 i2 t
24 1 2005-05-27 12:40:30 24 1 2006-06-20 12:29:40
DROP TABLE t1, t2;
+CREATE TABLE t1 (i INT);
+(SELECT i FROM t1) UNION (SELECT i FROM t1);
+i
+SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
+(
+(SELECT i FROM t1) UNION
+(SELECT i FROM t1)
+);
+i
+SELECT * FROM t1
+WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
+explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
+from t1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))
+from t1' at line 1
+explain select * from t1 where not exists
+((select t11.i from t1 t11) union (select t12.i from t1 t12));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
insert into t1 (a) select FLOOR(rand() * 100) from t1;
@@ -3661,8 +3685,6 @@ insert into t1 select RAND()*1000, A.a + 10*(B.a+10*(C.a+10*D.a))
from t3 A, t3 B, t3 C, t3 D where D.a<3;
insert into t2(y,z) select t1.b, RAND()*1000 from t1, t3;
SET SESSION sort_buffer_size = 32 * 1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
SELECT SQL_NO_CACHE COUNT(*)
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
FROM t1) t;
@@ -4254,6 +4276,35 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+2
+2
+2
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
+(SELECT 1 FROM t2 WHERE t1.a = t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))))
+DROP TABLE t1,t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(f11 int, f12 int);
@@ -4795,6 +4846,270 @@ id g v s
51 50 NULL l
61 60 NULL l
drop table t1, t2;
+#
+# Bug#33204: INTO is allowed in subselect, causing inconsistent results
+#
+CREATE TABLE t1( a INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2( a INT, b INT );
+SELECT *
+FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO @var FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
+a
+2
+SELECT * FROM (
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+1
+2
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
+a
+1
+SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
+1
+1
+SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
+a
+1
+SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
+a 1
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM (t1 t1a);
+a
+1
+2
+SELECT * FROM ((t1 t1a));
+a
+1
+2
+SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a2' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 ) a
+1 1
+1 2
+SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a
+1 1
+1 2
+SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
+a b
+SELECT 1 UNION ( SELECT 1 UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+( SELECT 1 UNION SELECT 1 UNION SELECT 1 )
+1
+SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
+((SELECT 1 UNION SELECT 1 UNION SELECT 1))
+1
+SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') UNION SELECT 1 )' at line 1
+SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
+1
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT EXISTS(SELECT 1+1);
+EXISTS(SELECT 1+1)
+1
+SELECT EXISTS(SELECT 1+1 INTO @test);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @test)' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+DROP TABLE t1, t2;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index d4b0e33f653..a8b4065d257 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -54,7 +54,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having (<expr_cache><'1'>((select '1')) = 1)
+Note 1003 select 1 AS `1` from dual having (<expr_cache><'1'>((select '1')) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from dual
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -318,7 +318,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from dual where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -735,11 +735,11 @@ id
2
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ref id id 5 const 1 100.00 Using index
+1 PRIMARY t2 ref id id 5 const 1 100.00 Using where; Using index
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
-Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = (1 + 1))
+Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1)))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index
@@ -926,7 +926,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
@@ -936,7 +936,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
@@ -1437,7 +1437,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from dual)
(select * from t1);
s1
tttt
@@ -1625,7 +1625,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
+Note 1003 select 'e' AS `s1` from dual where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
@@ -3562,6 +3562,30 @@ ORDER BY t1.t DESC LIMIT 1);
i1 i2 t i1 i2 t
24 1 2005-05-27 12:40:30 24 1 2006-06-20 12:29:40
DROP TABLE t1, t2;
+CREATE TABLE t1 (i INT);
+(SELECT i FROM t1) UNION (SELECT i FROM t1);
+i
+SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
+(
+(SELECT i FROM t1) UNION
+(SELECT i FROM t1)
+);
+i
+SELECT * FROM t1
+WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
+explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
+from t1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))
+from t1' at line 1
+explain select * from t1 where not exists
+((select t11.i from t1 t11) union (select t12.i from t1 t12));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
insert into t1 (a) select FLOOR(rand() * 100) from t1;
@@ -3658,8 +3682,6 @@ insert into t1 select RAND()*1000, A.a + 10*(B.a+10*(C.a+10*D.a))
from t3 A, t3 B, t3 C, t3 D where D.a<3;
insert into t2(y,z) select t1.b, RAND()*1000 from t1, t3;
SET SESSION sort_buffer_size = 32 * 1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
SELECT SQL_NO_CACHE COUNT(*)
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
FROM t1) t;
@@ -4251,6 +4273,35 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+2
+2
+2
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
+(SELECT 1 FROM t2 WHERE t1.a = t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))))
+DROP TABLE t1,t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(f11 int, f12 int);
@@ -4792,6 +4843,270 @@ id g v s
51 50 NULL l
61 60 NULL l
drop table t1, t2;
+#
+# Bug#33204: INTO is allowed in subselect, causing inconsistent results
+#
+CREATE TABLE t1( a INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2( a INT, b INT );
+SELECT *
+FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO @var FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
+a
+2
+SELECT * FROM (
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+1
+2
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
+a
+1
+SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
+1
+1
+SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
+a
+1
+SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
+a 1
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM (t1 t1a);
+a
+1
+2
+SELECT * FROM ((t1 t1a));
+a
+1
+2
+SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a2' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 ) a
+1 1
+1 2
+SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a
+1 1
+1 2
+SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
+a b
+SELECT 1 UNION ( SELECT 1 UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+( SELECT 1 UNION SELECT 1 UNION SELECT 1 )
+1
+SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
+((SELECT 1 UNION SELECT 1 UNION SELECT 1))
+1
+SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') UNION SELECT 1 )' at line 1
+SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
+1
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT EXISTS(SELECT 1+1);
+EXISTS(SELECT 1+1)
+1
+SELECT EXISTS(SELECT 1+1 INTO @test);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @test)' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+DROP TABLE t1, t2;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index f9ec2abade1..511fa140ca8 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -54,7 +54,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having (<expr_cache><'1'>((select '1')) = 1)
+Note 1003 select 1 AS `1` from dual having (<expr_cache><'1'>((select '1')) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from dual
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -318,7 +318,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select <expr_cache><`test`.`t2`.`a`>((select '2' from dual where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -735,11 +735,11 @@ id
2
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ref id id 5 const 1 100.00 Using index
+1 PRIMARY t2 ref id id 5 const 1 100.00 Using where; Using index
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
-Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = (1 + 1))
+Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1)))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index
@@ -926,7 +926,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
@@ -936,7 +936,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
@@ -1437,7 +1437,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from dual)
(select * from t1);
s1
tttt
@@ -1625,7 +1625,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
+Note 1003 select 'e' AS `s1` from dual where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
@@ -3562,6 +3562,30 @@ ORDER BY t1.t DESC LIMIT 1);
i1 i2 t i1 i2 t
24 1 2005-05-27 12:40:30 24 1 2006-06-20 12:29:40
DROP TABLE t1, t2;
+CREATE TABLE t1 (i INT);
+(SELECT i FROM t1) UNION (SELECT i FROM t1);
+i
+SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
+(
+(SELECT i FROM t1) UNION
+(SELECT i FROM t1)
+);
+i
+SELECT * FROM t1
+WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
+explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
+from t1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))
+from t1' at line 1
+explain select * from t1 where not exists
+((select t11.i from t1 t11) union (select t12.i from t1 t12));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
insert into t1 (a) select FLOOR(rand() * 100) from t1;
@@ -3658,8 +3682,6 @@ insert into t1 select RAND()*1000, A.a + 10*(B.a+10*(C.a+10*D.a))
from t3 A, t3 B, t3 C, t3 D where D.a<3;
insert into t2(y,z) select t1.b, RAND()*1000 from t1, t3;
SET SESSION sort_buffer_size = 32 * 1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
SELECT SQL_NO_CACHE COUNT(*)
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
FROM t1) t;
@@ -4251,6 +4273,35 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+2
+2
+2
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists(select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
+EXPLAIN EXTENDED
+SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
+(SELECT 1 FROM t2 WHERE t1.a = t2.a));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))))
+DROP TABLE t1,t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(f11 int, f12 int);
@@ -4792,6 +4843,270 @@ id g v s
51 50 NULL l
61 60 NULL l
drop table t1, t2;
+#
+# Bug#33204: INTO is allowed in subselect, causing inconsistent results
+#
+CREATE TABLE t1( a INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2( a INT, b INT );
+SELECT *
+FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO @var FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
+a
+2
+SELECT * FROM (
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+1
+2
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
+a
+1
+SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
+1
+1
+SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
+a
+1
+SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
+a 1
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM (t1 t1a);
+a
+1
+2
+SELECT * FROM ((t1 t1a));
+a
+1
+2
+SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a2' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 ) a
+1 1
+1 2
+SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a
+1 1
+1 2
+SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
+a b
+SELECT 1 UNION ( SELECT 1 UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+( SELECT 1 UNION SELECT 1 UNION SELECT 1 )
+1
+SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
+((SELECT 1 UNION SELECT 1 UNION SELECT 1))
+1
+SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') UNION SELECT 1 )' at line 1
+SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
+1
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT EXISTS(SELECT 1+1);
+EXISTS(SELECT 1+1)
+1
+SELECT EXISTS(SELECT 1+1 INTO @test);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @test)' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
+DROP TABLE t1, t2;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result
index f17edf3be6c..00c62920fce 100644
--- a/mysql-test/r/subselect_sj2.result
+++ b/mysql-test/r/subselect_sj2.result
@@ -60,7 +60,7 @@ a b pk1 pk2 pk3
set @save_max_heap_table_size= @@max_heap_table_size;
set max_heap_table_size=16384;
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
drop table t3;
create table t3 (
a int,
@@ -77,8 +77,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY subselect2 ALL unique_key NULL NULL NULL 10
1 PRIMARY t3 ref b b 5 test.t0.a 1
2 SUBQUERY t0 ALL NULL NULL NULL NULL 10
-set @save_ecp= @@engine_condition_pushdown;
-set engine_condition_pushdown=0;
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@@ -95,7 +93,6 @@ a b pk1 pk2
11 11 11 11
12 12 12 12
13 13 13 13
-set engine_condition_pushdown=@save_ecp;
set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
explain select * from t1 where a in (select b from t2);
@@ -115,7 +112,7 @@ a b
2 2
drop table t1, t2, t3;
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
insert into t1 select a, 'filler123456', 'filler123456' from t0;
insert into t1 select a+10, 'filler123456', 'filler123456' from t0;
diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result
index 67215d1715e..8e3ec975b35 100644
--- a/mysql-test/r/subselect_sj2_jcl6.result
+++ b/mysql-test/r/subselect_sj2_jcl6.result
@@ -64,7 +64,7 @@ a b pk1 pk2 pk3
set @save_max_heap_table_size= @@max_heap_table_size;
set max_heap_table_size=16384;
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
drop table t3;
create table t3 (
a int,
@@ -79,10 +79,8 @@ from t0 A, t0 B where B.a <5;
explain select * from t3 where b in (select a from t0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY subselect2 ALL unique_key NULL NULL NULL 10
-1 PRIMARY t3 ref b b 5 test.t0.a 1 Using join buffer
+1 PRIMARY t3 ref b b 5 test.t0.a 1
2 SUBQUERY t0 ALL NULL NULL NULL NULL 10
-set @save_ecp= @@engine_condition_pushdown;
-set engine_condition_pushdown=0;
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@@ -99,7 +97,6 @@ a b pk1 pk2
11 11 11 11
12 12 12 12
13 13 13 13
-set engine_condition_pushdown=@save_ecp;
set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
explain select * from t1 where a in (select b from t2);
@@ -119,7 +116,7 @@ a b
2 2
drop table t1, t2, t3;
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
insert into t1 select a, 'filler123456', 'filler123456' from t0;
insert into t1 select a+10, 'filler123456', 'filler123456' from t0;
diff --git a/mysql-test/r/table_options.result b/mysql-test/r/table_options.result
index ed6fe4fb3de..d0ebbeb0197 100644
--- a/mysql-test/r/table_options.result
+++ b/mysql-test/r/table_options.result
@@ -3,9 +3,9 @@ SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1';
Warnings:
-Warning 1651 Unknown option 'fkey'
-Warning 1651 Unknown option 'dff'
-Warning 1651 Unknown option 'tkey1'
+Warning 1707 Unknown option 'fkey'
+Warning 1707 Unknown option 'dff'
+Warning 1707 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -16,10 +16,10 @@ drop table t1;
#reassiginig options in the same line
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1;
Warnings:
-Warning 1651 Unknown option 'fkey'
-Warning 1651 Unknown option 'dff'
-Warning 1651 Unknown option 'tkey1'
-Warning 1651 Unknown option 'tkey2'
+Warning 1707 Unknown option 'fkey'
+Warning 1707 Unknown option 'dff'
+Warning 1707 Unknown option 'tkey1'
+Warning 1707 Unknown option 'tkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -29,7 +29,7 @@ t1 CREATE TABLE `t1` (
#add option
alter table t1 tkey4=4v1;
Warnings:
-Warning 1651 Unknown option 'tkey4'
+Warning 1707 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` (
#remove options
alter table t1 tkey3=DEFAULT tkey4=DEFAULT;
Warnings:
-Warning 1651 Unknown option 'tkey3'
-Warning 1651 Unknown option 'tkey4'
+Warning 1707 Unknown option 'tkey3'
+Warning 1707 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -50,11 +50,11 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1;
Warnings:
-Warning 1651 Unknown option 'fkey1'
-Warning 1651 Unknown option 'kkey1'
-Warning 1651 Unknown option 'TKEY1'
-Warning 1651 Unknown option 'tkey2'
-Warning 1651 Unknown option 'tkey3'
+Warning 1707 Unknown option 'fkey1'
+Warning 1707 Unknown option 'kkey1'
+Warning 1707 Unknown option 'TKEY1'
+Warning 1707 Unknown option 'tkey2'
+Warning 1707 Unknown option 'tkey3'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` (
#change field with option with the same value
alter table t1 change a a int `FKEY1`='v1';
Warnings:
-Warning 1651 Unknown option 'FKEY1'
+Warning 1707 Unknown option 'FKEY1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -74,7 +74,7 @@ t1 CREATE TABLE `t1` (
#change field with option with a different value
alter table t1 change a a int fkey1=v2;
Warnings:
-Warning 1651 Unknown option 'fkey1'
+Warning 1707 Unknown option 'fkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -93,7 +93,7 @@ t1 CREATE TABLE `t1` (
#new key with options
alter table t1 add key bkey (b) kkey2=v1;
Warnings:
-Warning 1651 Unknown option 'kkey2'
+Warning 1707 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -105,8 +105,8 @@ t1 CREATE TABLE `t1` (
#new column with options
alter table t1 add column c int fkey1=v1 fkey2=v2;
Warnings:
-Warning 1651 Unknown option 'fkey1'
-Warning 1651 Unknown option 'fkey2'
+Warning 1707 Unknown option 'fkey1'
+Warning 1707 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -141,7 +141,7 @@ t1 CREATE TABLE `t1` (
#add column with options after delete
alter table t1 add column b int fkey2=v1;
Warnings:
-Warning 1651 Unknown option 'fkey2'
+Warning 1707 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` (
#add key
alter table t1 add key bkey (b) kkey2=v2;
Warnings:
-Warning 1651 Unknown option 'kkey2'
+Warning 1707 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -168,7 +168,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a int) tkey1=100;
Warnings:
-Warning 1651 Unknown option 'tkey1'
+Warning 1707 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index a76a0a53510..a37d3945ca1 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -516,7 +516,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where (('2007-04-25 18:30:22' = 0))
+Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from (dual) where (('2007-04-25 18:30:22' = 0))
select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id cur_date
@@ -527,7 +527,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where (('2007-04-25' = 0))
+Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from (dual) where (('2007-04-25' = 0))
select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id cur_date
@@ -647,7 +647,7 @@ SET NAMES CP850;
INSERT INTO t1 VALUES (1,'2010-04-12 22:30:12'), (2,'2010-04-12 22:30:12'), (3,'2010-04-12 22:30:12');
EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22 18:40:07';
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref AtTime AtTime 9 const 1 100.00 Using where
+1 SIMPLE t1 ref AtTime AtTime 9 const 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = '2010-02-22 18:40:07')
DROP TABLE t1;
diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result
index 98ac5973e6d..80eb4e45a91 100644
--- a/mysql-test/r/type_varchar.result
+++ b/mysql-test/r/type_varchar.result
@@ -476,7 +476,7 @@ a (a DIV 2)
t 0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: '1a'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1366 Incorrect decimal value: '' for column '' at row 0
Warning 1292 Truncated incorrect DECIMAL value: 't '
SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
a CAST(a AS SIGNED)
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 15ee25ab79a..611e807ce8e 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -321,7 +321,7 @@ select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
CAST(a AS DECIMAL(13,5))
0.00000
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row 0
+Warning 1366 Incorrect decimal value: '' for column '' at row 0
Warning 1292 Truncated incorrect DECIMAL value: ''
create table t1 (a integer unsigned);
insert into t1 values (1),(-1),(0),(-2);
diff --git a/mysql-test/r/innodb_mrr.result b/mysql-test/r/xtradb_mrr.result
index 7b1c18d2523..7b1c18d2523 100644
--- a/mysql-test/r/innodb_mrr.result
+++ b/mysql-test/r/xtradb_mrr.result
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index 5a6fbc953b4..bf05b27f14a 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -39,7 +39,7 @@ use new_test1/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -234,7 +234,7 @@ use new_test1/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index db83ac969fb..55809d4bda1 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -5,7 +5,7 @@ insert into t1 values (1,2);
commit;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; drop table if exists t1
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; create table t1 (a int, b int) engine=innodb
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into t1 values (1,2)
diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
index a3784562adb..458805a9157 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
@@ -76,10 +76,10 @@ insert into t1 values (1,1,1);
insert into t1 values (RAND()*1000+10, RAND()*1000+10, RAND()*1000+10);
update t1 set n1=rand() where n1=1;
Warnings:
-Note 1592 Statement may not be safe to log in statement format.
+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.
delete from t1 where n2=1 + rand()*0;
Warnings:
-Note 1592 Statement may not be safe to log in statement format.
+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.
drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a int);
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index 2964b493c5d..3f1e4e98bec 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -7,7 +7,6 @@
# BINLOG statement does not work in embedded mode.
-source include/have_log_bin.inc;
source include/not_embedded.inc;
disable_warnings;
diff --git a/mysql-test/suite/binlog/t/binlog_index-master.opt b/mysql-test/suite/binlog/t/binlog_index-master.opt
deleted file mode 100644
index 26cd87ef8c3..00000000000
--- a/mysql-test/suite/binlog/t/binlog_index-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-stack-trace --test-expect-abort --log-warnings=0
diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test
index 32c27fe8f89..0ccea406a82 100644
--- a/mysql-test/suite/binlog/t/binlog_old_versions.test
+++ b/mysql-test/suite/binlog/t/binlog_old_versions.test
@@ -22,7 +22,6 @@
# Related bugs: BUG#27779, BUG#31581, BUG#31582, BUG#31583, BUG#32407
-source include/have_log_bin.inc;
source include/not_embedded.inc;
--disable_warnings
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index f0017b75990..740649f0053 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -135,8 +135,8 @@ BEGIN
END|
--DELIMITER ;
---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
---eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+--eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO"
# In each iteration of this loop, we select one method to make the
# statement unsafe.
diff --git a/mysql-test/suite/federated/federated_debug.result b/mysql-test/suite/federated/federated_debug.result
index 73a6cac892e..58c7ebefea3 100644
--- a/mysql-test/suite/federated/federated_debug.result
+++ b/mysql-test/suite/federated/federated_debug.result
@@ -14,11 +14,6 @@ a
1
# Start a asynchronous reload
# Wait for tables to be closed
-# Timeout in include/wait_show_condition.inc for
-# show_statement : SHOW STATUS LIKE 'Open_tables'
-# field : Value
-# condition : = '0'
-# max_run_time : 31
# Ensure that the server didn't crash
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/federated/federated_plugin-master.opt b/mysql-test/suite/federated/federated_plugin-master.opt
deleted file mode 100644
index fa9ad063fe1..00000000000
--- a/mysql-test/suite/federated/federated_plugin-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---plugin_dir=$FEDERATED_PLUGIN_DIR
diff --git a/mysql-test/suite/innodb/combinations b/mysql-test/suite/innodb/combinations
new file mode 100644
index 00000000000..5051719d92a
--- /dev/null
+++ b/mysql-test/suite/innodb/combinations
@@ -0,0 +1,12 @@
+[innodb_plugin]
+ignore-builtin-innodb
+plugin-load=$HA_INNODB_SO
+innodb
+
+[xtradb_plugin]
+ignore-builtin-innodb
+plugin-load=$HA_XTRADB_SO
+innodb
+
+[xtradb]
+innodb
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index a721b42f2b7..fd7cf87d138 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -1574,12 +1574,6 @@ ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c1,c1,c2);
ERROR 42S21: Duplicate column name 'c1'
drop table t1;
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-concat(a, b)
-11113333
-drop table t1;
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
ERROR HY000: The used table type doesn't support FULLTEXT indexes
@@ -1714,7 +1708,6 @@ show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
-SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 0
@@ -1732,7 +1725,6 @@ set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 16
-SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 500
@@ -3185,5 +3177,3 @@ Variable_name Value
Handler_update 1
Variable_name Value
Handler_delete 1
-set optimizer_switch='index_condition_pushdown=default';
-set @@optimizer_use_mrr=default;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result
index 89aeb84a880..8573fb60718 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result
@@ -9,6 +9,7 @@ SHOW WARNINGS;
Level Code Message
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_max=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index f290410a488..2b4c25dab0d 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -2677,7 +2677,7 @@ WHERE t2.i = t1.pk AND t1.pk BETWEEN 0 AND 224
HAVING f > 7
ORDER BY f;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort
+1 SIMPLE t1 index PRIMARY idx 5 NULL 6 Using where; Using index
1 SIMPLE t2 ref idx idx 5 test.t1.pk 1 Using index
SELECT t1 .i AS f FROM t1, t2
WHERE t2.i = t1.pk AND t1.pk BETWEEN 0 AND 224
diff --git a/mysql-test/suite/innodb/suite.pm b/mysql-test/suite/innodb/suite.pm
new file mode 100644
index 00000000000..9accba5b8a1
--- /dev/null
+++ b/mysql-test/suite/innodb/suite.pm
@@ -0,0 +1,19 @@
+package My::Suite::InnoDB;
+
+@ISA = qw(My::Suite);
+
+############# initialization ######################
+my @combinations;
+
+push @combinations, 'innodb_plugin' if $ENV{HA_INNODB_SO};
+push @combinations, 'xtradb_plugin' if $ENV{HA_XTRADB_SO};
+push @combinations, 'xtradb' if $::mysqld_variables{'innodb'} eq "ON";
+
+return "Neither innodb_plugin nor xtradb are available" unless @combinations;
+
+$ENV{INNODB_COMBINATIONS}=join ':', @combinations
+ unless $ENV{INNODB_COMBINATIONS};
+
+############# return an object ######################
+bless { };
+
diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def
index 888298bbb09..8cae44a3607 100644
--- a/mysql-test/suite/innodb/t/disabled.def
+++ b/mysql-test/suite/innodb/t/disabled.def
@@ -9,3 +9,4 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+
diff --git a/mysql-test/suite/innodb/t/innodb-analyze.test b/mysql-test/suite/innodb/t/innodb-analyze.test
index 9bdb9db697c..c2e4410544a 100644
--- a/mysql-test/suite/innodb/t/innodb-analyze.test
+++ b/mysql-test/suite/innodb/t/innodb-analyze.test
@@ -3,8 +3,6 @@
# different values of the parameter innodb_stats_sample_pages.
#
--- source include/have_innodb.inc
-
# we care only that the following SQL commands do not produce errors
# and do not crash the server
-- disable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
index 790646fe13b..6bcc901a878 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-optimize.test b/mysql-test/suite/innodb/t/innodb-autoinc-optimize.test
index 0f0cb57f92f..2cd1449ec0f 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-optimize.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-optimize.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 2f51cf9ef12..84c359a6bde 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
@@ -665,20 +664,17 @@ SELECT * FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+##
+# 55277: Failing assertion: auto_inc > 0
+#
DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (18446744073709551615);
+# Restart the server
+-- source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=18446744073709551615 DEFAULT CHARSET=latin1
DROP TABLE t1;
-
#
# restore environment to the state it was before this test execution
#
diff --git a/mysql-test/suite/innodb/t/innodb-consistent.test b/mysql-test/suite/innodb/t/innodb-consistent.test
index bf829a74ea2..561f31f5783 100644
--- a/mysql-test/suite/innodb/t/innodb-consistent.test
+++ b/mysql-test/suite/innodb/t/innodb-consistent.test
@@ -1,5 +1,4 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 05d1d37c422..26de072f08b 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
let $MYSQLD_DATADIR= `select @@datadir`;
diff --git a/mysql-test/suite/innodb/t/innodb-index_ucs2.test b/mysql-test/suite/innodb/t/innodb-index_ucs2.test
index fff9a4da1a8..84f2444ff4d 100644
--- a/mysql-test/suite/innodb/t/innodb-index_ucs2.test
+++ b/mysql-test/suite/innodb/t/innodb-index_ucs2.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
-- source include/have_ucs2.inc
-- let charset = ucs2
diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test
index 96f555e3ecc..05501ec0d03 100644
--- a/mysql-test/suite/innodb/t/innodb-lock.test
+++ b/mysql-test/suite/innodb/t/innodb-lock.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
#
# Check and select innodb lock type
diff --git a/mysql-test/suite/innodb/t/innodb-replace.test b/mysql-test/suite/innodb/t/innodb-replace.test
index 8c3aacde5e8..20ca8e98ce2 100644
--- a/mysql-test/suite/innodb/t/innodb-replace.test
+++ b/mysql-test/suite/innodb/t/innodb-replace.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/innodb-semi-consistent.test b/mysql-test/suite/innodb/t/innodb-semi-consistent.test
index 2551db99cf3..6036aa3ed9c 100644
--- a/mysql-test/suite/innodb/t/innodb-semi-consistent.test
+++ b/mysql-test/suite/innodb/t/innodb-semi-consistent.test
@@ -1,5 +1,4 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
--disable_warnings
drop table if exists t1,t2;
diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view.test b/mysql-test/suite/innodb/t/innodb-system-table-view.test
index e570a33b59d..904087577c8 100644
--- a/mysql-test/suite/innodb/t/innodb-system-table-view.test
+++ b/mysql-test/suite/innodb/t/innodb-system-table-view.test
@@ -2,7 +2,6 @@
# that displays the InnoDB system table content through
# information schema tables.
---source include/have_innodb.inc
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
diff --git a/mysql-test/suite/innodb/t/innodb-timeout.test b/mysql-test/suite/innodb/t/innodb-timeout.test
index f23fe3cff2d..fd839540667 100644
--- a/mysql-test/suite/innodb/t/innodb-timeout.test
+++ b/mysql-test/suite/innodb/t/innodb-timeout.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
let $timeout=`select @@innodb_lock_wait_timeout`;
set global innodb_lock_wait_timeout=42;
diff --git a/mysql-test/suite/innodb/t/innodb-ucs2.test b/mysql-test/suite/innodb/t/innodb-ucs2.test
index 7b91ef37d3f..1b59d4aa32e 100644
--- a/mysql-test/suite/innodb/t/innodb-ucs2.test
+++ b/mysql-test/suite/innodb/t/innodb-ucs2.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
-- source include/have_ucs2.inc
--disable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
index 041b063645b..41ac793df88 100644
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
@@ -1,3 +1,2 @@
--default-storage-engine=MyISAM
--loose-innodb-use-sys-malloc=true
---loose-innodb-use-sys-malloc=true
diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test b/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
index 07ccf261713..c485755378c 100644
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
+++ b/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
@@ -1,4 +1,3 @@
---source include/have_innodb.inc
# XtraDB has lots of "still reachable" memory leak warnings at shutdown when
# --innodb-use-sys-malloc
--source include/not_valgrind.inc
@@ -25,27 +24,4 @@ create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
select * from t1;
drop table t1;
---source include/have_innodb.inc
-#display current value of innodb_use_sys_malloc
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-#try changing it. Should fail.
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_sys_malloc=0;
---echo Expected error 'Read only variable'
-
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-
-#do some stuff to see if it works.
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index 8e00a8b019b..236579c83b8 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index b839fb9b59f..d9cdedb13bf 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -19,8 +19,6 @@
# #
#######################################################################
--- source include/have_innodb.inc
-
let $MYSQLD_DATADIR= `select @@datadir`;
let collation=utf8_unicode_ci;
--source include/have_collation.inc
@@ -1221,11 +1219,11 @@ drop table t1;
#
# Bug #4082: integer truncation
#
-
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-drop table t1;
+# disable because the bug has resurfaced
+#create table t1(a int(1) , b int(1)) engine=innodb;
+#insert into t1 values ('1111', '3333');
+#select distinct concat(a, b) from t1;
+#drop table t1;
#
# BUG#7709 test case - Boolean fulltext query against unsupported
@@ -1313,7 +1311,7 @@ drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
---replace_result 512 511
+--replace_result 512 511 2047 511
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
@@ -1339,7 +1337,6 @@ show variables like "innodb_sync_spin_loops";
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
# Test for innodb_thread_concurrency variable
-SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=1001;
show variables like "innodb_thread_concurrency";
@@ -1347,7 +1344,6 @@ set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
-SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
# Test for innodb_concurrency_tickets variable
show variables like "innodb_concurrency_tickets";
@@ -2558,9 +2554,6 @@ SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
-- enable_query_log
-set optimizer_switch='index_condition_pushdown=default';
-set @@optimizer_use_mrr=default;
-
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
index 96f748673c0..7d2e94c296d 100644
--- a/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
+++ b/mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
@@ -1,8 +1,6 @@
# This test runs with old-style locking, as:
# --innodb-autoinc-lock-mode=0
--- source include/have_innodb.inc
-
--disable_warnings
drop table if exists t1;
--enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb_bug21704.test b/mysql-test/suite/innodb/t/innodb_bug21704.test
index c649b61034c..a1dbc8eb734 100644
--- a/mysql-test/suite/innodb/t/innodb_bug21704.test
+++ b/mysql-test/suite/innodb/t/innodb_bug21704.test
@@ -1,5 +1,3 @@
--- source include/have_innodb.inc
-
--echo #
--echo # Bug#21704: Renaming column does not update FK definition.
--echo #
diff --git a/mysql-test/suite/innodb/t/innodb_bug30919.test b/mysql-test/suite/innodb/t/innodb_bug30919.test
index 56b2c7bc03d..84435ad3312 100644
--- a/mysql-test/suite/innodb/t/innodb_bug30919.test
+++ b/mysql-test/suite/innodb/t/innodb_bug30919.test
@@ -1,4 +1,3 @@
---source include/have_innodb.inc
--source include/have_partition.inc
--vertical_results
let $engine_type= 'innodb';
diff --git a/mysql-test/suite/innodb/t/innodb_bug34053.test b/mysql-test/suite/innodb/t/innodb_bug34053.test
index b935e45c06d..2025a029613 100644
--- a/mysql-test/suite/innodb/t/innodb_bug34053.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34053.test
@@ -3,7 +3,6 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
SET storage_engine=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test
index 68c385fd72a..09ab23eb4f4 100644
--- a/mysql-test/suite/innodb/t/innodb_bug34300.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34300.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/34300
#
--- source include/have_innodb.inc
-
-- disable_query_log
-- disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug35220.test b/mysql-test/suite/innodb/t/innodb_bug35220.test
index 26f7d6b1ddd..4388cfd2a85 100644
--- a/mysql-test/suite/innodb/t/innodb_bug35220.test
+++ b/mysql-test/suite/innodb/t/innodb_bug35220.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/35220
#
--- source include/have_innodb.inc
-
SET storage_engine=InnoDB;
# we care only that the following SQL commands do not produce errors
diff --git a/mysql-test/suite/innodb/t/innodb_bug36169.test b/mysql-test/suite/innodb/t/innodb_bug36169.test
index 5bbbf45d484..0695413266b 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36169.test
+++ b/mysql-test/suite/innodb/t/innodb_bug36169.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/36169
#
--- source include/have_innodb.inc
-
let $file_format=`select @@innodb_file_format`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb/t/innodb_bug36172.test
index 6f5dd7629ff..9269d54032d 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test
+++ b/mysql-test/suite/innodb/t/innodb_bug36172.test
@@ -3,7 +3,6 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
SET storage_engine=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test
index 0d4262b4473..db338324da3 100644
--- a/mysql-test/suite/innodb/t/innodb_bug38231.test
+++ b/mysql-test/suite/innodb/t/innodb_bug38231.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/38231
#
--- source include/have_innodb.inc
-
# skip this test in embedded mode because "TRUNCATE TABLE bug38231_1"
# hangs in that mode waiting for "lock_wait_timeout" although it is
# preceded by --send
diff --git a/mysql-test/suite/innodb/t/innodb_bug39438.test b/mysql-test/suite/innodb/t/innodb_bug39438.test
index 52302871beb..6f57ef17ab3 100644
--- a/mysql-test/suite/innodb/t/innodb_bug39438.test
+++ b/mysql-test/suite/innodb/t/innodb_bug39438.test
@@ -7,8 +7,6 @@
# works with innodb_file_per_table.
#
--- source include/have_innodb.inc
-
SET storage_engine=InnoDB;
# we care only that the following SQL commands do not crash the server
diff --git a/mysql-test/suite/innodb/t/innodb_bug40360.test b/mysql-test/suite/innodb/t/innodb_bug40360.test
index e88837aab4f..a6b67b03c6f 100644
--- a/mysql-test/suite/innodb/t/innodb_bug40360.test
+++ b/mysql-test/suite/innodb/t/innodb_bug40360.test
@@ -3,7 +3,6 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
SET TX_ISOLATION='READ-COMMITTED';
diff --git a/mysql-test/suite/innodb/t/innodb_bug40565.test b/mysql-test/suite/innodb/t/innodb_bug40565.test
index d7aa0fd514a..4d4ee6811d7 100644
--- a/mysql-test/suite/innodb/t/innodb_bug40565.test
+++ b/mysql-test/suite/innodb/t/innodb_bug40565.test
@@ -1,5 +1,4 @@
# Bug #40565 Update Query Results in "1 Row Affected" But Should Be "Zero Rows"
--- source include/have_innodb.inc
create table bug40565(value decimal(4,2)) engine=innodb;
insert into bug40565 values (1), (null);
diff --git a/mysql-test/suite/innodb/t/innodb_bug41904.test b/mysql-test/suite/innodb/t/innodb_bug41904.test
index 365c5229adc..0aac1c840c3 100644
--- a/mysql-test/suite/innodb/t/innodb_bug41904.test
+++ b/mysql-test/suite/innodb/t/innodb_bug41904.test
@@ -3,7 +3,6 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
index 2e4cf1f46dd..96c28db8ede 100644
--- a/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/42101
#
--- source include/have_innodb.inc
-
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
diff --git a/mysql-test/suite/innodb/t/innodb_bug42101.test b/mysql-test/suite/innodb/t/innodb_bug42101.test
index f0b88e034a0..2603ff1e682 100644
--- a/mysql-test/suite/innodb/t/innodb_bug42101.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42101.test
@@ -3,8 +3,6 @@
# http://bugs.mysql.com/42101
#
--- source include/have_innodb.inc
-
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
--error ER_WRONG_VALUE_FOR_VAR
diff --git a/mysql-test/suite/innodb/t/innodb_bug42419.test b/mysql-test/suite/innodb/t/innodb_bug42419.test
index 93c4764252a..b3d732662e1 100644
--- a/mysql-test/suite/innodb/t/innodb_bug42419.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42419.test
@@ -4,7 +4,6 @@
#
--source include/not_embedded.inc
---source include/have_innodb.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`)
diff --git a/mysql-test/suite/innodb/t/innodb_bug44032.test b/mysql-test/suite/innodb/t/innodb_bug44032.test
index a963cb8b68f..74c4b1dcb04 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44032.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44032.test
@@ -2,7 +2,6 @@
# (btr_cur_update_in_place not invoked when updating from/to NULL;
# the update is performed by delete and insert instead)
--- source include/have_innodb.inc
CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug44369.test b/mysql-test/suite/innodb/t/innodb_bug44369.test
index f5d85cd5815..2d9304567f8 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44369.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44369.test
@@ -3,7 +3,6 @@
# some innodb internal reserved key words,
# both case sensitively and insensitely.
---source include/have_innodb.inc
# This create table operation should fail.
--error ER_WRONG_COLUMN_NAME
diff --git a/mysql-test/suite/innodb/t/innodb_bug44571.test b/mysql-test/suite/innodb/t/innodb_bug44571.test
index 91b6722d8af..d0868659910 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44571.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44571.test
@@ -4,7 +4,6 @@
# Please also refer to related fix in
# http://bugs.mysql.com/47621
#
--- source include/have_innodb.inc
CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
ALTER TABLE bug44571 CHANGE foo bar INT;
diff --git a/mysql-test/suite/innodb/t/innodb_bug45357.test b/mysql-test/suite/innodb/t/innodb_bug45357.test
index 81727f352dd..524ee85c6ba 100644
--- a/mysql-test/suite/innodb/t/innodb_bug45357.test
+++ b/mysql-test/suite/innodb/t/innodb_bug45357.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
set session transaction isolation level read committed;
diff --git a/mysql-test/suite/innodb/t/innodb_bug46000.test b/mysql-test/suite/innodb/t/innodb_bug46000.test
index 5a3c666326e..95b9ff4dcc9 100644
--- a/mysql-test/suite/innodb/t/innodb_bug46000.test
+++ b/mysql-test/suite/innodb/t/innodb_bug46000.test
@@ -3,7 +3,6 @@
# "GEN_CLUST_INDEX", which is the reserved
# name for innodb default primary index.
---source include/have_innodb.inc
# This 'create table' operation should fail because of
# using the reserve name as its index name.
diff --git a/mysql-test/suite/innodb/t/innodb_bug46676.test b/mysql-test/suite/innodb/t/innodb_bug46676.test
index 440666c4226..27bd1dcd6dc 100644
--- a/mysql-test/suite/innodb/t/innodb_bug46676.test
+++ b/mysql-test/suite/innodb/t/innodb_bug46676.test
@@ -2,7 +2,6 @@
# It is reproducible with InnoDB plugin 1.0.4 + MySQL 5.1.37.
# But no longer reproducible after MySQL 5.1.38 (with plugin 1.0.5).
---source include/have_innodb.inc
SET foreign_key_checks=0;
CREATE TABLE t1 (id int, foreign key (id) references t2(id)) ENGINE=INNODB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb/t/innodb_bug47167.test
index 8fcd129cf94..3bb0d995b47 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47167.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47167.test
@@ -3,7 +3,6 @@
# originally "innodb_file_format_check") with a user-Defined Variable.
--source include/not_embedded.inc
---source include/have_innodb.inc
# Save the value (Antelope) in 'innodb_file_format_max' to
# 'old_innodb_file_format_max'
diff --git a/mysql-test/suite/innodb/t/innodb_bug47621.test b/mysql-test/suite/innodb/t/innodb_bug47621.test
index 4863cc6bba1..80b42bc738b 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47621.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47621.test
@@ -2,7 +2,6 @@
# not result in column definition inconsistency between MySQL and
# InnoDB
---source include/have_innodb.inc
CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47622.test b/mysql-test/suite/innodb/t/innodb_bug47622.test
index 9cf9d0e531b..45cf4d5ec4d 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47622.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47622.test
@@ -4,7 +4,6 @@
# We resolve the problem by sync the index sequence
# up when opening the table.
---source include/have_innodb.inc
connect (a,localhost,root,,);
connect (b,localhost,root,,);
diff --git a/mysql-test/suite/innodb/t/innodb_bug47777.test b/mysql-test/suite/innodb/t/innodb_bug47777.test
index 8f2985b2cf0..52d975901de 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47777.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47777.test
@@ -4,7 +4,6 @@
# should follow the process for the BLOB
# datatype as well.
---source include/have_innodb.inc
create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb_bug48024.test b/mysql-test/suite/innodb/t/innodb_bug48024.test
index db828aa1cda..aa7dd8dbf10 100644
--- a/mysql-test/suite/innodb/t/innodb_bug48024.test
+++ b/mysql-test/suite/innodb/t/innodb_bug48024.test
@@ -1,6 +1,5 @@
# Bug #48024 Innodb doesn't work with multi-statements
---source include/have_innodb.inc
CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug49164.test b/mysql-test/suite/innodb/t/innodb_bug49164.test
index 7f1c9f4ca9c..96d59da02f2 100644
--- a/mysql-test/suite/innodb/t/innodb_bug49164.test
+++ b/mysql-test/suite/innodb/t/innodb_bug49164.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
# Bug #49164 READ-COMMITTED reports "matched: 0" on compound PK
# a duplicate of
diff --git a/mysql-test/suite/innodb/t/innodb_bug51378.test b/mysql-test/suite/innodb/t/innodb_bug51378.test
index 8f7b0b9605a..c171bae04ae 100644
--- a/mysql-test/suite/innodb/t/innodb_bug51378.test
+++ b/mysql-test/suite/innodb/t/innodb_bug51378.test
@@ -9,7 +9,6 @@
# will be created as primary index
# Following queries test various scenario, no mismatch
# error message should be printed.
---source include/have_innodb.inc
# Create a table contains a BLOB column
create table bug51378 (
diff --git a/mysql-test/suite/innodb/t/innodb_bug51920.test b/mysql-test/suite/innodb/t/innodb_bug51920.test
index bc3bb006c1c..41c52bbd89b 100644
--- a/mysql-test/suite/innodb/t/innodb_bug51920.test
+++ b/mysql-test/suite/innodb/t/innodb_bug51920.test
@@ -2,7 +2,6 @@
# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
INSERT INTO bug51920 VALUES (1);
diff --git a/mysql-test/suite/innodb/t/innodb_bug52199.test b/mysql-test/suite/innodb/t/innodb_bug52199.test
index 0fec64ba243..b95cdef3fdd 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52199.test
+++ b/mysql-test/suite/innodb/t/innodb_bug52199.test
@@ -1,4 +1,6 @@
--- source include/have_innodb.inc
+
+let collation=utf32_bin;
+--source include/have_collation.inc
CREATE TABLE bug52199 (a INT NOT NULL,
b CHAR(125) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL
diff --git a/mysql-test/suite/innodb/t/innodb_bug52663.test b/mysql-test/suite/innodb/t/innodb_bug52663.test
index fcf97531e00..e4e87ee33d8 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52663.test
+++ b/mysql-test/suite/innodb/t/innodb_bug52663.test
@@ -1,4 +1,3 @@
---source include/have_innodb.inc
set session transaction isolation level read committed;
diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb/t/innodb_bug52745.test
index 686ca705ab7..25adf5c064a 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52745.test
+++ b/mysql-test/suite/innodb/t/innodb_bug52745.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_max=`select @@innodb_file_format_max`;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53290.test b/mysql-test/suite/innodb/t/innodb_bug53290.test
index ea15212fa39..90e23127d64 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53290.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53290.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
create table bug53290 (x bigint) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test
index e0e568034d8..cac39c10d30 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53591.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_max=`select @@innodb_file_format_max`;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53592.test b/mysql-test/suite/innodb/t/innodb_bug53592.test
index bc37743f6bf..7eefe6d7631 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53592.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53592.test
@@ -2,7 +2,6 @@
# table after fast alter table added unique key". The fix is to make
# sure index number lookup should go through "index translation table".
---source include/have_innodb.inc
# Use FIC for index creation
set old_alter_table=0;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53674.test b/mysql-test/suite/innodb/t/innodb_bug53674.test
index c96c3403b36..c2d11b953e6 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53674.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53674.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
-- source include/have_log_bin.inc
create table bug53674(a int)engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb_bug54044.test b/mysql-test/suite/innodb/t/innodb_bug54044.test
index a6722ed6399..1846cf22544 100644
--- a/mysql-test/suite/innodb/t/innodb_bug54044.test
+++ b/mysql-test/suite/innodb/t/innodb_bug54044.test
@@ -1,7 +1,6 @@
# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type
# during create table, so it will not trigger assertion failure.
---source include/have_innodb.inc
# This 'create table' operation should fail because of
# using NULL datatype
diff --git a/mysql-test/suite/innodb/t/innodb_bug54679.test b/mysql-test/suite/innodb/t/innodb_bug54679.test
index c5e308acb5e..b279e1eaf9f 100644
--- a/mysql-test/suite/innodb/t/innodb_bug54679.test
+++ b/mysql-test/suite/innodb/t/innodb_bug54679.test
@@ -1,6 +1,5 @@
# Test Bug #54679 alter table causes compressed row_format to revert to compact
---source include/have_innodb.inc
let $file_format=`select @@innodb_file_format`;
let $file_format_max=`select @@innodb_file_format_max`;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56716.test b/mysql-test/suite/innodb/t/innodb_bug56716.test
index 3345038d9c1..c8e1ed83e38 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56716.test
+++ b/mysql-test/suite/innodb/t/innodb_bug56716.test
@@ -1,7 +1,6 @@
#
# Bug #56716 InnoDB locks a record gap without locking the table
#
--- source include/have_innodb.inc
CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug57255.test b/mysql-test/suite/innodb/t/innodb_bug57255.test
index 2b37a0a6092..4f08a9b46bf 100644
--- a/mysql-test/suite/innodb/t/innodb_bug57255.test
+++ b/mysql-test/suite/innodb/t/innodb_bug57255.test
@@ -1,7 +1,6 @@
# Test Bug #57255. Cascade deletes that affect different rows should not
# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
---source include/have_innodb.inc
create table A(id int not null primary key) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
index aa411258da0..5c80ef89ba4 100644
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test
@@ -1,5 +1,4 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
diff --git a/mysql-test/suite/innodb/t/innodb_gis.test b/mysql-test/suite/innodb/t/innodb_gis.test
index 1adb14ea482..dec0c8bf725 100644
--- a/mysql-test/suite/innodb/t/innodb_gis.test
+++ b/mysql-test/suite/innodb/t/innodb_gis.test
@@ -1,4 +1,3 @@
---source include/have_innodb.inc
SET storage_engine=innodb;
--source include/gis_generic.inc
--source include/gis_keys.inc
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb/t/innodb_information_schema.test
index 3dc2a8a40d4..934642dcb40 100644
--- a/mysql-test/suite/innodb/t/innodb_information_schema.test
+++ b/mysql-test/suite/innodb/t/innodb_information_schema.test
@@ -3,7 +3,6 @@
# INFORMATION_SCHEMA.innodb_locks.lock_data
#
--- source include/have_innodb.inc
-- disable_query_log
-- disable_result_log
diff --git a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
index fcbf2b1cfc7..f861d8de445 100644
--- a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
+++ b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
@@ -1,4 +1,3 @@
---source include/have_innodb.inc
--echo #
--echo # Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test
index 7ab17ccf70a..6393671d358 100644
--- a/mysql-test/suite/innodb/t/innodb_multi_update.test
+++ b/mysql-test/suite/innodb/t/innodb_multi_update.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
#
# Test multi update with different join methods
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index 522e32a53ca..ef43a192d52 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -2,12 +2,11 @@
#
# Last update:
# 2006-07-26 ML test refactored (MySQL 5.1)
-# main testing code t/innodb_mysql.test -> include/mix1.inc
+# main testing code t/innodb_mysql.test -> include/mix1.inc
#
# Slow test, don't run during staging part
-- source include/not_staging.inc
--- source include/have_innodb.inc
-- source include/have_query_cache.inc
let $engine_type= InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql_rbk.test b/mysql-test/suite/innodb/t/innodb_mysql_rbk.test
index d2368c81f95..e565bff16de 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql_rbk.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql_rbk.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
#
# Bug #41453: Assertion `m_status == DA_ERROR' failed in
diff --git a/mysql-test/suite/innodb/t/innodb_notembedded.test b/mysql-test/suite/innodb/t/innodb_notembedded.test
index c74dc931505..1caccdbc32b 100644
--- a/mysql-test/suite/innodb/t/innodb_notembedded.test
+++ b/mysql-test/suite/innodb/t/innodb_notembedded.test
@@ -1,5 +1,4 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/suite/innodb/t/innodb_timeout_rollback.test b/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
index 99890971064..44e8acdde13 100644
--- a/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
+++ b/mysql-test/suite/innodb/t/innodb_timeout_rollback.test
@@ -1,4 +1,3 @@
--- source include/have_innodb.inc
--source include/innodb_rollback_on_timeout.inc
diff --git a/mysql-test/suite/innodb/t/innodb_trx_weight.test b/mysql-test/suite/innodb/t/innodb_trx_weight.test
index b72eaad345f..b2583ff3a8a 100644
--- a/mysql-test/suite/innodb/t/innodb_trx_weight.test
+++ b/mysql-test/suite/innodb/t/innodb_trx_weight.test
@@ -6,7 +6,6 @@
# be heavier than ones that had not.
#
--- source include/have_innodb.inc
SET storage_engine=InnoDB;
diff --git a/mysql-test/suite/maria/r/compat_aliases.result b/mysql-test/suite/maria/r/compat_aliases.result
index 22150cc680b..45bccc04e6e 100644
--- a/mysql-test/suite/maria/r/compat_aliases.result
+++ b/mysql-test/suite/maria/r/compat_aliases.result
@@ -1,7 +1,7 @@
select * from information_schema.plugins where plugin_name like '%aria';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE PLUGIN_MATURITY PLUGIN_AUTH_VERSION
-Maria 1.5 ACTIVE DAEMON 50300.0 NULL NULL Monty Program Ab Compatibility aliases for the Aria engine GPL Gamma 1.5
-Aria 1.5 ACTIVE STORAGE ENGINE 50300.0 NULL NULL Monty Program Ab Crash-safe tables with MyISAM heritage GPL Gamma 1.5
+Maria 1.5 ACTIVE DAEMON 50507.0 NULL NULL Monty Program Ab Compatibility aliases for the Aria engine GPL Gamma 1.5
+Aria 1.5 ACTIVE STORAGE ENGINE 50507.0 NULL NULL Monty Program Ab Crash-safe tables with MyISAM heritage GPL Gamma 1.5
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_variables as maria_vars left join
information_schema.session_variables as aria_vars
diff --git a/mysql-test/suite/maria/r/maria-connect.result b/mysql-test/suite/maria/r/maria-connect.result
index a02c29f3d5f..ff6a27c4f8f 100644
--- a/mysql-test/suite/maria/r/maria-connect.result
+++ b/mysql-test/suite/maria/r/maria-connect.result
@@ -14,10 +14,14 @@ a
2
3
4
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 106 Query 1 204 use `test`; CREATE TABLE t1 (a int primary key)
-master-bin.000001 204 Query 1 295 use `test`; insert t1 values (1),(2),(3)
-master-bin.000001 295 Query 1 386 use `test`; insert t1 values (4),(2),(5)
+master-bin.000001 107 Query 1 205 use `test`; CREATE TABLE t1 (a int primary key)
+master-bin.000001 205 Query 1 273 BEGIN
+master-bin.000001 273 Query 1 364 use `test`; insert t1 values (1),(2),(3)
+master-bin.000001 364 Query 1 433 COMMIT
+master-bin.000001 433 Query 1 501 BEGIN
+master-bin.000001 501 Query 1 592 use `test`; insert t1 values (4),(2),(5)
+master-bin.000001 592 Query 1 661 COMMIT
drop table t1;
set binlog_format=default;
diff --git a/mysql-test/suite/maria/r/maria-no-logging.result b/mysql-test/suite/maria/r/maria-no-logging.result
index 0d3d7804853..9c50245d05d 100644
--- a/mysql-test/suite/maria/r/maria-no-logging.result
+++ b/mysql-test/suite/maria/r/maria-no-logging.result
@@ -1,4 +1,4 @@
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
@@ -41,7 +41,7 @@ Warnings:
Note 1050 Table 't1' already exists
show engine aria logs;
Type Name Status
-Aria Size 24576 aria_log.00000001 unknown
+Aria Size 16384 aria_log.00000001 unknown
* shut down mysqld, removed logs, restarted it
drop table t1;
create table t1 engine=aria transactional=1 select * from t2;
diff --git a/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result b/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result
index 57a2927c749..778d8ba9911 100644
--- a/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result
+++ b/mysql-test/suite/maria/r/maria-recovery-rtree-ft.result
@@ -1,4 +1,4 @@
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
@@ -10,14 +10,14 @@ name VARCHAR(32)
,SPATIAL key (line)
) transactional=1 row_format=page engine=aria;
SHOW INDEX FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 line 1 line A NULL 32 NULL SPATIAL
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 line 1 line A NULL 32 NULL SPATIAL
CREATE TABLE t2 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)
) transactional=1 row_format=page engine=aria;
SHOW INDEX FROM t2;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t2 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
-t2 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t2 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
+t2 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
* TEST of REDO: see if recovery can reconstruct if we give it an old table
* copied t2 for feeding_recovery
* copied t1 for feeding_recovery
diff --git a/mysql-test/suite/maria/r/maria-recovery.result b/mysql-test/suite/maria/r/maria-recovery.result
index cfabbf10be9..8d5da9b7269 100644
--- a/mysql-test/suite/maria/r/maria-recovery.result
+++ b/mysql-test/suite/maria/r/maria-recovery.result
@@ -1,4 +1,4 @@
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
diff --git a/mysql-test/suite/maria/r/maria-recovery2.result b/mysql-test/suite/maria/r/maria-recovery2.result
index b78d7dcc4e7..3ac14085624 100644
--- a/mysql-test/suite/maria/r/maria-recovery2.result
+++ b/mysql-test/suite/maria/r/maria-recovery2.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("File '.*aria_log.000.*' not found \\(Errcode: 2\\)");
call mtr.add_suppression("Table '.\/mysqltest\/t_corrupted1' is crashed, skipping it. Please repair it with aria_chk -r");
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
@@ -121,8 +121,8 @@ Checksum-check
ok
use mysqltest;
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 1 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 1 NULL NULL YES BTREE
drop table t1;
* TEST of recovery when OPTIMIZE has replaced the index file and crash
create table t_corrupted1 (a varchar(100), key(a)) engine=aria;
diff --git a/mysql-test/suite/maria/r/maria-recovery3.result b/mysql-test/suite/maria/r/maria-recovery3.result
index 4ce52425204..9eadd35a722 100644
--- a/mysql-test/suite/maria/r/maria-recovery3.result
+++ b/mysql-test/suite/maria/r/maria-recovery3.result
@@ -1,4 +1,4 @@
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
diff --git a/mysql-test/suite/maria/r/maria.result b/mysql-test/suite/maria/r/maria.result
index f6e3777a0b6..edc086c2f9e 100644
--- a/mysql-test/suite/maria/r/maria.result
+++ b/mysql-test/suite/maria/r/maria.result
@@ -4,7 +4,7 @@ Aria YES Crash-safe tables with MyISAM heritage YES NO NO
set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop table if exists t1,t2;
drop view if exists v1;
SET SQL_WARNINGS=1;
@@ -50,16 +50,16 @@ optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
-t1 1 b 1 b A 1 NULL NULL BTREE
+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 5 NULL NULL BTREE
+t1 1 b 1 b A 1 NULL NULL BTREE
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
-t1 1 b 1 b A 1 NULL NULL BTREE
+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 5 NULL NULL BTREE
+t1 1 b 1 b A 1 NULL NULL BTREE
drop table t1;
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b));
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
@@ -360,13 +360,13 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 b 1 b A 5 NULL NULL YES BTREE
-t1 1 c 1 c A 5 NULL NULL YES BTREE
-t1 1 a 1 a A 1 NULL NULL BTREE
-t1 1 a 2 b A 5 NULL NULL YES BTREE
-t1 1 c_2 1 c A 5 NULL NULL YES BTREE
-t1 1 c_2 2 a A 5 NULL NULL BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 b 1 b A 5 NULL NULL YES BTREE
+t1 1 c 1 c A 5 NULL NULL YES BTREE
+t1 1 a 1 a A 1 NULL NULL BTREE
+t1 1 a 2 b A 5 NULL NULL YES BTREE
+t1 1 c_2 1 c A 5 NULL NULL YES BTREE
+t1 1 c_2 2 a A 5 NULL NULL BTREE
explain select * from t1,t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 2
@@ -575,6 +575,7 @@ select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
2 2 1
+unlock tables;
drop table t1,t2;
set autocommit=1;
CREATE TABLE t1 (c1 varchar(250) NOT NULL) ROW_FORMAT=DYNAMIC;
@@ -589,6 +590,7 @@ INSERT INTO t2 VALUES ('test000001'), ('test000005');
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
+unlock tables;
DROP TABLE t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`));
Got one of the listed errors
@@ -620,29 +622,29 @@ Error 1146 Table 'test.t3' doesn't exist
drop table t1,t2;
create table t1 (a int, key (a));
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A NULL NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A NULL NULL NULL YES BTREE
alter table t1 disable keys;
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
create table t2 (a int);
set @@rand_seed1=31415926,@@rand_seed2=2718281828;
insert t1 select * from t2;
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A NULL NULL NULL YES BTREE disabled
alter table t1 enable keys;
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 1000 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 1000 NULL NULL YES BTREE
alter table t1 engine=heap;
alter table t1 disable keys;
Warnings:
Note 1031 Table storage engine for 't1' doesn't have this option
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a NULL 500 NULL NULL YES HASH
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a NULL 500 NULL NULL YES HASH
drop table t1,t2;
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
insert into t1 values (null,''), (null,'');
@@ -712,16 +714,16 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 10 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 10 NULL NULL YES BTREE
insert into t1 values (11);
delete from t1 where a=11;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 10 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 10 NULL NULL YES BTREE
set aria_stats_method=nulls_equal;
show variables like 'aria_stats_method';
Variable_name Value
@@ -732,16 +734,16 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 5 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 5 NULL NULL YES BTREE
insert into t1 values (11);
delete from t1 where a=11;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 5 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 5 NULL NULL YES BTREE
set aria_stats_method=DEFAULT;
show variables like 'aria_stats_method';
Variable_name Value
@@ -752,16 +754,16 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 10 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 10 NULL NULL YES BTREE
insert into t1 values (11);
delete from t1 where a=11;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 10 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 10 NULL NULL YES BTREE
drop table t1;
set aria_stats_method=nulls_ignored;
show variables like 'aria_stats_method';
@@ -779,21 +781,21 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 2 NULL NULL YES BTREE
-t1 1 a 2 b A 4 NULL NULL YES BTREE
-t1 1 a 3 c A 4 NULL NULL YES BTREE
-t1 1 a 4 d A 4 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 2 NULL NULL YES BTREE
+t1 1 a 2 b A 4 NULL NULL YES BTREE
+t1 1 a 3 c A 4 NULL NULL YES BTREE
+t1 1 a 4 d A 4 NULL NULL YES BTREE
delete from t1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 0 NULL NULL YES BTREE
-t1 1 a 2 b A 0 NULL NULL YES BTREE
-t1 1 a 3 c A 0 NULL NULL YES BTREE
-t1 1 a 4 d A 0 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 0 NULL NULL YES BTREE
+t1 1 a 2 b A 0 NULL NULL YES BTREE
+t1 1 a 3 c A 0 NULL NULL YES BTREE
+t1 1 a 4 d A 0 NULL NULL YES BTREE
set aria_stats_method=DEFAULT;
drop table t1;
create table t1(
@@ -1639,13 +1641,13 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 8 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 8 NULL NULL YES BTREE
alter table t1 disable keys;
alter table t1 enable keys;
show keys from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A 8 NULL NULL YES BTREE
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 a 1 a A 8 NULL NULL YES BTREE
drop table t1;
show create table t1;
show create table t1;
@@ -2530,6 +2532,7 @@ insert into t1 values (1);
lock table t1 write concurrent;
delete from t1;
ERROR 42000: The storage engine for the table doesn't support DELETE in WRITE CONCURRENT
+unlock tables;
drop table t1;
create table t1 (p int primary key, i int, a char(10), key k1(i), key k2(a))
engine aria;
@@ -2584,12 +2587,6 @@ insert into t1 values (1);
alter table t1 partition by list (s1) (partition p1 values in (2));
ERROR HY000: Table has no partition for value 1
drop table t1;
-create table t1 (c1 int);
-create table t2 (c1 int);
-lock table t1 read, t2 read;
-flush tables with read lock;
-unlock tables;
-drop table t1, t2;
create table t1(a int primary key, b blob, c blob) engine=aria;
insert into t1 values(1,repeat('a',100), repeat('b',657860));
Warnings:
diff --git a/mysql-test/suite/maria/r/maria2.result b/mysql-test/suite/maria/r/maria2.result
index f145a4884e7..a0ec440b662 100644
--- a/mysql-test/suite/maria/r/maria2.result
+++ b/mysql-test/suite/maria/r/maria2.result
@@ -29,6 +29,7 @@ count(*)
select * from t1;
i
2
+unlock tables;
drop table t1,t2;
create table t1(id int, s char(1), unique(s)) engine=aria;
insert into t1 values(1,"a") on duplicate key update t1.id=t1.id+1;
diff --git a/mysql-test/suite/maria/r/maria3.result b/mysql-test/suite/maria/r/maria3.result
index 2311669640b..a05efb1a1f2 100644
--- a/mysql-test/suite/maria/r/maria3.result
+++ b/mysql-test/suite/maria/r/maria3.result
@@ -4,7 +4,7 @@ Aria YES Crash-safe tables with MyISAM heritage YES NO NO
set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
drop table if exists t1,t2;
SET SQL_WARNINGS=1;
create table t1 (a int not null, key `a` (a) key_block_size=512);
@@ -231,7 +231,6 @@ insert into t1 values (1,1,"aaa"),(1,2,null);
checksum table t1;
Table Checksum
test.t1 1112804611
-lock table t1 write;
insert into t1 values (1,3,repeat('c',30000)),(4,4,repeat('a',30000));
update t1 set v="row5" where b=4;
delete from t1 where b=3;
@@ -312,7 +311,7 @@ aria_log_file_size 4294959104
aria_log_purge_type immediate
aria_max_sort_file_size 9223372036853727232
aria_pagecache_age_threshold 300
-aria_pagecache_buffer_size 134213632
+aria_pagecache_buffer_size 134217728
aria_pagecache_division_limit 100
aria_page_checksum OFF
aria_recover NORMAL
@@ -395,7 +394,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
set global aria_log_file_size=4294967296;
Warnings:
-Warning 1292 Truncated incorrect log_file_size value: '4294967296'
+Warning 1292 Truncated incorrect aria_log_file_size value: '4294967296'
create table t1 (a int not null);
lock tables t1 write;
insert into t1 values (1),(2);
@@ -513,7 +512,7 @@ drop table t1;
create table t1 (n int not null, c char(1)) engine=aria transactional=1;
alter table t1 engine=myisam;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
alter table t1 engine=aria;
show create table t1;
Table Create Table
@@ -524,7 +523,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (n int not null, c char(1)) engine=myisam transactional=1;
Warnings:
-Error 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
+Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
alter table t1 engine=aria;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/maria/r/ps_maria.result b/mysql-test/suite/maria/r/ps_maria.result
index 30f7edb8a99..98e6b1b1f8b 100644
--- a/mysql-test/suite/maria/r/ps_maria.result
+++ b/mysql-test/suite/maria/r/ps_maria.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1788,11 +1788,11 @@ t5 CREATE TABLE `t5` (
`const06` varchar(10) NOT NULL DEFAULT '',
`param06` longtext,
`const07` date DEFAULT NULL,
- `param07` longblob,
+ `param07` longtext,
`const08` varchar(19) NOT NULL DEFAULT '',
`param08` longtext,
`const09` datetime DEFAULT NULL,
- `param09` longblob,
+ `param09` longtext,
`const10` int(10) NOT NULL DEFAULT '0',
`param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL,
@@ -1807,8 +1807,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1818,18 +1818,18 @@ def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 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 144 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 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1927,28 +1927,28 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
+def @arg13 250 16777215 10 Y 0 31 8
+def @arg14 250 16777215 19 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+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,
@@ -1974,28 +1974,28 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
+def @arg13 250 16777215 0 Y 0 31 8
+def @arg14 250 16777215 0 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+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
@@ -2024,28 +2024,28 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
+def @arg13 250 16777215 10 Y 0 31 8
+def @arg14 250 16777215 19 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+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 ;
@@ -2064,28 +2064,28 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
+def @arg13 250 16777215 0 Y 0 31 8
+def @arg14 250 16777215 0 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+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" ;
@@ -2112,28 +2112,28 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
+def @arg13 250 16777215 10 Y 0 31 8
+def @arg14 250 16777215 19 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+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,
@@ -2156,28 +2156,28 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
+def @arg13 250 16777215 0 Y 0 31 8
+def @arg14 250 16777215 0 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+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,
@@ -2202,28 +2202,28 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
+def @arg13 250 16777215 10 Y 0 31 8
+def @arg14 250 16777215 19 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+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 ;
@@ -2240,28 +2240,28 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
+def @arg13 250 16777215 0 Y 0 31 8
+def @arg14 250 16777215 0 Y 0 31 8
+def @arg15 250 16777215 19 Y 0 31 8
+def @arg16 250 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 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+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" ;
@@ -2585,10 +2585,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -2608,10 +2608,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -2631,10 +2631,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -2654,10 +2654,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -2679,10 +2679,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -2704,10 +2704,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -2729,10 +2729,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -2754,10 +2754,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -2822,10 +2822,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+54 5 54 54 54 54 54 54 54 54 54 54
+55 6 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56 56 56 56 56 56 56 56
+57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -3039,7 +3039,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
diff --git a/mysql-test/suite/maria/t/maria-connect.test b/mysql-test/suite/maria/t/maria-connect.test
index 9efb5844bc2..79ba45d2b13 100644
--- a/mysql-test/suite/maria/t/maria-connect.test
+++ b/mysql-test/suite/maria/t/maria-connect.test
@@ -27,7 +27,7 @@ insert t1 values (1),(2),(3);
--error ER_DUP_ENTRY
insert t1 values (4),(2),(5);
select * from t1;
-SHOW BINLOG EVENTS FROM 106;
+SHOW BINLOG EVENTS FROM 107;
drop table t1;
set binlog_format=default;
diff --git a/mysql-test/suite/maria/t/maria-no-logging.test b/mysql-test/suite/maria/t/maria-no-logging.test
index f0533686588..7055a842510 100644
--- a/mysql-test/suite/maria/t/maria-no-logging.test
+++ b/mysql-test/suite/maria/t/maria-no-logging.test
@@ -4,7 +4,7 @@
# can't restart server in embedded
--source include/not_embedded.inc
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
--disable_warnings
drop database if exists mysqltest;
diff --git a/mysql-test/suite/maria/t/maria-preload-master.opt b/mysql-test/suite/maria/t/maria-preload-master.opt
deleted file mode 100644
index 959cf74c816..00000000000
--- a/mysql-test/suite/maria/t/maria-preload-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-safemalloc
diff --git a/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
index a943185d12f..b39b36ed3e1 100644
--- a/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
+++ b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
@@ -7,7 +7,7 @@
--source include/have_debug.inc
--source include/have_maria.inc
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
let $MARIA_LOG=.;
--disable_warnings
diff --git a/mysql-test/suite/maria/t/maria-recovery.test b/mysql-test/suite/maria/t/maria-recovery.test
index 6eb91c59dc1..b0f01f37d0d 100644
--- a/mysql-test/suite/maria/t/maria-recovery.test
+++ b/mysql-test/suite/maria/t/maria-recovery.test
@@ -5,7 +5,7 @@
--source include/have_debug.inc
--source include/have_maria.inc
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
let $MARIA_LOG=../../tmp;
--disable_warnings
diff --git a/mysql-test/suite/maria/t/maria-recovery2.test b/mysql-test/suite/maria/t/maria-recovery2.test
index 81ea45fbd42..c1081d033ac 100644
--- a/mysql-test/suite/maria/t/maria-recovery2.test
+++ b/mysql-test/suite/maria/t/maria-recovery2.test
@@ -8,7 +8,7 @@
call mtr.add_suppression("File '.*aria_log.000.*' not found \\(Errcode: 2\\)");
call mtr.add_suppression("Table '.\/mysqltest\/t_corrupted1' is crashed, skipping it. Please repair it with aria_chk -r");
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
let $MARIA_LOG=../../tmp;
--disable_warnings
diff --git a/mysql-test/suite/maria/t/maria-recovery3.test b/mysql-test/suite/maria/t/maria-recovery3.test
index 192361633ca..a5fd55499a2 100644
--- a/mysql-test/suite/maria/t/maria-recovery3.test
+++ b/mysql-test/suite/maria/t/maria-recovery3.test
@@ -5,7 +5,7 @@
--source include/have_debug.inc
--source include/have_maria.inc
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
let $MARIA_LOG=../../tmp;
--disable_warnings
diff --git a/mysql-test/suite/maria/t/maria.test b/mysql-test/suite/maria/t/maria.test
index ccbe2c99037..482f49d2ca1 100644
--- a/mysql-test/suite/maria/t/maria.test
+++ b/mysql-test/suite/maria/t/maria.test
@@ -14,7 +14,7 @@ set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
let $default_log_file_size=`select @@global.aria_log_file_size`;
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
# Initialise
--disable_warnings
@@ -551,6 +551,7 @@ commit;
disconnect root;
connection default;
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
+unlock tables;
drop table t1,t2;
set autocommit=1;
#
@@ -569,6 +570,7 @@ disconnect con1;
connection default;
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
+unlock tables;
DROP TABLE t1,t2;
#
@@ -1793,6 +1795,7 @@ lock table t1 write concurrent;
# should be fixed with fully implemented versioning
--error ER_CHECK_NOT_IMPLEMENTED
delete from t1;
+unlock tables;
drop table t1;
#
@@ -1852,16 +1855,6 @@ alter table t1 partition by list (s1) (partition p1 values in (2));
drop table t1;
#
-# Bug #39226 Aria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES
-
-create table t1 (c1 int);
-create table t2 (c1 int);
-lock table t1 read, t2 read;
-flush tables with read lock;
-unlock tables;
-drop table t1, t2;
-
-#
# Bug #40311
# Crash when aborting inserting of row with 2 blobs where first is short
#
diff --git a/mysql-test/suite/maria/t/maria2.test b/mysql-test/suite/maria/t/maria2.test
index 00bbea165ee..df691569e05 100644
--- a/mysql-test/suite/maria/t/maria2.test
+++ b/mysql-test/suite/maria/t/maria2.test
@@ -83,6 +83,7 @@ insert into t1 values (2);
alter table t1 modify i bigint default 1;
select count(*) from t1;
select * from t1;
+unlock tables;
drop table t1,t2;
#
diff --git a/mysql-test/suite/maria/t/maria3.test b/mysql-test/suite/maria/t/maria3.test
index 55b5959a970..3cf395f66e7 100644
--- a/mysql-test/suite/maria/t/maria3.test
+++ b/mysql-test/suite/maria/t/maria3.test
@@ -8,7 +8,7 @@ set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
let $default_log_file_size=`select @@global.aria_log_file_size`;
-set global aria_log_file_size=4294967295;
+set global aria_log_file_size=4294959104;
# Initialise
--disable_warnings
diff --git a/mysql-test/suite/parts/r/partition_repair_myisam.result b/mysql-test/suite/parts/r/partition_repair_myisam.result
index 4af00ddcc6d..2d0a26b397c 100644
--- a/mysql-test/suite/parts/r/partition_repair_myisam.result
+++ b/mysql-test/suite/parts/r/partition_repair_myisam.result
@@ -408,7 +408,7 @@ ALTER TABLE t1_will_crash CHECK PARTITION p6;
Table Op Msg_type Msg_text
test.t1_will_crash check warning Size of datafile is: 868 Should be: 604
test.t1_will_crash check error Record-count is not ok; is 8 Should be: 7
-test.t1_will_crash check warning Found 10 parts. Should be: 7
+test.t1_will_crash check warning Found 10 key parts. Should be: 7
test.t1_will_crash check error Partition p6 returned error
test.t1_will_crash check error Corrupt
ALTER TABLE t1_will_crash REPAIR PARTITION p6;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 18d2addb295..cf47b9de3f1 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -133,14 +133,14 @@ partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR 42000: Too many key parts specified; max 32 parts allowed
+ERROR HY000: Too many fields in 'list of partition fields'
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine='InnoDB'
partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) (
partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR HY000: Too many fields in 'list of partition fields'
+drop table t1;
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='InnoDB'
partition by key(a,b,c,d,e,f,g,h) (
partition pa1 max_rows=20 min_rows=2,
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index b4647a2a803..828be71c437 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -133,14 +133,14 @@ partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR 42000: Too many key parts specified; max 32 parts allowed
+ERROR HY000: Too many fields in 'list of partition fields'
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine='MyISAM'
partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) (
partition pa1 max_rows=20 min_rows=2,
partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
-ERROR HY000: Too many fields in 'list of partition fields'
+drop table t1;
create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='MyISAM'
partition by key(a,b,c,d,e,f,g,h) (
partition pa1 max_rows=20 min_rows=2,
diff --git a/mysql-test/suite/parts/t/partition_debug_innodb.test b/mysql-test/suite/parts/t/partition_debug_innodb.test
index c5d8df33213..ba7ca3059ae 100644
--- a/mysql-test/suite/parts/t/partition_debug_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_innodb.test
@@ -5,6 +5,7 @@
--source include/have_innodb.inc
--source include/have_partition.inc
--source include/not_valgrind.inc
+--source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/parts/t/partition_debug_myisam-master.opt b/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
index 425fda95086..24264558cf0 100644
--- a/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
+++ b/mysql-test/suite/parts/t/partition_debug_myisam-master.opt
@@ -1 +1 @@
---skip-stack-trace --skip-core-file
+--skip-stack-trace --skip-core-file --myisam-recover-option=off
diff --git a/mysql-test/suite/parts/t/partition_debug_myisam.test b/mysql-test/suite/parts/t/partition_debug_myisam.test
index a4d5ee4bf04..98560827ca9 100644
--- a/mysql-test/suite/parts/t/partition_debug_myisam.test
+++ b/mysql-test/suite/parts/t/partition_debug_myisam.test
@@ -4,6 +4,7 @@
--source include/have_debug.inc
--source include/have_partition.inc
--source include/not_valgrind.inc
+--source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
index c610ea42924..115a0ba2cc8 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
@@ -1 +1 @@
---loose-innodb_file_per_table=1
+--loose-innodb_file_per_table
diff --git a/mysql-test/suite/parts/t/partition_special_innodb-master.opt b/mysql-test/suite/parts/t/partition_special_innodb-master.opt
index c69292bfe7a..79851bac7b2 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb-master.opt
+++ b/mysql-test/suite/parts/t/partition_special_innodb-master.opt
@@ -1 +1 @@
---loose-innodb-lock-wait-timeout=2 --loose-innodb-file-per-table=1
+--loose-innodb-lock-wait-timeout=2 --loose-innodb-file-per-table
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.test b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
index b0882a18dc1..7a7f0e5ddb7 100644
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.test
+++ b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
@@ -1,4 +1,4 @@
---source include/have_innodb.inc
+--source include/have_xtradb.inc
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
diff --git a/mysql-test/suite/percona/percona_innodb_doublewrite_file.test b/mysql-test/suite/percona/percona_innodb_doublewrite_file.test
index 8068d561190..d9e94db8463 100644
--- a/mysql-test/suite/percona/percona_innodb_doublewrite_file.test
+++ b/mysql-test/suite/percona/percona_innodb_doublewrite_file.test
@@ -1,2 +1,2 @@
---source include/have_innodb.inc
+--source include/have_xtradb.inc
show variables like 'innodb_doublewrite%';
diff --git a/mysql-test/suite/percona/percona_innodb_use_sys_stats_table-master.opt b/mysql-test/suite/percona/percona_innodb_use_sys_stats_table-master.opt
index c6865f5704c..7479e2036aa 100644
--- a/mysql-test/suite/percona/percona_innodb_use_sys_stats_table-master.opt
+++ b/mysql-test/suite/percona/percona_innodb_use_sys_stats_table-master.opt
@@ -1 +1 @@
---innodb_use_sys_stats_table
+--loose-innodb_use_sys_stats_table
diff --git a/mysql-test/suite/percona/percona_innodb_use_sys_stats_table.test b/mysql-test/suite/percona/percona_innodb_use_sys_stats_table.test
index 02791137f08..534b26a3b45 100644
--- a/mysql-test/suite/percona/percona_innodb_use_sys_stats_table.test
+++ b/mysql-test/suite/percona/percona_innodb_use_sys_stats_table.test
@@ -1,2 +1,2 @@
---source include/have_innodb.inc
+--source include/have_xtradb.inc
show variables like 'innodb_use_sys_stats%';
diff --git a/mysql-test/suite/percona/percona_xtradb_admin_command.test b/mysql-test/suite/percona/percona_xtradb_admin_command.test
index 5dc3fb2b33a..b675c2afa21 100644
--- a/mysql-test/suite/percona/percona_xtradb_admin_command.test
+++ b/mysql-test/suite/percona/percona_xtradb_admin_command.test
@@ -1,3 +1,3 @@
---source include/have_innodb.inc
+--source include/have_xtradb.inc
select * from information_schema.XTRADB_ADMIN_COMMAND;
select * from information_schema.XTRADB_ADMIN_COMMAND /*!XTRA_HELLO*/;
diff --git a/mysql-test/suite/percona/percona_xtradb_bug317074.test b/mysql-test/suite/percona/percona_xtradb_bug317074.test
index abf5d8ee1f6..029e0f8fcdf 100644
--- a/mysql-test/suite/percona/percona_xtradb_bug317074.test
+++ b/mysql-test/suite/percona/percona_xtradb_bug317074.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_xtradb.inc
SET @old_innodb_file_format=@@innodb_file_format;
SET @old_innodb_file_per_table=@@innodb_file_per_table;
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade.result b/mysql-test/suite/perfschema/r/pfs_upgrade.result
index 31d12598357..08991726796 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 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 1118: Unexpected content found in the performance_schema database.
+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.
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 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 1118: Unexpected content found in the performance_schema database.
+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.
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 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 1118: Unexpected content found in the performance_schema database.
+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.
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 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 1118: Unexpected content found in the performance_schema database.
+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.
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 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 1118: Unexpected content found in the performance_schema database.
+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.
FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/t/no_threads-master.opt b/mysql-test/suite/perfschema/t/no_threads-master.opt
index 0dfb498094a..63784bf7c66 100644
--- a/mysql-test/suite/perfschema/t/no_threads-master.opt
+++ b/mysql-test/suite/perfschema/t/no_threads-master.opt
@@ -1 +1 @@
---one-thread --thread-handling=no-threads --loose-performance-schema-max-thread_instances=10 --default-storage-engine=MyISAM --skip-innodb
+--one-thread --thread-handling=no-threads --loose-performance-schema-max-thread_instances=10 --default-storage-engine=MyISAM
diff --git a/mysql-test/suite/rpl/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result
index af6b33966e9..a451b2e581a 100644
--- a/mysql-test/suite/rpl/r/rpl_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_ddl.result
@@ -878,11 +878,11 @@ 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
+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
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-------- switch to master -------
@@ -927,13 +927,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
-t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
+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
-t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
+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 NULL NULL NULL YES BTREE
-------- switch to master -------
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 b336fc12d42..ecc2987576c 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
@@ -9,7 +9,7 @@ USE mysqlslap;
select @@global.binlog_format;
@@global.binlog_format
MIXED
-CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
+CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
FLUSH TABLE t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
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 47ce547fcac..7a5c6533641 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
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 8c4bcf48a65..542e9dfd6cb 100644
--- a/mysql-test/suite/rpl/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
@@ -5,7 +5,6 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop tables if exists t1;
-CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
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;
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index 70e1d2f06e8..f529170d05e 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -82,14 +82,15 @@ master-bin.000005 #
master-bin.000006 #
master-bin.000007 #
master-bin.000008 #
+master-bin.000009 #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000008 # <Binlog_Do_DB> <Binlog_Ignore_DB>
+master-bin.000009 # <Binlog_Do_DB> <Binlog_Ignore_DB>
select * from t4;
a
testing temporary tables part 2
-Master_Log_File master-bin.000008
-Relay_Master_Log_File master-bin.000008
+Master_Log_File master-bin.000009
+Relay_Master_Log_File master-bin.000009
Checking that both slave threads are running.
lock tables t3 read;
select count(*) from t3 where n >= 4;
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 b9480abd4b8..d9e70ce95c5 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
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
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 cb095ad561e..4b2948f9382 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
@@ -1,17 +1,17 @@
-CREATE TABLE t1 (c1 char(50));
+CREATE TABLE t1 (c1 char(50)) engine=myisam;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO 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 (c1 char(50))
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (c1 char(50)) engine=myisam
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # 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 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 74eb14d33e0..13a5c179520 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -416,7 +416,7 @@ Rpl_semi_sync_slave_status OFF
# Test non-semi-sync slave connect to semi-sync master
#
set sql_log_bin=0;
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_PLUGIN';
+INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 5000;
/* 5s */
set sql_log_bin=1;
@@ -435,7 +435,7 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
include/stop_slave.inc
[ reinstall semi-sync slave plugin and disable semi-sync ]
-INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_PLUGIN';
+INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_SO';
set global rpl_semi_sync_slave_enabled= 0;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
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 6f53ad68d76..e48f1a7d0f3 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
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_stm_maria.result b/mysql-test/suite/rpl/r/rpl_stm_maria.result
index 1fe1fd87349..3a3ba256325 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_maria.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_maria.result
@@ -4,7 +4,7 @@ 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.');
+CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format');
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
index 11c648dece5..5d687006b76 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
@@ -6,19 +6,7 @@
# Options: --skip-name-resolve, master: --bind-address=0.0.0.0, slave: --bind-address=::
# (see corresponding cnf file)
#
-# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
---disable_query_log
---disable_abort_on_error
-connect (checkcon123456789,::1,root,,test,$SLAVE_MYPORT);
-if($mysql_errno)
-{
-skip wrong IP for slave;
-}
-connection default;
-disconnect checkcon123456789;
---enable_abort_on_error
---enable_query_log
-# end check
+--source include/check_ipv6.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
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 6e1d3286f07..1a32c388921 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
@@ -6,4 +6,5 @@
--source include/have_innodb.inc
--let $engine=Innodb
+set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
index 937ca5ed653..cd04c2ccc0b 100644
--- a/mysql-test/suite/rpl/t/rpl_relayspace.test
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
@@ -5,7 +5,7 @@ source include/master-slave.inc;
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/wait_for_slave_to_stop.inc;
connection master;
# This will generate a master's binlog > 10 bytes
create table t1 (a int);
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 5c3b163eea3..8b54878a203 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
@@ -6,4 +6,5 @@
--source include/have_innodb.inc
--let $engine=Innodb
+set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test b/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
index 1a4b1c1306d..cef259687fb 100644
--- a/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
+++ b/mysql-test/suite/rpl/t/rpl_row_loaddata_concurrent.test
@@ -3,7 +3,7 @@
-- source include/have_binlog_format_row.inc
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
-CREATE TABLE t1 (c1 char(50));
+CREATE TABLE t1 (c1 char(50)) engine=myisam;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE t1;
-- source include/show_binlog_events.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/rpl/t/rpl_semi_sync-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/rpl/t/rpl_semi_sync-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 1bf4f1a3396..17fa67e97e3 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -61,7 +61,7 @@ let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled',
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
- eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 5000; /* 5s */
set sql_log_bin=1;
}
@@ -126,7 +126,7 @@ let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', V
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
- eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
set sql_log_bin=1;
}
enable_query_log;
@@ -566,8 +566,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
connection master;
set sql_log_bin=0;
-replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_PLUGIN;
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+replace_result $SEMISYNC_MASTER_SO SEMISYNC_MASTER_SO;
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 5000; /* 5s */
set sql_log_bin=1;
set global rpl_semi_sync_master_enabled= 1;
@@ -585,8 +585,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
source include/stop_slave.inc;
echo [ reinstall semi-sync slave plugin and disable semi-sync ];
-replace_result $SEMISYNC_SLAVE_PLUGIN SEMISYNC_SLAVE_PLUGIN;
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+replace_result $SEMISYNC_SLAVE_SO SEMISYNC_SLAVE_SO;
+eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
set global rpl_semi_sync_slave_enabled= 0;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
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 3c4a05d640c..78be60a4852 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 @@
-$SEMISYNC_PLUGIN_OPT --max-connections=23
+--max-connections=23
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
index feb885ce07b..3b68441141a 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -23,7 +23,7 @@ let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled',
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
- eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+ eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
SET GLOBAL rpl_semi_sync_master_enabled = 1;
set sql_log_bin=1;
}
@@ -37,7 +37,7 @@ let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', V
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
- eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+ eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
set sql_log_bin=1;
}
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 87dd3eb3295..f3a4b174ab3 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
@@ -6,4 +6,5 @@
--source include/have_innodb.inc
--let $engine=Innodb
+set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_maria.test b/mysql-test/suite/rpl/t/rpl_stm_maria.test
index b4dc0ef7e4a..6a37e390716 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_maria.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_maria.test
@@ -5,7 +5,7 @@
--source include/master-slave.inc
# Suppress warnings that rand() is unsafe in statement binlog mode
-CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
+CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format');
--disable_warnings
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result
index 7f6dca3eb7b..0f741ff930a 100644
--- a/mysql-test/suite/sys_vars/r/all_vars.result
+++ b/mysql-test/suite/sys_vars/r/all_vars.result
@@ -10,7 +10,5 @@ There should be *no* long test name listed below:
select variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
There should be *no* variables listed below:
-INNODB_FILE_FORMAT_MAX
-INNODB_FILE_FORMAT_MAX
drop table t1;
drop table t2;
diff --git a/mysql-test/suite/sys_vars/r/aria_block_size_basic.result b/mysql-test/suite/sys_vars/r/aria_block_size_basic.result
new file mode 100644
index 00000000000..ba7f494de1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_block_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.aria_block_size;
+@@global.aria_block_size
+8192
+select @@session.aria_block_size;
+ERROR HY000: Variable 'aria_block_size' is a GLOBAL variable
+show global variables like 'aria_block_size';
+Variable_name Value
+aria_block_size 8192
+show session variables like 'aria_block_size';
+Variable_name Value
+aria_block_size 8192
+select * from information_schema.global_variables where variable_name='aria_block_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_BLOCK_SIZE 8192
+select * from information_schema.session_variables where variable_name='aria_block_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_BLOCK_SIZE 8192
+set global aria_block_size=1;
+ERROR HY000: Variable 'aria_block_size' is a read only variable
+set session aria_block_size=1;
+ERROR HY000: Variable 'aria_block_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/aria_checkpoint_interval_basic.result b/mysql-test/suite/sys_vars/r/aria_checkpoint_interval_basic.result
new file mode 100644
index 00000000000..a49a5794f11
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_checkpoint_interval_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.aria_checkpoint_interval;
+select @@global.aria_checkpoint_interval;
+@@global.aria_checkpoint_interval
+30
+select @@session.aria_checkpoint_interval;
+ERROR HY000: Variable 'aria_checkpoint_interval' is a GLOBAL variable
+show global variables like 'aria_checkpoint_interval';
+Variable_name Value
+aria_checkpoint_interval 30
+show session variables like 'aria_checkpoint_interval';
+Variable_name Value
+aria_checkpoint_interval 30
+select * from information_schema.global_variables where variable_name='aria_checkpoint_interval';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_CHECKPOINT_INTERVAL 30
+select * from information_schema.session_variables where variable_name='aria_checkpoint_interval';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_CHECKPOINT_INTERVAL 30
+set global aria_checkpoint_interval=1;
+select @@global.aria_checkpoint_interval;
+@@global.aria_checkpoint_interval
+1
+set session aria_checkpoint_interval=1;
+ERROR HY000: Variable 'aria_checkpoint_interval' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_checkpoint_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_checkpoint_interval'
+set global aria_checkpoint_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_checkpoint_interval'
+set global aria_checkpoint_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_checkpoint_interval'
+set global aria_checkpoint_interval=0;
+select @@global.aria_checkpoint_interval;
+@@global.aria_checkpoint_interval
+0
+set global aria_checkpoint_interval=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_checkpoint_interval value: '18446744073709551615'
+select @@global.aria_checkpoint_interval;
+@@global.aria_checkpoint_interval
+4294967295
+SET @@global.aria_checkpoint_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_force_start_after_recovery_failures_basic.result b/mysql-test/suite/sys_vars/r/aria_force_start_after_recovery_failures_basic.result
new file mode 100644
index 00000000000..be0056507a7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_force_start_after_recovery_failures_basic.result
@@ -0,0 +1,21 @@
+select @@global.aria_force_start_after_recovery_failures;
+@@global.aria_force_start_after_recovery_failures
+0
+select @@session.aria_force_start_after_recovery_failures;
+ERROR HY000: Variable 'aria_force_start_after_recovery_failures' is a GLOBAL variable
+show global variables like 'aria_force_start_after_recovery_failures';
+Variable_name Value
+aria_force_start_after_recovery_failures 0
+show session variables like 'aria_force_start_after_recovery_failures';
+Variable_name Value
+aria_force_start_after_recovery_failures 0
+select * from information_schema.global_variables where variable_name='aria_force_start_after_recovery_failures';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_FORCE_START_AFTER_RECOVERY_FAILURES 0
+select * from information_schema.session_variables where variable_name='aria_force_start_after_recovery_failures';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_FORCE_START_AFTER_RECOVERY_FAILURES 0
+set global aria_force_start_after_recovery_failures=1;
+ERROR HY000: Variable 'aria_force_start_after_recovery_failures' is a read only variable
+set session aria_force_start_after_recovery_failures=1;
+ERROR HY000: Variable 'aria_force_start_after_recovery_failures' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/aria_group_commit_basic.result b/mysql-test/suite/sys_vars/r/aria_group_commit_basic.result
new file mode 100644
index 00000000000..fb6e887bb21
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_group_commit_basic.result
@@ -0,0 +1,45 @@
+SET @start_global_value = @@global.aria_group_commit;
+select @@global.aria_group_commit;
+@@global.aria_group_commit
+none
+select @@session.aria_group_commit;
+ERROR HY000: Variable 'aria_group_commit' is a GLOBAL variable
+show global variables like 'aria_group_commit';
+Variable_name Value
+aria_group_commit none
+show session variables like 'aria_group_commit';
+Variable_name Value
+aria_group_commit none
+select * from information_schema.global_variables where variable_name='aria_group_commit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_GROUP_COMMIT none
+select * from information_schema.session_variables where variable_name='aria_group_commit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_GROUP_COMMIT none
+set global aria_group_commit=1;
+select @@global.aria_group_commit;
+@@global.aria_group_commit
+hard
+set session aria_group_commit=1;
+ERROR HY000: Variable 'aria_group_commit' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_group_commit=none;
+select @@global.aria_group_commit;
+@@global.aria_group_commit
+none
+set global aria_group_commit=hard;
+select @@global.aria_group_commit;
+@@global.aria_group_commit
+hard
+set global aria_group_commit=soft;
+select @@global.aria_group_commit;
+@@global.aria_group_commit
+soft
+set global aria_group_commit=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_group_commit'
+set global aria_group_commit=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_group_commit'
+set global aria_group_commit="foo";
+ERROR 42000: Variable 'aria_group_commit' can't be set to the value of 'foo'
+set global aria_group_commit=3;
+ERROR 42000: Variable 'aria_group_commit' can't be set to the value of '3'
+SET @@global.aria_group_commit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_group_commit_interval_basic.result b/mysql-test/suite/sys_vars/r/aria_group_commit_interval_basic.result
new file mode 100644
index 00000000000..3cec802b3dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_group_commit_interval_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.aria_group_commit_interval;
+select @@global.aria_group_commit_interval;
+@@global.aria_group_commit_interval
+0
+select @@session.aria_group_commit_interval;
+ERROR HY000: Variable 'aria_group_commit_interval' is a GLOBAL variable
+show global variables like 'aria_group_commit_interval';
+Variable_name Value
+aria_group_commit_interval 0
+show session variables like 'aria_group_commit_interval';
+Variable_name Value
+aria_group_commit_interval 0
+select * from information_schema.global_variables where variable_name='aria_group_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_GROUP_COMMIT_INTERVAL 0
+select * from information_schema.session_variables where variable_name='aria_group_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_GROUP_COMMIT_INTERVAL 0
+set global aria_group_commit_interval=1;
+select @@global.aria_group_commit_interval;
+@@global.aria_group_commit_interval
+1
+set session aria_group_commit_interval=1;
+ERROR HY000: Variable 'aria_group_commit_interval' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_group_commit_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_group_commit_interval'
+set global aria_group_commit_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_group_commit_interval'
+set global aria_group_commit_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_group_commit_interval'
+set global aria_group_commit_interval=0;
+select @@global.aria_group_commit_interval;
+@@global.aria_group_commit_interval
+0
+set global aria_group_commit_interval=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_group_commit_interval value: '18446744073709551615'
+select @@global.aria_group_commit_interval;
+@@global.aria_group_commit_interval
+4294967295
+SET @@global.aria_group_commit_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_log_file_size_basic.result b/mysql-test/suite/sys_vars/r/aria_log_file_size_basic.result
new file mode 100644
index 00000000000..ae823df4bf7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_log_file_size_basic.result
@@ -0,0 +1,53 @@
+SET @start_global_value = @@global.aria_log_file_size;
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+1073741824
+select @@session.aria_log_file_size;
+ERROR HY000: Variable 'aria_log_file_size' is a GLOBAL variable
+show global variables like 'aria_log_file_size';
+Variable_name Value
+aria_log_file_size 1073741824
+show session variables like 'aria_log_file_size';
+Variable_name Value
+aria_log_file_size 1073741824
+select * from information_schema.global_variables where variable_name='aria_log_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_FILE_SIZE 1073741824
+select * from information_schema.session_variables where variable_name='aria_log_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_FILE_SIZE 1073741824
+set global aria_log_file_size=1024*1024*10;
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+10485760
+set session aria_log_file_size=1;
+ERROR HY000: Variable 'aria_log_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_log_file_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_log_file_size'
+set global aria_log_file_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_log_file_size'
+set global aria_log_file_size="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_log_file_size'
+set global aria_log_file_size=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '1'
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+8388608
+set global aria_log_file_size=@@global.aria_log_file_size + 8192 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '8396799'
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+8388608
+set global aria_log_file_size=@@global.aria_log_file_size + 8192;
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+8396800
+set global aria_log_file_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '18446744073709551615'
+select @@global.aria_log_file_size;
+@@global.aria_log_file_size
+4294959104
+SET @@global.aria_log_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_log_purge_type_basic.result b/mysql-test/suite/sys_vars/r/aria_log_purge_type_basic.result
new file mode 100644
index 00000000000..1e6acad97d1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_log_purge_type_basic.result
@@ -0,0 +1,45 @@
+SET @start_global_value = @@global.aria_log_purge_type;
+select @@global.aria_log_purge_type;
+@@global.aria_log_purge_type
+immediate
+select @@session.aria_log_purge_type;
+ERROR HY000: Variable 'aria_log_purge_type' is a GLOBAL variable
+show global variables like 'aria_log_purge_type';
+Variable_name Value
+aria_log_purge_type immediate
+show session variables like 'aria_log_purge_type';
+Variable_name Value
+aria_log_purge_type immediate
+select * from information_schema.global_variables where variable_name='aria_log_purge_type';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_PURGE_TYPE immediate
+select * from information_schema.session_variables where variable_name='aria_log_purge_type';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_PURGE_TYPE immediate
+set global aria_log_purge_type=1;
+select @@global.aria_log_purge_type;
+@@global.aria_log_purge_type
+external
+set session aria_log_purge_type=1;
+ERROR HY000: Variable 'aria_log_purge_type' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_log_purge_type=immediate;
+select @@global.aria_log_purge_type;
+@@global.aria_log_purge_type
+immediate
+set global aria_log_purge_type=external;
+select @@global.aria_log_purge_type;
+@@global.aria_log_purge_type
+external
+set global aria_log_purge_type=at_flush;
+select @@global.aria_log_purge_type;
+@@global.aria_log_purge_type
+at_flush
+set global aria_log_purge_type=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_log_purge_type'
+set global aria_log_purge_type=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_log_purge_type'
+set global aria_log_purge_type="foo";
+ERROR 42000: Variable 'aria_log_purge_type' can't be set to the value of 'foo'
+set global aria_log_purge_type=3;
+ERROR 42000: Variable 'aria_log_purge_type' can't be set to the value of '3'
+SET @@global.aria_log_purge_type = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_max_sort_file_size_basic.result b/mysql-test/suite/sys_vars/r/aria_max_sort_file_size_basic.result
new file mode 100644
index 00000000000..83421bfc730
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_max_sort_file_size_basic.result
@@ -0,0 +1,53 @@
+SET @start_global_value = @@global.aria_max_sort_file_size;
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+9223372036853727232
+select @@session.aria_max_sort_file_size;
+ERROR HY000: Variable 'aria_max_sort_file_size' is a GLOBAL variable
+show global variables like 'aria_max_sort_file_size';
+Variable_name Value
+aria_max_sort_file_size 9223372036853727232
+show session variables like 'aria_max_sort_file_size';
+Variable_name Value
+aria_max_sort_file_size 9223372036853727232
+select * from information_schema.global_variables where variable_name='aria_max_sort_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+select * from information_schema.session_variables where variable_name='aria_max_sort_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+set global aria_max_sort_file_size=1024*1024*10;
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+10485760
+set session aria_max_sort_file_size=1;
+ERROR HY000: Variable 'aria_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_max_sort_file_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_max_sort_file_size'
+set global aria_max_sort_file_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_max_sort_file_size'
+set global aria_max_sort_file_size="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_max_sort_file_size'
+set global aria_max_sort_file_size=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '1'
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+0
+set global aria_max_sort_file_size=@@global.aria_max_sort_file_size + 1024*1024 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '1048575'
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+0
+set global aria_max_sort_file_size=@@global.aria_max_sort_file_size + 1024*1024;
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+1048576
+set global aria_max_sort_file_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '18446744073709551615'
+select @@global.aria_max_sort_file_size;
+@@global.aria_max_sort_file_size
+9223372036853727232
+SET @@global.aria_max_sort_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_page_checksum_basic.result b/mysql-test/suite/sys_vars/r/aria_page_checksum_basic.result
new file mode 100644
index 00000000000..4b30036a26a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_page_checksum_basic.result
@@ -0,0 +1,39 @@
+SET @start_global_value = @@global.aria_page_checksum;
+select @@global.aria_page_checksum;
+@@global.aria_page_checksum
+1
+select @@session.aria_page_checksum;
+ERROR HY000: Variable 'aria_page_checksum' is a GLOBAL variable
+show global variables like 'aria_page_checksum';
+Variable_name Value
+aria_page_checksum ON
+show session variables like 'aria_page_checksum';
+Variable_name Value
+aria_page_checksum ON
+select * from information_schema.global_variables where variable_name='aria_page_checksum';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGE_CHECKSUM ON
+select * from information_schema.session_variables where variable_name='aria_page_checksum';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGE_CHECKSUM ON
+set global aria_page_checksum=ON;
+select @@global.aria_page_checksum;
+@@global.aria_page_checksum
+1
+set global aria_page_checksum=OFF;
+select @@global.aria_page_checksum;
+@@global.aria_page_checksum
+0
+set global aria_page_checksum=1;
+select @@global.aria_page_checksum;
+@@global.aria_page_checksum
+1
+set session aria_page_checksum=1;
+ERROR HY000: Variable 'aria_page_checksum' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_page_checksum=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_page_checksum'
+set global aria_page_checksum=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_page_checksum'
+set global aria_page_checksum="foo";
+ERROR 42000: Variable 'aria_page_checksum' can't be set to the value of 'foo'
+SET @@global.aria_page_checksum = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_age_threshold_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_age_threshold_basic.result
new file mode 100644
index 00000000000..cd4fb0a3c26
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_pagecache_age_threshold_basic.result
@@ -0,0 +1,53 @@
+SET @start_global_value = @@global.aria_pagecache_age_threshold;
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+300
+select @@session.aria_pagecache_age_threshold;
+ERROR HY000: Variable 'aria_pagecache_age_threshold' is a GLOBAL variable
+show global variables like 'aria_pagecache_age_threshold';
+Variable_name Value
+aria_pagecache_age_threshold 300
+show session variables like 'aria_pagecache_age_threshold';
+Variable_name Value
+aria_pagecache_age_threshold 300
+select * from information_schema.global_variables where variable_name='aria_pagecache_age_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_AGE_THRESHOLD 300
+select * from information_schema.session_variables where variable_name='aria_pagecache_age_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_AGE_THRESHOLD 300
+set global aria_pagecache_age_threshold=200;
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+200
+set session aria_pagecache_age_threshold=1;
+ERROR HY000: Variable 'aria_pagecache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_pagecache_age_threshold=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_age_threshold'
+set global aria_pagecache_age_threshold=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_age_threshold'
+set global aria_pagecache_age_threshold="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_age_threshold'
+set global aria_pagecache_age_threshold=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '1'
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+100
+set global aria_pagecache_age_threshold=@@global.aria_pagecache_age_threshold + 100 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '199'
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+100
+set global aria_pagecache_age_threshold=@@global.aria_pagecache_age_threshold + 100;
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+200
+set global aria_pagecache_age_threshold=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '18446744073709551615'
+select @@global.aria_pagecache_age_threshold;
+@@global.aria_pagecache_age_threshold
+18446744073709551600
+SET @@global.aria_pagecache_age_threshold = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result
new file mode 100644
index 00000000000..5f481b0b134
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.aria_pagecache_buffer_size;
+@@global.aria_pagecache_buffer_size
+134217728
+select @@session.aria_pagecache_buffer_size;
+ERROR HY000: Variable 'aria_pagecache_buffer_size' is a GLOBAL variable
+show global variables like 'aria_pagecache_buffer_size';
+Variable_name Value
+aria_pagecache_buffer_size 134217728
+show session variables like 'aria_pagecache_buffer_size';
+Variable_name Value
+aria_pagecache_buffer_size 134217728
+select * from information_schema.global_variables where variable_name='aria_pagecache_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_BUFFER_SIZE 134217728
+select * from information_schema.session_variables where variable_name='aria_pagecache_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_BUFFER_SIZE 134217728
+set global aria_pagecache_buffer_size=1;
+ERROR HY000: Variable 'aria_pagecache_buffer_size' is a read only variable
+set session aria_pagecache_buffer_size=1;
+ERROR HY000: Variable 'aria_pagecache_buffer_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_division_limit_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_division_limit_basic.result
new file mode 100644
index 00000000000..98aae5b3c01
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_pagecache_division_limit_basic.result
@@ -0,0 +1,43 @@
+SET @start_global_value = @@global.aria_pagecache_division_limit;
+select @@global.aria_pagecache_division_limit;
+@@global.aria_pagecache_division_limit
+100
+select @@session.aria_pagecache_division_limit;
+ERROR HY000: Variable 'aria_pagecache_division_limit' is a GLOBAL variable
+show global variables like 'aria_pagecache_division_limit';
+Variable_name Value
+aria_pagecache_division_limit 100
+show session variables like 'aria_pagecache_division_limit';
+Variable_name Value
+aria_pagecache_division_limit 100
+select * from information_schema.global_variables where variable_name='aria_pagecache_division_limit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_DIVISION_LIMIT 100
+select * from information_schema.session_variables where variable_name='aria_pagecache_division_limit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_DIVISION_LIMIT 100
+set global aria_pagecache_division_limit=20;
+select @@global.aria_pagecache_division_limit;
+@@global.aria_pagecache_division_limit
+20
+set session aria_pagecache_division_limit=1;
+ERROR HY000: Variable 'aria_pagecache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_pagecache_division_limit=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_division_limit'
+set global aria_pagecache_division_limit=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_division_limit'
+set global aria_pagecache_division_limit="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_pagecache_division_limit'
+set global aria_pagecache_division_limit=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_division_limit value: '0'
+select @@global.aria_pagecache_division_limit;
+@@global.aria_pagecache_division_limit
+1
+set global aria_pagecache_division_limit=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_division_limit value: '18446744073709551615'
+select @@global.aria_pagecache_division_limit;
+@@global.aria_pagecache_division_limit
+100
+SET @@global.aria_pagecache_division_limit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_recover_basic.result b/mysql-test/suite/sys_vars/r/aria_recover_basic.result
new file mode 100644
index 00000000000..ec275449c22
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_recover_basic.result
@@ -0,0 +1,53 @@
+SET @start_global_value = @@global.aria_recover;
+select @@global.aria_recover;
+@@global.aria_recover
+NORMAL
+select @@session.aria_recover;
+ERROR HY000: Variable 'aria_recover' is a GLOBAL variable
+show global variables like 'aria_recover';
+Variable_name Value
+aria_recover NORMAL
+show session variables like 'aria_recover';
+Variable_name Value
+aria_recover NORMAL
+select * from information_schema.global_variables where variable_name='aria_recover';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_RECOVER NORMAL
+select * from information_schema.session_variables where variable_name='aria_recover';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_RECOVER NORMAL
+set global aria_recover=1;
+select @@global.aria_recover;
+@@global.aria_recover
+NORMAL
+set session aria_recover=1;
+ERROR HY000: Variable 'aria_recover' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_recover=normal;
+select @@global.aria_recover;
+@@global.aria_recover
+NORMAL
+set global aria_recover=backup;
+select @@global.aria_recover;
+@@global.aria_recover
+BACKUP
+set global aria_recover='force';
+select @@global.aria_recover;
+@@global.aria_recover
+FORCE
+set global aria_recover='quick';
+select @@global.aria_recover;
+@@global.aria_recover
+QUICK
+set global aria_recover=off;
+select @@global.aria_recover;
+@@global.aria_recover
+OFF
+set global aria_recover=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_recover'
+set global aria_recover=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_recover'
+set global aria_recover="foo";
+ERROR 42000: Variable 'aria_recover' can't be set to the value of 'foo'
+set global aria_recover=5;
+ERROR 42000: Variable 'aria_recover' can't be set to the value of '5'
+SET @@global.aria_recover = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_repair_threads_basic.result b/mysql-test/suite/sys_vars/r/aria_repair_threads_basic.result
new file mode 100644
index 00000000000..b070191e212
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_repair_threads_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.aria_repair_threads;
+select @@global.aria_repair_threads;
+@@global.aria_repair_threads
+1
+select @@session.aria_repair_threads;
+@@session.aria_repair_threads
+1
+show global variables like 'aria_repair_threads';
+Variable_name Value
+aria_repair_threads 1
+show session variables like 'aria_repair_threads';
+Variable_name Value
+aria_repair_threads 1
+select * from information_schema.global_variables where variable_name='aria_repair_threads';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_REPAIR_THREADS 1
+select * from information_schema.session_variables where variable_name='aria_repair_threads';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_REPAIR_THREADS 1
+set global aria_repair_threads=10;
+select @@global.aria_repair_threads;
+@@global.aria_repair_threads
+10
+set session aria_repair_threads=10;
+select @@session.aria_repair_threads;
+@@session.aria_repair_threads
+10
+set global aria_repair_threads=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_repair_threads'
+set session aria_repair_threads=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_repair_threads'
+set global aria_repair_threads="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_repair_threads'
+set global aria_repair_threads=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_repair_threads value: '0'
+select @@global.aria_repair_threads;
+@@global.aria_repair_threads
+1
+set session aria_repair_threads=cast(-1 as unsigned int);
+select @@session.aria_repair_threads;
+@@session.aria_repair_threads
+18446744073709551615
+SET @@global.aria_repair_threads = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
new file mode 100644
index 00000000000..cf067c7e7b6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.aria_sort_buffer_size;
+select @@global.aria_sort_buffer_size;
+@@global.aria_sort_buffer_size
+134217728
+select @@session.aria_sort_buffer_size;
+@@session.aria_sort_buffer_size
+134217728
+show global variables like 'aria_sort_buffer_size';
+Variable_name Value
+aria_sort_buffer_size 134217728
+show session variables like 'aria_sort_buffer_size';
+Variable_name Value
+aria_sort_buffer_size 134217728
+select * from information_schema.global_variables where variable_name='aria_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SORT_BUFFER_SIZE 134217728
+select * from information_schema.session_variables where variable_name='aria_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SORT_BUFFER_SIZE 134217728
+set global aria_sort_buffer_size=10;
+select @@global.aria_sort_buffer_size;
+@@global.aria_sort_buffer_size
+10
+set session aria_sort_buffer_size=10;
+select @@session.aria_sort_buffer_size;
+@@session.aria_sort_buffer_size
+10
+set global aria_sort_buffer_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size'
+set session aria_sort_buffer_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size'
+set global aria_sort_buffer_size="foo";
+ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size'
+set global aria_sort_buffer_size=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '0'
+select @@global.aria_sort_buffer_size;
+@@global.aria_sort_buffer_size
+4
+set session aria_sort_buffer_size=cast(-1 as unsigned int);
+select @@session.aria_sort_buffer_size;
+@@session.aria_sort_buffer_size
+18446744073709551615
+SET @@global.aria_sort_buffer_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_stats_method_basic.result b/mysql-test/suite/sys_vars/r/aria_stats_method_basic.result
new file mode 100644
index 00000000000..4ebddcd36bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_stats_method_basic.result
@@ -0,0 +1,48 @@
+SET @start_global_value = @@global.aria_stats_method;
+select @@global.aria_stats_method;
+@@global.aria_stats_method
+nulls_unequal
+select @@session.aria_stats_method;
+@@session.aria_stats_method
+nulls_unequal
+show global variables like 'aria_stats_method';
+Variable_name Value
+aria_stats_method nulls_unequal
+show session variables like 'aria_stats_method';
+Variable_name Value
+aria_stats_method nulls_unequal
+select * from information_schema.global_variables where variable_name='aria_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_STATS_METHOD nulls_unequal
+select * from information_schema.session_variables where variable_name='aria_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_STATS_METHOD nulls_unequal
+set global aria_stats_method=1;
+select @@global.aria_stats_method;
+@@global.aria_stats_method
+nulls_equal
+set session aria_stats_method=1;
+select @@session.aria_stats_method;
+@@session.aria_stats_method
+nulls_equal
+set session aria_stats_method=nulls_unequal;
+select @@session.aria_stats_method;
+@@session.aria_stats_method
+nulls_unequal
+set session aria_stats_method=nulls_equal;
+select @@session.aria_stats_method;
+@@session.aria_stats_method
+nulls_equal
+set session aria_stats_method=nulls_ignored;
+select @@session.aria_stats_method;
+@@session.aria_stats_method
+nulls_ignored
+set session aria_stats_method=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_stats_method'
+set session aria_stats_method=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_stats_method'
+set session aria_stats_method="foo";
+ERROR 42000: Variable 'aria_stats_method' can't be set to the value of 'foo'
+set session aria_stats_method=3;
+ERROR 42000: Variable 'aria_stats_method' can't be set to the value of '3'
+SET @@global.aria_stats_method = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_sync_log_dir_basic.result b/mysql-test/suite/sys_vars/r/aria_sync_log_dir_basic.result
new file mode 100644
index 00000000000..02bcee466ee
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_sync_log_dir_basic.result
@@ -0,0 +1,45 @@
+SET @start_global_value = @@global.aria_sync_log_dir;
+select @@global.aria_sync_log_dir;
+@@global.aria_sync_log_dir
+NEWFILE
+select @@session.aria_sync_log_dir;
+ERROR HY000: Variable 'aria_sync_log_dir' is a GLOBAL variable
+show global variables like 'aria_sync_log_dir';
+Variable_name Value
+aria_sync_log_dir NEWFILE
+show session variables like 'aria_sync_log_dir';
+Variable_name Value
+aria_sync_log_dir NEWFILE
+select * from information_schema.global_variables where variable_name='aria_sync_log_dir';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SYNC_LOG_DIR NEWFILE
+select * from information_schema.session_variables where variable_name='aria_sync_log_dir';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SYNC_LOG_DIR NEWFILE
+set global aria_sync_log_dir=1;
+select @@global.aria_sync_log_dir;
+@@global.aria_sync_log_dir
+NEWFILE
+set session aria_sync_log_dir=1;
+ERROR HY000: Variable 'aria_sync_log_dir' is a GLOBAL variable and should be set with SET GLOBAL
+set global aria_sync_log_dir=never;
+select @@global.aria_sync_log_dir;
+@@global.aria_sync_log_dir
+NEVER
+set global aria_sync_log_dir=newfile;
+select @@global.aria_sync_log_dir;
+@@global.aria_sync_log_dir
+NEWFILE
+set global aria_sync_log_dir=always;
+select @@global.aria_sync_log_dir;
+@@global.aria_sync_log_dir
+ALWAYS
+set global aria_sync_log_dir=1.1;
+ERROR 42000: Incorrect argument type to variable 'aria_sync_log_dir'
+set global aria_sync_log_dir=1e1;
+ERROR 42000: Incorrect argument type to variable 'aria_sync_log_dir'
+set global aria_sync_log_dir="foo";
+ERROR 42000: Variable 'aria_sync_log_dir' can't be set to the value of 'foo'
+set global aria_sync_log_dir=3;
+ERROR 42000: Variable 'aria_sync_log_dir' can't be set to the value of '3'
+SET @@global.aria_sync_log_dir = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/aria_used_for_temp_tables_basic.result b/mysql-test/suite/sys_vars/r/aria_used_for_temp_tables_basic.result
new file mode 100644
index 00000000000..4c2e2e74337
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_used_for_temp_tables_basic.result
@@ -0,0 +1,21 @@
+select @@global.aria_used_for_temp_tables;
+@@global.aria_used_for_temp_tables
+1
+select @@session.aria_used_for_temp_tables;
+ERROR HY000: Variable 'aria_used_for_temp_tables' is a GLOBAL variable
+show global variables like 'aria_used_for_temp_tables';
+Variable_name Value
+aria_used_for_temp_tables ON
+show session variables like 'aria_used_for_temp_tables';
+Variable_name Value
+aria_used_for_temp_tables ON
+select * from information_schema.global_variables where variable_name='aria_used_for_temp_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_USED_FOR_TEMP_TABLES ON
+select * from information_schema.session_variables where variable_name='aria_used_for_temp_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_USED_FOR_TEMP_TABLES ON
+set global aria_used_for_temp_tables=1;
+ERROR HY000: Variable 'aria_used_for_temp_tables' is a read only variable
+set session aria_used_for_temp_tables=1;
+ERROR HY000: Variable 'aria_used_for_temp_tables' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/deadlock_search_depth_long_basic.result b/mysql-test/suite/sys_vars/r/deadlock_search_depth_long_basic.result
new file mode 100644
index 00000000000..7b51fa3614a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/deadlock_search_depth_long_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.deadlock_search_depth_long;
+select @@global.deadlock_search_depth_long;
+@@global.deadlock_search_depth_long
+15
+select @@session.deadlock_search_depth_long;
+@@session.deadlock_search_depth_long
+15
+show global variables like 'deadlock_search_depth_long';
+Variable_name Value
+deadlock_search_depth_long 15
+show session variables like 'deadlock_search_depth_long';
+Variable_name Value
+deadlock_search_depth_long 15
+select * from information_schema.global_variables where variable_name='deadlock_search_depth_long';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_SEARCH_DEPTH_LONG 15
+select * from information_schema.session_variables where variable_name='deadlock_search_depth_long';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_SEARCH_DEPTH_LONG 15
+set global deadlock_search_depth_long=10;
+select @@global.deadlock_search_depth_long;
+@@global.deadlock_search_depth_long
+10
+set session deadlock_search_depth_long=10;
+select @@session.deadlock_search_depth_long;
+@@session.deadlock_search_depth_long
+10
+set global deadlock_search_depth_long=1.1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_long'
+set session deadlock_search_depth_long=1e1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_long'
+set global deadlock_search_depth_long="foo";
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_long'
+set global deadlock_search_depth_long=0;
+select @@global.deadlock_search_depth_long;
+@@global.deadlock_search_depth_long
+0
+set session deadlock_search_depth_long=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect deadlock_search_depth_long value: '18446744073709551615'
+select @@session.deadlock_search_depth_long;
+@@session.deadlock_search_depth_long
+33
+SET @@global.deadlock_search_depth_long = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/deadlock_search_depth_short_basic.result b/mysql-test/suite/sys_vars/r/deadlock_search_depth_short_basic.result
new file mode 100644
index 00000000000..5aab1253c27
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/deadlock_search_depth_short_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.deadlock_search_depth_short;
+select @@global.deadlock_search_depth_short;
+@@global.deadlock_search_depth_short
+4
+select @@session.deadlock_search_depth_short;
+@@session.deadlock_search_depth_short
+4
+show global variables like 'deadlock_search_depth_short';
+Variable_name Value
+deadlock_search_depth_short 4
+show session variables like 'deadlock_search_depth_short';
+Variable_name Value
+deadlock_search_depth_short 4
+select * from information_schema.global_variables where variable_name='deadlock_search_depth_short';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_SEARCH_DEPTH_SHORT 4
+select * from information_schema.session_variables where variable_name='deadlock_search_depth_short';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_SEARCH_DEPTH_SHORT 4
+set global deadlock_search_depth_short=10;
+select @@global.deadlock_search_depth_short;
+@@global.deadlock_search_depth_short
+10
+set session deadlock_search_depth_short=10;
+select @@session.deadlock_search_depth_short;
+@@session.deadlock_search_depth_short
+10
+set global deadlock_search_depth_short=1.1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_short'
+set session deadlock_search_depth_short=1e1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_short'
+set global deadlock_search_depth_short="foo";
+ERROR 42000: Incorrect argument type to variable 'deadlock_search_depth_short'
+set global deadlock_search_depth_short=0;
+select @@global.deadlock_search_depth_short;
+@@global.deadlock_search_depth_short
+0
+set session deadlock_search_depth_short=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect deadlock_search_depth_short value: '18446744073709551615'
+select @@session.deadlock_search_depth_short;
+@@session.deadlock_search_depth_short
+32
+SET @@global.deadlock_search_depth_short = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/deadlock_timeout_long_basic.result b/mysql-test/suite/sys_vars/r/deadlock_timeout_long_basic.result
new file mode 100644
index 00000000000..8f76c6d3344
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/deadlock_timeout_long_basic.result
@@ -0,0 +1,42 @@
+SET @start_global_value = @@global.deadlock_timeout_long;
+select @@global.deadlock_timeout_long;
+@@global.deadlock_timeout_long
+50000000
+select @@session.deadlock_timeout_long;
+@@session.deadlock_timeout_long
+50000000
+show global variables like 'deadlock_timeout_long';
+Variable_name Value
+deadlock_timeout_long 50000000
+show session variables like 'deadlock_timeout_long';
+Variable_name Value
+deadlock_timeout_long 50000000
+select * from information_schema.global_variables where variable_name='deadlock_timeout_long';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_TIMEOUT_LONG 50000000
+select * from information_schema.session_variables where variable_name='deadlock_timeout_long';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_TIMEOUT_LONG 50000000
+set global deadlock_timeout_long=10;
+select @@global.deadlock_timeout_long;
+@@global.deadlock_timeout_long
+10
+set session deadlock_timeout_long=10;
+select @@session.deadlock_timeout_long;
+@@session.deadlock_timeout_long
+10
+set global deadlock_timeout_long=1.1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_long'
+set session deadlock_timeout_long=1e1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_long'
+set global deadlock_timeout_long="foo";
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_long'
+set global deadlock_timeout_long=0;
+select @@global.deadlock_timeout_long;
+@@global.deadlock_timeout_long
+0
+set session deadlock_timeout_long=cast(-1 as unsigned int);
+select @@session.deadlock_timeout_long;
+@@session.deadlock_timeout_long
+18446744073709551615
+SET @@global.deadlock_timeout_long = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/deadlock_timeout_short_basic.result b/mysql-test/suite/sys_vars/r/deadlock_timeout_short_basic.result
new file mode 100644
index 00000000000..f2bf4132bf7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/deadlock_timeout_short_basic.result
@@ -0,0 +1,42 @@
+SET @start_global_value = @@global.deadlock_timeout_short;
+select @@global.deadlock_timeout_short;
+@@global.deadlock_timeout_short
+10000
+select @@session.deadlock_timeout_short;
+@@session.deadlock_timeout_short
+10000
+show global variables like 'deadlock_timeout_short';
+Variable_name Value
+deadlock_timeout_short 10000
+show session variables like 'deadlock_timeout_short';
+Variable_name Value
+deadlock_timeout_short 10000
+select * from information_schema.global_variables where variable_name='deadlock_timeout_short';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_TIMEOUT_SHORT 10000
+select * from information_schema.session_variables where variable_name='deadlock_timeout_short';
+VARIABLE_NAME VARIABLE_VALUE
+DEADLOCK_TIMEOUT_SHORT 10000
+set global deadlock_timeout_short=10;
+select @@global.deadlock_timeout_short;
+@@global.deadlock_timeout_short
+10
+set session deadlock_timeout_short=10;
+select @@session.deadlock_timeout_short;
+@@session.deadlock_timeout_short
+10
+set global deadlock_timeout_short=1.1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_short'
+set session deadlock_timeout_short=1e1;
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_short'
+set global deadlock_timeout_short="foo";
+ERROR 42000: Incorrect argument type to variable 'deadlock_timeout_short'
+set global deadlock_timeout_short=0;
+select @@global.deadlock_timeout_short;
+@@global.deadlock_timeout_short
+0
+set session deadlock_timeout_short=cast(-1 as unsigned int);
+select @@session.deadlock_timeout_short;
+@@session.deadlock_timeout_short
+18446744073709551615
+SET @@global.deadlock_timeout_short = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result b/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result
new file mode 100644
index 00000000000..70f338ad305
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/debug_crc_break_basic.result
@@ -0,0 +1,39 @@
+SET @start_global_value = @@global.debug_crc_break;
+select @@global.debug_crc_break;
+@@global.debug_crc_break
+0
+select @@session.debug_crc_break;
+ERROR HY000: Variable 'debug_crc_break' is a GLOBAL variable
+show global variables like 'debug_crc_break';
+Variable_name Value
+debug_crc_break 0
+show session variables like 'debug_crc_break';
+Variable_name Value
+debug_crc_break 0
+select * from information_schema.global_variables where variable_name='debug_crc_break';
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG_CRC_BREAK 0
+select * from information_schema.session_variables where variable_name='debug_crc_break';
+VARIABLE_NAME VARIABLE_VALUE
+DEBUG_CRC_BREAK 0
+set global debug_crc_break=1;
+select @@global.debug_crc_break;
+@@global.debug_crc_break
+1
+set session debug_crc_break=1;
+ERROR HY000: Variable 'debug_crc_break' is a GLOBAL variable and should be set with SET GLOBAL
+set global debug_crc_break=1.1;
+ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
+set global debug_crc_break=1e1;
+ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
+set global debug_crc_break="foo";
+ERROR 42000: Incorrect argument type to variable 'debug_crc_break'
+set global debug_crc_break=0;
+select @@global.debug_crc_break;
+@@global.debug_crc_break
+0
+set global debug_crc_break=cast(-1 as unsigned int);
+select @@global.debug_crc_break;
+@@global.debug_crc_break
+18446744073709551615
+SET @@global.debug_crc_break = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
index c2acc7ab5ac..727e6ca88f2 100644
--- a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
@@ -1,11 +1,5 @@
SET @start_global_value = @@global.default_storage_engine;
-SELECT @start_global_value;
-@start_global_value
-InnoDB
SET @start_session_value = @@session.default_storage_engine;
-SELECT @start_session_value;
-@start_session_value
-InnoDB
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.default_storage_engine = INNODB;
SET @@global.default_storage_engine = DEFAULT;
@@ -108,10 +102,4 @@ SELECT default_storage_engine = @@session.default_storage_engine;
ERROR 42S22: Unknown column 'default_storage_engine' in 'field list'
SET @@default_storage_engine = @start_global_value;
SET @@global.default_storage_engine = @start_global_value;
-SELECT @@global.default_storage_engine;
-@@global.default_storage_engine
-InnoDB
SET @@session.default_storage_engine = @start_session_value;
-SELECT @@session.default_storage_engine;
-@@session.default_storage_engine
-InnoDB
diff --git a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
index 2b0b57d5b33..6ae736d14e2 100644
--- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
@@ -9,7 +9,7 @@ SELECT @global_start_value;
select @old_session_opt_switch:=@@session.optimizer_switch,
@old_global_opt_switch:=@@global.optimizer_switch;
@old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
'#--------------------FN_DYNVARS_028_01------------------------#'
SET @@session.engine_condition_pushdown = 0;
Warnings:
@@ -212,7 +212,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@session.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
@@ -220,7 +220,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@session.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
@@ -228,7 +228,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@global.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
@@ -236,7 +236,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@global.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
@@ -244,31 +244,31 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@session.optimizer_switch = "engine_condition_pushdown=on";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@session.optimizer_switch = "engine_condition_pushdown=off";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@global.optimizer_switch = "engine_condition_pushdown=on";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set @@global.optimizer_switch = "engine_condition_pushdown=off";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
SET @@session.engine_condition_pushdown = @session_start_value;
Warnings:
Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead
@@ -287,4 +287,4 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
diff --git a/mysql-test/suite/sys_vars/r/extra_max_connections_basic.result b/mysql-test/suite/sys_vars/r/extra_max_connections_basic.result
new file mode 100644
index 00000000000..353271cabb2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/extra_max_connections_basic.result
@@ -0,0 +1,43 @@
+SET @start_global_value = @@global.extra_max_connections;
+select @@global.extra_max_connections;
+@@global.extra_max_connections
+1
+select @@session.extra_max_connections;
+ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable
+show global variables like 'extra_max_connections';
+Variable_name Value
+extra_max_connections 1
+show session variables like 'extra_max_connections';
+Variable_name Value
+extra_max_connections 1
+select * from information_schema.global_variables where variable_name='extra_max_connections';
+VARIABLE_NAME VARIABLE_VALUE
+EXTRA_MAX_CONNECTIONS 1
+select * from information_schema.session_variables where variable_name='extra_max_connections';
+VARIABLE_NAME VARIABLE_VALUE
+EXTRA_MAX_CONNECTIONS 1
+set global extra_max_connections=1;
+select @@global.extra_max_connections;
+@@global.extra_max_connections
+1
+set session extra_max_connections=1;
+ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable and should be set with SET GLOBAL
+set global extra_max_connections=1.1;
+ERROR 42000: Incorrect argument type to variable 'extra_max_connections'
+set global extra_max_connections=1e1;
+ERROR 42000: Incorrect argument type to variable 'extra_max_connections'
+set global extra_max_connections="foo";
+ERROR 42000: Incorrect argument type to variable 'extra_max_connections'
+set global extra_max_connections=0;
+Warnings:
+Warning 1292 Truncated incorrect extra_max_connections value: '0'
+select @@global.extra_max_connections;
+@@global.extra_max_connections
+1
+set global extra_max_connections=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect extra_max_connections value: '18446744073709551615'
+select @@global.extra_max_connections;
+@@global.extra_max_connections
+100000
+SET @@global.extra_max_connections = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/extra_port_basic.result b/mysql-test/suite/sys_vars/r/extra_port_basic.result
new file mode 100644
index 00000000000..cbf6dbcb4f9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/extra_port_basic.result
@@ -0,0 +1,21 @@
+select @@global.extra_port;
+@@global.extra_port
+0
+select @@session.extra_port;
+ERROR HY000: Variable 'extra_port' is a GLOBAL variable
+show global variables like 'extra_port';
+Variable_name Value
+extra_port 0
+show session variables like 'extra_port';
+Variable_name Value
+extra_port 0
+select * from information_schema.global_variables where variable_name='extra_port';
+VARIABLE_NAME VARIABLE_VALUE
+EXTRA_PORT 0
+select * from information_schema.session_variables where variable_name='extra_port';
+VARIABLE_NAME VARIABLE_VALUE
+EXTRA_PORT 0
+set global extra_port=1;
+ERROR HY000: Variable 'extra_port' is a read only variable
+set session extra_port=1;
+ERROR HY000: Variable 'extra_port' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/join_cache_level_basic.result b/mysql-test/suite/sys_vars/r/join_cache_level_basic.result
new file mode 100644
index 00000000000..fecc886d460
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/join_cache_level_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.join_cache_level;
+select @@global.join_cache_level;
+@@global.join_cache_level
+1
+select @@session.join_cache_level;
+@@session.join_cache_level
+1
+show global variables like 'join_cache_level';
+Variable_name Value
+join_cache_level 1
+show session variables like 'join_cache_level';
+Variable_name Value
+join_cache_level 1
+select * from information_schema.global_variables where variable_name='join_cache_level';
+VARIABLE_NAME VARIABLE_VALUE
+JOIN_CACHE_LEVEL 1
+select * from information_schema.session_variables where variable_name='join_cache_level';
+VARIABLE_NAME VARIABLE_VALUE
+JOIN_CACHE_LEVEL 1
+set global join_cache_level=4;
+select @@global.join_cache_level;
+@@global.join_cache_level
+4
+set session join_cache_level=4;
+select @@session.join_cache_level;
+@@session.join_cache_level
+4
+set global join_cache_level=1.1;
+ERROR 42000: Incorrect argument type to variable 'join_cache_level'
+set session join_cache_level=1e1;
+ERROR 42000: Incorrect argument type to variable 'join_cache_level'
+set global join_cache_level="foo";
+ERROR 42000: Incorrect argument type to variable 'join_cache_level'
+set global join_cache_level=0;
+select @@global.join_cache_level;
+@@global.join_cache_level
+0
+set session join_cache_level=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect join_cache_level value: '18446744073709551615'
+select @@session.join_cache_level;
+@@session.join_cache_level
+8
+SET @@global.join_cache_level = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
index 4612b5c7324..89aef2a3703 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic.result
@@ -3,7 +3,7 @@ SET @start_value = @@global.key_buffer_size;
SET @@global.key_buffer_size = DEFAULT;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
-8388608
+134217728
'#---------------------FN_DYNVARS_055_02-------------------------#'
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/key_cache_segments_basic.result b/mysql-test/suite/sys_vars/r/key_cache_segments_basic.result
new file mode 100644
index 00000000000..55590b270e9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_segments_basic.result
@@ -0,0 +1,41 @@
+SET @start_global_value = @@global.key_cache_segments;
+select @@global.key_cache_segments;
+@@global.key_cache_segments
+0
+select @@session.key_cache_segments;
+ERROR HY000: Variable 'key_cache_segments' is a GLOBAL variable
+show global variables like 'key_cache_segments';
+Variable_name Value
+key_cache_segments 0
+show session variables like 'key_cache_segments';
+Variable_name Value
+key_cache_segments 0
+select * from information_schema.global_variables where variable_name='key_cache_segments';
+VARIABLE_NAME VARIABLE_VALUE
+KEY_CACHE_SEGMENTS 0
+select * from information_schema.session_variables where variable_name='key_cache_segments';
+VARIABLE_NAME VARIABLE_VALUE
+KEY_CACHE_SEGMENTS 0
+set global key_cache_segments=1;
+select @@global.key_cache_segments;
+@@global.key_cache_segments
+1
+set session key_cache_segments=1;
+ERROR HY000: Variable 'key_cache_segments' is a GLOBAL variable and should be set with SET GLOBAL
+set global key_cache_segments=1.1;
+ERROR 42000: Incorrect argument type to variable 'key_cache_segments'
+set global key_cache_segments=1e1;
+ERROR 42000: Incorrect argument type to variable 'key_cache_segments'
+set global key_cache_segments="foo";
+ERROR 42000: Incorrect argument type to variable 'key_cache_segments'
+set global key_cache_segments=0;
+select @@global.key_cache_segments;
+@@global.key_cache_segments
+0
+set global key_cache_segments=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect key_cache_segments value: '18446744073709551615'
+select @@global.key_cache_segments;
+@@global.key_cache_segments
+64
+SET @@global.key_cache_segments = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result b/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result
new file mode 100644
index 00000000000..5b6eccf2185
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_filter_basic.result
@@ -0,0 +1,96 @@
+SET @start_global_value = @@global.log_slow_filter;
+select @@global.log_slow_filter;
+@@global.log_slow_filter
+admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+show global variables like 'log_slow_filter';
+Variable_name Value
+log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+show session variables like 'log_slow_filter';
+Variable_name Value
+log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+select * from information_schema.global_variables where variable_name='log_slow_filter';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_FILTER admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+select * from information_schema.session_variables where variable_name='log_slow_filter';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_FILTER admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+set global log_slow_filter=1;
+select @@global.log_slow_filter;
+@@global.log_slow_filter
+admin
+set session log_slow_filter=1;
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin
+set session log_slow_filter=1;
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin
+set session log_slow_filter=2;
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+filesort
+set session log_slow_filter=5;
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin,filesort_on_disk
+set session log_slow_filter='admin';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin
+set session log_slow_filter='filesort';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+filesort
+set session log_slow_filter='filesort_on_disk';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+filesort_on_disk
+set session log_slow_filter='full_join';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+full_join
+set session log_slow_filter='full_scan';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+full_scan
+set session log_slow_filter='query_cache';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+query_cache
+set session log_slow_filter='query_cache_miss';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+query_cache_miss
+set session log_slow_filter='tmp_table';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+tmp_table
+set session log_slow_filter='tmp_table_on_disk';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+tmp_table_on_disk
+set session log_slow_filter='filesort,query_cache';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+filesort,query_cache
+set session log_slow_filter='admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
+set session log_slow_filter='';
+select @@session.log_slow_filter;
+@@session.log_slow_filter
+
+set session log_slow_filter=1.1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_filter'
+set session log_slow_filter=1e1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_filter'
+set session log_slow_filter="foo";
+ERROR 42000: Variable 'log_slow_filter' can't be set to the value of 'foo'
+set session log_slow_filter=1024;
+ERROR 42000: Variable 'log_slow_filter' can't be set to the value of '1024'
+SET @@global.log_slow_filter = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result b/mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result
new file mode 100644
index 00000000000..ec47f5e0a30
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_rate_limit_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.log_slow_rate_limit;
+select @@global.log_slow_rate_limit;
+@@global.log_slow_rate_limit
+1
+select @@session.log_slow_rate_limit;
+@@session.log_slow_rate_limit
+1
+show global variables like 'log_slow_rate_limit';
+Variable_name Value
+log_slow_rate_limit 1
+show session variables like 'log_slow_rate_limit';
+Variable_name Value
+log_slow_rate_limit 1
+select * from information_schema.global_variables where variable_name='log_slow_rate_limit';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_RATE_LIMIT 1
+select * from information_schema.session_variables where variable_name='log_slow_rate_limit';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_RATE_LIMIT 1
+set global log_slow_rate_limit=10;
+select @@global.log_slow_rate_limit;
+@@global.log_slow_rate_limit
+10
+set session log_slow_rate_limit=10;
+select @@session.log_slow_rate_limit;
+@@session.log_slow_rate_limit
+10
+set global log_slow_rate_limit=1.1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_rate_limit'
+set session log_slow_rate_limit=1e1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_rate_limit'
+set global log_slow_rate_limit="foo";
+ERROR 42000: Incorrect argument type to variable 'log_slow_rate_limit'
+set global log_slow_rate_limit=0;
+Warnings:
+Warning 1292 Truncated incorrect log_slow_rate_limit value: '0'
+select @@global.log_slow_rate_limit;
+@@global.log_slow_rate_limit
+1
+set session log_slow_rate_limit=cast(-1 as unsigned int);
+select @@session.log_slow_rate_limit;
+@@session.log_slow_rate_limit
+18446744073709551615
+SET @@global.log_slow_rate_limit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result b/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result
new file mode 100644
index 00000000000..24b805d4d9c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result
@@ -0,0 +1,64 @@
+SET @start_global_value = @@global.log_slow_verbosity;
+select @@global.log_slow_verbosity;
+@@global.log_slow_verbosity
+
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+
+show global variables like 'log_slow_verbosity';
+Variable_name Value
+log_slow_verbosity
+show session variables like 'log_slow_verbosity';
+Variable_name Value
+log_slow_verbosity
+select * from information_schema.global_variables where variable_name='log_slow_verbosity';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_VERBOSITY
+select * from information_schema.session_variables where variable_name='log_slow_verbosity';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_SLOW_VERBOSITY
+set global log_slow_verbosity=1;
+select @@global.log_slow_verbosity;
+@@global.log_slow_verbosity
+innodb
+set session log_slow_verbosity=1;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb
+set session log_slow_verbosity=1;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb
+set session log_slow_verbosity=2;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+query_plan
+set session log_slow_verbosity=3;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb,query_plan
+set session log_slow_verbosity='innodb';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb
+set session log_slow_verbosity='query_plan';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+query_plan
+set session log_slow_verbosity='innodb,query_plan';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb,query_plan
+set session log_slow_verbosity='';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+
+set session log_slow_verbosity=1.1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_verbosity'
+set session log_slow_verbosity=1e1;
+ERROR 42000: Incorrect argument type to variable 'log_slow_verbosity'
+set session log_slow_verbosity="foo";
+ERROR 42000: Variable 'log_slow_verbosity' can't be set to the value of 'foo'
+set session log_slow_verbosity=4;
+ERROR 42000: Variable 'log_slow_verbosity' can't be set to the value of '4'
+SET @@global.log_slow_verbosity = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_block_size_basic.result b/mysql-test/suite/sys_vars/r/maria_block_size_basic.result
new file mode 100644
index 00000000000..a0842541534
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_block_size_basic.result
@@ -0,0 +1,25 @@
+select @@global.maria_block_size, @@global.aria_block_size;
+@@global.maria_block_size @@global.aria_block_size
+8192 8192
+select @@session.maria_block_size, @@session.aria_block_size;
+ERROR HY000: Variable 'maria_block_size' is a GLOBAL variable
+show global variables like '%aria_block_size';
+Variable_name Value
+aria_block_size 8192
+maria_block_size 8192
+show session variables like '%aria_block_size';
+Variable_name Value
+aria_block_size 8192
+maria_block_size 8192
+select * from information_schema.global_variables where variable_name like '%aria_block_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_BLOCK_SIZE 8192
+MARIA_BLOCK_SIZE 8192
+select * from information_schema.session_variables where variable_name like '%aria_block_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_BLOCK_SIZE 8192
+MARIA_BLOCK_SIZE 8192
+set global maria_block_size=1;
+ERROR HY000: Variable 'maria_block_size' is a read only variable
+set session maria_block_size=1;
+ERROR HY000: Variable 'maria_block_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/maria_checkpoint_interval_basic.result b/mysql-test/suite/sys_vars/r/maria_checkpoint_interval_basic.result
new file mode 100644
index 00000000000..0a60303c7d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_checkpoint_interval_basic.result
@@ -0,0 +1,43 @@
+SET @start_global_value = @@global.maria_checkpoint_interval;
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+@@global.maria_checkpoint_interval @@global.aria_checkpoint_interval
+30 30
+select @@session.maria_checkpoint_interval, @@session.aria_checkpoint_interval;
+ERROR HY000: Variable 'maria_checkpoint_interval' is a GLOBAL variable
+show global variables like '%aria_checkpoint_interval';
+Variable_name Value
+aria_checkpoint_interval 30
+maria_checkpoint_interval 30
+show session variables like '%aria_checkpoint_interval';
+Variable_name Value
+aria_checkpoint_interval 30
+maria_checkpoint_interval 30
+select * from information_schema.global_variables where variable_name='maria_checkpoint_interval';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_CHECKPOINT_INTERVAL 30
+select * from information_schema.session_variables where variable_name='maria_checkpoint_interval';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_CHECKPOINT_INTERVAL 30
+set global maria_checkpoint_interval=1;
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+@@global.maria_checkpoint_interval @@global.aria_checkpoint_interval
+1 1
+set session maria_checkpoint_interval=1;
+ERROR HY000: Variable 'maria_checkpoint_interval' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_checkpoint_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_checkpoint_interval'
+set global maria_checkpoint_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_checkpoint_interval'
+set global maria_checkpoint_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_checkpoint_interval'
+set global maria_checkpoint_interval=0;
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+@@global.maria_checkpoint_interval @@global.aria_checkpoint_interval
+0 0
+set global maria_checkpoint_interval=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_checkpoint_interval value: '18446744073709551615'
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+@@global.maria_checkpoint_interval @@global.aria_checkpoint_interval
+4294967295 4294967295
+SET @@global.maria_checkpoint_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_force_start_after_recovery_failures_basic.result b/mysql-test/suite/sys_vars/r/maria_force_start_after_recovery_failures_basic.result
new file mode 100644
index 00000000000..f4bbd134df3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_force_start_after_recovery_failures_basic.result
@@ -0,0 +1,23 @@
+select @@global.maria_force_start_after_recovery_failures, @@global.aria_force_start_after_recovery_failures;
+@@global.maria_force_start_after_recovery_failures @@global.aria_force_start_after_recovery_failures
+0 0
+select @@session.maria_force_start_after_recovery_failures, @@session.aria_force_start_after_recovery_failures;
+ERROR HY000: Variable 'maria_force_start_after_recovery_failures' is a GLOBAL variable
+show global variables like '%aria_force_start_after_recovery_failures';
+Variable_name Value
+aria_force_start_after_recovery_failures 0
+maria_force_start_after_recovery_failures 0
+show session variables like '%aria_force_start_after_recovery_failures';
+Variable_name Value
+aria_force_start_after_recovery_failures 0
+maria_force_start_after_recovery_failures 0
+select * from information_schema.global_variables where variable_name='maria_force_start_after_recovery_failures';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_FORCE_START_AFTER_RECOVERY_FAILURES 0
+select * from information_schema.session_variables where variable_name='maria_force_start_after_recovery_failures';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_FORCE_START_AFTER_RECOVERY_FAILURES 0
+set global maria_force_start_after_recovery_failures=1;
+ERROR HY000: Variable 'maria_force_start_after_recovery_failures' is a read only variable
+set session maria_force_start_after_recovery_failures=1;
+ERROR HY000: Variable 'maria_force_start_after_recovery_failures' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/maria_group_commit_basic.result b/mysql-test/suite/sys_vars/r/maria_group_commit_basic.result
new file mode 100644
index 00000000000..7e97d379403
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_group_commit_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.maria_group_commit;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+@@global.maria_group_commit @@global.aria_group_commit
+none none
+select @@session.maria_group_commit, @@session.aria_group_commit;
+ERROR HY000: Variable 'maria_group_commit' is a GLOBAL variable
+show global variables like '%aria_group_commit';
+Variable_name Value
+aria_group_commit none
+maria_group_commit none
+show session variables like '%aria_group_commit';
+Variable_name Value
+aria_group_commit none
+maria_group_commit none
+select * from information_schema.global_variables where variable_name='maria_group_commit';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_GROUP_COMMIT none
+select * from information_schema.session_variables where variable_name='maria_group_commit';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_GROUP_COMMIT none
+set global maria_group_commit=1;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+@@global.maria_group_commit @@global.aria_group_commit
+hard hard
+set session maria_group_commit=1;
+ERROR HY000: Variable 'maria_group_commit' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_group_commit=none;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+@@global.maria_group_commit @@global.aria_group_commit
+none none
+set global maria_group_commit=hard;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+@@global.maria_group_commit @@global.aria_group_commit
+hard hard
+set global maria_group_commit=soft;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+@@global.maria_group_commit @@global.aria_group_commit
+soft soft
+set global maria_group_commit=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_group_commit'
+set global maria_group_commit=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_group_commit'
+set global maria_group_commit="foo";
+ERROR 42000: Variable 'maria_group_commit' can't be set to the value of 'foo'
+set global maria_group_commit=3;
+ERROR 42000: Variable 'maria_group_commit' can't be set to the value of '3'
+SET @@global.maria_group_commit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_group_commit_interval_basic.result b/mysql-test/suite/sys_vars/r/maria_group_commit_interval_basic.result
new file mode 100644
index 00000000000..23ae3ac7e82
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_group_commit_interval_basic.result
@@ -0,0 +1,43 @@
+SET @start_global_value = @@global.maria_group_commit_interval;
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+@@global.maria_group_commit_interval @@global.aria_group_commit_interval
+0 0
+select @@session.maria_group_commit_interval, @@session.aria_group_commit_interval;
+ERROR HY000: Variable 'maria_group_commit_interval' is a GLOBAL variable
+show global variables like '%aria_group_commit_interval';
+Variable_name Value
+aria_group_commit_interval 0
+maria_group_commit_interval 0
+show session variables like '%aria_group_commit_interval';
+Variable_name Value
+aria_group_commit_interval 0
+maria_group_commit_interval 0
+select * from information_schema.global_variables where variable_name='maria_group_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_GROUP_COMMIT_INTERVAL 0
+select * from information_schema.session_variables where variable_name='maria_group_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_GROUP_COMMIT_INTERVAL 0
+set global maria_group_commit_interval=1;
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+@@global.maria_group_commit_interval @@global.aria_group_commit_interval
+1 1
+set session maria_group_commit_interval=1;
+ERROR HY000: Variable 'maria_group_commit_interval' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_group_commit_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_group_commit_interval'
+set global maria_group_commit_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_group_commit_interval'
+set global maria_group_commit_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_group_commit_interval'
+set global maria_group_commit_interval=0;
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+@@global.maria_group_commit_interval @@global.aria_group_commit_interval
+0 0
+set global maria_group_commit_interval=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_group_commit_interval value: '18446744073709551615'
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+@@global.maria_group_commit_interval @@global.aria_group_commit_interval
+4294967295 4294967295
+SET @@global.maria_group_commit_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_log_file_size_basic.result b/mysql-test/suite/sys_vars/r/maria_log_file_size_basic.result
new file mode 100644
index 00000000000..33945ab1ae7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_log_file_size_basic.result
@@ -0,0 +1,57 @@
+SET @start_global_value = @@global.maria_log_file_size;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+1073741824 1073741824
+select @@session.maria_log_file_size, @@session.aria_log_file_size;
+ERROR HY000: Variable 'maria_log_file_size' is a GLOBAL variable
+show global variables like '%aria_log_file_size';
+Variable_name Value
+aria_log_file_size 1073741824
+maria_log_file_size 1073741824
+show session variables like '%aria_log_file_size';
+Variable_name Value
+aria_log_file_size 1073741824
+maria_log_file_size 1073741824
+select * from information_schema.global_variables where variable_name like '%aria_log_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_FILE_SIZE 1073741824
+MARIA_LOG_FILE_SIZE 1073741824
+select * from information_schema.session_variables where variable_name like '%aria_log_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_FILE_SIZE 1073741824
+MARIA_LOG_FILE_SIZE 1073741824
+set global maria_log_file_size=1024*1024*10;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+10485760 10485760
+set session maria_log_file_size=1;
+ERROR HY000: Variable 'maria_log_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_log_file_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_log_file_size'
+set global maria_log_file_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_log_file_size'
+set global maria_log_file_size="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_log_file_size'
+set global maria_log_file_size=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '1'
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+8388608 8388608
+set global maria_log_file_size=@@global.maria_log_file_size + 8192 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '8396799'
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+8388608 8388608
+set global maria_log_file_size=@@global.maria_log_file_size + 8192;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+8396800 8396800
+set global maria_log_file_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_log_file_size value: '18446744073709551615'
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+@@global.maria_log_file_size @@global.aria_log_file_size
+4294959104 4294959104
+SET @@global.maria_log_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_log_purge_type_basic.result b/mysql-test/suite/sys_vars/r/maria_log_purge_type_basic.result
new file mode 100644
index 00000000000..519c41ae46d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_log_purge_type_basic.result
@@ -0,0 +1,49 @@
+SET @start_global_value = @@global.maria_log_purge_type;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+@@global.maria_log_purge_type @@global.aria_log_purge_type
+immediate immediate
+select @@session.maria_log_purge_type, @@session.aria_log_purge_type;
+ERROR HY000: Variable 'maria_log_purge_type' is a GLOBAL variable
+show global variables like '%aria_log_purge_type';
+Variable_name Value
+aria_log_purge_type immediate
+maria_log_purge_type immediate
+show session variables like '%aria_log_purge_type';
+Variable_name Value
+aria_log_purge_type immediate
+maria_log_purge_type immediate
+select * from information_schema.global_variables where variable_name like '%aria_log_purge_type';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_PURGE_TYPE immediate
+MARIA_LOG_PURGE_TYPE immediate
+select * from information_schema.session_variables where variable_name like '%aria_log_purge_type';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_LOG_PURGE_TYPE immediate
+MARIA_LOG_PURGE_TYPE immediate
+set global maria_log_purge_type=1;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+@@global.maria_log_purge_type @@global.aria_log_purge_type
+external external
+set session maria_log_purge_type=1;
+ERROR HY000: Variable 'maria_log_purge_type' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_log_purge_type=immediate;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+@@global.maria_log_purge_type @@global.aria_log_purge_type
+immediate immediate
+set global maria_log_purge_type=external;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+@@global.maria_log_purge_type @@global.aria_log_purge_type
+external external
+set global maria_log_purge_type=at_flush;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+@@global.maria_log_purge_type @@global.aria_log_purge_type
+at_flush at_flush
+set global maria_log_purge_type=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_log_purge_type'
+set global maria_log_purge_type=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_log_purge_type'
+set global maria_log_purge_type="foo";
+ERROR 42000: Variable 'maria_log_purge_type' can't be set to the value of 'foo'
+set global maria_log_purge_type=3;
+ERROR 42000: Variable 'maria_log_purge_type' can't be set to the value of '3'
+SET @@global.maria_log_purge_type = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_max_sort_file_size_basic.result b/mysql-test/suite/sys_vars/r/maria_max_sort_file_size_basic.result
new file mode 100644
index 00000000000..1e11f8ee5a9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_max_sort_file_size_basic.result
@@ -0,0 +1,57 @@
+SET @start_global_value = @@global.maria_max_sort_file_size;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+9223372036853727232 9223372036853727232
+select @@session.maria_max_sort_file_size, @@session.aria_max_sort_file_size;
+ERROR HY000: Variable 'maria_max_sort_file_size' is a GLOBAL variable
+show global variables like '%aria_max_sort_file_size';
+Variable_name Value
+aria_max_sort_file_size 9223372036853727232
+maria_max_sort_file_size 9223372036853727232
+show session variables like '%aria_max_sort_file_size';
+Variable_name Value
+aria_max_sort_file_size 9223372036853727232
+maria_max_sort_file_size 9223372036853727232
+select * from information_schema.global_variables where variable_name like '%aria_max_sort_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+MARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+select * from information_schema.session_variables where variable_name like '%aria_max_sort_file_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+MARIA_MAX_SORT_FILE_SIZE 9223372036853727232
+set global maria_max_sort_file_size=1024*1024*10;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+10485760 10485760
+set session maria_max_sort_file_size=1;
+ERROR HY000: Variable 'maria_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_max_sort_file_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_max_sort_file_size'
+set global maria_max_sort_file_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_max_sort_file_size'
+set global maria_max_sort_file_size="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_max_sort_file_size'
+set global maria_max_sort_file_size=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '1'
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+0 0
+set global maria_max_sort_file_size=@@global.maria_max_sort_file_size + 1024*1024 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '1048575'
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+0 0
+set global maria_max_sort_file_size=@@global.maria_max_sort_file_size + 1024*1024;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+1048576 1048576
+set global maria_max_sort_file_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_max_sort_file_size value: '18446744073709551615'
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+@@global.maria_max_sort_file_size @@global.aria_max_sort_file_size
+9223372036853727232 9223372036853727232
+SET @@global.maria_max_sort_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_page_checksum_basic.result b/mysql-test/suite/sys_vars/r/maria_page_checksum_basic.result
new file mode 100644
index 00000000000..01cb1ea9a9d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_page_checksum_basic.result
@@ -0,0 +1,43 @@
+SET @start_global_value = @@global.maria_page_checksum;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+@@global.maria_page_checksum @@global.aria_page_checksum
+1 1
+select @@session.maria_page_checksum, @@session.aria_page_checksum;
+ERROR HY000: Variable 'maria_page_checksum' is a GLOBAL variable
+show global variables like '%aria_page_checksum';
+Variable_name Value
+aria_page_checksum ON
+maria_page_checksum ON
+show session variables like '%aria_page_checksum';
+Variable_name Value
+aria_page_checksum ON
+maria_page_checksum ON
+select * from information_schema.global_variables where variable_name like '%aria_page_checksum';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_PAGE_CHECKSUM ON
+ARIA_PAGE_CHECKSUM ON
+select * from information_schema.session_variables where variable_name like '%aria_page_checksum';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_PAGE_CHECKSUM ON
+ARIA_PAGE_CHECKSUM ON
+set global maria_page_checksum=ON;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+@@global.maria_page_checksum @@global.aria_page_checksum
+1 1
+set global maria_page_checksum=OFF;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+@@global.maria_page_checksum @@global.aria_page_checksum
+0 0
+set global maria_page_checksum=1;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+@@global.maria_page_checksum @@global.aria_page_checksum
+1 1
+set session maria_page_checksum=1;
+ERROR HY000: Variable 'maria_page_checksum' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_page_checksum=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_page_checksum'
+set global maria_page_checksum=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_page_checksum'
+set global maria_page_checksum="foo";
+ERROR 42000: Variable 'maria_page_checksum' can't be set to the value of 'foo'
+SET @@global.maria_page_checksum = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_pagecache_age_threshold_basic.result b/mysql-test/suite/sys_vars/r/maria_pagecache_age_threshold_basic.result
new file mode 100644
index 00000000000..c00bbfb1adf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_pagecache_age_threshold_basic.result
@@ -0,0 +1,57 @@
+SET @start_global_value = @@global.maria_pagecache_age_threshold;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+300 300
+select @@session.maria_pagecache_age_threshold, @@session.aria_pagecache_age_threshold;
+ERROR HY000: Variable 'maria_pagecache_age_threshold' is a GLOBAL variable
+show global variables like '%aria_pagecache_age_threshold';
+Variable_name Value
+aria_pagecache_age_threshold 300
+maria_pagecache_age_threshold 300
+show session variables like '%aria_pagecache_age_threshold';
+Variable_name Value
+aria_pagecache_age_threshold 300
+maria_pagecache_age_threshold 300
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_age_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_AGE_THRESHOLD 300
+MARIA_PAGECACHE_AGE_THRESHOLD 300
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_age_threshold';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_AGE_THRESHOLD 300
+MARIA_PAGECACHE_AGE_THRESHOLD 300
+set global maria_pagecache_age_threshold=200;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+200 200
+set session maria_pagecache_age_threshold=1;
+ERROR HY000: Variable 'maria_pagecache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_pagecache_age_threshold=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_age_threshold'
+set global maria_pagecache_age_threshold=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_age_threshold'
+set global maria_pagecache_age_threshold="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_age_threshold'
+set global maria_pagecache_age_threshold=1;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '1'
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+100 100
+set global maria_pagecache_age_threshold=@@global.maria_pagecache_age_threshold + 100 - 1;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '199'
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+100 100
+set global maria_pagecache_age_threshold=@@global.maria_pagecache_age_threshold + 100;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+200 200
+set global maria_pagecache_age_threshold=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_age_threshold value: '18446744073709551615'
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+@@global.maria_pagecache_age_threshold @@global.aria_pagecache_age_threshold
+18446744073709551600 18446744073709551600
+SET @@global.maria_pagecache_age_threshold = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_pagecache_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/maria_pagecache_buffer_size_basic.result
new file mode 100644
index 00000000000..a2b98f6d536
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_pagecache_buffer_size_basic.result
@@ -0,0 +1,25 @@
+select @@global.maria_pagecache_buffer_size, @@global.aria_pagecache_buffer_size;
+@@global.maria_pagecache_buffer_size @@global.aria_pagecache_buffer_size
+134217728 134217728
+select @@session.maria_pagecache_buffer_size, @@session.aria_pagecache_buffer_size;
+ERROR HY000: Variable 'maria_pagecache_buffer_size' is a GLOBAL variable
+show global variables like '%aria_pagecache_buffer_size';
+Variable_name Value
+aria_pagecache_buffer_size 134217728
+maria_pagecache_buffer_size 134217728
+show session variables like '%aria_pagecache_buffer_size';
+Variable_name Value
+aria_pagecache_buffer_size 134217728
+maria_pagecache_buffer_size 134217728
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_BUFFER_SIZE 134217728
+MARIA_PAGECACHE_BUFFER_SIZE 134217728
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_BUFFER_SIZE 134217728
+MARIA_PAGECACHE_BUFFER_SIZE 134217728
+set global maria_pagecache_buffer_size=1;
+ERROR HY000: Variable 'maria_pagecache_buffer_size' is a read only variable
+set session maria_pagecache_buffer_size=1;
+ERROR HY000: Variable 'maria_pagecache_buffer_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/maria_pagecache_division_limit_basic.result b/mysql-test/suite/sys_vars/r/maria_pagecache_division_limit_basic.result
new file mode 100644
index 00000000000..46fbb93e81b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_pagecache_division_limit_basic.result
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.maria_pagecache_division_limit;
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+@@global.maria_pagecache_division_limit @@global.aria_pagecache_division_limit
+100 100
+select @@session.maria_pagecache_division_limit, @@session.aria_pagecache_division_limit;
+ERROR HY000: Variable 'maria_pagecache_division_limit' is a GLOBAL variable
+show global variables like '%aria_pagecache_division_limit';
+Variable_name Value
+aria_pagecache_division_limit 100
+maria_pagecache_division_limit 100
+show session variables like '%aria_pagecache_division_limit';
+Variable_name Value
+aria_pagecache_division_limit 100
+maria_pagecache_division_limit 100
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_division_limit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_DIVISION_LIMIT 100
+MARIA_PAGECACHE_DIVISION_LIMIT 100
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_division_limit';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_DIVISION_LIMIT 100
+MARIA_PAGECACHE_DIVISION_LIMIT 100
+set global maria_pagecache_division_limit=20;
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+@@global.maria_pagecache_division_limit @@global.aria_pagecache_division_limit
+20 20
+set session maria_pagecache_division_limit=1;
+ERROR HY000: Variable 'maria_pagecache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_pagecache_division_limit=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_division_limit'
+set global maria_pagecache_division_limit=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_division_limit'
+set global maria_pagecache_division_limit="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_pagecache_division_limit'
+set global maria_pagecache_division_limit=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_division_limit value: '0'
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+@@global.maria_pagecache_division_limit @@global.aria_pagecache_division_limit
+1 1
+set global maria_pagecache_division_limit=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect aria_pagecache_division_limit value: '18446744073709551615'
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+@@global.maria_pagecache_division_limit @@global.aria_pagecache_division_limit
+100 100
+SET @@global.maria_pagecache_division_limit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_recover_basic.result b/mysql-test/suite/sys_vars/r/maria_recover_basic.result
new file mode 100644
index 00000000000..53a215d69c3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_recover_basic.result
@@ -0,0 +1,57 @@
+SET @start_global_value = @@global.maria_recover;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+NORMAL NORMAL
+select @@session.maria_recover, @@session.aria_recover;
+ERROR HY000: Variable 'maria_recover' is a GLOBAL variable
+show global variables like '%aria_recover';
+Variable_name Value
+aria_recover NORMAL
+maria_recover NORMAL
+show session variables like '%aria_recover';
+Variable_name Value
+aria_recover NORMAL
+maria_recover NORMAL
+select * from information_schema.global_variables where variable_name like '%aria_recover';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_RECOVER NORMAL
+ARIA_RECOVER NORMAL
+select * from information_schema.session_variables where variable_name like '%aria_recover';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_RECOVER NORMAL
+ARIA_RECOVER NORMAL
+set global maria_recover=1;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+NORMAL NORMAL
+set session maria_recover=1;
+ERROR HY000: Variable 'maria_recover' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_recover=normal;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+NORMAL NORMAL
+set global maria_recover=backup;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+BACKUP BACKUP
+set global maria_recover='force';
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+FORCE FORCE
+set global maria_recover=`quick`;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+QUICK QUICK
+set global maria_recover=off;
+select @@global.maria_recover, @@global.aria_recover;
+@@global.maria_recover @@global.aria_recover
+OFF OFF
+set global maria_recover=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_recover'
+set global maria_recover=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_recover'
+set global maria_recover="foo";
+ERROR 42000: Variable 'maria_recover' can't be set to the value of 'foo'
+set global maria_recover=5;
+ERROR 42000: Variable 'maria_recover' can't be set to the value of '5'
+SET @@global.maria_recover = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_repair_threads_basic.result b/mysql-test/suite/sys_vars/r/maria_repair_threads_basic.result
new file mode 100644
index 00000000000..0e0610953c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_repair_threads_basic.result
@@ -0,0 +1,48 @@
+SET @start_global_value = @@global.maria_repair_threads;
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+@@global.maria_repair_threads @@global.aria_repair_threads
+1 1
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+@@session.maria_repair_threads @@session.aria_repair_threads
+1 1
+show global variables like '%aria_repair_threads';
+Variable_name Value
+aria_repair_threads 1
+maria_repair_threads 1
+show session variables like '%aria_repair_threads';
+Variable_name Value
+aria_repair_threads 1
+maria_repair_threads 1
+select * from information_schema.global_variables where variable_name like '%aria_repair_threads';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_REPAIR_THREADS 1
+ARIA_REPAIR_THREADS 1
+select * from information_schema.session_variables where variable_name like '%aria_repair_threads';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_REPAIR_THREADS 1
+ARIA_REPAIR_THREADS 1
+set global maria_repair_threads=10;
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+@@global.maria_repair_threads @@global.aria_repair_threads
+10 10
+set session maria_repair_threads=10;
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+@@session.maria_repair_threads @@session.aria_repair_threads
+10 10
+set global maria_repair_threads=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_repair_threads'
+set session maria_repair_threads=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_repair_threads'
+set global maria_repair_threads="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_repair_threads'
+set global maria_repair_threads=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_repair_threads value: '0'
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+@@global.maria_repair_threads @@global.aria_repair_threads
+1 1
+set session maria_repair_threads=cast(-1 as unsigned int);
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+@@session.maria_repair_threads @@session.aria_repair_threads
+18446744073709551615 18446744073709551615
+SET @@global.maria_repair_threads = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/maria_sort_buffer_size_basic.result
new file mode 100644
index 00000000000..42ddaa05c16
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_sort_buffer_size_basic.result
@@ -0,0 +1,48 @@
+SET @start_global_value = @@global.maria_sort_buffer_size;
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+@@global.maria_sort_buffer_size @@global.aria_sort_buffer_size
+134217728 134217728
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+@@session.maria_sort_buffer_size @@session.aria_sort_buffer_size
+134217728 134217728
+show global variables like '%aria_sort_buffer_size';
+Variable_name Value
+aria_sort_buffer_size 134217728
+maria_sort_buffer_size 134217728
+show session variables like '%aria_sort_buffer_size';
+Variable_name Value
+aria_sort_buffer_size 134217728
+maria_sort_buffer_size 134217728
+select * from information_schema.global_variables where variable_name like '%aria_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SORT_BUFFER_SIZE 134217728
+MARIA_SORT_BUFFER_SIZE 134217728
+select * from information_schema.session_variables where variable_name like '%aria_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SORT_BUFFER_SIZE 134217728
+MARIA_SORT_BUFFER_SIZE 134217728
+set global maria_sort_buffer_size=10;
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+@@global.maria_sort_buffer_size @@global.aria_sort_buffer_size
+10 10
+set session maria_sort_buffer_size=10;
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+@@session.maria_sort_buffer_size @@session.aria_sort_buffer_size
+10 10
+set global maria_sort_buffer_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_sort_buffer_size'
+set session maria_sort_buffer_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_sort_buffer_size'
+set global maria_sort_buffer_size="foo";
+ERROR 42000: Incorrect argument type to variable 'maria_sort_buffer_size'
+set global maria_sort_buffer_size=0;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '0'
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+@@global.maria_sort_buffer_size @@global.aria_sort_buffer_size
+4 4
+set session maria_sort_buffer_size=cast(-1 as unsigned int);
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+@@session.maria_sort_buffer_size @@session.aria_sort_buffer_size
+18446744073709551615 18446744073709551615
+SET @@global.maria_sort_buffer_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_stats_method_basic.result b/mysql-test/suite/sys_vars/r/maria_stats_method_basic.result
new file mode 100644
index 00000000000..7b3b2015db3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_stats_method_basic.result
@@ -0,0 +1,52 @@
+SET @start_global_value = @@global.maria_stats_method;
+select @@global.maria_stats_method, @@global.aria_stats_method;
+@@global.maria_stats_method @@global.aria_stats_method
+nulls_unequal nulls_unequal
+select @@session.maria_stats_method, @@session.aria_stats_method;
+@@session.maria_stats_method @@session.aria_stats_method
+nulls_unequal nulls_unequal
+show global variables like '%aria_stats_method';
+Variable_name Value
+aria_stats_method nulls_unequal
+maria_stats_method nulls_unequal
+show session variables like '%aria_stats_method';
+Variable_name Value
+aria_stats_method nulls_unequal
+maria_stats_method nulls_unequal
+select * from information_schema.global_variables where variable_name like '%aria_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_STATS_METHOD nulls_unequal
+ARIA_STATS_METHOD nulls_unequal
+select * from information_schema.session_variables where variable_name like '%aria_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+MARIA_STATS_METHOD nulls_unequal
+ARIA_STATS_METHOD nulls_unequal
+set global maria_stats_method=1;
+select @@global.maria_stats_method, @@global.aria_stats_method;
+@@global.maria_stats_method @@global.aria_stats_method
+nulls_equal nulls_equal
+set session maria_stats_method=1;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+@@session.maria_stats_method @@session.aria_stats_method
+nulls_equal nulls_equal
+set session maria_stats_method=nulls_unequal;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+@@session.maria_stats_method @@session.aria_stats_method
+nulls_unequal nulls_unequal
+set session maria_stats_method=nulls_equal;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+@@session.maria_stats_method @@session.aria_stats_method
+nulls_equal nulls_equal
+set session maria_stats_method=nulls_ignored;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+@@session.maria_stats_method @@session.aria_stats_method
+nulls_ignored nulls_ignored
+set session maria_stats_method=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_stats_method'
+set session maria_stats_method=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_stats_method'
+set session maria_stats_method="foo";
+ERROR 42000: Variable 'maria_stats_method' can't be set to the value of 'foo'
+set session maria_stats_method=3;
+ERROR 42000: Variable 'maria_stats_method' can't be set to the value of '3'
+SET @@global.maria_stats_method = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_sync_log_dir_basic.result b/mysql-test/suite/sys_vars/r/maria_sync_log_dir_basic.result
new file mode 100644
index 00000000000..456a0ddb970
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_sync_log_dir_basic.result
@@ -0,0 +1,49 @@
+SET @start_global_value = @@global.maria_sync_log_dir;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+@@global.maria_sync_log_dir @@global.aria_sync_log_dir
+NEWFILE NEWFILE
+select @@session.maria_sync_log_dir, @@session.aria_sync_log_dir;
+ERROR HY000: Variable 'maria_sync_log_dir' is a GLOBAL variable
+show global variables like '%aria_sync_log_dir';
+Variable_name Value
+aria_sync_log_dir NEWFILE
+maria_sync_log_dir NEWFILE
+show session variables like '%aria_sync_log_dir';
+Variable_name Value
+aria_sync_log_dir NEWFILE
+maria_sync_log_dir NEWFILE
+select * from information_schema.global_variables where variable_name like '%aria_sync_log_dir';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SYNC_LOG_DIR NEWFILE
+MARIA_SYNC_LOG_DIR NEWFILE
+select * from information_schema.session_variables where variable_name like '%aria_sync_log_dir';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_SYNC_LOG_DIR NEWFILE
+MARIA_SYNC_LOG_DIR NEWFILE
+set global maria_sync_log_dir=1;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+@@global.maria_sync_log_dir @@global.aria_sync_log_dir
+NEWFILE NEWFILE
+set session maria_sync_log_dir=1;
+ERROR HY000: Variable 'maria_sync_log_dir' is a GLOBAL variable and should be set with SET GLOBAL
+set global maria_sync_log_dir=never;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+@@global.maria_sync_log_dir @@global.aria_sync_log_dir
+NEVER NEVER
+set global maria_sync_log_dir=newfile;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+@@global.maria_sync_log_dir @@global.aria_sync_log_dir
+NEWFILE NEWFILE
+set global maria_sync_log_dir=always;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+@@global.maria_sync_log_dir @@global.aria_sync_log_dir
+ALWAYS ALWAYS
+set global maria_sync_log_dir=1.1;
+ERROR 42000: Incorrect argument type to variable 'maria_sync_log_dir'
+set global maria_sync_log_dir=1e1;
+ERROR 42000: Incorrect argument type to variable 'maria_sync_log_dir'
+set global maria_sync_log_dir="foo";
+ERROR 42000: Variable 'maria_sync_log_dir' can't be set to the value of 'foo'
+set global maria_sync_log_dir=3;
+ERROR 42000: Variable 'maria_sync_log_dir' can't be set to the value of '3'
+SET @@global.maria_sync_log_dir = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/maria_used_for_temp_tables_basic.result b/mysql-test/suite/sys_vars/r/maria_used_for_temp_tables_basic.result
new file mode 100644
index 00000000000..8795e0f128b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/maria_used_for_temp_tables_basic.result
@@ -0,0 +1,25 @@
+select @@global.maria_used_for_temp_tables, @@global.aria_used_for_temp_tables;
+@@global.maria_used_for_temp_tables @@global.aria_used_for_temp_tables
+1 1
+select @@session.maria_used_for_temp_tables, @@session.aria_used_for_temp_tables;
+ERROR HY000: Variable 'maria_used_for_temp_tables' is a GLOBAL variable
+show global variables like '%aria_used_for_temp_tables';
+Variable_name Value
+aria_used_for_temp_tables ON
+maria_used_for_temp_tables ON
+show session variables like '%aria_used_for_temp_tables';
+Variable_name Value
+aria_used_for_temp_tables ON
+maria_used_for_temp_tables ON
+select * from information_schema.global_variables where variable_name like '%aria_used_for_temp_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_USED_FOR_TEMP_TABLES ON
+MARIA_USED_FOR_TEMP_TABLES ON
+select * from information_schema.session_variables where variable_name like '%aria_used_for_temp_tables';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_USED_FOR_TEMP_TABLES ON
+MARIA_USED_FOR_TEMP_TABLES ON
+set global maria_used_for_temp_tables=1;
+ERROR HY000: Variable 'maria_used_for_temp_tables' is a read only variable
+set session maria_used_for_temp_tables=1;
+ERROR HY000: Variable 'maria_used_for_temp_tables' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/mrr_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/mrr_buffer_size_basic.result
new file mode 100644
index 00000000000..9c358de69a5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mrr_buffer_size_basic.result
@@ -0,0 +1,50 @@
+SET @start_global_value = @@global.mrr_buffer_size;
+select @@global.mrr_buffer_size;
+@@global.mrr_buffer_size
+262144
+select @@session.mrr_buffer_size;
+@@session.mrr_buffer_size
+262144
+show global variables like 'mrr_buffer_size';
+Variable_name Value
+mrr_buffer_size 262144
+show session variables like 'mrr_buffer_size';
+Variable_name Value
+mrr_buffer_size 262144
+select * from information_schema.global_variables where variable_name='mrr_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+MRR_BUFFER_SIZE 262144
+select * from information_schema.session_variables where variable_name='mrr_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+MRR_BUFFER_SIZE 262144
+set global mrr_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect mrr_buffer_size value: '10'
+select @@global.mrr_buffer_size;
+@@global.mrr_buffer_size
+8192
+set session mrr_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect mrr_buffer_size value: '10'
+select @@session.mrr_buffer_size;
+@@session.mrr_buffer_size
+8192
+set global mrr_buffer_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'mrr_buffer_size'
+set session mrr_buffer_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'mrr_buffer_size'
+set global mrr_buffer_size="foo";
+ERROR 42000: Incorrect argument type to variable 'mrr_buffer_size'
+set global mrr_buffer_size=0;
+Warnings:
+Warning 1292 Truncated incorrect mrr_buffer_size value: '0'
+select @@global.mrr_buffer_size;
+@@global.mrr_buffer_size
+8192
+set session mrr_buffer_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect mrr_buffer_size value: '18446744073709551615'
+select @@session.mrr_buffer_size;
+@@session.mrr_buffer_size
+2147483647
+SET @@global.mrr_buffer_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result b/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result
new file mode 100644
index 00000000000..a43c194e3f9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mutex_deadlock_detector_basic.result
@@ -0,0 +1,21 @@
+select @@global.mutex_deadlock_detector;
+@@global.mutex_deadlock_detector
+1
+select @@session.mutex_deadlock_detector;
+ERROR HY000: Variable 'mutex_deadlock_detector' is a GLOBAL variable
+show global variables like 'mutex_deadlock_detector';
+Variable_name Value
+mutex_deadlock_detector ON
+show session variables like 'mutex_deadlock_detector';
+Variable_name Value
+mutex_deadlock_detector ON
+select * from information_schema.global_variables where variable_name='mutex_deadlock_detector';
+VARIABLE_NAME VARIABLE_VALUE
+MUTEX_DEADLOCK_DETECTOR ON
+select * from information_schema.session_variables where variable_name='mutex_deadlock_detector';
+VARIABLE_NAME VARIABLE_VALUE
+MUTEX_DEADLOCK_DETECTOR ON
+set global mutex_deadlock_detector=1;
+ERROR HY000: Variable 'mutex_deadlock_detector' is a read only variable
+set session mutex_deadlock_detector=1;
+ERROR HY000: Variable 'mutex_deadlock_detector' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result b/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result
index 22384d3c6ef..3fc0f563298 100644
--- a/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result
+++ b/mysql-test/suite/sys_vars/r/myisam_recover_options_basic.result
@@ -1,20 +1,20 @@
select @@global.myisam_recover_options;
@@global.myisam_recover_options
-OFF
+DEFAULT
select @@session.myisam_recover_options;
ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
show global variables like 'myisam_recover_options';
Variable_name Value
-myisam_recover_options OFF
+myisam_recover_options DEFAULT
show session variables like 'myisam_recover_options';
Variable_name Value
-myisam_recover_options OFF
+myisam_recover_options DEFAULT
select * from information_schema.global_variables where variable_name='myisam_recover_options';
VARIABLE_NAME VARIABLE_VALUE
-MYISAM_RECOVER_OPTIONS OFF
+MYISAM_RECOVER_OPTIONS DEFAULT
select * from information_schema.session_variables where variable_name='myisam_recover_options';
VARIABLE_NAME VARIABLE_VALUE
-MYISAM_RECOVER_OPTIONS OFF
+MYISAM_RECOVER_OPTIONS DEFAULT
set global myisam_recover_options=1;
ERROR HY000: Variable 'myisam_recover_options' is a read only variable
set session myisam_recover_options=1;
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 acc8cd699f8..cab81890503 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,57 +1,57 @@
SET @start_global_value = @@global.optimizer_switch;
SELECT @start_global_value;
@start_global_value
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
set global optimizer_switch=10;
set session optimizer_switch=5;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
+optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off,index_condition_pushdown=off,firstmatch=off,loosescan=off,materialization=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,table_elimination=off
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
@@ -63,4 +63,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
SET @@global.optimizer_switch = @start_global_value;
SELECT @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,table_elimination=on
diff --git a/mysql-test/suite/sys_vars/r/optimizer_use_mrr_basic.result b/mysql-test/suite/sys_vars/r/optimizer_use_mrr_basic.result
new file mode 100644
index 00000000000..45a7d83c2ad
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/optimizer_use_mrr_basic.result
@@ -0,0 +1,48 @@
+SET @start_global_value = @@global.optimizer_use_mrr;
+select @@global.optimizer_use_mrr;
+@@global.optimizer_use_mrr
+force
+select @@session.optimizer_use_mrr;
+@@session.optimizer_use_mrr
+force
+show global variables like 'optimizer_use_mrr';
+Variable_name Value
+optimizer_use_mrr force
+show session variables like 'optimizer_use_mrr';
+Variable_name Value
+optimizer_use_mrr force
+select * from information_schema.global_variables where variable_name='optimizer_use_mrr';
+VARIABLE_NAME VARIABLE_VALUE
+OPTIMIZER_USE_MRR force
+select * from information_schema.session_variables where variable_name='optimizer_use_mrr';
+VARIABLE_NAME VARIABLE_VALUE
+OPTIMIZER_USE_MRR force
+set global optimizer_use_mrr=1;
+select @@global.optimizer_use_mrr;
+@@global.optimizer_use_mrr
+force
+set session optimizer_use_mrr=1;
+select @@session.optimizer_use_mrr;
+@@session.optimizer_use_mrr
+force
+set session optimizer_use_mrr='auto';
+select @@session.optimizer_use_mrr;
+@@session.optimizer_use_mrr
+auto
+set session optimizer_use_mrr='force';
+select @@session.optimizer_use_mrr;
+@@session.optimizer_use_mrr
+force
+set session optimizer_use_mrr='disable';
+select @@session.optimizer_use_mrr;
+@@session.optimizer_use_mrr
+disable
+set session optimizer_use_mrr=1.1;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_mrr'
+set session optimizer_use_mrr=1e1;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_mrr'
+set session optimizer_use_mrr="foo";
+ERROR 42000: Variable 'optimizer_use_mrr' can't be set to the value of 'foo'
+set session optimizer_use_mrr=3;
+ERROR 42000: Variable 'optimizer_use_mrr' can't be set to the value of '3'
+SET @@global.optimizer_use_mrr = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
index f81cae24dda..c18f4cd2a1d 100644
--- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
+++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
@@ -1,20 +1,20 @@
select @@global.plugin_dir;
@@global.plugin_dir
-MYSQL_LIBDIR/plugin
+MYSQL_LIBDIR/plugins
select @@session.plugin_dir;
ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
show global variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugin
+plugin_dir MYSQL_LIBDIR/plugins
show session variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugin
+plugin_dir MYSQL_LIBDIR/plugins
select * from information_schema.global_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugin
+PLUGIN_DIR MYSQL_LIBDIR/plugins
select * from information_schema.session_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugin
+PLUGIN_DIR MYSQL_LIBDIR/plugins
set global plugin_dir=1;
ERROR HY000: Variable 'plugin_dir' is a read only variable
set session plugin_dir=1;
diff --git a/mysql-test/suite/sys_vars/r/plugin_maturity_basic.result b/mysql-test/suite/sys_vars/r/plugin_maturity_basic.result
new file mode 100644
index 00000000000..e088361563e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/plugin_maturity_basic.result
@@ -0,0 +1,21 @@
+select @@global.plugin_maturity;
+@@global.plugin_maturity
+unknown
+select @@session.plugin_maturity;
+ERROR HY000: Variable 'plugin_maturity' is a GLOBAL variable
+show global variables like 'plugin_maturity';
+Variable_name Value
+plugin_maturity unknown
+show session variables like 'plugin_maturity';
+Variable_name Value
+plugin_maturity unknown
+select * from information_schema.global_variables where variable_name='plugin_maturity';
+VARIABLE_NAME VARIABLE_VALUE
+PLUGIN_MATURITY unknown
+select * from information_schema.session_variables where variable_name='plugin_maturity';
+VARIABLE_NAME VARIABLE_VALUE
+PLUGIN_MATURITY unknown
+set global plugin_maturity=1;
+ERROR HY000: Variable 'plugin_maturity' is a read only variable
+set session plugin_maturity=1;
+ERROR HY000: Variable 'plugin_maturity' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/rowid_merge_buff_size_basic.result b/mysql-test/suite/sys_vars/r/rowid_merge_buff_size_basic.result
new file mode 100644
index 00000000000..222500dabda
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rowid_merge_buff_size_basic.result
@@ -0,0 +1,44 @@
+SET @start_global_value = @@global.rowid_merge_buff_size;
+select @@global.rowid_merge_buff_size;
+@@global.rowid_merge_buff_size
+8388608
+select @@session.rowid_merge_buff_size;
+@@session.rowid_merge_buff_size
+8388608
+show global variables like 'rowid_merge_buff_size';
+Variable_name Value
+rowid_merge_buff_size 8388608
+show session variables like 'rowid_merge_buff_size';
+Variable_name Value
+rowid_merge_buff_size 8388608
+select * from information_schema.global_variables where variable_name='rowid_merge_buff_size';
+VARIABLE_NAME VARIABLE_VALUE
+ROWID_MERGE_BUFF_SIZE 8388608
+select * from information_schema.session_variables where variable_name='rowid_merge_buff_size';
+VARIABLE_NAME VARIABLE_VALUE
+ROWID_MERGE_BUFF_SIZE 8388608
+set global rowid_merge_buff_size=10;
+select @@global.rowid_merge_buff_size;
+@@global.rowid_merge_buff_size
+10
+set session rowid_merge_buff_size=10;
+select @@session.rowid_merge_buff_size;
+@@session.rowid_merge_buff_size
+10
+set global rowid_merge_buff_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'rowid_merge_buff_size'
+set session rowid_merge_buff_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'rowid_merge_buff_size'
+set global rowid_merge_buff_size="foo";
+ERROR 42000: Incorrect argument type to variable 'rowid_merge_buff_size'
+set global rowid_merge_buff_size=0;
+select @@global.rowid_merge_buff_size;
+@@global.rowid_merge_buff_size
+0
+set session rowid_merge_buff_size=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect rowid_merge_buff_size value: '18446744073709551615'
+select @@session.rowid_merge_buff_size;
+@@session.rowid_merge_buff_size
+9223372036854775807
+SET @@global.rowid_merge_buff_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/sql_mode_basic.result b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
index 19695fd3af6..df5f38c8b12 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result
@@ -357,7 +357,7 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT
SET @@global.sql_mode = 50000;
SELECT @@global.sql_mode;
@@global.sql_mode
-PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,,,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
+PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,NO_UNSIGNED_SUBTRACTION,POSTGRESQL,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
SET @@global.sql_mode = 500000;
SELECT @@global.sql_mode;
@@global.sql_mode
@@ -365,7 +365,7 @@ REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGR
SET @@global.sql_mode = 4294967295;
SELECT @@global.sql_mode;
@@global.sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,,,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,IGNORE_BAD_TABLE_OPTIONS,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
SET @@global.sql_mode = 4294967296;
ERROR 42000: Variable 'sql_mode' can't be set to the value of '4294967296'
SET @@global.sql_mode = 0.4;
diff --git a/mysql-test/suite/sys_vars/r/storage_engine_basic.result b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
index 6f10ec475a0..2831ebaa500 100644
--- a/mysql-test/suite/sys_vars/r/storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
@@ -1,11 +1,5 @@
SET @start_global_value = @@global.storage_engine;
-SELECT @start_global_value;
-@start_global_value
-InnoDB
SET @start_session_value = @@session.storage_engine;
-SELECT @start_session_value;
-@start_session_value
-InnoDB
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.storage_engine = INNODB;
SET @@global.storage_engine = DEFAULT;
@@ -108,10 +102,4 @@ SELECT storage_engine = @@session.storage_engine;
ERROR 42S22: Unknown column 'storage_engine' in 'field list'
SET @@storage_engine = @start_global_value;
SET @@global.storage_engine = @start_global_value;
-SELECT @@global.storage_engine;
-@@global.storage_engine
-InnoDB
SET @@session.storage_engine = @start_session_value;
-SELECT @@session.storage_engine;
-@@session.storage_engine
-InnoDB
diff --git a/mysql-test/suite/sys_vars/r/thread_stack_basic.result b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
index c9c458a28a9..4d974f66a00 100644
--- a/mysql-test/suite/sys_vars/r/thread_stack_basic.result
+++ b/mysql-test/suite/sys_vars/r/thread_stack_basic.result
@@ -1,20 +1,20 @@
select @@global.thread_stack;
@@global.thread_stack
-262144
+294912
select @@session.thread_stack;
ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
show global variables like 'thread_stack';
Variable_name Value
-thread_stack 262144
+thread_stack 294912
show session variables like 'thread_stack';
Variable_name Value
-thread_stack 262144
+thread_stack 294912
select * from information_schema.global_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_STACK 262144
+THREAD_STACK 294912
select * from information_schema.session_variables where variable_name='thread_stack';
VARIABLE_NAME VARIABLE_VALUE
-THREAD_STACK 262144
+THREAD_STACK 294912
set global thread_stack=1;
ERROR HY000: Variable 'thread_stack' is a read only variable
set session thread_stack=1;
diff --git a/mysql-test/suite/sys_vars/r/userstat_basic.result b/mysql-test/suite/sys_vars/r/userstat_basic.result
new file mode 100644
index 00000000000..2d082cd3a25
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/userstat_basic.result
@@ -0,0 +1,39 @@
+SET @start_global_value = @@global.userstat;
+select @@global.userstat;
+@@global.userstat
+0
+select @@session.userstat;
+ERROR HY000: Variable 'userstat' is a GLOBAL variable
+show global variables like 'userstat';
+Variable_name Value
+userstat OFF
+show session variables like 'userstat';
+Variable_name Value
+userstat OFF
+select * from information_schema.global_variables where variable_name='userstat';
+VARIABLE_NAME VARIABLE_VALUE
+USERSTAT OFF
+select * from information_schema.session_variables where variable_name='userstat';
+VARIABLE_NAME VARIABLE_VALUE
+USERSTAT OFF
+set global userstat=ON;
+select @@global.userstat;
+@@global.userstat
+1
+set global userstat=OFF;
+select @@global.userstat;
+@@global.userstat
+0
+set global userstat=1;
+select @@global.userstat;
+@@global.userstat
+1
+set session userstat=1;
+ERROR HY000: Variable 'userstat' is a GLOBAL variable and should be set with SET GLOBAL
+set global userstat=1.1;
+ERROR 42000: Incorrect argument type to variable 'userstat'
+set global userstat=1e1;
+ERROR 42000: Incorrect argument type to variable 'userstat'
+set global userstat="foo";
+ERROR 42000: Variable 'userstat' can't be set to the value of 'foo'
+SET @@global.userstat = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/all_vars-master.opt b/mysql-test/suite/sys_vars/t/all_vars-master.opt
index 3eec696ce86..48457b17309 100644
--- a/mysql-test/suite/sys_vars/t/all_vars-master.opt
+++ b/mysql-test/suite/sys_vars/t/all_vars-master.opt
@@ -1 +1 @@
-$SEMISYNC_PLUGIN_OPT --loose-innodb
+--loose-innodb
diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test
index e9e7e16687a..74430787c26 100644
--- a/mysql-test/suite/sys_vars/t/all_vars.test
+++ b/mysql-test/suite/sys_vars/t/all_vars.test
@@ -15,24 +15,23 @@
--source include/not_embedded.inc
-# 2010-01-28 OBN Added support to load 'innodb' and 'semisync' if possible.
-# As we need to have there variables loaded if the components exist but do
-# not want the test skiped if they are not, we cannot use the 'have_xxx' mecanizm.
-# Added an 'all_vars-master.opt' file that includes
-# "$SEMISYNC_PLUGIN_OPT --loose-innodb" (see $SEMISYNC_PLUGIN_OPT setting in mysql-test-run.pl)
-# and logic similar to 'include/have_semisync_plugin.inc' that will load semisync plugin
-if (`SELECT @@have_dynamic_loading = 'YES' AND LENGTH('$SEMISYNC_MASTER_PLUGIN') > 0`)
-{
- --disable_query_log
- # The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
- --replace_regex /\.dll/.so/
- eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
- --replace_regex /\.dll/.so/
- eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
- --enable_query_log
-}
-
-
+#
+# load everything we want to include in the testing
+#
+--disable_query_log
+--disable_result_log
+--disable_abort_on_error
+eval INSTALL PLUGIN archive SONAME "$HA_ARCHIVE_SO";
+eval INSTALL PLUGIN blackhole SONAME "$HA_BLACKHOLE_SO";
+eval INSTALL PLUGIN federated SONAME "$HA_FEDERATEDX_SO";
+eval INSTALL PLUGIN oqgraph SONAME "$HA_OQGRAPH_SO";
+eval INSTALL PLUGIN sphinx SONAME "$HA_SPHINX_SO";
+eval INSTALL PLUGIN innodb SONAME "$HA_XTRADB_SO";
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME "$SEMISYNC_MASTER_SO";
+eval INSTALL PLUGIN rpl_semi_sync_slave SONAME "$SEMISYNC_SLAVE_SO";
+--enable_abort_on_error
+--enable_result_log
+--enable_query_log
#
# This test verifies that *all* system variables are tested
@@ -48,6 +47,7 @@ perl;
use File::Basename;
my $dirname=dirname($ENV{MYSQLTEST_FILE});
my @all_tests=<$dirname/*_basic{,_32,_64}.test>;
+ #*/
open(F, '>', "$ENV{MYSQLTEST_VARDIR}/tmp/sys_vars.all_vars.txt") or die;
binmode F;
print F join "\n", sort map { s/_basic(_32|_64)?\.test$//; basename $_ } @all_tests;
@@ -78,11 +78,18 @@ select variable_name as `There should be *no* variables listed below:` from t2
drop table t1;
drop table t2;
-# Unloading the semisync plugins in case they were loaded
-if (`SELECT @@have_dynamic_loading = 'YES' AND LENGTH('$SEMISYNC_MASTER_PLUGIN') > 0`)
-{
- --disable_query_log
- UNINSTALL PLUGIN rpl_semi_sync_master;
- UNINSTALL PLUGIN rpl_semi_sync_slave;
- --enable_query_log
-}
+--disable_query_log
+--disable_result_log
+--disable_abort_on_error
+UNINSTALL PLUGIN archive;
+UNINSTALL PLUGIN blackhole;
+UNINSTALL PLUGIN federated;
+UNINSTALL PLUGIN oqgraph;
+UNINSTALL PLUGIN sphinx;
+UNINSTALL PLUGIN innodb;
+UNINSTALL PLUGIN rpl_semi_sync_master;
+UNINSTALL PLUGIN rpl_semi_sync_slave;
+--enable_abort_on_error
+--enable_result_log
+--enable_query_log
+
diff --git a/mysql-test/suite/sys_vars/t/aria_block_size_basic.test b/mysql-test/suite/sys_vars/t/aria_block_size_basic.test
new file mode 100644
index 00000000000..ceac27fcd92
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_block_size_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.aria_block_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_block_size;
+show global variables like 'aria_block_size';
+show session variables like 'aria_block_size';
+select * from information_schema.global_variables where variable_name='aria_block_size';
+select * from information_schema.session_variables where variable_name='aria_block_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global aria_block_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session aria_block_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/aria_checkpoint_interval_basic.test b/mysql-test/suite/sys_vars/t/aria_checkpoint_interval_basic.test
new file mode 100644
index 00000000000..6829ca99ba0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_checkpoint_interval_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_checkpoint_interval;
+
+#
+# exists as global only
+#
+select @@global.aria_checkpoint_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_checkpoint_interval;
+show global variables like 'aria_checkpoint_interval';
+show session variables like 'aria_checkpoint_interval';
+select * from information_schema.global_variables where variable_name='aria_checkpoint_interval';
+select * from information_schema.session_variables where variable_name='aria_checkpoint_interval';
+
+#
+# show that it's writable
+#
+set global aria_checkpoint_interval=1;
+select @@global.aria_checkpoint_interval;
+--error ER_GLOBAL_VARIABLE
+set session aria_checkpoint_interval=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_checkpoint_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_checkpoint_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_checkpoint_interval="foo";
+
+#
+# min/max values
+#
+set global aria_checkpoint_interval=0;
+select @@global.aria_checkpoint_interval;
+set global aria_checkpoint_interval=cast(-1 as unsigned int);
+select @@global.aria_checkpoint_interval;
+
+SET @@global.aria_checkpoint_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_force_start_after_recovery_failures_basic.test b/mysql-test/suite/sys_vars/t/aria_force_start_after_recovery_failures_basic.test
new file mode 100644
index 00000000000..c99a303b795
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_force_start_after_recovery_failures_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.aria_force_start_after_recovery_failures;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_force_start_after_recovery_failures;
+show global variables like 'aria_force_start_after_recovery_failures';
+show session variables like 'aria_force_start_after_recovery_failures';
+select * from information_schema.global_variables where variable_name='aria_force_start_after_recovery_failures';
+select * from information_schema.session_variables where variable_name='aria_force_start_after_recovery_failures';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global aria_force_start_after_recovery_failures=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session aria_force_start_after_recovery_failures=1;
+
diff --git a/mysql-test/suite/sys_vars/t/aria_group_commit_basic.test b/mysql-test/suite/sys_vars/t/aria_group_commit_basic.test
new file mode 100644
index 00000000000..11d7d598ef3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_group_commit_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_group_commit;
+
+#
+# exists as global only
+#
+select @@global.aria_group_commit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_group_commit;
+show global variables like 'aria_group_commit';
+show session variables like 'aria_group_commit';
+select * from information_schema.global_variables where variable_name='aria_group_commit';
+select * from information_schema.session_variables where variable_name='aria_group_commit';
+
+#
+# show that it's writable
+#
+set global aria_group_commit=1;
+select @@global.aria_group_commit;
+--error ER_GLOBAL_VARIABLE
+set session aria_group_commit=1;
+
+#
+# all valid values
+#
+set global aria_group_commit=none;
+select @@global.aria_group_commit;
+set global aria_group_commit=hard;
+select @@global.aria_group_commit;
+set global aria_group_commit=soft;
+select @@global.aria_group_commit;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_group_commit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_group_commit=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_group_commit="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_group_commit=3;
+
+SET @@global.aria_group_commit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_group_commit_interval_basic.test b/mysql-test/suite/sys_vars/t/aria_group_commit_interval_basic.test
new file mode 100644
index 00000000000..5b606ee1707
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_group_commit_interval_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_group_commit_interval;
+
+#
+# exists as global only
+#
+select @@global.aria_group_commit_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_group_commit_interval;
+show global variables like 'aria_group_commit_interval';
+show session variables like 'aria_group_commit_interval';
+select * from information_schema.global_variables where variable_name='aria_group_commit_interval';
+select * from information_schema.session_variables where variable_name='aria_group_commit_interval';
+
+#
+# show that it's writable
+#
+set global aria_group_commit_interval=1;
+select @@global.aria_group_commit_interval;
+--error ER_GLOBAL_VARIABLE
+set session aria_group_commit_interval=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_group_commit_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_group_commit_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_group_commit_interval="foo";
+
+#
+# min/max values
+#
+set global aria_group_commit_interval=0;
+select @@global.aria_group_commit_interval;
+set global aria_group_commit_interval=cast(-1 as unsigned int);
+select @@global.aria_group_commit_interval;
+
+SET @@global.aria_group_commit_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_log_file_size_basic.test b/mysql-test/suite/sys_vars/t/aria_log_file_size_basic.test
new file mode 100644
index 00000000000..c403e7d3889
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_log_file_size_basic.test
@@ -0,0 +1,47 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_log_file_size;
+
+#
+# exists as global only
+#
+select @@global.aria_log_file_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_log_file_size;
+show global variables like 'aria_log_file_size';
+show session variables like 'aria_log_file_size';
+select * from information_schema.global_variables where variable_name='aria_log_file_size';
+select * from information_schema.session_variables where variable_name='aria_log_file_size';
+
+#
+# show that it's writable
+#
+set global aria_log_file_size=1024*1024*10;
+select @@global.aria_log_file_size;
+--error ER_GLOBAL_VARIABLE
+set session aria_log_file_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_log_file_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_log_file_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_log_file_size="foo";
+
+#
+# min/max values, block size
+#
+set global aria_log_file_size=1;
+select @@global.aria_log_file_size;
+set global aria_log_file_size=@@global.aria_log_file_size + 8192 - 1;
+select @@global.aria_log_file_size;
+set global aria_log_file_size=@@global.aria_log_file_size + 8192;
+select @@global.aria_log_file_size;
+set global aria_log_file_size=cast(-1 as unsigned int);
+select @@global.aria_log_file_size;
+
+SET @@global.aria_log_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_log_purge_type_basic.test b/mysql-test/suite/sys_vars/t/aria_log_purge_type_basic.test
new file mode 100644
index 00000000000..6424b7db2c0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_log_purge_type_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_log_purge_type;
+
+#
+# exists as global only
+#
+select @@global.aria_log_purge_type;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_log_purge_type;
+show global variables like 'aria_log_purge_type';
+show session variables like 'aria_log_purge_type';
+select * from information_schema.global_variables where variable_name='aria_log_purge_type';
+select * from information_schema.session_variables where variable_name='aria_log_purge_type';
+
+#
+# show that it's writable
+#
+set global aria_log_purge_type=1;
+select @@global.aria_log_purge_type;
+--error ER_GLOBAL_VARIABLE
+set session aria_log_purge_type=1;
+
+#
+# all valid values
+#
+set global aria_log_purge_type=immediate;
+select @@global.aria_log_purge_type;
+set global aria_log_purge_type=external;
+select @@global.aria_log_purge_type;
+set global aria_log_purge_type=at_flush;
+select @@global.aria_log_purge_type;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_log_purge_type=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_log_purge_type=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_log_purge_type="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_log_purge_type=3;
+
+SET @@global.aria_log_purge_type = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_max_sort_file_size_basic.test b/mysql-test/suite/sys_vars/t/aria_max_sort_file_size_basic.test
new file mode 100644
index 00000000000..b2385d2f99b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_max_sort_file_size_basic.test
@@ -0,0 +1,47 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_max_sort_file_size;
+
+#
+# exists as global only
+#
+select @@global.aria_max_sort_file_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_max_sort_file_size;
+show global variables like 'aria_max_sort_file_size';
+show session variables like 'aria_max_sort_file_size';
+select * from information_schema.global_variables where variable_name='aria_max_sort_file_size';
+select * from information_schema.session_variables where variable_name='aria_max_sort_file_size';
+
+#
+# show that it's writable
+#
+set global aria_max_sort_file_size=1024*1024*10;
+select @@global.aria_max_sort_file_size;
+--error ER_GLOBAL_VARIABLE
+set session aria_max_sort_file_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_max_sort_file_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_max_sort_file_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_max_sort_file_size="foo";
+
+#
+# min/max values, block size
+#
+set global aria_max_sort_file_size=1;
+select @@global.aria_max_sort_file_size;
+set global aria_max_sort_file_size=@@global.aria_max_sort_file_size + 1024*1024 - 1;
+select @@global.aria_max_sort_file_size;
+set global aria_max_sort_file_size=@@global.aria_max_sort_file_size + 1024*1024;
+select @@global.aria_max_sort_file_size;
+set global aria_max_sort_file_size=cast(-1 as unsigned int);
+select @@global.aria_max_sort_file_size;
+
+SET @@global.aria_max_sort_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_page_checksum_basic.test b/mysql-test/suite/sys_vars/t/aria_page_checksum_basic.test
new file mode 100644
index 00000000000..5340699a346
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_page_checksum_basic.test
@@ -0,0 +1,39 @@
+# bool global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_page_checksum;
+
+#
+# exists as global only
+#
+select @@global.aria_page_checksum;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_page_checksum;
+show global variables like 'aria_page_checksum';
+show session variables like 'aria_page_checksum';
+select * from information_schema.global_variables where variable_name='aria_page_checksum';
+select * from information_schema.session_variables where variable_name='aria_page_checksum';
+
+#
+# show that it's writable
+#
+set global aria_page_checksum=ON;
+select @@global.aria_page_checksum;
+set global aria_page_checksum=OFF;
+select @@global.aria_page_checksum;
+set global aria_page_checksum=1;
+select @@global.aria_page_checksum;
+--error ER_GLOBAL_VARIABLE
+set session aria_page_checksum=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_page_checksum=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_page_checksum=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_page_checksum="foo";
+
+SET @@global.aria_page_checksum = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_pagecache_age_threshold_basic.test b/mysql-test/suite/sys_vars/t/aria_pagecache_age_threshold_basic.test
new file mode 100644
index 00000000000..2d8dcc4eff5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_pagecache_age_threshold_basic.test
@@ -0,0 +1,47 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_pagecache_age_threshold;
+
+#
+# exists as global only
+#
+select @@global.aria_pagecache_age_threshold;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_pagecache_age_threshold;
+show global variables like 'aria_pagecache_age_threshold';
+show session variables like 'aria_pagecache_age_threshold';
+select * from information_schema.global_variables where variable_name='aria_pagecache_age_threshold';
+select * from information_schema.session_variables where variable_name='aria_pagecache_age_threshold';
+
+#
+# show that it's writable
+#
+set global aria_pagecache_age_threshold=200;
+select @@global.aria_pagecache_age_threshold;
+--error ER_GLOBAL_VARIABLE
+set session aria_pagecache_age_threshold=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_age_threshold=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_age_threshold=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_age_threshold="foo";
+
+#
+# min/max values, block size
+#
+set global aria_pagecache_age_threshold=1;
+select @@global.aria_pagecache_age_threshold;
+set global aria_pagecache_age_threshold=@@global.aria_pagecache_age_threshold + 100 - 1;
+select @@global.aria_pagecache_age_threshold;
+set global aria_pagecache_age_threshold=@@global.aria_pagecache_age_threshold + 100;
+select @@global.aria_pagecache_age_threshold;
+set global aria_pagecache_age_threshold=cast(-1 as unsigned int);
+select @@global.aria_pagecache_age_threshold;
+
+SET @@global.aria_pagecache_age_threshold = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_pagecache_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/aria_pagecache_buffer_size_basic.test
new file mode 100644
index 00000000000..172787d793a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_pagecache_buffer_size_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.aria_pagecache_buffer_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_pagecache_buffer_size;
+show global variables like 'aria_pagecache_buffer_size';
+show session variables like 'aria_pagecache_buffer_size';
+select * from information_schema.global_variables where variable_name='aria_pagecache_buffer_size';
+select * from information_schema.session_variables where variable_name='aria_pagecache_buffer_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global aria_pagecache_buffer_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session aria_pagecache_buffer_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/aria_pagecache_division_limit_basic.test b/mysql-test/suite/sys_vars/t/aria_pagecache_division_limit_basic.test
new file mode 100644
index 00000000000..096b9869979
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_pagecache_division_limit_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_pagecache_division_limit;
+
+#
+# exists as global only
+#
+select @@global.aria_pagecache_division_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_pagecache_division_limit;
+show global variables like 'aria_pagecache_division_limit';
+show session variables like 'aria_pagecache_division_limit';
+select * from information_schema.global_variables where variable_name='aria_pagecache_division_limit';
+select * from information_schema.session_variables where variable_name='aria_pagecache_division_limit';
+
+#
+# show that it's writable
+#
+set global aria_pagecache_division_limit=20;
+select @@global.aria_pagecache_division_limit;
+--error ER_GLOBAL_VARIABLE
+set session aria_pagecache_division_limit=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_division_limit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_division_limit=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_pagecache_division_limit="foo";
+
+#
+# min/max values, block size
+#
+set global aria_pagecache_division_limit=0;
+select @@global.aria_pagecache_division_limit;
+set global aria_pagecache_division_limit=cast(-1 as unsigned int);
+select @@global.aria_pagecache_division_limit;
+
+SET @@global.aria_pagecache_division_limit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_recover_basic.test b/mysql-test/suite/sys_vars/t/aria_recover_basic.test
new file mode 100644
index 00000000000..25aa2d7cf77
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_recover_basic.test
@@ -0,0 +1,51 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_recover;
+
+#
+# exists as global only
+#
+select @@global.aria_recover;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_recover;
+show global variables like 'aria_recover';
+show session variables like 'aria_recover';
+select * from information_schema.global_variables where variable_name='aria_recover';
+select * from information_schema.session_variables where variable_name='aria_recover';
+
+#
+# show that it's writable
+#
+set global aria_recover=1;
+select @@global.aria_recover;
+--error ER_GLOBAL_VARIABLE
+set session aria_recover=1;
+
+#
+# all valid values
+#
+set global aria_recover=normal;
+select @@global.aria_recover;
+set global aria_recover=backup;
+select @@global.aria_recover;
+set global aria_recover='force';
+select @@global.aria_recover;
+set global aria_recover='quick';
+select @@global.aria_recover;
+set global aria_recover=off;
+select @@global.aria_recover;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_recover=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_recover=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_recover="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_recover=5;
+
+SET @@global.aria_recover = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_repair_threads_basic.test b/mysql-test/suite/sys_vars/t/aria_repair_threads_basic.test
new file mode 100644
index 00000000000..476bd0b4cb2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_repair_threads_basic.test
@@ -0,0 +1,43 @@
+# ulong session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_repair_threads;
+
+#
+# exists as global only
+#
+select @@global.aria_repair_threads;
+select @@session.aria_repair_threads;
+show global variables like 'aria_repair_threads';
+show session variables like 'aria_repair_threads';
+select * from information_schema.global_variables where variable_name='aria_repair_threads';
+select * from information_schema.session_variables where variable_name='aria_repair_threads';
+
+#
+# show that it's writable
+#
+set global aria_repair_threads=10;
+select @@global.aria_repair_threads;
+set session aria_repair_threads=10;
+select @@session.aria_repair_threads;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_repair_threads=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session aria_repair_threads=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_repair_threads="foo";
+
+#
+# min/max values, block size
+#
+set global aria_repair_threads=0;
+select @@global.aria_repair_threads;
+set session aria_repair_threads=cast(-1 as unsigned int);
+select @@session.aria_repair_threads;
+
+SET @@global.aria_repair_threads = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test
new file mode 100644
index 00000000000..699f6ae8e20
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test
@@ -0,0 +1,43 @@
+# ulong session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_sort_buffer_size;
+
+#
+# exists as global only
+#
+select @@global.aria_sort_buffer_size;
+select @@session.aria_sort_buffer_size;
+show global variables like 'aria_sort_buffer_size';
+show session variables like 'aria_sort_buffer_size';
+select * from information_schema.global_variables where variable_name='aria_sort_buffer_size';
+select * from information_schema.session_variables where variable_name='aria_sort_buffer_size';
+
+#
+# show that it's writable
+#
+set global aria_sort_buffer_size=10;
+select @@global.aria_sort_buffer_size;
+set session aria_sort_buffer_size=10;
+select @@session.aria_sort_buffer_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_sort_buffer_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session aria_sort_buffer_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_sort_buffer_size="foo";
+
+#
+# min/max values, block size
+#
+set global aria_sort_buffer_size=0;
+select @@global.aria_sort_buffer_size;
+set session aria_sort_buffer_size=cast(-1 as unsigned int);
+select @@session.aria_sort_buffer_size;
+
+SET @@global.aria_sort_buffer_size = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/aria_stats_method_basic.test b/mysql-test/suite/sys_vars/t/aria_stats_method_basic.test
new file mode 100644
index 00000000000..6db279237c1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_stats_method_basic.test
@@ -0,0 +1,46 @@
+# enum session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_stats_method;
+
+#
+# exists as global only
+#
+select @@global.aria_stats_method;
+select @@session.aria_stats_method;
+show global variables like 'aria_stats_method';
+show session variables like 'aria_stats_method';
+select * from information_schema.global_variables where variable_name='aria_stats_method';
+select * from information_schema.session_variables where variable_name='aria_stats_method';
+
+#
+# show that it's writable
+#
+set global aria_stats_method=1;
+select @@global.aria_stats_method;
+set session aria_stats_method=1;
+select @@session.aria_stats_method;
+
+#
+# all valid values
+#
+set session aria_stats_method=nulls_unequal;
+select @@session.aria_stats_method;
+set session aria_stats_method=nulls_equal;
+select @@session.aria_stats_method;
+set session aria_stats_method=nulls_ignored;
+select @@session.aria_stats_method;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session aria_stats_method=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session aria_stats_method=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session aria_stats_method="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session aria_stats_method=3;
+
+SET @@global.aria_stats_method = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_sync_log_dir_basic.test b/mysql-test/suite/sys_vars/t/aria_sync_log_dir_basic.test
new file mode 100644
index 00000000000..7809e0d8d11
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_sync_log_dir_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.aria_sync_log_dir;
+
+#
+# exists as global only
+#
+select @@global.aria_sync_log_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_sync_log_dir;
+show global variables like 'aria_sync_log_dir';
+show session variables like 'aria_sync_log_dir';
+select * from information_schema.global_variables where variable_name='aria_sync_log_dir';
+select * from information_schema.session_variables where variable_name='aria_sync_log_dir';
+
+#
+# show that it's writable
+#
+set global aria_sync_log_dir=1;
+select @@global.aria_sync_log_dir;
+--error ER_GLOBAL_VARIABLE
+set session aria_sync_log_dir=1;
+
+#
+# all valid values
+#
+set global aria_sync_log_dir=never;
+select @@global.aria_sync_log_dir;
+set global aria_sync_log_dir=newfile;
+select @@global.aria_sync_log_dir;
+set global aria_sync_log_dir=always;
+select @@global.aria_sync_log_dir;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_sync_log_dir=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global aria_sync_log_dir=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_sync_log_dir="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global aria_sync_log_dir=3;
+
+SET @@global.aria_sync_log_dir = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/aria_used_for_temp_tables_basic.test b/mysql-test/suite/sys_vars/t/aria_used_for_temp_tables_basic.test
new file mode 100644
index 00000000000..e962dcf178d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_used_for_temp_tables_basic.test
@@ -0,0 +1,22 @@
+# bool readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.aria_used_for_temp_tables;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_used_for_temp_tables;
+show global variables like 'aria_used_for_temp_tables';
+show session variables like 'aria_used_for_temp_tables';
+select * from information_schema.global_variables where variable_name='aria_used_for_temp_tables';
+select * from information_schema.session_variables where variable_name='aria_used_for_temp_tables';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global aria_used_for_temp_tables=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session aria_used_for_temp_tables=1;
+
diff --git a/mysql-test/suite/sys_vars/t/deadlock_search_depth_long_basic.test b/mysql-test/suite/sys_vars/t/deadlock_search_depth_long_basic.test
new file mode 100644
index 00000000000..1862015b0a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/deadlock_search_depth_long_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.deadlock_search_depth_long;
+
+#
+# exists as global only
+#
+select @@global.deadlock_search_depth_long;
+select @@session.deadlock_search_depth_long;
+show global variables like 'deadlock_search_depth_long';
+show session variables like 'deadlock_search_depth_long';
+select * from information_schema.global_variables where variable_name='deadlock_search_depth_long';
+select * from information_schema.session_variables where variable_name='deadlock_search_depth_long';
+
+#
+# show that it's writable
+#
+set global deadlock_search_depth_long=10;
+select @@global.deadlock_search_depth_long;
+set session deadlock_search_depth_long=10;
+select @@session.deadlock_search_depth_long;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_search_depth_long=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session deadlock_search_depth_long=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_search_depth_long="foo";
+
+#
+# min/max values, block size
+#
+set global deadlock_search_depth_long=0;
+select @@global.deadlock_search_depth_long;
+set session deadlock_search_depth_long=cast(-1 as unsigned int);
+select @@session.deadlock_search_depth_long;
+
+SET @@global.deadlock_search_depth_long = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/deadlock_search_depth_short_basic.test b/mysql-test/suite/sys_vars/t/deadlock_search_depth_short_basic.test
new file mode 100644
index 00000000000..3df6fb92c51
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/deadlock_search_depth_short_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.deadlock_search_depth_short;
+
+#
+# exists as global only
+#
+select @@global.deadlock_search_depth_short;
+select @@session.deadlock_search_depth_short;
+show global variables like 'deadlock_search_depth_short';
+show session variables like 'deadlock_search_depth_short';
+select * from information_schema.global_variables where variable_name='deadlock_search_depth_short';
+select * from information_schema.session_variables where variable_name='deadlock_search_depth_short';
+
+#
+# show that it's writable
+#
+set global deadlock_search_depth_short=10;
+select @@global.deadlock_search_depth_short;
+set session deadlock_search_depth_short=10;
+select @@session.deadlock_search_depth_short;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_search_depth_short=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session deadlock_search_depth_short=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_search_depth_short="foo";
+
+#
+# min/max values, block size
+#
+set global deadlock_search_depth_short=0;
+select @@global.deadlock_search_depth_short;
+set session deadlock_search_depth_short=cast(-1 as unsigned int);
+select @@session.deadlock_search_depth_short;
+
+SET @@global.deadlock_search_depth_short = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/deadlock_timeout_long_basic.test b/mysql-test/suite/sys_vars/t/deadlock_timeout_long_basic.test
new file mode 100644
index 00000000000..4ebc3cc059d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/deadlock_timeout_long_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.deadlock_timeout_long;
+
+#
+# exists as global only
+#
+select @@global.deadlock_timeout_long;
+select @@session.deadlock_timeout_long;
+show global variables like 'deadlock_timeout_long';
+show session variables like 'deadlock_timeout_long';
+select * from information_schema.global_variables where variable_name='deadlock_timeout_long';
+select * from information_schema.session_variables where variable_name='deadlock_timeout_long';
+
+#
+# show that it's writable
+#
+set global deadlock_timeout_long=10;
+select @@global.deadlock_timeout_long;
+set session deadlock_timeout_long=10;
+select @@session.deadlock_timeout_long;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_timeout_long=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session deadlock_timeout_long=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_timeout_long="foo";
+
+#
+# min/max values, block size
+#
+set global deadlock_timeout_long=0;
+select @@global.deadlock_timeout_long;
+set session deadlock_timeout_long=cast(-1 as unsigned int);
+select @@session.deadlock_timeout_long;
+
+SET @@global.deadlock_timeout_long = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/deadlock_timeout_short_basic.test b/mysql-test/suite/sys_vars/t/deadlock_timeout_short_basic.test
new file mode 100644
index 00000000000..86beeaeae9c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/deadlock_timeout_short_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.deadlock_timeout_short;
+
+#
+# exists as global only
+#
+select @@global.deadlock_timeout_short;
+select @@session.deadlock_timeout_short;
+show global variables like 'deadlock_timeout_short';
+show session variables like 'deadlock_timeout_short';
+select * from information_schema.global_variables where variable_name='deadlock_timeout_short';
+select * from information_schema.session_variables where variable_name='deadlock_timeout_short';
+
+#
+# show that it's writable
+#
+set global deadlock_timeout_short=10;
+select @@global.deadlock_timeout_short;
+set session deadlock_timeout_short=10;
+select @@session.deadlock_timeout_short;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_timeout_short=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session deadlock_timeout_short=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global deadlock_timeout_short="foo";
+
+#
+# min/max values, block size
+#
+set global deadlock_timeout_short=0;
+select @@global.deadlock_timeout_short;
+set session deadlock_timeout_short=cast(-1 as unsigned int);
+select @@session.deadlock_timeout_short;
+
+SET @@global.deadlock_timeout_short = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
new file mode 100644
index 00000000000..f7d17a8e5ad
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
@@ -0,0 +1,42 @@
+# ulong global
+
+SET @start_global_value = @@global.debug_crc_break;
+
+#
+# exists as global only
+#
+select @@global.debug_crc_break;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.debug_crc_break;
+show global variables like 'debug_crc_break';
+show session variables like 'debug_crc_break';
+select * from information_schema.global_variables where variable_name='debug_crc_break';
+select * from information_schema.session_variables where variable_name='debug_crc_break';
+
+#
+# show that it's writable
+#
+set global debug_crc_break=1;
+select @@global.debug_crc_break;
+--error ER_GLOBAL_VARIABLE
+set session debug_crc_break=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global debug_crc_break=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global debug_crc_break=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global debug_crc_break="foo";
+
+#
+# min/max values
+#
+set global debug_crc_break=0;
+select @@global.debug_crc_break;
+set global debug_crc_break=cast(-1 as unsigned int);
+select @@global.debug_crc_break;
+
+SET @@global.debug_crc_break = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test
index f47453eb234..3e805688565 100644
--- a/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_storage_engine_basic.test
@@ -29,9 +29,7 @@
#############################################################
SET @start_global_value = @@global.default_storage_engine;
-SELECT @start_global_value;
SET @start_session_value = @@session.default_storage_engine;
-SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
@@ -41,10 +39,12 @@ SELECT @start_session_value;
SET @@global.default_storage_engine = INNODB;
SET @@global.default_storage_engine = DEFAULT;
+--replace_result MyISAM InnoDB
SELECT @@global.default_storage_engine;
SET @@session.default_storage_engine = INNODB;
SET @@session.default_storage_engine = DEFAULT;
+--replace_result MyISAM InnoDB
SELECT @@session.default_storage_engine;
@@ -173,10 +173,7 @@ SET @@default_storage_engine = @start_global_value;
####################################
SET @@global.default_storage_engine = @start_global_value;
-SELECT @@global.default_storage_engine;
SET @@session.default_storage_engine = @start_session_value;
-SELECT @@session.default_storage_engine;
-
#############################################################
# END OF default_storage_engine TESTS #
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
index 483eea9daeb..ba9f819f96b 100644
--- a/mysql-test/suite/sys_vars/t/disabled.def
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -14,4 +14,5 @@ query_cache_size_basic_64 : Bug#36747: Allocating a large query cache
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
diff --git a/mysql-test/suite/sys_vars/t/extra_max_connections_basic.test b/mysql-test/suite/sys_vars/t/extra_max_connections_basic.test
new file mode 100644
index 00000000000..214e64ebe7d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/extra_max_connections_basic.test
@@ -0,0 +1,42 @@
+# ulong global
+
+SET @start_global_value = @@global.extra_max_connections;
+
+#
+# exists as global only
+#
+select @@global.extra_max_connections;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.extra_max_connections;
+show global variables like 'extra_max_connections';
+show session variables like 'extra_max_connections';
+select * from information_schema.global_variables where variable_name='extra_max_connections';
+select * from information_schema.session_variables where variable_name='extra_max_connections';
+
+#
+# show that it's writable
+#
+set global extra_max_connections=1;
+select @@global.extra_max_connections;
+--error ER_GLOBAL_VARIABLE
+set session extra_max_connections=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global extra_max_connections=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global extra_max_connections=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global extra_max_connections="foo";
+
+#
+# min/max values
+#
+set global extra_max_connections=0;
+select @@global.extra_max_connections;
+set global extra_max_connections=cast(-1 as unsigned int);
+select @@global.extra_max_connections;
+
+SET @@global.extra_max_connections = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/extra_port_basic.test b/mysql-test/suite/sys_vars/t/extra_port_basic.test
new file mode 100644
index 00000000000..af5500e7ab7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/extra_port_basic.test
@@ -0,0 +1,21 @@
+# ulong readonly
+
+#
+# show the global and session values;
+#
+select @@global.extra_port;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.extra_port;
+show global variables like 'extra_port';
+show session variables like 'extra_port';
+select * from information_schema.global_variables where variable_name='extra_port';
+select * from information_schema.session_variables where variable_name='extra_port';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global extra_port=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session extra_port=1;
+
diff --git a/mysql-test/suite/sys_vars/t/join_cache_level_basic.test b/mysql-test/suite/sys_vars/t/join_cache_level_basic.test
new file mode 100644
index 00000000000..1e0deb9c028
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/join_cache_level_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.join_cache_level;
+
+#
+# exists as global only
+#
+select @@global.join_cache_level;
+select @@session.join_cache_level;
+show global variables like 'join_cache_level';
+show session variables like 'join_cache_level';
+select * from information_schema.global_variables where variable_name='join_cache_level';
+select * from information_schema.session_variables where variable_name='join_cache_level';
+
+#
+# show that it's writable
+#
+set global join_cache_level=4;
+select @@global.join_cache_level;
+set session join_cache_level=4;
+select @@session.join_cache_level;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global join_cache_level=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session join_cache_level=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global join_cache_level="foo";
+
+#
+# min/max values, block size
+#
+set global join_cache_level=0;
+select @@global.join_cache_level;
+set session join_cache_level=cast(-1 as unsigned int);
+select @@session.join_cache_level;
+
+SET @@global.join_cache_level = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_segments_basic.test b/mysql-test/suite/sys_vars/t/key_cache_segments_basic.test
new file mode 100644
index 00000000000..ce0c736e4cc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_segments_basic.test
@@ -0,0 +1,42 @@
+# ulong global
+
+SET @start_global_value = @@global.key_cache_segments;
+
+#
+# exists as global only
+#
+select @@global.key_cache_segments;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.key_cache_segments;
+show global variables like 'key_cache_segments';
+show session variables like 'key_cache_segments';
+select * from information_schema.global_variables where variable_name='key_cache_segments';
+select * from information_schema.session_variables where variable_name='key_cache_segments';
+
+#
+# show that it's writable
+#
+set global key_cache_segments=1;
+select @@global.key_cache_segments;
+--error ER_GLOBAL_VARIABLE
+set session key_cache_segments=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global key_cache_segments=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global key_cache_segments=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global key_cache_segments="foo";
+
+#
+# min/max values
+#
+set global key_cache_segments=0;
+select @@global.key_cache_segments;
+set global key_cache_segments=cast(-1 as unsigned int);
+select @@global.key_cache_segments;
+
+SET @@global.key_cache_segments = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test b/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test
new file mode 100644
index 00000000000..2891b7ded8b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_filter_basic.test
@@ -0,0 +1,69 @@
+# set session
+
+SET @start_global_value = @@global.log_slow_filter;
+
+#
+# exists as global only
+#
+select @@global.log_slow_filter;
+select @@session.log_slow_filter;
+show global variables like 'log_slow_filter';
+show session variables like 'log_slow_filter';
+select * from information_schema.global_variables where variable_name='log_slow_filter';
+select * from information_schema.session_variables where variable_name='log_slow_filter';
+
+#
+# show that it's writable
+#
+set global log_slow_filter=1;
+select @@global.log_slow_filter;
+set session log_slow_filter=1;
+select @@session.log_slow_filter;
+
+#
+# all valid values
+#
+set session log_slow_filter=1;
+select @@session.log_slow_filter;
+set session log_slow_filter=2;
+select @@session.log_slow_filter;
+set session log_slow_filter=5;
+select @@session.log_slow_filter;
+set session log_slow_filter='admin';
+select @@session.log_slow_filter;
+set session log_slow_filter='filesort';
+select @@session.log_slow_filter;
+set session log_slow_filter='filesort_on_disk';
+select @@session.log_slow_filter;
+set session log_slow_filter='full_join';
+select @@session.log_slow_filter;
+set session log_slow_filter='full_scan';
+select @@session.log_slow_filter;
+set session log_slow_filter='query_cache';
+select @@session.log_slow_filter;
+set session log_slow_filter='query_cache_miss';
+select @@session.log_slow_filter;
+set session log_slow_filter='tmp_table';
+select @@session.log_slow_filter;
+set session log_slow_filter='tmp_table_on_disk';
+select @@session.log_slow_filter;
+set session log_slow_filter='filesort,query_cache';
+select @@session.log_slow_filter;
+set session log_slow_filter='admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk';
+select @@session.log_slow_filter;
+set session log_slow_filter='';
+select @@session.log_slow_filter;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_filter=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_filter=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_filter="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_filter=1024;
+
+SET @@global.log_slow_filter = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test b/mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test
new file mode 100644
index 00000000000..bb90b29e5f4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_rate_limit_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.log_slow_rate_limit;
+
+#
+# exists as global only
+#
+select @@global.log_slow_rate_limit;
+select @@session.log_slow_rate_limit;
+show global variables like 'log_slow_rate_limit';
+show session variables like 'log_slow_rate_limit';
+select * from information_schema.global_variables where variable_name='log_slow_rate_limit';
+select * from information_schema.session_variables where variable_name='log_slow_rate_limit';
+
+#
+# show that it's writable
+#
+set global log_slow_rate_limit=10;
+select @@global.log_slow_rate_limit;
+set session log_slow_rate_limit=10;
+select @@session.log_slow_rate_limit;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global log_slow_rate_limit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_rate_limit=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global log_slow_rate_limit="foo";
+
+#
+# min/max values, block size
+#
+set global log_slow_rate_limit=0;
+select @@global.log_slow_rate_limit;
+set session log_slow_rate_limit=cast(-1 as unsigned int);
+select @@session.log_slow_rate_limit;
+
+SET @@global.log_slow_rate_limit = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test b/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test
new file mode 100644
index 00000000000..9302d5f1210
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test
@@ -0,0 +1,53 @@
+# set session
+
+SET @start_global_value = @@global.log_slow_verbosity;
+
+#
+# exists as global only
+#
+select @@global.log_slow_verbosity;
+select @@session.log_slow_verbosity;
+show global variables like 'log_slow_verbosity';
+show session variables like 'log_slow_verbosity';
+select * from information_schema.global_variables where variable_name='log_slow_verbosity';
+select * from information_schema.session_variables where variable_name='log_slow_verbosity';
+
+#
+# show that it's writable
+#
+set global log_slow_verbosity=1;
+select @@global.log_slow_verbosity;
+set session log_slow_verbosity=1;
+select @@session.log_slow_verbosity;
+
+#
+# all valid values
+#
+set session log_slow_verbosity=1;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity=2;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity=3;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity='innodb';
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity='query_plan';
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity='innodb,query_plan';
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity='';
+select @@session.log_slow_verbosity;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_verbosity=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session log_slow_verbosity=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_verbosity="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session log_slow_verbosity=4;
+
+SET @@global.log_slow_verbosity = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_block_size_basic.test b/mysql-test/suite/sys_vars/t/maria_block_size_basic.test
new file mode 100644
index 00000000000..5acfcab539a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_block_size_basic.test
@@ -0,0 +1,24 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.maria_block_size, @@global.aria_block_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_block_size, @@session.aria_block_size;
+show global variables like '%aria_block_size';
+show session variables like '%aria_block_size';
+--sorted_result
+select * from information_schema.global_variables where variable_name like '%aria_block_size';
+--sorted_result
+select * from information_schema.session_variables where variable_name like '%aria_block_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global maria_block_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session maria_block_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/maria_checkpoint_interval_basic.test b/mysql-test/suite/sys_vars/t/maria_checkpoint_interval_basic.test
new file mode 100644
index 00000000000..ccbf9ee8eb0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_checkpoint_interval_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_checkpoint_interval;
+
+#
+# exists as global only
+#
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_checkpoint_interval, @@session.aria_checkpoint_interval;
+show global variables like '%aria_checkpoint_interval';
+show session variables like '%aria_checkpoint_interval';
+select * from information_schema.global_variables where variable_name='maria_checkpoint_interval';
+select * from information_schema.session_variables where variable_name='maria_checkpoint_interval';
+
+#
+# show that it's writable
+#
+set global maria_checkpoint_interval=1;
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+--error ER_GLOBAL_VARIABLE
+set session maria_checkpoint_interval=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_checkpoint_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_checkpoint_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_checkpoint_interval="foo";
+
+#
+# min/max values
+#
+set global maria_checkpoint_interval=0;
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+set global maria_checkpoint_interval=cast(-1 as unsigned int);
+select @@global.maria_checkpoint_interval, @@global.aria_checkpoint_interval;
+
+SET @@global.maria_checkpoint_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_force_start_after_recovery_failures_basic.test b/mysql-test/suite/sys_vars/t/maria_force_start_after_recovery_failures_basic.test
new file mode 100644
index 00000000000..a6b69561a7e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_force_start_after_recovery_failures_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.maria_force_start_after_recovery_failures, @@global.aria_force_start_after_recovery_failures;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_force_start_after_recovery_failures, @@session.aria_force_start_after_recovery_failures;
+show global variables like '%aria_force_start_after_recovery_failures';
+show session variables like '%aria_force_start_after_recovery_failures';
+select * from information_schema.global_variables where variable_name='maria_force_start_after_recovery_failures';
+select * from information_schema.session_variables where variable_name='maria_force_start_after_recovery_failures';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global maria_force_start_after_recovery_failures=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session maria_force_start_after_recovery_failures=1;
+
diff --git a/mysql-test/suite/sys_vars/t/maria_group_commit_basic.test b/mysql-test/suite/sys_vars/t/maria_group_commit_basic.test
new file mode 100644
index 00000000000..09a9cb6f46e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_group_commit_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_group_commit;
+
+#
+# exists as global only
+#
+select @@global.maria_group_commit, @@global.aria_group_commit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_group_commit, @@session.aria_group_commit;
+show global variables like '%aria_group_commit';
+show session variables like '%aria_group_commit';
+select * from information_schema.global_variables where variable_name='maria_group_commit';
+select * from information_schema.session_variables where variable_name='maria_group_commit';
+
+#
+# show that it's writable
+#
+set global maria_group_commit=1;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+--error ER_GLOBAL_VARIABLE
+set session maria_group_commit=1;
+
+#
+# all valid values
+#
+set global maria_group_commit=none;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+set global maria_group_commit=hard;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+set global maria_group_commit=soft;
+select @@global.maria_group_commit, @@global.aria_group_commit;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_group_commit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_group_commit=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_group_commit="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_group_commit=3;
+
+SET @@global.maria_group_commit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_group_commit_interval_basic.test b/mysql-test/suite/sys_vars/t/maria_group_commit_interval_basic.test
new file mode 100644
index 00000000000..d60219fad5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_group_commit_interval_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_group_commit_interval;
+
+#
+# exists as global only
+#
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_group_commit_interval, @@session.aria_group_commit_interval;
+show global variables like '%aria_group_commit_interval';
+show session variables like '%aria_group_commit_interval';
+select * from information_schema.global_variables where variable_name='maria_group_commit_interval';
+select * from information_schema.session_variables where variable_name='maria_group_commit_interval';
+
+#
+# show that it's writable
+#
+set global maria_group_commit_interval=1;
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+--error ER_GLOBAL_VARIABLE
+set session maria_group_commit_interval=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_group_commit_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_group_commit_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_group_commit_interval="foo";
+
+#
+# min/max values
+#
+set global maria_group_commit_interval=0;
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+set global maria_group_commit_interval=cast(-1 as unsigned int);
+select @@global.maria_group_commit_interval, @@global.aria_group_commit_interval;
+
+SET @@global.maria_group_commit_interval = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_log_file_size_basic.test b/mysql-test/suite/sys_vars/t/maria_log_file_size_basic.test
new file mode 100644
index 00000000000..367ee6c3365
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_log_file_size_basic.test
@@ -0,0 +1,47 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_log_file_size;
+
+#
+# exists as global only
+#
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_log_file_size, @@session.aria_log_file_size;
+show global variables like '%aria_log_file_size';
+show session variables like '%aria_log_file_size';
+select * from information_schema.global_variables where variable_name like '%aria_log_file_size';
+select * from information_schema.session_variables where variable_name like '%aria_log_file_size';
+
+#
+# show that it's writable
+#
+set global maria_log_file_size=1024*1024*10;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+--error ER_GLOBAL_VARIABLE
+set session maria_log_file_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_log_file_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_log_file_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_log_file_size="foo";
+
+#
+# min/max values, block size
+#
+set global maria_log_file_size=1;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+set global maria_log_file_size=@@global.maria_log_file_size + 8192 - 1;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+set global maria_log_file_size=@@global.maria_log_file_size + 8192;
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+set global maria_log_file_size=cast(-1 as unsigned int);
+select @@global.maria_log_file_size, @@global.aria_log_file_size;
+
+SET @@global.maria_log_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_log_purge_type_basic.test b/mysql-test/suite/sys_vars/t/maria_log_purge_type_basic.test
new file mode 100644
index 00000000000..1bf6221922c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_log_purge_type_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_log_purge_type;
+
+#
+# exists as global only
+#
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_log_purge_type, @@session.aria_log_purge_type;
+show global variables like '%aria_log_purge_type';
+show session variables like '%aria_log_purge_type';
+select * from information_schema.global_variables where variable_name like '%aria_log_purge_type';
+select * from information_schema.session_variables where variable_name like '%aria_log_purge_type';
+
+#
+# show that it's writable
+#
+set global maria_log_purge_type=1;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+--error ER_GLOBAL_VARIABLE
+set session maria_log_purge_type=1;
+
+#
+# all valid values
+#
+set global maria_log_purge_type=immediate;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+set global maria_log_purge_type=external;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+set global maria_log_purge_type=at_flush;
+select @@global.maria_log_purge_type, @@global.aria_log_purge_type;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_log_purge_type=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_log_purge_type=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_log_purge_type="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_log_purge_type=3;
+
+SET @@global.maria_log_purge_type = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_max_sort_file_size_basic.test b/mysql-test/suite/sys_vars/t/maria_max_sort_file_size_basic.test
new file mode 100644
index 00000000000..1879449935b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_max_sort_file_size_basic.test
@@ -0,0 +1,49 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_max_sort_file_size;
+
+#
+# exists as global only
+#
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_max_sort_file_size, @@session.aria_max_sort_file_size;
+show global variables like '%aria_max_sort_file_size';
+show session variables like '%aria_max_sort_file_size';
+--sorted_result
+select * from information_schema.global_variables where variable_name like '%aria_max_sort_file_size';
+--sorted_result
+select * from information_schema.session_variables where variable_name like '%aria_max_sort_file_size';
+
+#
+# show that it's writable
+#
+set global maria_max_sort_file_size=1024*1024*10;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+--error ER_GLOBAL_VARIABLE
+set session maria_max_sort_file_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_max_sort_file_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_max_sort_file_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_max_sort_file_size="foo";
+
+#
+# min/max values, block size
+#
+set global maria_max_sort_file_size=1;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+set global maria_max_sort_file_size=@@global.maria_max_sort_file_size + 1024*1024 - 1;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+set global maria_max_sort_file_size=@@global.maria_max_sort_file_size + 1024*1024;
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+set global maria_max_sort_file_size=cast(-1 as unsigned int);
+select @@global.maria_max_sort_file_size, @@global.aria_max_sort_file_size;
+
+SET @@global.maria_max_sort_file_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_page_checksum_basic.test b/mysql-test/suite/sys_vars/t/maria_page_checksum_basic.test
new file mode 100644
index 00000000000..2085abdffd5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_page_checksum_basic.test
@@ -0,0 +1,39 @@
+# bool global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_page_checksum;
+
+#
+# exists as global only
+#
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_page_checksum, @@session.aria_page_checksum;
+show global variables like '%aria_page_checksum';
+show session variables like '%aria_page_checksum';
+select * from information_schema.global_variables where variable_name like '%aria_page_checksum';
+select * from information_schema.session_variables where variable_name like '%aria_page_checksum';
+
+#
+# show that it's writable
+#
+set global maria_page_checksum=ON;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+set global maria_page_checksum=OFF;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+set global maria_page_checksum=1;
+select @@global.maria_page_checksum, @@global.aria_page_checksum;
+--error ER_GLOBAL_VARIABLE
+set session maria_page_checksum=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_page_checksum=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_page_checksum=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_page_checksum="foo";
+
+SET @@global.maria_page_checksum = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_pagecache_age_threshold_basic.test b/mysql-test/suite/sys_vars/t/maria_pagecache_age_threshold_basic.test
new file mode 100644
index 00000000000..17204db2c6c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_pagecache_age_threshold_basic.test
@@ -0,0 +1,47 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_pagecache_age_threshold;
+
+#
+# exists as global only
+#
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_pagecache_age_threshold, @@session.aria_pagecache_age_threshold;
+show global variables like '%aria_pagecache_age_threshold';
+show session variables like '%aria_pagecache_age_threshold';
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_age_threshold';
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_age_threshold';
+
+#
+# show that it's writable
+#
+set global maria_pagecache_age_threshold=200;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+--error ER_GLOBAL_VARIABLE
+set session maria_pagecache_age_threshold=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_age_threshold=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_age_threshold=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_age_threshold="foo";
+
+#
+# min/max values, block size
+#
+set global maria_pagecache_age_threshold=1;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+set global maria_pagecache_age_threshold=@@global.maria_pagecache_age_threshold + 100 - 1;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+set global maria_pagecache_age_threshold=@@global.maria_pagecache_age_threshold + 100;
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+set global maria_pagecache_age_threshold=cast(-1 as unsigned int);
+select @@global.maria_pagecache_age_threshold, @@global.aria_pagecache_age_threshold;
+
+SET @@global.maria_pagecache_age_threshold = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_pagecache_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/maria_pagecache_buffer_size_basic.test
new file mode 100644
index 00000000000..1c37d2014db
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_pagecache_buffer_size_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.maria_pagecache_buffer_size, @@global.aria_pagecache_buffer_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_pagecache_buffer_size, @@session.aria_pagecache_buffer_size;
+show global variables like '%aria_pagecache_buffer_size';
+show session variables like '%aria_pagecache_buffer_size';
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_buffer_size';
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_buffer_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global maria_pagecache_buffer_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session maria_pagecache_buffer_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/maria_pagecache_division_limit_basic.test b/mysql-test/suite/sys_vars/t/maria_pagecache_division_limit_basic.test
new file mode 100644
index 00000000000..c68cb05de10
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_pagecache_division_limit_basic.test
@@ -0,0 +1,43 @@
+# ulong global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_pagecache_division_limit;
+
+#
+# exists as global only
+#
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_pagecache_division_limit, @@session.aria_pagecache_division_limit;
+show global variables like '%aria_pagecache_division_limit';
+show session variables like '%aria_pagecache_division_limit';
+select * from information_schema.global_variables where variable_name like '%aria_pagecache_division_limit';
+select * from information_schema.session_variables where variable_name like '%aria_pagecache_division_limit';
+
+#
+# show that it's writable
+#
+set global maria_pagecache_division_limit=20;
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+--error ER_GLOBAL_VARIABLE
+set session maria_pagecache_division_limit=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_division_limit=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_division_limit=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_pagecache_division_limit="foo";
+
+#
+# min/max values, block size
+#
+set global maria_pagecache_division_limit=0;
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+set global maria_pagecache_division_limit=cast(-1 as unsigned int);
+select @@global.maria_pagecache_division_limit, @@global.aria_pagecache_division_limit;
+
+SET @@global.maria_pagecache_division_limit = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_recover_basic.test b/mysql-test/suite/sys_vars/t/maria_recover_basic.test
new file mode 100644
index 00000000000..d188339929d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_recover_basic.test
@@ -0,0 +1,51 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_recover;
+
+#
+# exists as global only
+#
+select @@global.maria_recover, @@global.aria_recover;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_recover, @@session.aria_recover;
+show global variables like '%aria_recover';
+show session variables like '%aria_recover';
+select * from information_schema.global_variables where variable_name like '%aria_recover';
+select * from information_schema.session_variables where variable_name like '%aria_recover';
+
+#
+# show that it's writable
+#
+set global maria_recover=1;
+select @@global.maria_recover, @@global.aria_recover;
+--error ER_GLOBAL_VARIABLE
+set session maria_recover=1;
+
+#
+# all valid values
+#
+set global maria_recover=normal;
+select @@global.maria_recover, @@global.aria_recover;
+set global maria_recover=backup;
+select @@global.maria_recover, @@global.aria_recover;
+set global maria_recover='force';
+select @@global.maria_recover, @@global.aria_recover;
+set global maria_recover=`quick`;
+select @@global.maria_recover, @@global.aria_recover;
+set global maria_recover=off;
+select @@global.maria_recover, @@global.aria_recover;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_recover=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_recover=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_recover="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_recover=5;
+
+SET @@global.maria_recover = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_repair_threads_basic.test b/mysql-test/suite/sys_vars/t/maria_repair_threads_basic.test
new file mode 100644
index 00000000000..7f66d18f528
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_repair_threads_basic.test
@@ -0,0 +1,43 @@
+# ulong session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_repair_threads;
+
+#
+# exists as global only
+#
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+show global variables like '%aria_repair_threads';
+show session variables like '%aria_repair_threads';
+select * from information_schema.global_variables where variable_name like '%aria_repair_threads';
+select * from information_schema.session_variables where variable_name like '%aria_repair_threads';
+
+#
+# show that it's writable
+#
+set global maria_repair_threads=10;
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+set session maria_repair_threads=10;
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_repair_threads=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session maria_repair_threads=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_repair_threads="foo";
+
+#
+# min/max values, block size
+#
+set global maria_repair_threads=0;
+select @@global.maria_repair_threads, @@global.aria_repair_threads;
+set session maria_repair_threads=cast(-1 as unsigned int);
+select @@session.maria_repair_threads, @@session.aria_repair_threads;
+
+SET @@global.maria_repair_threads = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/maria_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/maria_sort_buffer_size_basic.test
new file mode 100644
index 00000000000..7887e2d19b5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_sort_buffer_size_basic.test
@@ -0,0 +1,43 @@
+# ulong session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_sort_buffer_size;
+
+#
+# exists as global only
+#
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+show global variables like '%aria_sort_buffer_size';
+show session variables like '%aria_sort_buffer_size';
+select * from information_schema.global_variables where variable_name like '%aria_sort_buffer_size';
+select * from information_schema.session_variables where variable_name like '%aria_sort_buffer_size';
+
+#
+# show that it's writable
+#
+set global maria_sort_buffer_size=10;
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+set session maria_sort_buffer_size=10;
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_sort_buffer_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session maria_sort_buffer_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_sort_buffer_size="foo";
+
+#
+# min/max values, block size
+#
+set global maria_sort_buffer_size=0;
+select @@global.maria_sort_buffer_size, @@global.aria_sort_buffer_size;
+set session maria_sort_buffer_size=cast(-1 as unsigned int);
+select @@session.maria_sort_buffer_size, @@session.aria_sort_buffer_size;
+
+SET @@global.maria_sort_buffer_size = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/maria_stats_method_basic.test b/mysql-test/suite/sys_vars/t/maria_stats_method_basic.test
new file mode 100644
index 00000000000..d615705c65a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_stats_method_basic.test
@@ -0,0 +1,46 @@
+# enum session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_stats_method;
+
+#
+# exists as global only
+#
+select @@global.maria_stats_method, @@global.aria_stats_method;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+show global variables like '%aria_stats_method';
+show session variables like '%aria_stats_method';
+select * from information_schema.global_variables where variable_name like '%aria_stats_method';
+select * from information_schema.session_variables where variable_name like '%aria_stats_method';
+
+#
+# show that it's writable
+#
+set global maria_stats_method=1;
+select @@global.maria_stats_method, @@global.aria_stats_method;
+set session maria_stats_method=1;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+
+#
+# all valid values
+#
+set session maria_stats_method=nulls_unequal;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+set session maria_stats_method=nulls_equal;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+set session maria_stats_method=nulls_ignored;
+select @@session.maria_stats_method, @@session.aria_stats_method;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session maria_stats_method=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session maria_stats_method=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session maria_stats_method="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session maria_stats_method=3;
+
+SET @@global.maria_stats_method = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_sync_log_dir_basic.test b/mysql-test/suite/sys_vars/t/maria_sync_log_dir_basic.test
new file mode 100644
index 00000000000..7e9a424cc49
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_sync_log_dir_basic.test
@@ -0,0 +1,47 @@
+# enum global
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.maria_sync_log_dir;
+
+#
+# exists as global only
+#
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_sync_log_dir, @@session.aria_sync_log_dir;
+show global variables like '%aria_sync_log_dir';
+show session variables like '%aria_sync_log_dir';
+select * from information_schema.global_variables where variable_name like '%aria_sync_log_dir';
+select * from information_schema.session_variables where variable_name like '%aria_sync_log_dir';
+
+#
+# show that it's writable
+#
+set global maria_sync_log_dir=1;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+--error ER_GLOBAL_VARIABLE
+set session maria_sync_log_dir=1;
+
+#
+# all valid values
+#
+set global maria_sync_log_dir=never;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+set global maria_sync_log_dir=newfile;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+set global maria_sync_log_dir=always;
+select @@global.maria_sync_log_dir, @@global.aria_sync_log_dir;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_sync_log_dir=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global maria_sync_log_dir=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_sync_log_dir="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set global maria_sync_log_dir=3;
+
+SET @@global.maria_sync_log_dir = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test b/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test
new file mode 100644
index 00000000000..504e2dfbcb5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test
@@ -0,0 +1,22 @@
+# bool readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.maria_used_for_temp_tables, @@global.aria_used_for_temp_tables;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.maria_used_for_temp_tables, @@session.aria_used_for_temp_tables;
+show global variables like '%aria_used_for_temp_tables';
+show session variables like '%aria_used_for_temp_tables';
+select * from information_schema.global_variables where variable_name like '%aria_used_for_temp_tables';
+select * from information_schema.session_variables where variable_name like '%aria_used_for_temp_tables';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global maria_used_for_temp_tables=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session maria_used_for_temp_tables=1;
+
diff --git a/mysql-test/suite/sys_vars/t/mrr_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/mrr_buffer_size_basic.test
new file mode 100644
index 00000000000..5641bb7db6f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mrr_buffer_size_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.mrr_buffer_size;
+
+#
+# exists as global only
+#
+select @@global.mrr_buffer_size;
+select @@session.mrr_buffer_size;
+show global variables like 'mrr_buffer_size';
+show session variables like 'mrr_buffer_size';
+select * from information_schema.global_variables where variable_name='mrr_buffer_size';
+select * from information_schema.session_variables where variable_name='mrr_buffer_size';
+
+#
+# show that it's writable
+#
+set global mrr_buffer_size=10;
+select @@global.mrr_buffer_size;
+set session mrr_buffer_size=10;
+select @@session.mrr_buffer_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global mrr_buffer_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session mrr_buffer_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mrr_buffer_size="foo";
+
+#
+# min/max values, block size
+#
+set global mrr_buffer_size=0;
+select @@global.mrr_buffer_size;
+set session mrr_buffer_size=cast(-1 as unsigned int);
+select @@session.mrr_buffer_size;
+
+SET @@global.mrr_buffer_size = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
new file mode 100644
index 00000000000..03b7743a7aa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
@@ -0,0 +1,21 @@
+# bool readonly
+
+#
+# show the global and session values;
+#
+select @@global.mutex_deadlock_detector;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.mutex_deadlock_detector;
+show global variables like 'mutex_deadlock_detector';
+show session variables like 'mutex_deadlock_detector';
+select * from information_schema.global_variables where variable_name='mutex_deadlock_detector';
+select * from information_schema.session_variables where variable_name='mutex_deadlock_detector';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global mutex_deadlock_detector=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session mutex_deadlock_detector=1;
+
diff --git a/mysql-test/suite/sys_vars/t/optimizer_use_mrr_basic.test b/mysql-test/suite/sys_vars/t/optimizer_use_mrr_basic.test
new file mode 100644
index 00000000000..bb5f1284614
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/optimizer_use_mrr_basic.test
@@ -0,0 +1,46 @@
+# enum session
+--source include/have_maria.inc
+
+SET @start_global_value = @@global.optimizer_use_mrr;
+
+#
+# exists as global only
+#
+select @@global.optimizer_use_mrr;
+select @@session.optimizer_use_mrr;
+show global variables like 'optimizer_use_mrr';
+show session variables like 'optimizer_use_mrr';
+select * from information_schema.global_variables where variable_name='optimizer_use_mrr';
+select * from information_schema.session_variables where variable_name='optimizer_use_mrr';
+
+#
+# show that it's writable
+#
+set global optimizer_use_mrr=1;
+select @@global.optimizer_use_mrr;
+set session optimizer_use_mrr=1;
+select @@session.optimizer_use_mrr;
+
+#
+# all valid values
+#
+set session optimizer_use_mrr='auto';
+select @@session.optimizer_use_mrr;
+set session optimizer_use_mrr='force';
+select @@session.optimizer_use_mrr;
+set session optimizer_use_mrr='disable';
+select @@session.optimizer_use_mrr;
+
+#
+# incorrect types/values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set session optimizer_use_mrr=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session optimizer_use_mrr=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set session optimizer_use_mrr="foo";
+--error ER_WRONG_VALUE_FOR_VAR
+set session optimizer_use_mrr=3;
+
+SET @@global.optimizer_use_mrr = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
index d714950c807..24dc15b646e 100644
--- a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
@@ -5,18 +5,20 @@
#
# on windows it's <basedir>/lib/plugin
# on unix it's <basedir>/lib/mysql/plugin
+# unless mtr sets it to $MYSQL_TEST_DIR/var/plugins
#
---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+let plugindir=$MYSQL_TEST_DIR/var;
+--replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
select @@global.plugin_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.plugin_dir;
---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
show global variables like 'plugin_dir';
---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
show session variables like 'plugin_dir';
---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
select * from information_schema.global_variables where variable_name='plugin_dir';
---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
select * from information_schema.session_variables where variable_name='plugin_dir';
#
diff --git a/mysql-test/suite/sys_vars/t/plugin_maturity_basic.test b/mysql-test/suite/sys_vars/t/plugin_maturity_basic.test
new file mode 100644
index 00000000000..2590e07c85f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/plugin_maturity_basic.test
@@ -0,0 +1,21 @@
+# enum readonly
+
+#
+# show the global and session values;
+#
+select @@global.plugin_maturity;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.plugin_maturity;
+show global variables like 'plugin_maturity';
+show session variables like 'plugin_maturity';
+select * from information_schema.global_variables where variable_name='plugin_maturity';
+select * from information_schema.session_variables where variable_name='plugin_maturity';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global plugin_maturity=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session plugin_maturity=1;
+
diff --git a/mysql-test/suite/sys_vars/t/rowid_merge_buff_size_basic.test b/mysql-test/suite/sys_vars/t/rowid_merge_buff_size_basic.test
new file mode 100644
index 00000000000..1c88bdd7180
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rowid_merge_buff_size_basic.test
@@ -0,0 +1,42 @@
+# ulong session
+
+SET @start_global_value = @@global.rowid_merge_buff_size;
+
+#
+# exists as global only
+#
+select @@global.rowid_merge_buff_size;
+select @@session.rowid_merge_buff_size;
+show global variables like 'rowid_merge_buff_size';
+show session variables like 'rowid_merge_buff_size';
+select * from information_schema.global_variables where variable_name='rowid_merge_buff_size';
+select * from information_schema.session_variables where variable_name='rowid_merge_buff_size';
+
+#
+# show that it's writable
+#
+set global rowid_merge_buff_size=10;
+select @@global.rowid_merge_buff_size;
+set session rowid_merge_buff_size=10;
+select @@session.rowid_merge_buff_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global rowid_merge_buff_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session rowid_merge_buff_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global rowid_merge_buff_size="foo";
+
+#
+# min/max values, block size
+#
+set global rowid_merge_buff_size=0;
+select @@global.rowid_merge_buff_size;
+set session rowid_merge_buff_size=cast(-1 as unsigned int);
+select @@session.rowid_merge_buff_size;
+
+SET @@global.rowid_merge_buff_size = @start_global_value;
+
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
index 43954d6441d..ded489f36ff 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
@@ -9,7 +9,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
select @@global.rpl_semi_sync_master_enabled;
SET @start_global_value = @@global.rpl_semi_sync_master_enabled;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
index 0d085412a00..5258894150d 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
@@ -8,7 +8,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
select @@global.rpl_semi_sync_master_timeout;
SET @start_global_value = @@global.rpl_semi_sync_master_timeout;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
index c3f538f8dba..d9b1d860b35 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
@@ -8,7 +8,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
select @@global.rpl_semi_sync_master_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_master_trace_level;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
index 1db772dec61..896bd50d156 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
@@ -9,7 +9,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
select @@global.rpl_semi_sync_master_wait_no_slave;
SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
index 565139456db..030b0827a11 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
@@ -9,7 +9,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
select @@global.rpl_semi_sync_slave_enabled;
SET @start_global_value = @@global.rpl_semi_sync_slave_enabled;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt
deleted file mode 100644
index 58029d28ace..00000000000
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic-master.opt
+++ /dev/null
@@ -1 +0,0 @@
-$SEMISYNC_PLUGIN_OPT
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
index ac88593f02f..64c935ee957 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
@@ -8,7 +8,7 @@ source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
+eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
select @@global.rpl_semi_sync_slave_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level;
diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
index 49e8a52efea..2d1e94e6620 100644
--- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test
+++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test
@@ -35,9 +35,7 @@
#############################################################
SET @start_global_value = @@global.storage_engine;
-SELECT @start_global_value;
SET @start_session_value = @@session.storage_engine;
-SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
@@ -47,10 +45,12 @@ SELECT @start_session_value;
SET @@global.storage_engine = INNODB;
SET @@global.storage_engine = DEFAULT;
+--replace_result MyISAM InnoDB
SELECT @@global.storage_engine;
SET @@session.storage_engine = INNODB;
SET @@session.storage_engine = DEFAULT;
+--replace_result MyISAM InnoDB
SELECT @@session.storage_engine;
@@ -179,9 +179,7 @@ SET @@storage_engine = @start_global_value;
####################################
SET @@global.storage_engine = @start_global_value;
-SELECT @@global.storage_engine;
SET @@session.storage_engine = @start_session_value;
-SELECT @@session.storage_engine;
#############################################################
diff --git a/mysql-test/suite/sys_vars/t/userstat_basic.test b/mysql-test/suite/sys_vars/t/userstat_basic.test
new file mode 100644
index 00000000000..55aa98c90c7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/userstat_basic.test
@@ -0,0 +1,38 @@
+# bool global
+
+SET @start_global_value = @@global.userstat;
+
+#
+# exists as global only
+#
+select @@global.userstat;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.userstat;
+show global variables like 'userstat';
+show session variables like 'userstat';
+select * from information_schema.global_variables where variable_name='userstat';
+select * from information_schema.session_variables where variable_name='userstat';
+
+#
+# show that it's writable
+#
+set global userstat=ON;
+select @@global.userstat;
+set global userstat=OFF;
+select @@global.userstat;
+set global userstat=1;
+select @@global.userstat;
+--error ER_GLOBAL_VARIABLE
+set session userstat=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global userstat=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global userstat=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global userstat="foo";
+
+SET @@global.userstat = @start_global_value;
diff --git a/mysql-test/suite/vcol/inc/vcol_keys.inc b/mysql-test/suite/vcol/inc/vcol_keys.inc
index 68a40afea92..bba58363a81 100644
--- a/mysql-test/suite/vcol/inc/vcol_keys.inc
+++ b/mysql-test/suite/vcol/inc/vcol_keys.inc
@@ -96,9 +96,9 @@ if (!$skip_spatial_index_check)
{
--echo # Error "All parts of a SPATIAL index must be NOT NULL"
--error ER_SPATIAL_CANT_HAVE_NULL
- create table t1 (a int, b int as (a+1) persistent, spatial index (b));
+ create table t1 (a int, b geometry as (a+1) persistent, spatial index (b));
create table t1 (a int, b int as (a+1) persistent);
- --error ER_SPATIAL_CANT_HAVE_NULL
+ --error ER_SPATIAL_MUST_HAVE_GEOM_COL
alter table t1 add spatial index (b);
drop table t1;
}
diff --git a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
index 4f6b960f9d0..78a8e8944fd 100644
--- a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
@@ -83,7 +83,7 @@ let $rows = 1;
--echo # COT()
let $cols = a double, b double as (format(cot(a),6));
let $values1 = 12,default;
-let $values2 = 0,default;
+let $values2 = 1,default;
let $rows = 2;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
diff --git a/mysql-test/suite/vcol/r/vcol_archive.result b/mysql-test/suite/vcol/r/vcol_archive.result
index 83fb78a5592..5ca80dae7d2 100644
--- a/mysql-test/suite/vcol/r/vcol_archive.result
+++ b/mysql-test/suite/vcol/r/vcol_archive.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'archive';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'ARCHIVE' is not yet supported for computed columns
create table t1 (a int);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'ARCHIVE' is not yet supported for computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_blackhole.result b/mysql-test/suite/vcol/r/vcol_blackhole.result
index 15e7505aebb..dad1902643f 100644
--- a/mysql-test/suite/vcol/r/vcol_blackhole.result
+++ b/mysql-test/suite/vcol/r/vcol_blackhole.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'blackhole';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'BLACKHOLE' is not yet supported for computed columns
create table t1 (a int);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'BLACKHOLE' is not yet supported for computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_csv.result b/mysql-test/suite/vcol/r/vcol_csv.result
index 97977505696..2da4e330f9f 100644
--- a/mysql-test/suite/vcol/r/vcol_csv.result
+++ b/mysql-test/suite/vcol/r/vcol_csv.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'CSV';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'CSV' is not yet supported for computed columns
create table t1 (a int not null);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'CSV' is not yet supported for computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
index 161a82171ce..3628139bd03 100644
--- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
@@ -25,8 +25,8 @@ a b c
# INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols
insert into t1 values (1,2,3);
Warnings:
-Warning 1647 The value specified for computed column 'b' in table 't1' ignored
-Warning 1647 The value specified for computed column 'c' in table 't1' ignored
+Warning 1703 The value specified for computed column 'b' in table 't1' ignored
+Warning 1703 The value specified for computed column 'c' in table 't1' ignored
select * from t1;
a b c
1 -1 -1
@@ -65,8 +65,8 @@ a b c
# against vcols
insert into t1 (a,b) values (1,3), (2,4);
Warnings:
-Warning 1647 The value specified for computed column 'b' in table 't1' ignored
-Warning 1647 The value specified for computed column 'b' in table 't1' ignored
+Warning 1703 The value specified for computed column 'b' in table 't1' ignored
+Warning 1703 The value specified for computed column 'b' in table 't1' ignored
select * from t1;
a b c
1 -1 -1
@@ -107,8 +107,8 @@ a b c
create table t2 like t1;
insert into t2 select * from t1;
Warnings:
-Warning 1647 The value specified for computed column 'b' in table 't2' ignored
-Warning 1647 The value specified for computed column 'c' in table 't2' ignored
+Warning 1703 The value specified for computed column 'b' in table 't2' ignored
+Warning 1703 The value specified for computed column 'c' in table 't2' ignored
select * from t1;
a b c
2 -2 -2
@@ -123,8 +123,8 @@ a b c
create table t2 like t1;
insert into t2 (a,b) select a,b from t1;
Warnings:
-Warning 1647 The value specified for computed column 'b' in table 't2' ignored
-Warning 1647 The value specified for computed column 'b' in table 't2' ignored
+Warning 1703 The value specified for computed column 'b' in table 't2' ignored
+Warning 1703 The value specified for computed column 'b' in table 't2' ignored
select * from t2;
a b c
2 -2 -2
@@ -159,7 +159,7 @@ a b c
2 -2 -2
update t1 set c=3 where a=2;
Warnings:
-Warning 1647 The value specified for computed column 'c' in table 't1' ignored
+Warning 1703 The value specified for computed column 'c' in table 't1' ignored
select * from t1;
a b c
1 -1 -1
@@ -189,7 +189,7 @@ a b c
2 -2 -2
update t1 set c=3 where b=-2;
Warnings:
-Warning 1647 The value specified for computed column 'c' in table 't1' ignored
+Warning 1703 The value specified for computed column 'c' in table 't1' ignored
select * from t1;
a b c
1 -1 -1
diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result
index af0935affbc..f44d306312d 100644
--- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result
@@ -100,11 +100,11 @@ drop table t1;
# TODO: FULLTEXT INDEX
# SPATIAL INDEX
# Error "All parts of a SPATIAL index must be NOT NULL"
-create table t1 (a int, b int as (a+1) persistent, spatial index (b));
+create table t1 (a int, b geometry as (a+1) persistent, spatial index (b));
ERROR 42000: All parts of a SPATIAL index must be NOT NULL
create table t1 (a int, b int as (a+1) persistent);
alter table t1 add spatial index (b);
-ERROR 42000: All parts of a SPATIAL index must be NOT NULL
+ERROR 42000: A SPATIAL index may only contain a geometrical type column
drop table t1;
# FOREIGN KEY
# Rejected FK options.
diff --git a/mysql-test/suite/vcol/r/vcol_memory.result b/mysql-test/suite/vcol/r/vcol_memory.result
index 30b6bd4a4bf..8cfb21f3930 100644
--- a/mysql-test/suite/vcol/r/vcol_memory.result
+++ b/mysql-test/suite/vcol/r/vcol_memory.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'memory';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'MEMORY' is not yet supported for computed columns
create table t1 (a int);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'MEMORY' is not yet supported for computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_merge.result b/mysql-test/suite/vcol/r/vcol_merge.result
index 03a1e151c2e..5cc2286a31a 100644
--- a/mysql-test/suite/vcol/r/vcol_merge.result
+++ b/mysql-test/suite/vcol/r/vcol_merge.result
@@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default);
insert into t2 values (2,default);
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: 'MRG_MYISAM' is not yet supported for computed columns
drop table t1,t2;
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index a460b8da709..0cdd0029b85 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -108,10 +108,10 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (p int, a double NOT NULL, v double AS (ROUND(a,p)) VIRTUAL);
INSERT INTO t1 VALUES (0,1,0);
Warnings:
-Warning 1647 The value specified for computed column 'v' in table 't1' ignored
+Warning 1703 The value specified for computed column 'v' in table 't1' ignored
INSERT INTO t1 VALUES (NULL,0,0);
Warnings:
-Warning 1647 The value specified for computed column 'v' in table 't1' ignored
+Warning 1703 The value specified for computed column 'v' in table 't1' ignored
SELECT a, p, v, ROUND(a,p), ROUND(a,p+NULL) FROM t1;
a p v ROUND(a,p) ROUND(a,p+NULL)
1 0 1 1 NULL
diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result
index e7c01abc3ac..cee28007caa 100644
--- a/mysql-test/suite/vcol/r/vcol_select_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result
@@ -53,7 +53,7 @@ a b c a b c
explain select * from t1,t3 where t1.c=t3.c and t3.c=-1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const c c 5 const 1
-1 SIMPLE t1 ref c c 5 const 2
+1 SIMPLE t1 ref c c 5 const 2 Using index condition
# select_type=PRIMARY, type=index,ALL
select * from t1 where b in (select c from t3);
a b c
@@ -130,7 +130,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 5 NULL 5 Using index
+1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by (scanning)
###
### filesort & range-based utils
###
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
index 844aae38af2..ce6bd7eed40 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
@@ -170,11 +170,11 @@ t1 CREATE TABLE `t1` (
`b` double AS (format(cot(a),6)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (12,default);
-insert into t1 values (0,default);
+insert into t1 values (1,default);
select * from t1;
a b
12 -1.572673
-0 NULL
+1 0.642093
drop table t1;
set sql_warnings = 0;
# CRC32()
diff --git a/mysql-test/suite/vcol/r/vcol_view_myisam.result b/mysql-test/suite/vcol/r/vcol_view_myisam.result
index bd5999792ff..72325939c20 100644
--- a/mysql-test/suite/vcol/r/vcol_view_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_view_myisam.result
@@ -266,8 +266,8 @@ insert into v1 (a) values (3);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 (a) values (2),(3),(0);
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a b c
1 -1 -1
diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
index 516e121a2aa..baefddc0fd1 100644
--- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
let $skip_full_text_checks = 1;
diff --git a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
index 38baa2b3024..e11618163cc 100644
--- a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_handler_innodb.test b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
index bf443c6bbd3..1a50aeaaa86 100644
--- a/mysql-test/suite/vcol/t/vcol_handler_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
index 5d9ac12e930..3b83c7f4565 100644
--- a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
index e408672ac07..d44d2f701cf 100644
--- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
index 88ed6157294..42834d5c0bb 100644
--- a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
@@ -35,7 +35,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_partition_innodb.test b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
index 01230120ef9..47f1581fc96 100644
--- a/mysql-test/suite/vcol/t/vcol_partition_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
@@ -34,7 +34,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_select_innodb.test b/mysql-test/suite/vcol/t/vcol_select_innodb.test
index 314aecb75b9..787f5fe77a7 100644
--- a/mysql-test/suite/vcol/t/vcol_select_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_select_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
index 53826a460a7..32e2600c2fc 100644
--- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
index 5a36fb1c06d..57655d6d3fe 100644
--- a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
@@ -34,7 +34,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_view_innodb.test b/mysql-test/suite/vcol/t/vcol_view_innodb.test
index 01fced8e4c3..322fb122436 100644
--- a/mysql-test/suite/vcol/t/vcol_view_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_view_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/t/archive_plugin-master.opt b/mysql-test/t/archive_plugin-master.opt
deleted file mode 100644
index 36b21a74922..00000000000
--- a/mysql-test/t/archive_plugin-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---plugin_dir=$ARCHIVE_PLUGIN_DIR
diff --git a/mysql-test/t/blackhole_plugin-master.opt b/mysql-test/t/blackhole_plugin-master.opt
deleted file mode 100644
index e78cd2b1662..00000000000
--- a/mysql-test/t/blackhole_plugin-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---plugin_dir=$BLACKHOLE_PLUGIN_DIR
diff --git a/mysql-test/t/bootstrap-master.opt b/mysql-test/t/bootstrap-master.opt
index 31a799e4d9b..96f0ce3f36c 100644
--- a/mysql-test/t/bootstrap-master.opt
+++ b/mysql-test/t/bootstrap-master.opt
@@ -1 +1 @@
---default-storage-engine=MyISAM --skip-innodb
+--default-storage-engine=MyISAM
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index ca8782f1b27..d5bb2f42273 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -7,7 +7,7 @@ drop table if exists t1;
# Add the datadir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`;
-let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --skip-innodb;
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --loose-skip-innodb;
#
# Check that --bootstrap reads from stdin
#
diff --git a/mysql-test/t/crash_commit_before-master.opt b/mysql-test/t/crash_commit_before-master.opt
index becc5443ef1..9bcf94dca97 100644
--- a/mysql-test/t/crash_commit_before-master.opt
+++ b/mysql-test/t/crash_commit_before-master.opt
@@ -1,3 +1,3 @@
--skip-stack-trace --skip-core-file
--default-storage-engine=MyISAM
---loose-innodb-file-per-table=0
+--loose-skip-innodb-file-per-table
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
index ef705474eee..513dfb4e03f 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -2,6 +2,8 @@
-- source include/have_utf8mb4.inc
+SET TIME_ZONE='+03:00';
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test
index b03284a1c7c..89e4499d0b1 100644
--- a/mysql-test/t/ctype_utf32.test
+++ b/mysql-test/t/ctype_utf32.test
@@ -1,5 +1,7 @@
-- source include/have_utf32.inc
+SET TIME_ZONE = '+03:00';
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 45f6dc2f82e..957c2e9a7b4 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -4,6 +4,9 @@
let collation=utf8_unicode_ci;
--source include/have_collation.inc
+SET TIME_ZONE='+03:00';
+
+--source include/have_innodb.inc
--disable_warnings
drop table if exists t1,t2,t3,t4;
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 1a121d10470..6b6cdaabcdf 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -258,7 +258,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT);
--error ER_SP_DOES_NOT_EXIST
INSERT DELAYED INTO t1 SET a= b();
---error 1305
+--error ER_BAD_FIELD_ERROR
INSERT DELAYED INTO t1 SET b= 1;
--error ER_SP_DOES_NOT_EXIST
INSERT DELAYED INTO t1 SET b= b();
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 7456face914..bd1817b20ec 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -18,3 +18,4 @@ query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails spo
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
diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test
index 1c296ee302b..3240dccbc76 100644
--- a/mysql-test/t/events_logs_tests.test
+++ b/mysql-test/t/events_logs_tests.test
@@ -75,10 +75,12 @@ create event ev_log_general on schedule at now() on completion not preserve
--replace_column 1 USER_HOST
select user_host, db, sql_text from mysql.slow_log
where sql_text like 'select \'events_logs_test\'%';
+
drop database events_test;
set global event_scheduler=off;
set @@global.long_query_time=default;
set @@session.long_query_time=default;
+
#
# Safety
#
diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/t/fulltext_plugin.test
index 25e4302ef0d..5f09992d464 100644
--- a/mysql-test/t/fulltext_plugin.test
+++ b/mysql-test/t/fulltext_plugin.test
@@ -4,7 +4,7 @@
# BUG#39746 - Debug flag breaks struct definition (server crash)
#
--replace_regex /\.dll/.so/
-eval INSTALL PLUGIN simple_parser SONAME $MYPLUGLIB_SO;
+eval INSTALL PLUGIN simple_parser SONAME '$MYPLUGLIB_SO';
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
DROP TABLE t1;
diff --git a/mysql-test/t/information_schema_all_engines-master.opt b/mysql-test/t/information_schema_all_engines-master.opt
deleted file mode 100644
index 959cf74c816..00000000000
--- a/mysql-test/t/information_schema_all_engines-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-safemalloc
diff --git a/mysql-test/t/information_schema_all_engines.test b/mysql-test/t/information_schema_all_engines.test
index b20ce60985c..97065803169 100644
--- a/mysql-test/t/information_schema_all_engines.test
+++ b/mysql-test/t/information_schema_all_engines.test
@@ -4,7 +4,7 @@
--source include/not_embedded.inc
--source include/have_pbxt.inc
---source include/have_innodb.inc
+--source include/have_xtradb.inc
--source include/not_staging.inc
use INFORMATION_SCHEMA;
diff --git a/mysql-test/t/information_schema_parameters.test b/mysql-test/t/information_schema_parameters.test
index ec9616926b7..254daa5d314 100644
--- a/mysql-test/t/information_schema_parameters.test
+++ b/mysql-test/t/information_schema_parameters.test
@@ -28,7 +28,7 @@
###############################################################################
-- echo # ========== parameters.1 ==========
USE INFORMATION_SCHEMA;
---replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
+--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
SHOW CREATE TABLE INFORMATION_SCHEMA.PARAMETERS;
# embedded server does not display privileges
diff --git a/mysql-test/t/information_schema_routines.test b/mysql-test/t/information_schema_routines.test
index c107b1dc2ce..2d80f67fb72 100644
--- a/mysql-test/t/information_schema_routines.test
+++ b/mysql-test/t/information_schema_routines.test
@@ -56,7 +56,7 @@
################################################################################
-- echo # ========== routines.1 ==========
USE INFORMATION_SCHEMA;
---replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
+--replace_result ENGINE=MyISAM "" ENGINE=MARIA "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
SHOW CREATE TABLE INFORMATION_SCHEMA.ROUTINES;
# embedded server does not display privileges
diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test
deleted file mode 100644
index eacf7e562be..00000000000
--- a/mysql-test/t/innodb-lock.test
+++ /dev/null
@@ -1,102 +0,0 @@
--- source include/have_innodb.inc
-
-#
-# Check and select innodb lock type
-#
-
-set global innodb_table_locks=1;
-
-select @@innodb_table_locks;
-
-#
-# Testing of explicit table locks with enforced table locks
-#
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Testing of explicit table locks with enforced table locks
-#
-
-set @@innodb_table_locks=1;
-
-connection con1;
-create table t1 (id integer, x integer) engine=INNODB;
-insert into t1 values(0, 0);
-set autocommit=0;
-SELECT * from t1 where id = 0 FOR UPDATE;
-
-connection con2;
-set autocommit=0;
-
-# The following statement should hang because con1 is locking the page
---send
-lock table t1 write;
---sleep 2
-
-connection con1;
-update t1 set x=1 where id = 0;
-select * from t1;
-commit;
-
-connection con2;
-reap;
-update t1 set x=2 where id = 0;
-commit;
-unlock tables;
-
-connection con1;
-select * from t1;
-commit;
-
-drop table t1;
-
-#
-# Try with old lock method (where LOCK TABLE is ignored by InnoDB)
-#
-
-set @@innodb_table_locks=0;
-
-create table t1 (id integer primary key, x integer) engine=INNODB;
-insert into t1 values(0, 0),(1,1),(2,2);
-commit;
-SELECT * from t1 where id = 0 FOR UPDATE;
-
-connection con2;
-set autocommit=0;
-set @@innodb_table_locks=0;
-
-# The following statement should work becase innodb doesn't check table locks
-lock table t1 write;
-
-connection con1;
-
-# This will be locked by MySQL
---send
-update t1 set x=10 where id = 2;
---sleep 2
-
-connection con2;
-
-# Note that we will get a deadlock if we try to select any rows marked
-# for update by con1 !
-
-SELECT * from t1 where id = 2;
-UPDATE t1 set x=3 where id = 2;
-commit;
-SELECT * from t1;
-commit;
-unlock tables;
-
-connection con1;
-reap;
-commit;
-select * from t1;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/innodb-master.opt b/mysql-test/t/innodb-master.opt
deleted file mode 100644
index 72c88068345..00000000000
--- a/mysql-test/t/innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=32768 --loose_innodb_lock_wait_timeout=1
diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/t/innodb-semi-consistent-master.opt
deleted file mode 100644
index cb48f1aaf60..00000000000
--- a/mysql-test/t/innodb-semi-consistent-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test
deleted file mode 100644
index f5ed4677c69..00000000000
--- a/mysql-test/t/innodb-semi-consistent.test
+++ /dev/null
@@ -1,68 +0,0 @@
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-# basic tests of semi-consistent reads
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-set binlog_format=mixed;
-set session transaction isolation level repeatable read;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-set autocommit=0;
-# this should lock the entire table
-select * from t1 where a=3 lock in share mode;
-connection b;
-set binlog_format=mixed;
-set session transaction isolation level repeatable read;
-set autocommit=0;
--- error ER_LOCK_WAIT_TIMEOUT
-update t1 set a=10 where a=5;
-connection a;
-commit;
-connection b;
-# perform a semi-consisent read (and unlock non-matching rows)
-set session transaction isolation level read committed;
-update t1 set a=10 where a=5;
-connection a;
--- error ER_LOCK_WAIT_TIMEOUT
-select * from t1 where a=2 for update;
-# this should lock the records (1),(2)
-select * from t1 where a=2 limit 1 for update;
-connection b;
-# semi-consistent read will skip non-matching locked rows a=1, a=2
-update t1 set a=11 where a=6;
--- error ER_LOCK_WAIT_TIMEOUT
-update t1 set a=12 where a=2;
--- error ER_LOCK_WAIT_TIMEOUT
-update t1 set a=13 where a=1;
-connection a;
-commit;
-connection b;
-update t1 set a=14 where a=1;
-commit;
-connection a;
-select * from t1;
-drop table t1;
-
-connection default;
-disconnect a;
-disconnect b;
-
-# Bug 39320
-create table t1 (a int, b int) engine=myisam;
-create table t2 (c int, d int, key (c)) engine=innodb;
-insert into t1 values (1,1);
-insert into t2 values (1,2);
-connect (a,localhost,root,,);
-connection a;
-set session transaction isolation level read committed;
-delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);
-connection default;
-disconnect a;
-drop table t1, t2;
diff --git a/mysql-test/t/innodb-zip.test b/mysql-test/t/innodb-zip.test
deleted file mode 100644
index 7514da087eb..00000000000
--- a/mysql-test/t/innodb-zip.test
+++ /dev/null
@@ -1,347 +0,0 @@
--- source include/have_innodb.inc
-
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-
-create table t0(a int primary key) engine=innodb row_format=compressed;
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
-alter table t1 key_block_size=0;
-alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
-
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-
-insert into t1 select 1, b from t2;
-commit;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-
-connection a;
-begin;
-update t1 set b=repeat('B',100);
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection a;
-rollback;
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection default;
-disconnect a;
-disconnect b;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1,t2;
-
-# The following should fail even in non-strict mode.
-SET SESSION innodb_strict_mode = off;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-# The maximum key size for a compressed row actually depends on the
-# version of libz used, as account must be taken for the maximum
-# compressed size of a key, and this differs between libz
-# versions. Some libz versions allow a size of 439, some only 438.
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-
-#
-# Test blob column inheritance (mantis issue#36)
-#
-
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
- primary key(c1, c2(22), c3(22)))
- engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
- repeat('C', 20000));
-
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-
-# one blob column which is unchanged in update and part of PK
-# one blob column which is changed and part of of PK
-# one blob column which is not part of PK and is unchanged
-select count(*) from t1 where c2 = repeat('A', 20000);
-select count(*) from t1 where c3 = repeat('D', 20000);
-select count(*) from t1 where c4 = repeat('C', 20000);
-
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-
-#
-#
-# Test innodb_file_format
-#
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`2`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`-1`;
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`Cheetah`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`abc`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`1a`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=``;
-
-#test strict mode.
-# this does not work anymore, has been removed from mysqltest
-# -- enable_errors
-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;
-drop table t1;
-
-#set strict_mode
-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;
-show warnings;
-
-
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-
-#check various ROW_FORMAT values.
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-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;
-
-#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
-show warnings;
-
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-show warnings;
-
---error ER_CANT_CREATE_TABLE
-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;
-
-#test multiple errors
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 9 row_format = redundant;
-show warnings;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-show warnings;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-show warnings;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-#test valid values with innodb_file_per_table unset
-set global innodb_file_per_table = off;
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show warnings;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (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 t8, t9;
-
-#test valid values with innodb_file_format unset
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show warnings;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show warnings;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (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 t8, t9;
-
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-#
-# Testing of tablespace tagging
-#
--- disable_info
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_check=`Antelope`;
-create table normal_table (
- c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-create table zip_table (
- c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
--- disable_result_log
-show table status;
--- enable_result_log
-select @@innodb_file_format_check;
-drop table normal_table, zip_table;
--- disable_result_log
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_format=$format;
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
deleted file mode 100644
index 2c9f84e823a..00000000000
--- a/mysql-test/t/innodb.test
+++ /dev/null
@@ -1,2565 +0,0 @@
-#######################################################################
-# #
-# Please, DO NOT TOUCH this file as well as the innodb.result file. #
-# These files are to be modified ONLY BY INNOBASE guys. #
-# #
-# Use innodb_mysql.[test|result] files instead. #
-# #
-# If nevertheless you need to make some changes here, please, forward #
-# your commit message #
-# To: innodb_dev_ww@oracle.com #
-# Cc: dev-innodb@mysql.com #
-# (otherwise your changes may be erased). #
-# #
-#######################################################################
-
--- source include/have_innodb.inc
-
-# Save the original values of some variables in order to be able to
-# estimate how much they have changed during the tests. Previously this
-# test assumed that e.g. rows_deleted is 0 here and after deleting 23
-# rows it expected that rows_deleted will be 23. Now we do not make
-# assumptions about the values of the variables at the beginning, e.g.
-# rows_deleted should be 23 + "rows_deleted before the test". This allows
-# the test to be run multiple times without restarting the mysqld server.
-# See Bug#43309 Test main.innodb can't be run twice
--- disable_query_log
-SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
-
-SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
-SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
-SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
-SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
-SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
-SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
-SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
-SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
--- enable_query_log
-
---disable_warnings
-drop table if exists t1,t2,t3,t4;
-drop database if exists mysqltest;
---enable_warnings
-
-#
-# Small basic test with ignore
-#
-
-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;
-
-update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
-select id, code, name from t1 order by id;
-update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
-select id, code, name from t1 order by id;
-
-drop table t1;
-
-#
-# A bit bigger test
-# The 'replace_column' statements are needed because the cardinality calculated
-# by innodb is not always the same between runs
-#
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- parent_id int(11) DEFAULT '0' NOT NULL,
- level tinyint(4) DEFAULT '0' NOT NULL,
- PRIMARY KEY (id),
- KEY parent_id (parent_id),
- KEY level (level)
-) engine=innodb;
-INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
-update t1 set parent_id=parent_id+100;
-select * from t1 where parent_id=102;
-update t1 set id=id+1000;
--- error ER_DUP_ENTRY,1022
-update t1 set id=1024 where id=1009;
-select * from t1;
-update ignore t1 set id=id+1; # This will change all rows
-select * from t1;
-update ignore t1 set id=1023 where id=1010;
-select * from t1 where parent_id=102;
---replace_column 9 #
-explain select level from t1 where level=1;
---replace_column 9 #
-explain select level,id from t1 where level=1;
---replace_column 9 #
-explain select level,id,parent_id from t1 where level=1;
-select level,id from t1 where level=1;
-select level,id,parent_id from t1 where level=1;
-optimize table t1;
---replace_column 7 #
-show keys from t1;
-drop table t1;
-
-#
-# Test replace
-#
-
-CREATE TABLE t1 (
- gesuchnr int(11) DEFAULT '0' NOT NULL,
- benutzer_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (gesuchnr,benutzer_id)
-) engine=innodb;
-
-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);
-select * from t1;
-drop table t1;
-
-#
-# test delete using hidden_primary_key
-#
-
-create table t1 (a int) engine=innodb;
-insert into t1 values (1), (2);
-optimize table t1;
-delete from t1 where a = 1;
-select * from t1;
-check table t1;
-drop table t1;
-
-create table t1 (a int,b varchar(20)) engine=innodb;
-insert into t1 values (1,""), (2,"testing");
-delete from t1 where a = 1;
-select * from t1;
-create index skr on t1 (a);
-insert into t1 values (3,""), (4,"testing");
-analyze table t1;
---replace_column 7 #
-show keys from t1;
-drop table t1;
-
-
-# Test of reading on secondary key with may be null
-
-create table t1 (a int,b varchar(20),key(a)) engine=innodb;
-insert into t1 values (1,""), (2,"testing");
-select * from t1 where a = 1;
-drop table t1;
-
-#
-# Test rollback
-#
-
-create table t1 (n int not null primary key) engine=innodb;
-set autocommit=0;
-insert into t1 values (4);
-rollback;
-select n, "after rollback" from t1;
-insert into t1 values (4);
-commit;
-select n, "after commit" from t1;
-commit;
-insert into t1 values (5);
--- error ER_DUP_ENTRY
-insert into t1 values (4);
-commit;
-select n, "after commit" from t1;
-set autocommit=1;
-insert into t1 values (6);
--- error ER_DUP_ENTRY
-insert into t1 values (4);
-select n from t1;
-set autocommit=0;
-#
-# savepoints
-#
-begin;
-savepoint `my_savepoint`;
-insert into t1 values (7);
-savepoint `savept2`;
-insert into t1 values (3);
-select n from t1;
-savepoint savept3;
-rollback to savepoint savept2;
---error 1305
-rollback to savepoint savept3;
-rollback to savepoint savept2;
-release savepoint `my_savepoint`;
-select n from t1;
--- error 1305
-rollback to savepoint `my_savepoint`;
---error 1305
-rollback to savepoint savept2;
-insert into t1 values (8);
-savepoint sv;
-commit;
-savepoint sv;
-set autocommit=1;
-# nop
-rollback;
-drop table t1;
-
-#
-# Test for commit and FLUSH TABLES WITH READ LOCK
-#
-
-create table t1 (n int not null primary key) engine=innodb;
-start transaction;
-insert into t1 values (4);
-flush tables with read lock;
-#
-# Current code can't handle a read lock in middle of transaction
-#--error 1223;
-commit;
-unlock tables;
-commit;
-select * from t1;
-drop table t1;
-
-#
-# Testing transactions
-#
-
-create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb;
-begin;
-insert into t1 values(1,'hamdouni');
-select id as afterbegin_id,nom as afterbegin_nom from t1;
-rollback;
-select id as afterrollback_id,nom as afterrollback_nom from t1;
-set autocommit=0;
-insert into t1 values(2,'mysql');
-select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
-rollback;
-select id as afterrollback_id,nom as afterrollback_nom from t1;
-set autocommit=1;
-drop table t1;
-
-#
-# Simple not autocommit test
-#
-
-CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
-insert into t1 values ('pippo', 12);
--- error ER_DUP_ENTRY
-insert into t1 values ('pippo', 12); # Gives error
-delete from t1;
-delete from t1 where id = 'pippo';
-select * from t1;
-
-insert into t1 values ('pippo', 12);
-set autocommit=0;
-delete from t1;
-rollback;
-select * from t1;
-delete from t1;
-commit;
-select * from t1;
-drop table t1;
-
-#
-# Test of active transactions
-#
-
-create table t1 (a integer) engine=innodb;
-start transaction;
-rename table t1 to t2;
-create table t1 (b integer) engine=innodb;
-insert into t1 values (1);
-rollback;
-drop table t1;
-rename table t2 to t1;
-drop table t1;
-set autocommit=1;
-
-#
-# The following simple tests failed at some point
-#
-
-CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb;
-INSERT INTO t1 VALUES (1, 'Jochen');
-select * from t1;
-drop table t1;
-
-CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb;
-set autocommit=0;
-INSERT INTO t1 SET _userid='marc@anyware.co.uk';
-COMMIT;
-SELECT * FROM t1;
-SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
-drop table t1;
-set autocommit=1;
-
-#
-# Test when reading on part of unique key
-#
-CREATE TABLE t1 (
- user_id int(10) DEFAULT '0' NOT NULL,
- name varchar(100),
- phone varchar(100),
- ref_email varchar(100) DEFAULT '' NOT NULL,
- detail varchar(200),
- PRIMARY KEY (user_id,ref_email)
-)engine=innodb;
-
-INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar');
-select * from t1 where user_id=10292;
-INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds');
-select * from t1 where user_id=10292;
-select * from t1 where user_id>=10292;
-select * from t1 where user_id>10292;
-select * from t1 where user_id<10292;
-drop table t1;
-
-#
-# Test that keys are created in right order
-#
-
-CREATE TABLE t1 (a int not null, b int not null,c int not null,
-key(a),primary key(a,b), unique(c),key(a),unique(b));
---replace_column 7 #
-show index from t1;
-drop table t1;
-
-#
-# Test of ALTER TABLE and innodb tables
-#
-
-create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
-alter table t1 engine=innodb;
-insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
-select * from t1;
-update t1 set col2='7' where col1='4';
-select * from t1;
-alter table t1 add co3 int not null;
-select * from t1;
-update t1 set col2='9' where col1='2';
-select * from t1;
-drop table t1;
-
-#
-# INSERT INTO innodb tables
-#
-
-create table t1 (a int not null , b int, primary key (a)) engine = innodb;
-create table t2 (a int not null , b int, primary key (a)) engine = myisam;
-insert into t1 VALUES (1,3) , (2,3), (3,3);
-select * from t1;
-insert into t2 select * from t1;
-select * from t2;
-delete from t1 where b = 3;
-select * from t1;
-insert into t1 select * from t2;
-select * from t1;
-select * from t2;
-drop table t1,t2;
-
-#
-# ORDER BY on not primary key
-#
-
-CREATE TABLE t1 (
- user_name varchar(12),
- password text,
- subscribed char(1),
- user_id int(11) DEFAULT '0' NOT NULL,
- quota bigint(20),
- weight double,
- access_date date,
- access_time time,
- approved datetime,
- dummy_primary_key int(11) NOT NULL auto_increment,
- PRIMARY KEY (dummy_primary_key)
-) ENGINE=innodb;
-INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
-INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
-INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
-INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
-INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
-select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
-drop table t1;
-
-#
-# Testing of tables without primary keys
-#
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- parent_id int(11) DEFAULT '0' NOT NULL,
- level tinyint(4) DEFAULT '0' NOT NULL,
- KEY (id),
- KEY parent_id (parent_id),
- KEY level (level)
-) engine=innodb;
-INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
-INSERT INTO t1 values (179,5,2);
-update t1 set parent_id=parent_id+100;
-select * from t1 where parent_id=102;
-update t1 set id=id+1000;
-update t1 set id=1024 where id=1009;
-select * from t1;
-update ignore t1 set id=id+1; # This will change all rows
-select * from t1;
-update ignore t1 set id=1023 where id=1010;
-select * from t1 where parent_id=102;
---replace_column 9 #
-explain select level from t1 where level=1;
-select level,id from t1 where level=1;
-select level,id,parent_id from t1 where level=1;
-select level,id from t1 where level=1 order by id;
-delete from t1 where level=1;
-select * from t1;
-drop table t1;
-
-#
-# Test of index only reads
-#
-CREATE TABLE t1 (
- sca_code char(6) NOT NULL,
- cat_code char(6) NOT NULL,
- sca_desc varchar(50),
- lan_code char(2) NOT NULL,
- sca_pic varchar(100),
- sca_sdesc varchar(50),
- sca_sch_desc varchar(16),
- PRIMARY KEY (sca_code, cat_code, lan_code),
- INDEX sca_pic (sca_pic)
-) engine = innodb ;
-
-INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
-select count(*) from t1 where sca_code = 'PD';
-select count(*) from t1 where sca_code <= 'PD';
-select count(*) from t1 where sca_pic is null;
-alter table t1 drop index sca_pic;
-alter table t1 add index sca_pic (cat_code, sca_pic);
-select count(*) from t1 where sca_code='PD' and sca_pic is null;
-select count(*) from t1 where cat_code='E';
-
-alter table t1 drop index sca_pic;
-alter table t1 add index (sca_pic, cat_code);
-select count(*) from t1 where sca_code='PD' and sca_pic is null;
-select count(*) from t1 where sca_pic >= 'n';
-select sca_pic from t1 where sca_pic is null;
-update t1 set sca_pic="test" where sca_pic is null;
-delete from t1 where sca_code='pd';
-drop table t1;
-
-#
-# Test of opening table twice and timestamps
-#
-set @a:=now();
-CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
-insert into t1 (a) values(1),(2),(3);
-select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
-select a from t1 natural join t1 as t2 where b >= @a order by a;
-update t1 set a=5 where a=1;
-select a from t1;
-drop table t1;
-
-#
-# Test with variable length primary key
-#
-create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb;
-insert into t1 values("hello",1),("world",2);
-select * from t1 order by b desc;
-optimize table t1;
---replace_column 7 #
-show keys from t1;
-drop table t1;
-
-#
-# Test of create index with NULL columns
-#
-create table t1 (i int, j int ) ENGINE=innodb;
-insert into t1 values (1,2);
-select * from t1 where i=1 and j=2;
-create index ax1 on t1 (i,j);
-select * from t1 where i=1 and j=2;
-drop table t1;
-
-#
-# Test min-max optimization
-#
-
-CREATE TABLE t1 (
- a int3 unsigned NOT NULL,
- b int1 unsigned NOT NULL,
- UNIQUE (a, b)
-) ENGINE = innodb;
-
-INSERT INTO t1 VALUES (1, 1);
-SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
-drop table t1;
-
-#
-# Test INSERT DELAYED
-#
-
-CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb;
-# Can't test this in 3.23
-# INSERT DELAYED INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (1);
-SELECT * FROM t1;
-DROP TABLE t1;
-
-
-#
-# Crash when using many tables (Test case by Jeremy D Zawodny)
-#
-
-create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb;
-insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
---replace_column 9 #
-explain select * from t1 where a > 0 and a < 50;
-drop table t1;
-
-#
-# Test lock tables
-#
-
-create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
-insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
-LOCK TABLES t1 WRITE;
---error ER_DUP_ENTRY
-insert into t1 values (99,1,2,'D'),(1,1,2,'D');
-select id from t1;
-select id from t1;
-UNLOCK TABLES;
-DROP TABLE t1;
-
-create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
-insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
-LOCK TABLES t1 WRITE;
-begin;
---error ER_DUP_ENTRY
-insert into t1 values (99,1,2,'D'),(1,1,2,'D');
-select id from t1;
-insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
-commit;
-select id,id3 from t1;
-UNLOCK TABLES;
-DROP TABLE t1;
-
-#
-# Test prefix key
-#
-create table t1 (a char(20), unique (a(5))) engine=innodb;
-drop table t1;
-create table t1 (a char(20), index (a(5))) engine=innodb;
-show create table t1;
-drop table t1;
-
-#
-# Test using temporary table and auto_increment
-#
-
-create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb;
-insert into t1 values (NULL),(NULL),(NULL);
-delete from t1 where a=3;
-insert into t1 values (NULL);
-select * from t1;
-alter table t1 add b int;
-select * from t1;
-drop table t1;
-
-#Slashdot bug
-create table t1
- (
- id int auto_increment primary key,
- name varchar(32) not null,
- value text not null,
- uid int not null,
- unique key(name,uid)
- ) engine=innodb;
-insert into t1 values (1,'one','one value',101),
- (2,'two','two value',102),(3,'three','three value',103);
-set insert_id=5;
-replace into t1 (value,name,uid) values ('other value','two',102);
-delete from t1 where uid=102;
-set insert_id=5;
-replace into t1 (value,name,uid) values ('other value','two',102);
-set insert_id=6;
-replace into t1 (value,name,uid) values ('other value','two',102);
-select * from t1;
-drop table t1;
-
-#
-# Test DROP DATABASE
-#
-
-create database mysqltest;
-create table mysqltest.t1 (a int not null) engine= innodb;
-insert into mysqltest.t1 values(1);
-create table mysqltest.t2 (a int not null) engine= myisam;
-insert into mysqltest.t2 values(1);
-create table mysqltest.t3 (a int not null) engine= heap;
-insert into mysqltest.t3 values(1);
-commit;
-drop database mysqltest;
-# Don't check error message
---error 1049
-show tables from mysqltest;
-
-#
-# Test truncate table with and without auto_commit
-#
-
-set autocommit=0;
-create table t1 (a int not null) engine= innodb;
-insert into t1 values(1),(2);
-truncate table t1;
-commit;
-truncate table t1;
-truncate table t1;
-select * from t1;
-insert into t1 values(1),(2);
-delete from t1;
-select * from t1;
-commit;
-drop table t1;
-set autocommit=1;
-
-create table t1 (a int not null) engine= innodb;
-insert into t1 values(1),(2);
-truncate table t1;
-insert into t1 values(1),(2);
-select * from t1;
-truncate table t1;
-insert into t1 values(1),(2);
-delete from t1;
-select * from t1;
-drop table t1;
-
-#
-# Test of how ORDER BY works when doing it on the whole table
-#
-
-create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb;
-insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
---replace_column 9 #
-explain select * from t1 order by a;
---replace_column 9 #
-explain select * from t1 order by b;
---replace_column 9 #
-explain select * from t1 order by c;
---replace_column 9 #
-explain select a from t1 order by a;
---replace_column 9 #
-explain select b from t1 order by b;
---replace_column 9 #
-explain select a,b from t1 order by b;
---replace_column 9 #
-explain select a,b from t1;
---replace_column 9 #
-explain select a,b,c from t1;
-drop table t1;
-
-#
-# Check describe
-#
-
-create table t1 (t int not null default 1, key (t)) engine=innodb;
-desc t1;
-drop table t1;
-
-#
-# Test of multi-table-delete
-#
-
-CREATE TABLE t1 (
- number bigint(20) NOT NULL default '0',
- cname char(15) NOT NULL default '',
- carrier_id smallint(6) NOT NULL default '0',
- privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
- last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
- last_app_id smallint(6) default '-1',
- version smallint(6) NOT NULL default '0',
- assigned_scps int(11) default '0',
- status tinyint(4) default '0'
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1);
-INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
-INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1);
-INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
-INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
-INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
-CREATE TABLE t2 (
- number bigint(20) NOT NULL default '0',
- cname char(15) NOT NULL default '',
- carrier_id smallint(6) NOT NULL default '0',
- privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
- last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
- last_app_id smallint(6) default '-1',
- version smallint(6) NOT NULL default '0',
- assigned_scps int(11) default '0',
- status tinyint(4) default '0'
-) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1);
-INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
-INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1);
-INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
-select * from t1;
-select * from t2;
-delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
-select * from t1;
-select * from t2;
-select * from t2;
-drop table t1,t2;
-
-#
-# A simple test with some isolation levels
-# TODO: Make this into a test using replication to really test how
-# this works.
-#
-
-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;
-
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
-insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
-select id, code, name from t1 order by id;
-COMMIT;
-
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
-select id, code, name from t1 order by id;
-COMMIT;
-
-SET binlog_format='MIXED';
-BEGIN;
-SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
-select id, code, name from t1 order by id;
-COMMIT;
-DROP TABLE t1;
-
-#
-# Test of multi-table-update
-#
-create table t1 (n int(10), d int(10)) engine=innodb;
-create table t2 (n int(10), d int(10)) engine=innodb;
-insert into t1 values(1,1),(1,2);
-insert into t2 values(1,10),(2,20);
-UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
-select * from t1;
-select * from t2;
-drop table t1,t2;
-
-#
-# Bug #29136 erred multi-delete on trans table does not rollback
-#
-
-# prepare
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-CREATE TABLE t1 (a int, PRIMARY KEY (a));
-CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
-create trigger trg_del_t2 after delete on t2 for each row
- insert into t1 values (1);
-insert into t1 values (1);
-insert into t2 values (1),(2);
-
-
-# exec cases A, B - see multi_update.test
-
-# A. send_error() w/o send_eof() branch
-
---error ER_DUP_ENTRY
-delete t2 from t2;
-
-# check
-
-select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
-
-# cleanup bug#29136
-
-drop table t1, t2;
-
-
-#
-# Bug #29136 erred multi-delete on trans table does not rollback
-#
-
-# prepare
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-CREATE TABLE t1 (a int, PRIMARY KEY (a));
-CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
-create trigger trg_del_t2 after delete on t2 for each row
- insert into t1 values (1);
-insert into t1 values (1);
-insert into t2 values (1),(2);
-
-
-# exec cases A, B - see multi_update.test
-
-# A. send_error() w/o send_eof() branch
-
---error ER_DUP_ENTRY
-delete t2 from t2;
-
-# check
-
-select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
-
-# cleanup bug#29136
-
-drop table t1, t2;
-
-
-#
-# Testing of IFNULL
-#
-create table t1 (a int, b int) engine=innodb;
-insert into t1 values(20,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a;
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-insert into t1 values(10,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-drop table t1;
-
-#
-# Test of read_through not existing const_table
-#
-
-create table t1 (a varchar(10) not null) engine=myisam;
-create table t2 (b varchar(10) not null unique) engine=innodb;
-select t1.a from t1,t2 where t1.a=t2.b;
-drop table t1,t2;
-create table t1 (a int not null, b int, primary key (a)) engine = innodb;
-create table t2 (a int not null, b int, primary key (a)) engine = innodb;
-insert into t1 values (10, 20);
-insert into t2 values (10, 20);
-update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
-drop table t1,t2;
-
-#
-# Test of multi-table-delete with foreign key constraints
-#
-
-CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
-CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB;
-insert into t1 set id=1;
-insert into t2 set id=1, t1_id=1;
-delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
-select * from t1;
-select * from t2;
-drop table t2,t1;
-CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
-CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1, 1);
-SELECT * from t1;
-UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
-SELECT * from t1;
-UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
-SELECT * from t1;
-DROP TABLE t1,t2;
-
-#
-# Test of range_optimizer
-#
-
-set autocommit=0;
-
-CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
-
-CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
-
-CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB;
-
-INSERT INTO t3 VALUES("my-test-1", "my-test-2");
-COMMIT;
-
-INSERT INTO t1 VALUES("this-key", "will disappear");
-INSERT INTO t2 VALUES("this-key", "will also disappear");
-DELETE FROM t3 WHERE id1="my-test-1";
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-SELECT * FROM t3;
-ROLLBACK;
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-SELECT * FROM t3;
-SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
-COMMIT;
-set autocommit=1;
-DROP TABLE t1,t2,t3;
-
-#
-# Check update with conflicting key
-#
-
-CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb;
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-# We need the a < 1000 test here to quard against the halloween problems
-UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
-SELECT * from t1;
-drop table t1;
-
-#
-# Test multi update with different join methods
-#
-
-CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb;
-CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb;
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
-INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-
-# Full join, without key
-update t1,t2 set t1.a=t1.a+100;
-select * from t1;
-
-# unique key
-update t1,t2 set t1.a=t1.a+100 where t1.a=101;
-select * from t1;
-
-# ref key
-update t1,t2 set t1.b=t1.b+10 where t1.b=2;
-select * from t1;
-
-# Range key (in t1)
-update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
-select * from t1;
-select * from t2;
-
-drop table t1,t2;
-CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
-CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
-SET AUTOCOMMIT=0;
-INSERT INTO t1 ( B_ID ) VALUES ( 1 );
-INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
-ROLLBACK;
-SELECT * FROM t1;
-drop table t1,t2;
-create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb;
-insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
-select distinct parent,child from t1 order by parent;
-drop table t1;
-
-#
-# Test that MySQL priorities clustered indexes
-#
-create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb;
-create table t2 (a int not null auto_increment primary key, b int);
-insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
-insert into t2 (a) select b from t1;
-insert into t1 (b) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-select count(*) from t1;
---replace_column 9 #
-explain select * from t1 where c between 1 and 2500;
-update t1 set c=a;
---replace_column 9 #
-explain select * from t1 where c between 1 and 2500;
-drop table t1,t2;
-
-#
-# Test of UPDATE ... ORDER BY
-#
-
-create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
-
-insert into t1 (id) values (null),(null),(null),(null),(null);
-update t1 set fk=69 where fk is null order by id limit 1;
-SELECT * from t1;
-drop table t1;
-
-create table t1 (a int not null, b int not null, key (a));
-insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
-SET @tmp=0;
-update t1 set b=(@tmp:=@tmp+1) order by a;
-update t1 set b=99 where a=1 order by b asc limit 1;
-update t1 set b=100 where a=1 order by b desc limit 2;
-update t1 set a=a+10+b where a=1 order by b;
-select * from t1 order by a,b;
-drop table t1;
-
-#
-# Test of multi-table-updates (bug #1980).
-#
-
-create table t1 ( c char(8) not null ) engine=innodb;
-insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
-insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
-
-alter table t1 add b char(8) not null;
-alter table t1 add a char(8) not null;
-alter table t1 add primary key (a,b,c);
-update t1 set a=c, b=c;
-
-create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb;
-insert into t2 select * from t1;
-
-delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
-drop table t1,t2;
-
-#
-# test autoincrement with TRUNCATE
-#
-
-SET AUTOCOMMIT=1;
-create table t1 (a integer auto_increment primary key) engine=innodb;
-insert into t1 (a) values (NULL),(NULL);
-truncate table t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-drop table t1;
-
-#
-# Test dictionary handling with spaceand quoting
-#
-
-CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
-CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
-#show create table t2;
-drop table t2,t1;
-
-#
-# Test of multi updated and foreign keys
-#
-
-create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
-insert into `t1`values ( 1 ) ;
-create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
-insert into `t2`values ( 1 ) ;
-create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
-insert into `t3`values ( 1 ) ;
---error 1451
-delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
---error 1451
-update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
---error 1054
-update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-drop table t3,t2,t1;
-
-#
-# test for recursion depth limit
-#
-create table t1(
- id int primary key,
- pid int,
- index(pid),
- foreign key(pid) references t1(id) on delete cascade) engine=innodb;
-insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
- (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
--- error 1451
-delete from t1 where id=0;
-delete from t1 where id=15;
-delete from t1 where id=0;
-
-drop table t1;
-
-#
-# Test timestamps
-#
-
-CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
-CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
-(stamp))ENGINE=InnoDB;
-insert into t1 values (1),(2),(3);
-# Note that timestamp 3 is wrong
-insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
-SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
-'20020204120000' GROUP BY col1;
-drop table t1,t2;
-
-#
-# Test by Francois MASUREL
-#
-
-CREATE TABLE t1 (
- `id` int(10) unsigned NOT NULL auto_increment,
- `id_object` int(10) unsigned default '0',
- `id_version` int(10) unsigned NOT NULL default '1',
- `label` varchar(100) NOT NULL default '',
- `description` text,
- PRIMARY KEY (`id`),
- KEY `id_object` (`id_object`),
- KEY `id_version` (`id_version`)
-) ENGINE=InnoDB;
-
-INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
-
-CREATE TABLE t2 (
- `id` int(10) unsigned NOT NULL auto_increment,
- `id_version` int(10) unsigned NOT NULL default '1',
- PRIMARY KEY (`id`),
- KEY `id_version` (`id_version`)
-) ENGINE=InnoDB;
-
-INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
-
-SELECT t2.id, t1.`label` FROM t2 INNER JOIN
-(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
-ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
-drop table t1,t2;
-
-create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
-create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
-create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
-insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
-insert t2 select * from t1;
-insert t3 select * from t1;
-checksum table t1, t2, t3, t4 quick;
-checksum table t1, t2, t3, t4;
-checksum table t1, t2, t3, t4 extended;
-#show table status;
-drop table t1,t2,t3;
-
-#
-# Test problem with refering to different fields in same table in UNION
-# (Bug #2552)
-#
-create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
-insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
-select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
-drop table t1;
-
-#
-# Bug2160
-#
-create table t1 (a int) engine=innodb;
-create table t2 like t1;
-drop table t1,t2;
-
-#
-# Test of automaticly created foreign keys
-#
-
-create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
-create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
-show create table t1;
-show create table t2;
-create index id on t2 (id);
-show create table t2;
-create index id2 on t2 (id);
-show create table t2;
-drop index id2 on t2;
---error ER_DROP_INDEX_FK
-drop index id on t2;
-show create table t2;
-drop table t2;
-
-create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
-show create table t2;
-create unique index id on t2 (id,id2);
-show create table t2;
-drop table t2;
-
-# Check foreign key columns created in different order than key columns
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
-show create table t2;
-drop table t2;
-
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
-show create table t2;
-drop table t2;
-
-create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
-show create table t2;
-drop table t2;
-
-create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
-show create table t2;
-drop table t2;
-
-create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
-show create table t2;
-alter table t2 add index id_test (id), add index id_test2 (id,id2);
-show create table t2;
-drop table t2;
-
-# Test error handling
-
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
---error ER_WRONG_FK_DEF
-create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
-
-# bug#3749
-
-create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
-show create table t2;
-drop table t2;
-create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
-show create table t2;
-drop table t2, t1;
-
-
-#
-# Bug #6126: Duplicate columns in keys gives misleading error message
-#
---error 1060
-create table t1 (c char(10), index (c,c)) engine=innodb;
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
-create table t1 (c1 char(10), c2 char(10)) engine=innodb;
---error 1060
-alter table t1 add key (c1,c1);
---error 1060
-alter table t1 add key (c2,c1,c1);
---error 1060
-alter table t1 add key (c1,c2,c1);
---error 1060
-alter table t1 add key (c1,c1,c2);
-drop table t1;
-
-#
-# Bug #4082: integer truncation
-#
-
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-drop table t1;
-
-#
-# BUG#7709 test case - Boolean fulltext query against unsupported
-# engines does not fail
-#
-
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
---error 1214
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-DROP TABLE t1;
-
-#
-# check null values #1
-#
-
---disable_warnings
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
- CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-DROP TABLE t2;
-DROP TABLE t1;
-
-#
-# Bug#11816 - Truncate table doesn't work with temporary innodb tables
-# This is not an innodb bug, but we test it using innodb.
-#
-create temporary table t1 (a int) engine=innodb;
-insert into t1 values (4711);
-truncate t1;
-insert into t1 values (42);
-select * from t1;
-drop table t1;
-# Show that it works with permanent tables too.
-create table t1 (a int) engine=innodb;
-insert into t1 values (4711);
-truncate t1;
-insert into t1 values (42);
-select * from t1;
-drop table t1;
-
-#
-# Bug #13025 Server crash during filesort
-#
-
-create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
-insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
-select * from t1 order by a,b,c,d;
-explain select * from t1 order by a,b,c,d;
-drop table t1;
-
-#
-# BUG#11039,#13218 Wrong key length in min()
-#
-
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-select min(b) from t1 where a='8';
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# range optimizer problem
-#
-
-create table t1 (x bigint unsigned not null primary key) engine=innodb;
-insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
-select * from t1;
-select count(*) from t1 where x>0;
-select count(*) from t1 where x=0;
-select count(*) from t1 where x<0;
-select count(*) from t1 where x < -16;
-select count(*) from t1 where x = -16;
-explain select count(*) from t1 where x > -16;
-select count(*) from t1 where x > -16;
-select * from t1 where x > -16;
-select count(*) from t1 where x = 18446744073709551601;
-drop table t1;
-
-
-# Test for testable InnoDB status variables. This test
-# uses previous ones(pages_created, rows_deleted, ...).
-
-# InnoDB aligns the memory for the buffer pool to a page boundary. This may
-# cause actual pool size to be one less than requested depending on exact
-# alignment of obtained memory.
---replace_result 8192 8191
-SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
-SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
-SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
-SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
-SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
-
-# Test for row locks InnoDB status variables.
-SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
-SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
-SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
-SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
-SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
-
-# Test for innodb_sync_spin_loops variable
-SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
-show variables like "innodb_sync_spin_loops";
-set global innodb_sync_spin_loops=1000;
-show variables like "innodb_sync_spin_loops";
-set global innodb_sync_spin_loops=0;
-show variables like "innodb_sync_spin_loops";
-set global innodb_sync_spin_loops=20;
-show variables like "innodb_sync_spin_loops";
-set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
-
-# Test for innodb_thread_concurrency variable
-SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
-show variables like "innodb_thread_concurrency";
-set global innodb_thread_concurrency=1001;
-show variables like "innodb_thread_concurrency";
-set global innodb_thread_concurrency=0;
-show variables like "innodb_thread_concurrency";
-set global innodb_thread_concurrency=16;
-show variables like "innodb_thread_concurrency";
-SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
-
-# Test for innodb_concurrency_tickets variable
-show variables like "innodb_concurrency_tickets";
-set global innodb_concurrency_tickets=1000;
-show variables like "innodb_concurrency_tickets";
-set global innodb_concurrency_tickets=0;
-show variables like "innodb_concurrency_tickets";
-set global innodb_concurrency_tickets=500;
-show variables like "innodb_concurrency_tickets";
-
-# Test for innodb_thread_sleep_delay variable
-show variables like "innodb_thread_sleep_delay";
-set global innodb_thread_sleep_delay=100000;
-show variables like "innodb_thread_sleep_delay";
-set global innodb_thread_sleep_delay=0;
-show variables like "innodb_thread_sleep_delay";
-set global innodb_thread_sleep_delay=10000;
-show variables like "innodb_thread_sleep_delay";
-
-#
-# Test varchar
-#
-
-let $default=`select @@storage_engine`;
-set storage_engine=INNODB;
-source include/varchar.inc;
-
-#
-# Some errors/warnings on create
-#
-
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
-create table t1 (v varchar(65530), key(v));
-drop table t1;
-create table t1 (v varchar(65536));
-show create table t1;
-drop table t1;
-create table t1 (v varchar(65530) character set utf8);
-show create table t1;
-drop table t1;
-
-eval set storage_engine=$default;
-
-# InnoDB specific varchar tests
-create table t1 (v varchar(16384)) engine=innodb;
-drop table t1;
-
-#
-# BUG#11039 Wrong key length in min()
-#
-
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-select min(b) from t1 where a='8';
-drop table t1;
-
-#
-# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
-#
-
-CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2), (1), (3);
-select * from t1;
-truncate table t1;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2);
-replace into t1 (b) values (1);
-replace into t1 (b) values (3);
-select * from t1;
-drop table t1;
-
-create table t1 (rowid int not null auto_increment, val int not null,primary
-key (rowid), unique(val)) engine=innodb;
-replace into t1 (val) values ('1'),('2');
-replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY
-insert into t1 (val) values ('1'),('2');
-select * from t1;
-drop table t1;
-
-#
-# Test that update does not change internal auto-increment value
-#
-
-create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
-insert into t1 (val) values (1);
-update t1 set a=2 where a=1;
-# We should get the following error because InnoDB does not update the counter
---error ER_DUP_ENTRY
-insert into t1 (val) values (1);
-select * from t1;
-drop table t1;
-#
-# Bug #10465
-#
-
---disable_warnings
-CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
---enable_warnings
-INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
-SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
-SELECT GRADE FROM t1 WHERE GRADE= 151;
-DROP TABLE t1;
-
-#
-# Bug #12340 multitable delete deletes only one record
-#
-create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
-create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
-insert into t2 values ('aa','cc');
-insert into t1 values ('aa','bb'),('aa','cc');
-delete t1 from t1,t2 where f1=f3 and f4='cc';
-select * from t1;
-drop table t1,t2;
-
-#
-# Test that the slow TRUNCATE implementation resets autoincrement columns
-# (bug #11946)
-#
-
-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;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-
-# continued from above; test that doing a slow TRUNCATE on a table with 0
-# rows resets autoincrement columns
-DELETE FROM t1;
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-DROP TABLE t2, t1;
-
-# Test that foreign keys in temporary tables are not accepted (bug #12084)
-CREATE TABLE t1
-(
- id INT PRIMARY KEY
-) ENGINE=InnoDB;
-
---error 1005,1005
-CREATE TEMPORARY TABLE t2
-(
- id INT NOT NULL PRIMARY KEY,
- b INT,
- FOREIGN KEY (b) REFERENCES test.t1(id)
-) ENGINE=InnoDB;
-DROP TABLE t1;
-
-#
-# Test that index column max sizes are honored (bug #13315)
-#
-
-# prefix index
-create table t1 (col1 varchar(2000), index (col1(767)))
- character set = latin1 engine = innodb;
-
-# normal indexes
-create table t2 (col1 char(255), index (col1))
- character set = latin1 engine = innodb;
-create table t3 (col1 binary(255), index (col1))
- character set = latin1 engine = innodb;
-create table t4 (col1 varchar(767), index (col1))
- character set = latin1 engine = innodb;
-create table t5 (col1 varchar(767) primary key)
- character set = latin1 engine = innodb;
-create table t6 (col1 varbinary(767) primary key)
- character set = latin1 engine = innodb;
-create table t7 (col1 text, index(col1(767)))
- character set = latin1 engine = innodb;
-create table t8 (col1 blob, index(col1(767)))
- character set = latin1 engine = innodb;
-
-# multi-column indexes are allowed to be longer
-create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
- character set = latin1 engine = innodb;
-
-show create table t9;
-
-drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-
-# these should have their index length trimmed
-create table t1 (col1 varchar(768), index(col1))
- character set = latin1 engine = innodb;
-create table t2 (col1 varbinary(768), index(col1))
- character set = latin1 engine = innodb;
-create table t3 (col1 text, index(col1(768)))
- character set = latin1 engine = innodb;
-create table t4 (col1 blob, index(col1(768)))
- character set = latin1 engine = innodb;
-
-show create table t1;
-
-drop table t1, t2, t3, t4;
-
-# these should be refused
---error 1071
-create table t1 (col1 varchar(768) primary key)
- character set = latin1 engine = innodb;
---error 1071
-create table t2 (col1 varbinary(768) primary key)
- character set = latin1 engine = innodb;
---error 1071
-create table t3 (col1 text, primary key(col1(768)))
- character set = latin1 engine = innodb;
---error 1071
-create table t4 (col1 blob, primary key(col1(768)))
- character set = latin1 engine = innodb;
-
-#
-# Test improved foreign key error messages (bug #3443)
-#
-
-CREATE TABLE t1
-(
- id INT PRIMARY KEY
-) ENGINE=InnoDB;
-
-CREATE TABLE t2
-(
- v INT,
- CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
-) ENGINE=InnoDB;
-
---error 1452
-INSERT INTO t2 VALUES(2);
-
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1);
-
---error 1451
-DELETE FROM t1 WHERE id = 1;
-
---error 1217
-DROP TABLE t1;
-
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE t1;
-SET FOREIGN_KEY_CHECKS=1;
-
---error 1452
-INSERT INTO t2 VALUES(3);
-
-DROP TABLE t2;
-#
-# Test that checksum table uses a consistent read Bug #12669
-#
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=0;
-checksum table t1;
-connection b;
-insert into t1 values(3);
-connection a;
-#
-# Here checksum should not see insert
-#
-checksum table t1;
-connection a;
-commit;
-checksum table t1;
-commit;
-drop table t1;
-#
-# autocommit = 1
-#
-connection a;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=1;
-checksum table t1;
-connection b;
-set autocommit=1;
-insert into t1 values(3);
-connection a;
-#
-# Here checksum sees insert
-#
-checksum table t1;
-drop table t1;
-
-connection default;
-disconnect a;
-disconnect b;
-
-# tests for bugs #9802 and #13778
-
-# test that FKs between invalid types are not accepted
-
-set foreign_key_checks=0;
-create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--- error 1005
-create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
-set foreign_key_checks=1;
-drop table t2;
-
-# test that FKs between different charsets are not accepted in CREATE even
-# when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--- error 1005
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
-set foreign_key_checks=1;
-drop table t1;
-
-# test that invalid datatype conversions with ALTER are not allowed
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
-create table t1(a varchar(10) primary key) engine = innodb;
--- error 1025,1025
-alter table t1 modify column a int;
-set foreign_key_checks=1;
-drop table t2,t1;
-
-# test that charset conversions with ALTER are allowed when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-alter table t1 convert to character set utf8;
-set foreign_key_checks=1;
-drop table t2,t1;
-
-# test that RENAME does not allow invalid charsets when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--- error 1025
-rename table t3 to t1;
-set foreign_key_checks=1;
-drop table t2,t3;
-
-# test that foreign key errors are reported correctly (Bug #15550)
-
-create table t1(a int primary key) row_format=redundant engine=innodb;
-create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
-create table t3(a int primary key) row_format=compact engine=innodb;
-create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
-
-insert into t1 values(1);
-insert into t3 values(1);
--- error 1452
-insert into t2 values(2);
--- error 1452
-insert into t4 values(2);
-insert into t2 values(1);
-insert into t4 values(1);
--- error 1451
-update t1 set a=2;
--- error 1452
-update t2 set a=2;
--- error 1451
-update t3 set a=2;
--- error 1452
-update t4 set a=2;
--- error 1451
-truncate t1;
--- error 1451
-truncate t3;
-truncate t2;
-truncate t4;
-truncate t1;
-truncate t3;
-
-drop table t4,t3,t2,t1;
-
-
-#
-# Test that we can create a large (>1K) key
-#
-create table t1 (a varchar(255) character set utf8,
- b varchar(255) character set utf8,
- c varchar(255) character set utf8,
- d varchar(255) character set utf8,
- key (a,b,c,d)) engine=innodb;
-drop table t1;
---error ER_TOO_LONG_KEY
-create table t1 (a varchar(255) character set utf8,
- b varchar(255) character set utf8,
- c varchar(255) character set utf8,
- d varchar(255) character set utf8,
- e varchar(255) character set utf8,
- key (a,b,c,d,e)) engine=innodb;
-
-
-# test the padding of BINARY types and collations (Bug #14189)
-
-create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
-create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
-create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
-create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
-
-insert into t1 values (0x41),(0x4120),(0x4100);
--- error ER_DUP_ENTRY
-insert into t2 values (0x41),(0x4120),(0x4100);
-insert into t2 values (0x41),(0x4120);
--- error ER_DUP_ENTRY
-insert into t3 values (0x41),(0x4120),(0x4100);
-insert into t3 values (0x41),(0x4100);
--- error ER_DUP_ENTRY
-insert into t4 values (0x41),(0x4120),(0x4100);
-insert into t4 values (0x41),(0x4100);
-select hex(s1) from t1;
-select hex(s1) from t2;
-select hex(s1) from t3;
-select hex(s1) from t4;
-drop table t1,t2,t3,t4;
-
-create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
-create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-
-insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
--- error 1452
-insert into t2 values(0x42);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-update t1 set s1=0x123456 where a=2;
-select hex(s1) from t2;
--- error 1451
-update t1 set s1=0x12 where a=1;
--- error 1451
-update t1 set s1=0x12345678 where a=1;
--- error 1451
-update t1 set s1=0x123457 where a=1;
-update t1 set s1=0x1220 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x1200 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x4200 where a=1;
-select hex(s1) from t2;
--- error 1451
-delete from t1 where a=1;
-delete from t1 where a=2;
-update t2 set s1=0x4120;
--- error 1451
-delete from t1;
-delete from t1 where a!=3;
-select a,hex(s1) from t1;
-select hex(s1) from t2;
-
-drop table t2,t1;
-
-create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
-create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-
-insert into t1 values(1,0x4100),(2,0x41);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-update t1 set s1=0x1234 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x12 where a=2;
-select hex(s1) from t2;
-delete from t1 where a=1;
--- error 1451
-delete from t1 where a=2;
-select a,hex(s1) from t1;
-select hex(s1) from t2;
-
-drop table t2,t1;
-# Ensure that <tablename>_ibfk_0 is not mistreated as a
-# generated foreign key identifier. (Bug #16387)
-
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
-CREATE TABLE t2(a INT) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
-ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
-SHOW CREATE TABLE t2;
-DROP TABLE t2,t1;
-
-#
-# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-commit;
-connection b;
-set autocommit = 0;
-update t1 set b = 5 where a = 2;
-connection a;
-delimiter |;
-create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
-delimiter ;|
-set autocommit = 0;
-connection a;
-insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
-(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
-(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
-(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
-(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
-connection b;
-commit;
-connection a;
-commit;
-drop trigger t1t;
-drop table t1;
-disconnect a;
-disconnect b;
-#
-# Another trigger test
-#
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-insert into t2(a) values (1),(2),(3);
-insert into t3(a) values (1),(2),(3);
-insert into t4(a) values (1),(2),(3);
-insert into t3(a) values (5),(7),(8);
-insert into t4(a) values (5),(7),(8);
-insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
-
-delimiter |;
-create trigger t1t before insert on t1 for each row begin
- INSERT INTO t2 SET a = NEW.a;
-end |
-
-create trigger t2t before insert on t2 for each row begin
- DELETE FROM t3 WHERE a = NEW.a;
-end |
-
-create trigger t3t before delete on t3 for each row begin
- UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
-end |
-
-create trigger t4t before update on t4 for each row begin
- UPDATE t5 SET b = b + 1 where a = NEW.a;
-end |
-delimiter ;|
-commit;
-set autocommit = 0;
-update t1 set b = b + 5 where a = 1;
-update t2 set b = b + 5 where a = 1;
-update t3 set b = b + 5 where a = 1;
-update t4 set b = b + 5 where a = 1;
-insert into t5(a) values(20);
-connection b;
-set autocommit = 0;
-insert into t1(a) values(7);
-insert into t2(a) values(8);
-delete from t2 where a = 3;
-update t4 set b = b + 1 where a = 3;
-commit;
-drop trigger t1t;
-drop trigger t2t;
-drop trigger t3t;
-drop trigger t4t;
-drop table t1, t2, t3, t4, t5;
-connection default;
-disconnect a;
-disconnect b;
-
-#
-# Test that cascading updates leading to duplicate keys give the correct
-# error message (bug #9680)
-#
-
-CREATE TABLE t1 (
- field1 varchar(8) NOT NULL DEFAULT '',
- field2 varchar(8) NOT NULL DEFAULT '',
- PRIMARY KEY (field1, field2)
-) ENGINE=InnoDB;
-
-CREATE TABLE t2 (
- field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
- FOREIGN KEY (field1) REFERENCES t1 (field1)
- ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB;
-
-INSERT INTO t1 VALUES ('old', 'somevalu');
-INSERT INTO t1 VALUES ('other', 'anyvalue');
-
-INSERT INTO t2 VALUES ('old');
-INSERT INTO t2 VALUES ('other');
-
---error ER_FOREIGN_DUPLICATE_KEY
-UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-#
-# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
-#
-create table t1 (
- c1 bigint not null,
- c2 bigint not null,
- primary key (c1),
- unique key (c2)
-) engine=innodb;
-#
-create table t2 (
- c1 bigint not null,
- primary key (c1)
-) engine=innodb;
-#
-alter table t1 add constraint c2_fk foreign key (c2)
- references t2(c1) on delete cascade;
-show create table t1;
-#
-alter table t1 drop foreign key c2_fk;
-show create table t1;
-#
-drop table t1, t2;
-
-#
-# Bug #14360: problem with intervals
-#
-
-create table t1(a date) engine=innodb;
-create table t2(a date, key(a)) engine=innodb;
-insert into t1 values('2005-10-01');
-insert into t2 values('2005-10-01');
-select * from t1, t2
- where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
-drop table t1, t2;
-
-create table t1 (id int not null, f_id int not null, f int not null,
-primary key(f_id, id)) engine=innodb;
-create table t2 (id int not null,s_id int not null,s varchar(200),
-primary key(id)) engine=innodb;
-INSERT INTO t1 VALUES (8, 1, 3);
-INSERT INTO t1 VALUES (1, 2, 1);
-INSERT INTO t2 VALUES (1, 0, '');
-INSERT INTO t2 VALUES (8, 1, '');
-commit;
-DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
-WHERE mm.id IS NULL;
-select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
-where mm.id is null lock in share mode;
-drop table t1,t2;
-
-#
-# Test case where X-locks on unused rows should be released in a
-# update (because READ COMMITTED isolation level)
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
-commit;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t1 set b = 5 where b = 1;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-#
-# X-lock to record (7,3) should be released in a update
-#
-select * from t1 where a = 7 and b = 3 for update;
-connection a;
-commit;
-connection b;
-commit;
-drop table t1;
-connection default;
-disconnect a;
-disconnect b;
-
-#
-# Test case where no locks should be released (because we are not
-# using READ COMMITTED isolation level)
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
-commit;
-set autocommit = 0;
-select * from t1 lock in share mode;
-update t1 set b = 5 where b = 1;
-connection b;
-set autocommit = 0;
-#
-# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
-#
---error 1205
-select * from t1 where a = 2 and b = 2 for update;
-#
-# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
-#
---error 1205
-connection a;
-commit;
-connection b;
-commit;
-connection default;
-disconnect a;
-disconnect b;
-drop table t1;
-
-#
-# Consistent read should be used in following selects
-#
-# 1) INSERT INTO ... SELECT
-# 2) UPDATE ... = ( SELECT ...)
-# 3) CREATE ... SELECT
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(d int not null, e int, primary key(d)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t1 select * from t2;
-update t1 set b = (select e from t2 where a = d);
-create table t3(d int not null, e int, primary key(d)) engine=innodb
-select * from t2;
-commit;
-connection a;
-commit;
-connection default;
-disconnect a;
-disconnect b;
-drop table t1, t2, t3;
-
-#
-# Consistent read should not be used if
-#
-# (a) isolation level is serializable OR
-# (b) select ... lock in share mode OR
-# (c) select ... for update
-#
-# in following queries:
-#
-# 1) INSERT INTO ... SELECT
-# 2) UPDATE ... = ( SELECT ...)
-# 3) CREATE ... SELECT
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connect (c,localhost,root,,);
-connect (d,localhost,root,,);
-connect (e,localhost,root,,);
-connect (f,localhost,root,,);
-connect (g,localhost,root,,);
-connect (h,localhost,root,,);
-connect (i,localhost,root,,);
-connect (j,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(a int not null, b int, primary key(a)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-create table t3(d int not null, b int, primary key(d)) engine=innodb;
-insert into t3 values (8,6),(12,1),(3,1);
-create table t5(a int not null, b int, primary key(a)) engine=innodb;
-insert into t5 values (1,2),(5,3),(4,2);
-create table t6(d int not null, e int, primary key(d)) engine=innodb;
-insert into t6 values (8,6),(12,1),(3,1);
-create table t8(a int not null, b int, primary key(a)) engine=innodb;
-insert into t8 values (1,2),(5,3),(4,2);
-create table t9(d int not null, e int, primary key(d)) engine=innodb;
-insert into t9 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-insert into t1 select * from t2;
-connection c;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-update t3 set b = (select b from t2 where a = d);
-connection d;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
-connection e;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-insert into t5 (select * from t2 lock in share mode);
-connection f;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-update t6 set e = (select b from t2 where a = d lock in share mode);
-connection g;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
-connection h;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-insert into t8 (select * from t2 for update);
-connection i;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-update t9 set e = (select b from t2 where a = d for update);
-connection j;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
-
-connection b;
---error 1205
-reap;
-
-connection c;
---error 1205
-reap;
-
-connection d;
---error 1205
-reap;
-
-connection e;
---error 1205
-reap;
-
-connection f;
---error 1205
-reap;
-
-connection g;
---error 1205
-reap;
-
-connection h;
---error 1205
-reap;
-
-connection i;
---error 1205
-reap;
-
-connection j;
---error 1205
-reap;
-
-connection a;
-commit;
-
-connection default;
-disconnect a;
-disconnect b;
-disconnect c;
-disconnect d;
-disconnect e;
-disconnect f;
-disconnect g;
-disconnect h;
-disconnect i;
-disconnect j;
-drop table t1, t2, t3, t5, t6, t8, t9;
-
-# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
---error ER_WRONG_COLUMN_NAME
-CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-
-#
-# Bug #17152: Wrong result with BINARY comparison on aliased column
-#
-
-CREATE TABLE t1 (
- a BIGINT(20) NOT NULL,
- PRIMARY KEY (a)
- ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-
-CREATE TABLE t2 (
- a BIGINT(20) NOT NULL,
- b VARCHAR(128) NOT NULL,
- c TEXT NOT NULL,
- PRIMARY KEY (a,b),
- KEY idx_t2_b_c (b,c(200)),
- CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
- ON DELETE CASCADE
- ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1, 'bar', 'vbar');
-INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
-INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
-INSERT INTO t2 VALUES (1, 'customer_over', '1');
-
-SELECT * FROM t2 WHERE b = 'customer_over';
-SELECT * FROM t2 WHERE BINARY b = 'customer_over';
-SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
-/* Bang: Empty result set, above was expected: */
-SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-
-drop table t2, t1;
-
-#
-# Test optimize on table with open transaction
-#
-
-CREATE TABLE t1 ( a int ) ENGINE=innodb;
-BEGIN;
-INSERT INTO t1 VALUES (1);
-OPTIMIZE TABLE t1;
-DROP TABLE t1;
-
-#
-# Bug #24741 (existing cascade clauses disappear when adding foreign keys)
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
-
-CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
- CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
- ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
-
-ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
-DELETE CASCADE ON UPDATE CASCADE;
-
-SHOW CREATE TABLE t2;
-DROP TABLE t2, t1;
-
-#
-# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns
-# for which there is a foreign key constraint ON ... SET NULL.
-#
-
-CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
-CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
-# mysqltest first does replace_regex, then replace_result
---replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
---error 1025
-ALTER TABLE t2 MODIFY a INT NOT NULL;
-DELETE FROM t1;
-DROP TABLE t2,t1;
-
-#
-# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables)
-# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?))
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
-AUTO_INCREMENT=42;
-
-INSERT INTO t1 VALUES (0),(347),(0);
-SELECT * FROM t1;
-
-SHOW CREATE TABLE t1;
-
-CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(42),(347),(348);
-ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
-SHOW CREATE TABLE t1;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #21101 (Prints wrong error message if max row size is too large)
-#
-set innodb_strict_mode=on;
---error 1118
-CREATE TABLE t1 (
- c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
- c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
- c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
- c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
- c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
- c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
- c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
- c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
- ) ENGINE = InnoDB;
-
-#
-# Bug #31860 InnoDB assumes AUTOINC values can only be positive.
-#
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1(
- id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
- ) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(-10);
-SELECT * FROM t1;
-#
-# NOTE: The server really needs to be restarted at this point
-# for the test to be useful.
-#
-# Without the fix InnoDB would trip over an assertion here.
-INSERT INTO t1 VALUES(NULL);
-# The next value should be 1 and not -9 or a -ve number
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #21409 Incorrect result returned when in READ-COMMITTED with
-# query_cache ON
-#
-CONNECT (c1,localhost,root,,);
-CONNECT (c2,localhost,root,,);
-CONNECTION c1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-DROP TABLE IF EXISTS t1, t2;
-CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
-CREATE TABLE t2 LIKE t1;
-SELECT * FROM t2;
-CONNECTION c2;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (1);
-COMMIT;
-CONNECTION c1;
-SELECT * FROM t1 WHERE a=1;
-DISCONNECT c1;
-DISCONNECT c2;
-CONNECT (c1,localhost,root,,);
-CONNECT (c2,localhost,root,,);
-CONNECTION c1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-SELECT * FROM t2;
-CONNECTION c2;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (2);
-COMMIT;
-CONNECTION c1;
-# The result set below should be the same for both selects
-SELECT * FROM t1 WHERE a=2;
-SELECT * FROM t1 WHERE a=2;
-DROP TABLE t1;
-DROP TABLE t2;
-DISCONNECT c1;
-DISCONNECT c2;
-CONNECTION default;
-
-#
-# Bug #29157 UPDATE, changed rows incorrect
-#
-create table t1 (i int, j int) engine=innodb;
-insert into t1 (i, j) values (1, 1), (2, 2);
---enable_info
-update t1 set j = 2;
---disable_info
-drop table t1;
-
-#
-# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or
-# I_S
-#
-create table t1 (id int) comment='this is a comment' engine=innodb;
-select table_comment, data_free > 0 as data_free_is_set
- from information_schema.tables
- where table_schema='test' and table_name = 't1';
-drop table t1;
-
-#
-# Bug 34920 test
-#
-CONNECTION default;
-CREATE TABLE t1 (
- c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- c2 VARCHAR(128) NOT NULL,
- PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
-
-CREATE TABLE t2 (
- c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- c2 INT(10) UNSIGNED DEFAULT NULL,
- PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
-
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-DROP TABLE t2;
-DROP TABLE t1;
-# End 34920 test
-#
-# Bug #29507 TRUNCATE shows to many rows effected
-#
-CONNECTION default;
-CREATE TABLE t1 (c1 int default NULL,
- c2 int default NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
---enable_info
-TRUNCATE TABLE t1;
-
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
-TRUNCATE TABLE t1;
-
---disable_info
-DROP TABLE t1;
-#
-# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
-#
--- disable_query_log
--- disable_result_log
-
-CONNECT (c1,localhost,root,,);
-
-DROP TABLE IF EXISTS bug35537;
-CREATE TABLE bug35537 (
- c1 int
-) ENGINE=InnoDB;
-
-INSERT INTO bug35537 VALUES (1);
-
--- enable_result_log
-
-SHOW SESSION STATUS LIKE 'Handler_update%';
-SHOW SESSION STATUS LIKE 'Handler_delete%';
-
-UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
-DELETE FROM bug35537 WHERE c1 = 2;
-
-SHOW SESSION STATUS LIKE 'Handler_update%';
-SHOW SESSION STATUS LIKE 'Handler_delete%';
-
-DROP TABLE bug35537;
-
-DISCONNECT c1;
-CONNECTION default;
-
-SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
-
--- enable_query_log
-
-#######################################################################
-# #
-# Please, DO NOT TOUCH this file as well as the innodb.result file. #
-# These files are to be modified ONLY BY INNOBASE guys. #
-# #
-# Use innodb_mysql.[test|result] files instead. #
-# #
-# If nevertheless you need to make some changes here, please, forward #
-# your commit message #
-# To: innodb_dev_ww@oracle.com #
-# Cc: dev-innodb@mysql.com #
-# (otherwise your changes may be erased). #
-# #
-#######################################################################
diff --git a/mysql-test/t/innodb_bug36172.test b/mysql-test/t/innodb_bug36172.test
deleted file mode 100644
index 67af2b2f7c2..00000000000
--- a/mysql-test/t/innodb_bug36172.test
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Test case for bug 36172
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-SET storage_engine=InnoDB;
-
-# we do not really care about what gets printed, we are only
-# interested in getting success or failure according to our
-# expectations
-
--- disable_query_log
--- disable_result_log
-
-let $file_format=`select @@innodb_file_format`;
-let $file_format_check=`select @@innodb_file_format_check`;
-let $file_per_table=`select @@innodb_file_per_table`;
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=on;
-
-DROP TABLE IF EXISTS `table0`;
-CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
-insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366';
-CHECK TABLE table0 EXTENDED;
-INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
-CHECK TABLE table0 EXTENDED;
-
-DROP TABLE table0;
-EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
-EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/t/innodb_bug47167.test b/mysql-test/t/innodb_bug47167.test
deleted file mode 100644
index 88e927c01bd..00000000000
--- a/mysql-test/t/innodb_bug47167.test
+++ /dev/null
@@ -1,45 +0,0 @@
-# This is the unit test for bug *47167.
-# It tests setting the global variable
-# "innodb_file_format_check" with a
-# user-Defined Variable.
-
---source include/have_innodb.inc
-
-# Save the value (Antelope) in 'innodb_file_format_check' to
-# 'old_innodb_file_format_check'
-set @old_innodb_file_format_check=@@innodb_file_format_check;
-
-# @old_innodb_file_format_check shall have the value of 'Antelope'
-select @old_innodb_file_format_check;
-
-# Reset the value in 'innodb_file_format_check' to 'Barracuda'
-set global innodb_file_format_check = Barracuda;
-
-select @@innodb_file_format_check;
-
-# Set 'innodb_file_format_check' to its default value, which
-# is the latest file format supported in the current release.
-set global innodb_file_format_check = DEFAULT;
-
-select @@innodb_file_format_check;
-
-# Put the saved value back to 'innodb_file_format_check'
-set global innodb_file_format_check = @old_innodb_file_format_check;
-
-# Check whether 'innodb_file_format_check' get its original value.
-select @@innodb_file_format_check;
-
-# Following are negative tests, all should fail.
---disable_warnings
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check = cheetah;
-
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check = Bear;
-
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check = on;
-
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check = off;
---enable_warnings
diff --git a/mysql-test/t/innodb_file_format.test b/mysql-test/t/innodb_file_format.test
deleted file mode 100644
index 6de026ad97f..00000000000
--- a/mysql-test/t/innodb_file_format.test
+++ /dev/null
@@ -1,31 +0,0 @@
--- source include/have_innodb.inc
-
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-
-select @@innodb_file_format;
-select @@innodb_file_format_check;
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=cheetah;
-select @@innodb_file_format;
-set global innodb_file_format=default;
-select @@innodb_file_format;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format;
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check=cheetah;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=default;
-select @@innodb_file_format_check;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=antelope;
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index eda3e8451dd..824af06cf69 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -2,6 +2,8 @@
# Testing of table locking
#
+--source include/have_partition.inc
+
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
diff --git a/mysql-test/t/log_slow.test b/mysql-test/t/log_slow.test
index d624e9f2520..af8a948d318 100644
--- a/mysql-test/t/log_slow.test
+++ b/mysql-test/t/log_slow.test
@@ -40,7 +40,7 @@ show fields from mysql.slow_log;
# Check flush command
#
-flush slow query logs;
+flush slow logs;
# Reset used variables
diff --git a/mysql-test/t/merge_debug.test b/mysql-test/t/merge_debug.test
index 2e30cf88b5d..5bf01468b89 100644
--- a/mysql-test/t/merge_debug.test
+++ b/mysql-test/t/merge_debug.test
@@ -26,7 +26,7 @@ INSERT INTO t2 VALUES (20);
INSERT INTO t3 VALUES (30);
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE;
-SET GLOBAL debug="+d,*,myisam_pretend_crashed_table_on_open";
+SET GLOBAL debug="+d,myisam_pretend_crashed_table_on_open";
--disable_warnings
CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29);
--enable_warnings
diff --git a/mysql-test/t/myisam-master.opt b/mysql-test/t/myisam-master.opt
new file mode 100644
index 00000000000..c5f16ccfd5b
--- /dev/null
+++ b/mysql-test/t/myisam-master.opt
@@ -0,0 +1 @@
+--myisam-recover-options=off
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 91de7ecff02..4c188ff3147 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -103,5 +103,5 @@ DROP USER 'user3'@'%';
# Test the --upgrade-system-tables option
#
--replace_result $MYSQLTEST_VARDIR var
---exec $MYSQL_UPGRADE --skip-verbose --upgrade-system-tables
+--exec $MYSQL_UPGRADE --force --upgrade-system-tables
diff --git a/mysql-test/t/mysql_upgrade_ssl.test b/mysql-test/t/mysql_upgrade_ssl.test
index d1c029bf33a..8ed818186b2 100644
--- a/mysql-test/t/mysql_upgrade_ssl.test
+++ b/mysql-test/t/mysql_upgrade_ssl.test
@@ -6,5 +6,5 @@
--echo #
--echo # Bug#55672 mysql_upgrade dies with internal error
--echo #
---exec $MYSQL_UPGRADE --skip-verbose --ssl --force 2>&1
+--exec $MYSQL_UPGRADE --skip-verbose --skip-silent --ssl --force 2>&1
--exit
diff --git a/mysql-test/t/mysqld_option_err.test b/mysql-test/t/mysqld_option_err.test
index 9c02dec51e6..0c38eba7ca9 100644
--- a/mysql-test/t/mysqld_option_err.test
+++ b/mysql-test/t/mysqld_option_err.test
@@ -21,22 +21,22 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--echo Test that unknown option is not silently ignored.
--error 2
---exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption >$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption >$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test bad binlog format.
--error 1
---exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test bad default storage engine.
--error 1
---exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --default-storage-engine=nonexistentengine >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --default-storage-engine=nonexistentengine >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test non-numeric value passed to number option.
--error 1
---exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --min-examined-row-limit=notanumber >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --min-examined-row-limit=notanumber >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
# Test for MBug#423035: error in parsing enum value for plugin
@@ -44,16 +44,16 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
# See also Bug#32034.
--echo Test that bad value for plugin enum option is rejected correctly.
--error 7
---exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
#
# Test that an wrong option with --help --verbose gives an error
#
--echo Test that --help --verbose works
---exec $MYSQLD --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test that --not-known-option --help --verbose gives error
--error 2
---exec $MYSQLD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Done.
diff --git a/mysql-test/t/not_partition.test b/mysql-test/t/not_partition.test
index 38b88c00ba3..b930214e008 100644
--- a/mysql-test/t/not_partition.test
+++ b/mysql-test/t/not_partition.test
@@ -1,5 +1,5 @@
--disable_abort_on_error
-# Run this test only when mysqld don't has partitioning (not compiled with)
+# Run this test only when mysqld doesn't have partitioning (not compiled with)
# the statements are not expected to work, just check that we
# can't crash the server
-- require r/not_partition.require
diff --git a/mysql-test/t/optimizer_switch.test b/mysql-test/t/optimizer_switch.test
deleted file mode 100644
index 713262197d4..00000000000
--- a/mysql-test/t/optimizer_switch.test
+++ /dev/null
@@ -1,113 +0,0 @@
---echo #
---echo # Generic @@optimizer_switch tests
---echo #
---echo #
-
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='index_merge=off,index_merge_union=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='index_merge_union=on';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,index_merge_sort_union=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch=4;
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch=NULL;
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='default,index_merge';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge=index_merge';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge=on,but...';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge=';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='on';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge=on,index_merge=off';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='index_merge_union=on,index_merge_union=default';
-
---error ER_WRONG_VALUE_FOR_VAR
-set optimizer_switch='default,index_merge=on,index_merge=off,default';
-
-set optimizer_switch=default;
-set optimizer_switch='index_merge=off,index_merge_union=off,default';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-set optimizer_switch=default;
-
-# Check setting defaults for global vars
---replace_regex /,table_elimination=on//
-select @@global.optimizer_switch;
-set @@global.optimizer_switch=default;
---replace_regex /,table_elimination=on//
-select @@global.optimizer_switch;
-
---echo #
---echo # Check index_merge's @@optimizer_switch flags
---echo #
---replace_regex /,table_elimination.on//
-select @@optimizer_switch;
-
---echo
---echo BUG#37120 optimizer_switch allowable values not according to specification
---echo
-
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,materialization=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,semijoin=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,loosescan=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,semijoin=off,materialization=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,materialization=off,semijoin=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,semijoin=off,materialization=off,loosescan=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,semijoin=off,loosescan=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-
-set optimizer_switch='default,materialization=off,loosescan=off';
---replace_regex /,table_elimination=on//
-select @@optimizer_switch;
-set optimizer_switch=default;
-
-
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 3e9ac2ce2b5..abf543ad53a 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -16,6 +16,9 @@ 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,
@@ -569,3 +572,6 @@ SET SESSION sql_mode = 'NO_ZERO_DATE';
OPTIMIZE TABLE t1;
SET SESSION sql_mode = @old_mode;
DROP TABLE t1;
+
+set global default_storage_engine=default;
+
diff --git a/mysql-test/t/pool_of_threads.cnf b/mysql-test/t/pool_of_threads.cnf
index 9ab0571df9f..4ae202bab6c 100644
--- a/mysql-test/t/pool_of_threads.cnf
+++ b/mysql-test/t/pool_of_threads.cnf
@@ -1,7 +1,6 @@
!include include/default_my.cnf
[mysqld.1]
-test-ignore-wrong-options
loose-thread-handling= pool-of-threads
loose-thread_pool_size= 2
extra-port= @mysqld.1.#extra-port
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index d9293554615..56ea4e7c268 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -877,19 +877,6 @@ drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
-# Tests moved from main.variables due to needing query cache in server.
-set GLOBAL query_cache_size=100000;
---error ER_GLOBAL_VARIABLE
-set SESSION query_cache_size=10000;
-set global query_cache_limit=100;
-set global query_cache_size=100;
-set global query_cache_type=demand;
-
-set GLOBAL query_cache_type=default;
-set GLOBAL query_cache_limit=default;
-set GLOBAL query_cache_size=default;
-
-
--echo End of 4.1 tests
#
diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test
index ce62b931a93..c2cd4d796aa 100644
--- a/mysql-test/t/query_cache_debug.test
+++ b/mysql-test/t/query_cache_debug.test
@@ -18,7 +18,7 @@ connect (bug30887con2, localhost, root, ,test);
connection bug30887con1;
--echo Activate debug hook and attempt to retrieve the statement from the cache.
-set session debug='+d,wait_in_query_cache_insert';
+set session debug='+d,foobar,wait_in_query_cache_insert';
--send select SQL_CACHE * from t1;
connection default;
@@ -67,7 +67,7 @@ connect(con2,localhost,root,,test,,);
connection con1;
--echo # Switch to connection con1
-SET SESSION debug='+d,wait_after_query_cache_invalidate';
+SET SESSION debug='+d,foobar,wait_after_query_cache_invalidate';
--echo # Send concurrent insert, will wait in the query cache table invalidate
--send INSERT INTO t1 VALUES (4)
@@ -157,8 +157,8 @@ 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,wait_in_query_cache_invalidate1';
-SET SESSION debug='+d,wait_in_query_cache_invalidate2';
+SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate1';
+SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate2';
--send DELETE FROM t1 WHERE a like '%a%';
connection default;
@@ -173,14 +173,14 @@ 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,wait_in_query_cache_insert';
+SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
--send SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3
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,wait_in_query_cache_insert';
+SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
--send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
connection default;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 87f36c452f2..96510bdcf7e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1333,6 +1333,7 @@ explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 a
# If the like starts with a certain letter key will be used.
#
+--sorted_result
select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
diff --git a/mysql-test/t/status_user.test b/mysql-test/t/status_user.test
index d42f81b20e5..8b017767e37 100644
--- a/mysql-test/t/status_user.test
+++ b/mysql-test/t/status_user.test
@@ -1,7 +1,7 @@
#
# Testing of user status (the userstat variable).
-# Note that this test requires a fresh restart to not problems with
-# old status
+# Note that this test requires a fresh restart to not have problems with the
+# old status values
-- source include/have_innodb.inc
-- source include/have_log_bin.inc
diff --git a/mysql-test/t/subselect_cache.test b/mysql-test/t/subselect_cache.test
index e8dd256b20b..b83ab27e03e 100644
--- a/mysql-test/t/subselect_cache.test
+++ b/mysql-test/t/subselect_cache.test
@@ -1,4 +1,3 @@
-
set optimizer_switch='subquery_cache=on';
create table t1 (a int, b int);
@@ -1611,3 +1610,4 @@ WHERE ( table1 . `pk` < 5 ) OR ( table1 . `col_varchar_key` IS NOT NULL)
GROUP BY field3
HAVING (field3 <= 'h' AND field2 != 4) ;
drop tables t1, t2, t3;
+
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test
index e73e7cfade2..d0794db68bb 100644
--- a/mysql-test/t/subselect_sj2.test
+++ b/mysql-test/t/subselect_sj2.test
@@ -47,7 +47,7 @@ select * from t3 where b in (select a from t1);
set @save_max_heap_table_size= @@max_heap_table_size;
set max_heap_table_size=16384;
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
drop table t3;
create table t3 (
@@ -62,11 +62,7 @@ insert into t3 select
from t0 A, t0 B where B.a <5;
explain select * from t3 where b in (select a from t0);
-# Because of BUG#40154, run the next select w/o index condition pushdown:
-set @save_ecp= @@engine_condition_pushdown;
-set engine_condition_pushdown=0;
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
-set engine_condition_pushdown=@save_ecp;
set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
@@ -83,7 +79,7 @@ drop table t1, t2, t3;
# Test join buffering
#
set @save_join_buffer_size = @@join_buffer_size;
-set join_buffer_size= 8000;
+set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
insert into t1 select a, 'filler123456', 'filler123456' from t0;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 073fcd28246..7472c9c0d26 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -79,7 +79,7 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
# Should fail becasue the file t9.MYI already exist in 'run'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1,1,ER_UNKNOWN_ERROR
+--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";
# Should fail becasue the file t9.MYD already exist in 'tmp'
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index d3761d98049..d619afab176 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -916,7 +916,7 @@ INSERT INTO t1 VALUES (5);
CONNECTION rl_contender;
# Wait until wl_acquirer is waiting for the read lock on t2 to be released.
let $wait_condition=
- SELECT STATE = 'Locked' FROM INFORMATION_SCHEMA.PROCESSLIST
+ SELECT STATE = 'Waiting for table level lock' FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID = $wl_acquirer_thread_id;
--source include/wait_condition.inc
# must not "see" the row inserted by the INSERT (as it must run before the
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index fd71b888396..4ee412f80d8 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -425,8 +425,8 @@ drop function if exists test.metaphon;
drop function if exists metaphon;
--enable_warnings
---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
select metaphon("Hello");
@@ -442,8 +442,8 @@ CREATE FUNCTION test.metaphon(a TEXT) RETURNS TEXT return "This is a SF";
create database db_31767;
use db_31767;
---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
use test;
@@ -504,8 +504,8 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES(1),(50);
---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
-eval CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(1);
DROP FUNCTION myfunc_double;
DROP TABLE t1;
diff --git a/mysql-test/t/unsafe_binlog_innodb-master.opt b/mysql-test/t/unsafe_binlog_innodb-master.opt
index d5ecd2ed9a5..0d13f0834a5 100644
--- a/mysql-test/t/unsafe_binlog_innodb-master.opt
+++ b/mysql-test/t/unsafe_binlog_innodb-master.opt
@@ -1 +1 @@
---loose-innodb_locks_unsafe_for_binlog=true --loose-innodb_lock_wait_timeout=1
+--loose-innodb_locks_unsafe_for_binlog --loose-innodb_lock_wait_timeout=1
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 2b7a07f4753..e2027e445a0 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -1407,7 +1407,9 @@ drop function if exists t1_max;
drop function if exists t1_min;
--enable_warnings
+--disable_warnings
create table t1 (a int) engine=innodb;
+--enable_warnings
insert into t1(a) values (0), (1);
create function t1_max() returns int return (select max(a) from t1);
create function t1_min() returns int return (select min(a) from t1);
diff --git a/mysql-test/t/innodb_mrr.test b/mysql-test/t/xtradb_mrr.test
index 0f5b41cef27..62b46152cf0 100644
--- a/mysql-test/t/innodb_mrr.test
+++ b/mysql-test/t/xtradb_mrr.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_xtradb.inc
--disable_warnings
drop table if exists t1,t2,t3,t4;
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 0962cfc9636..da5a2fa0b3b 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -88,12 +88,12 @@ 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)
+#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)
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 82b3db32c43..703cd8568e0 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -141,6 +141,7 @@ extern struct charset_info_st my_charset_utf8mb4_persian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci;
+extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf8mb4 */
#endif /* HAVE_UCA_COLLATIONS */
diff --git a/mysys/checksum.c b/mysys/checksum.c
index b2579351134..c8d3c1a038d 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -18,7 +18,7 @@
#include <my_sys.h>
#include <zlib.h>
-ha_checksum my_crc_dbug_check= 1; /* Unlikely number */
+ulong my_crc_dbug_check= ~0; /* Cannot happen */
/*
Calculate a long checksum for a memoryblock.
@@ -34,7 +34,7 @@ ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length)
{
crc= (ha_checksum) crc32((uint)crc, pos, (uint) length);
DBUG_PRINT("info", ("crc: %lu", (ulong) crc));
- if (crc == my_crc_dbug_check)
+ if ((ulong)crc == my_crc_dbug_check)
my_debug_put_break_here();
return crc;
}
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 04a5214e2d4..c74504e4fa8 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -474,52 +474,3 @@ err:
return (size_t) -1;
}
-
-int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
- const char *default_val)
-{
- uint length;
- DBUG_ENTER("init_strvar_from_file");
-
- if ((length=my_b_gets(f,var, max_size)))
- {
- char* last_p = var + length -1;
- if (*last_p == '\n')
- *last_p = 0; /* if we stopped on newline, kill it */
- else
- {
- /*
- If we truncated a line or stopped on last char, remove all chars
- up to and including newline.
- */
- int c;
- while (((c=my_b_get(f)) != '\n' && c != my_b_EOF))
- ;
- }
- DBUG_RETURN(0);
- }
- else if (default_val)
- {
- strmake(var, default_val, max_size-1);
- DBUG_RETURN(0);
- }
- DBUG_RETURN(1);
-}
-
-int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
-{
- char buf[32];
- DBUG_ENTER("init_intvar_from_file");
-
- if (my_b_gets(f, buf, sizeof(buf)))
- {
- *var = atoi(buf);
- DBUG_RETURN(0);
- }
- else if (default_val)
- {
- *var = default_val;
- DBUG_RETURN(0);
- }
- DBUG_RETURN(1);
-}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 6a283383e24..41b93517655 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -179,10 +179,10 @@ typedef struct st_simple_key_cache_cb
HASH_LINK *free_hash_list; /* list of free hash links */
BLOCK_LINK *free_block_list; /* list of free blocks */
BLOCK_LINK *block_root; /* memory for block links */
- uchar HUGE_PTR *block_mem; /* memory for block buffers */
+ uchar *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
- pthread_mutex_t cache_lock; /* to lock access to the cache structure */
+ mysql_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
/*
Waiting for a zero resize count. Using a queue for symmetry though
@@ -793,7 +793,7 @@ void finish_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
if (acquire_lock)
keycache_pthread_mutex_lock(&keycache->cache_lock);
- safe_mutex_assert_owner(&keycache->cache_lock);
+ mysql_mutex_assert_owner(&keycache->cache_lock);
/*
Mark the resize finished. This allows other threads to start a
@@ -5195,7 +5195,7 @@ int init_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
end_simple_key_cache(partition, 1);
if (!key_cache_inited)
{
- my_free(partition, MYF(0));
+ my_free(partition);
partition= 0;
}
if ((i == 0 && cnt < 0) || i > 0)
@@ -5214,7 +5214,7 @@ int init_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
*/
if (key_cache_inited)
{
- my_free(partition, MYF(0));
+ my_free(partition);
partition= 0;
if(key_cache_inited)
memmove(partition_ptr, partition_ptr+1,
@@ -5423,8 +5423,8 @@ void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
if (cleanup)
{
for (i= 0; i < partitions; i++)
- my_free((uchar*) keycache->partition_array[i], MYF(0));
- my_free((uchar*) keycache->partition_array, MYF(0));
+ my_free(keycache->partition_array[i]);
+ my_free(keycache->partition_array);
keycache->key_cache_inited= 0;
}
DBUG_VOID_RETURN;
@@ -6121,7 +6121,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
{
if (keycache->keycache_cb)
{
- my_free((uchar *) keycache->keycache_cb, MYF(0));
+ my_free(keycache->keycache_cb);
keycache->keycache_cb= 0;
}
keycache->key_cache_inited= 0;
@@ -6363,7 +6363,8 @@ int flush_key_blocks(KEY_CACHE *keycache,
*/
int reset_key_cache_counters(const char *name __attribute__((unused)),
- KEY_CACHE *keycache)
+ KEY_CACHE *keycache,
+ void *unused __attribute__((unused)))
{
if (keycache->key_cache_inited)
{
diff --git a/mysys/my_compress.c b/mysys/my_compress.c
index d408520a862..98f96f6b2b6 100644
--- a/mysys/my_compress.c
+++ b/mysys/my_compress.c
@@ -89,7 +89,7 @@ void *my_az_allocator(void *dummy __attribute__((unused)), unsigned int items,
void my_az_free(void *dummy __attribute__((unused)), void *address)
{
- my_free(address, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(address);
}
/*
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 17bb796fd9b..c2f4f53a780 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -122,7 +122,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
{
my_errno= errno;
if (MyFlags & MY_WME)
- my_error(EE_CANT_COPY_OWNERSHIP, MYF(ME_JUST_WARNING), to, errno);
+ my_error(EE_CANT_COPY_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), to, errno);
if (MyFlags & MY_FAE)
goto err;
}
diff --git a/mysys/my_error.c b/mysys/my_error.c
index a682585a82e..48b907d48cb 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -150,29 +150,6 @@ void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
/*
- Error with va_list
-
- SYNOPSIS
- my_printv_error()
- error Errno
- format Format string
- MyFlags Flags
- ... variable list
-*/
-
-int my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
-{
- char ebuff[ERRMSGSIZE+20];
- DBUG_ENTER("my_printv_error");
- DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s",
- error, MyFlags, errno, format));
-
- (void) my_vsnprintf(ebuff, sizeof(ebuff), format, ap);
- DBUG_RETURN((*error_handler_hook)(error, ebuff, MyFlags));
-}
-
-
-/*
Give message using error_handler_hook
SYNOPSIS
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index a13ba364594..74c0d6b5ba3 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -157,7 +157,7 @@ int handle_options(int *argc, char ***argv,
my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose;
char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN];
- const char *prev_found;
+ const char *UNINIT_VAR(prev_found);
const struct my_option *optp;
void *value;
int error, i;
@@ -228,7 +228,6 @@ int handle_options(int *argc, char ***argv,
Find first the right option. Return error in case of an ambiguous,
or unknown option
*/
- LINT_INIT(prev_found);
optp= longopts;
if (!(opt_found= findopt(opt_str, length, &optp, &prev_found)))
{
@@ -544,7 +543,8 @@ int handle_options(int *argc, char ***argv,
(*argc)--; /* option handled (short), decrease argument count */
continue;
}
- if ((error= setval(optp, value, argument, set_maximum_value)))
+ if (((error= setval(optp, value, argument, set_maximum_value))) &&
+ !option_is_loose)
return error;
if (get_one_option && get_one_option(optp->id, optp, argument))
return EXIT_UNSPECIFIED_ERROR;
@@ -1009,6 +1009,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_getopt_error_reporter(WARNING_LEVEL,
"option '%s': unsigned value %s adjusted to %s",
optp->name, ullstr(old, buf1), ullstr(num, buf2));
+
return num;
}
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index 8daa9af39a9..2cbe65bebba 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -22,8 +22,6 @@
#include <my_sys.h>
#include "my_handler_errors.h"
-#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
-
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)
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 71b3d960386..ae4aa5bb5b7 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -96,10 +96,10 @@ 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 defined(THREAD)
if (my_thread_global_init())
return 1;
#if defined(HAVE_PTHREAD_INIT)
diff --git a/mysys/my_safehash.c b/mysys/my_safehash.c
index 7ffb6d82e53..08c94a1d7c8 100644
--- a/mysys/my_safehash.c
+++ b/mysys/my_safehash.c
@@ -101,7 +101,7 @@ my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
{
DBUG_ENTER("safe_hash_init");
if (my_hash_init(&hash->hash, &my_charset_bin, elements,
- 0, 0, (hash_get_key) safe_hash_entry_get,
+ 0, 0, (my_hash_get_key) safe_hash_entry_get,
(void (*)(void*)) safe_hash_entry_free, 0))
{
hash->default_value= 0;
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 97af25cf92d..c6bf3c0ef0f 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -88,19 +88,6 @@ static const char *proc_info_dummy(void *a __attribute__((unused)),
/* this is to be able to call set_thd_proc_info from the C code */
const char *(*proc_info_hook)(void *, const char *, const char *, const char *,
const unsigned int)= proc_info_dummy;
-
-static const char *proc_info_dummy(void *a __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *c __attribute__((unused)),
- const char *d __attribute__((unused)),
- const unsigned int e __attribute__((unused)))
-{
- return 0;
-}
-
-/* this is to be able to call set_thd_proc_info from the C code */
-const char *(*proc_info_hook)(void *, const char *, const char *, const char *,
- const unsigned int)= proc_info_dummy;
#if defined(ENABLED_DEBUG_SYNC)
/**
Global pointer to be set if callback function is defined
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 7b895149d84..a2d89c79b4e 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -391,10 +391,7 @@ void my_thread_end(void)
mysql_cond_destroy(&tmp->suspend);
#endif
mysql_mutex_destroy(&tmp->mutex);
- TRASH(tmp, sizeof(*tmp));
- free(tmp);
-#warning why monty added pthread_setspecific(THR_KEY_mysys,0) here?
/*
Decrement counter for number of running threads. We are using this
in my_thread_global_end() to wait until all threads have called
@@ -406,6 +403,9 @@ void my_thread_end(void)
if (--THR_thread_count == 0)
mysql_cond_signal(&THR_COND_threads);
mysql_mutex_unlock(&THR_LOCK_threads);
+
+ TRASH(tmp, sizeof(*tmp));
+ free(tmp);
}
pthread_setspecific(THR_KEY_mysys,0);
}
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 4d8ff6254e3..ad1636011db 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -18,7 +18,6 @@
*****************************************************************************/
#if defined(_WIN32)
-#warning #include <my_global.h>
#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 1ca32d58832..19d4a707062 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -18,7 +18,7 @@
*****************************************************************************/
#if defined (_WIN32)
/* SAFE_MUTEX will not work until the thread structure is up to date */
-#warning #include <my_global.h>
+
#undef SAFE_MUTEX
#include "mysys_priv.h"
#include <process.h>
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 30ffac0ac77..772e0346016 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -85,7 +85,6 @@ extern PSI_file_key key_file_charset, key_file_cnf;
#endif
void my_error_unregister_all(void);
-<<<<<<< TREE
#ifdef _WIN32
#include <sys/stat.h>
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 10607822ac0..9742861db08 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -230,7 +230,7 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
abort:
if (alarm_data->malloced)
- my_free(alarm_data, MYF(0));
+ my_free(alarm_data);
mysql_mutex_unlock(&LOCK_alarm);
one_signal_hand_sigmask(SIG_SETMASK,&old_mask,NULL);
abort_no_unlock:
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 135a2a5618f..b22823ae33e 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -117,26 +117,16 @@ static inline mysql_cond_t *get_cond(void)
return &my_thread_var->suspend;
}
+static inline int LOCK_CMP(THR_LOCK_DATA *a, THR_LOCK_DATA *b)
+{
+ if (a->lock != b->lock)
+ return a->lock < b->lock;
-/*
- Priority for locks (decides in which order locks are locked)
- We want all write locks to be first, followed by read locks.
- Locks from MERGE tables has a little lower priority than other
- locks, to allow one to release merge tables without having
- to unlock and re-lock other locks.
- The lower the number, the higher the priority for the lock.
- Read locks should have 4, write locks should have 0.
- UNLOCK is 8, to force these last in thr_merge_locks.
- For MERGE tables we add 2 (THR_LOCK_MERGE_PRIV) to the lock priority.
- THR_LOCK_LATE_PRIV (1) is used when one locks other tables to be merged
- with existing locks. This way we prioritize the original locks over the
- new locks.
-*/
-
-static uint lock_priority[(uint)TL_WRITE_ONLY+1] =
-{ 8, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0};
+ if (a->type != b->type)
+ return a->type > b->type;
-#define LOCK_CMP(A,B) ((uchar*) ((A)->lock) + lock_priority[(uint) (A)->type] + (A)->priority < (uchar*) ((B)->lock) + lock_priority[(uint) (B)->type] + (B)->priority)
+ return a->priority < b->priority;
+}
/*
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index bd53ee433e8..b5548662679 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -171,12 +171,12 @@ static int safe_mutex_lazy_init_deadlock_detection(safe_mutex_t *mp)
pthread_mutex_lock(&THR_LOCK_mutex);
mp->id= ++safe_mutex_id;
pthread_mutex_unlock(&THR_LOCK_mutex);
- hash_init(mp->locked_mutex, &my_charset_bin,
+ my_hash_init(mp->locked_mutex, &my_charset_bin,
1000,
offsetof(safe_mutex_deadlock_t, id),
sizeof(mp->id),
0, 0, HASH_UNIQUE);
- hash_init(mp->used_mutex, &my_charset_bin,
+ my_hash_init(mp->used_mutex, &my_charset_bin,
1000,
offsetof(safe_mutex_t, id),
sizeof(mp->id),
@@ -186,10 +186,7 @@ static int safe_mutex_lazy_init_deadlock_detection(safe_mutex_t *mp)
int safe_mutex_init(safe_mutex_t *mp,
const pthread_mutexattr_t *attr __attribute__((unused)),
- const char *name,
- myf my_flags,
- const char *file,
- uint line)
+ const char *name, const char *file, uint line)
{
DBUG_ENTER("safe_mutex_init");
DBUG_PRINT("enter",("mutex: 0x%lx name: %s", (ulong) mp, name));
@@ -202,11 +199,9 @@ int safe_mutex_init(safe_mutex_t *mp,
/* Skip the very common '&' prefix from the autogenerated name */
mp->name= name[0] == '&' ? name + 1 : name;
- if (!safe_mutex_deadlock_detector)
- my_flags|= MYF_NO_DEADLOCK_DETECTION;
/* Deadlock detection is initialised only lazily, on first use. */
- mp->create_flags= my_flags;
+ mp->create_flags= safe_mutex_deadlock_detector ? MYF_NO_DEADLOCK_DETECTION : 0;
#ifdef SAFE_MUTEX_DETECT_DESTROY
/*
@@ -342,7 +337,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
*/
pthread_mutex_lock(&THR_LOCK_mutex);
- if (!hash_search(mutex_root->locked_mutex, (uchar*) &mp->id, 0))
+ if (!my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id, 0))
{
safe_mutex_deadlock_t *deadlock;
safe_mutex_t *mutex;
@@ -362,7 +357,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
mutex= mutex_root;
do
{
- if (hash_search(mp->locked_mutex, (uchar*) &mutex->id, 0))
+ if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id, 0))
{
print_deadlock_warning(mp, mutex);
/* Mark wrong usage to avoid future warnings for same error */
@@ -669,9 +664,9 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp)
mp);
pthread_mutex_unlock(&THR_LOCK_mutex);
- hash_free(mp->used_mutex);
- hash_free(mp->locked_mutex);
- my_free(mp->locked_mutex, 0);
+ my_hash_free(mp->used_mutex);
+ my_hash_free(mp->locked_mutex);
+ my_free(mp->locked_mutex);
mp->create_flags|= MYF_NO_DEADLOCK_DETECTION;
}
}
@@ -718,8 +713,7 @@ void safe_mutex_end(FILE *file __attribute__((unused)))
safe_mutex_t **my_thread_var_mutex_in_use()
{
- struct st_my_thread_var *tmp=
- my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
+ struct st_my_thread_var *tmp= my_thread_var;
return tmp ? &tmp->mutex_in_use : 0;
}
@@ -785,17 +779,17 @@ static my_bool remove_from_locked_mutex(safe_mutex_t *mp,
(ulong) delete_mutex, (ulong) mp,
delete_mutex->id, mp->id));
- found= (safe_mutex_deadlock_t *) hash_search(mp->locked_mutex,
+ found= (safe_mutex_deadlock_t *) my_hash_search(mp->locked_mutex,
(uchar*) &delete_mutex->id, 0);
DBUG_ASSERT(found);
if (found)
{
- if (hash_delete(mp->locked_mutex, (uchar*) found))
+ if (my_hash_delete(mp->locked_mutex, (uchar*) found))
{
DBUG_ASSERT(0);
}
if (!--found->count)
- my_free(found, MYF(0));
+ my_free(found);
}
DBUG_RETURN(0);
}
@@ -807,12 +801,12 @@ static my_bool remove_from_used_mutex(safe_mutex_deadlock_t *locked_mutex,
DBUG_PRINT("enter", ("delete_mutex: 0x%lx mutex: 0x%lx (id: %lu <- %lu)",
(ulong) mutex, (ulong) locked_mutex,
mutex->id, locked_mutex->id));
- if (hash_delete(locked_mutex->mutex->used_mutex, (uchar*) mutex))
+ if (my_hash_delete(locked_mutex->mutex->used_mutex, (uchar*) mutex))
{
DBUG_ASSERT(0);
}
if (!--locked_mutex->count)
- my_free(locked_mutex, MYF(0));
+ my_free(locked_mutex);
DBUG_RETURN(0);
}
diff --git a/mysys/wqueue.c b/mysys/wqueue.c
index fcc0a39725d..b6f52ba5c31 100644
--- a/mysys/wqueue.c
+++ b/mysys/wqueue.c
@@ -130,7 +130,7 @@ void wqueue_release_queue(WQUEUE *wqueue)
do
{
thread= next;
- pthread_cond_signal(&thread->suspend);
+ mysql_cond_signal(&thread->suspend);
next= thread->next;
thread->next= NULL;
}
@@ -158,7 +158,7 @@ void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue)
if (first_type == MY_PTHREAD_LOCK_WRITE)
{
/* release first waiting for write lock */
- pthread_cond_signal(&next->suspend);
+ mysql_cond_signal(&next->suspend);
if (next == last)
wqueue->last_thread= NULL;
else
@@ -184,7 +184,7 @@ void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue)
else
{
/* release waiting for read lock */
- pthread_cond_signal(&thread->suspend);
+ mysql_cond_signal(&thread->suspend);
thread->next= NULL;
}
} while (thread != last);
@@ -204,7 +204,7 @@ void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue)
void wqueue_add_and_wait(WQUEUE *wqueue,
struct st_my_thread_var *thread,
- pthread_mutex_t *lock)
+ mysql_mutex_t *lock)
{
DBUG_ENTER("wqueue_add_and_wait");
DBUG_PRINT("enter",
@@ -215,7 +215,7 @@ void wqueue_add_and_wait(WQUEUE *wqueue,
{
DBUG_PRINT("info", ("wait... cond: 0x%lx mutex: 0x%lx",
(ulong) &thread->suspend, (ulong) lock));
- pthread_cond_wait(&thread->suspend, lock);
+ mysql_cond_wait(&thread->suspend, lock);
DBUG_PRINT("info", ("wait done cond: 0x%lx mutex: 0x%lx next: 0x%lx",
(ulong) &thread->suspend, (ulong) lock,
(ulong) thread->next));
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index f39ff6a78fd..e00de3f8118 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -145,7 +145,7 @@ static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param
the list of search terms when parsing a search string.
*/
-static void add_word(MYSQL_FTPARSER_PARAM *param, const unsigned char *word, size_t len)
+static void add_word(MYSQL_FTPARSER_PARAM *param, const char *word, size_t len)
{
MYSQL_FTPARSER_BOOLEAN_INFO bool_info=
{ FT_TOKEN_WORD, 0, 0, 0, 0, ' ', 0 };
@@ -169,7 +169,7 @@ static void add_word(MYSQL_FTPARSER_PARAM *param, const unsigned char *word, siz
static int simple_parser_parse(MYSQL_FTPARSER_PARAM *param)
{
- const unsigned char *end, *start, *docend= param->doc + param->length;
+ const char *end, *start, *docend= param->doc + param->length;
number_of_calls++;
diff --git a/sql-common/client.c b/sql-common/client.c
index ebc23e53b49..6b5f04f2bff 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1194,7 +1194,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
#define extension_set_string(OPTS, X, STR) \
if ((OPTS)->extension) \
- my_free((OPTS)->extension->X, MYF(MY_ALLOW_ZERO_PTR)); \
+ my_free((OPTS)->extension->X); \
else \
(OPTS)->extension= (struct st_mysql_options_extention *) \
my_malloc(sizeof(struct st_mysql_options_extention), \
@@ -1764,11 +1764,11 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
{
DBUG_ENTER("mysql_ssl_set");
#ifdef HAVE_OPENSSL
- my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mysql->options.ssl_key);
+ my_free(mysql->options.ssl_cert);
+ my_free(mysql->options.ssl_ca);
+ my_free(mysql->options.ssl_capath);
+ my_free(mysql->options.ssl_cipher);
mysql->options.ssl_key= strdup_if_not_null(key);
mysql->options.ssl_cert= strdup_if_not_null(cert);
mysql->options.ssl_ca= strdup_if_not_null(ca);
@@ -2911,9 +2911,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
char *end, *host_info=0, *server_version_end, *pkt_end;
char *scramble_data;
const char *scramble_plugin;
- my_socket sock;
- in_addr_t ip_addr;
- struct sockaddr_in sock_addr;
ulong pkt_length;
NET *net= &mysql->net;
#ifdef MYSQL_SERVER
@@ -3590,9 +3587,9 @@ static void mysql_close_free_options(MYSQL *mysql)
#endif /* HAVE_SMEM */
if (mysql->options.extension)
{
- my_free(mysql->options.extension->plugin_dir,MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.extension->default_auth,MYF(MY_ALLOW_ZERO_PTR));
- my_free(mysql->options.extension,MYF(0));
+ my_free(mysql->options.extension->plugin_dir);
+ my_free(mysql->options.extension->default_auth);
+ my_free(mysql->options.extension);
}
bzero((char*) &mysql->options,sizeof(mysql->options));
DBUG_VOID_RETURN;
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index c609f165d1c..71c305fdb2a 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -221,7 +221,7 @@ static void load_env_plugins(MYSQL *mysql)
plugs= s + 1;
} while (s);
- my_free(free_env, MYF(0));
+ my_free(free_env);
}
/********** extern functions to be used by libmysql *********************/
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 9bcce146ebe..9a808b62f24 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -20,7 +20,6 @@ ${CMAKE_SOURCE_DIR}/regex
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/sql
-${CMAKE_SOURCE_DIR}/extra/libevent
)
SET(GEN_SOURCES
@@ -90,7 +89,7 @@ ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
ADD_DEPENDENCIES(sql GenServerSource)
DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
- mysys dbug strings vio regex libevent psapi.lib
+ mysys dbug strings vio regex
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${SSL_LIBRARIES})
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 4478fc14791..e80b213cc81 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -19,7 +19,6 @@
Engine defined options of tables/fields/keys in CREATE/ALTER TABLE.
*/
-#include "mysql_priv.h"
#include "create_options.h"
#include <my_getopt.h>
diff --git a/sql/create_options.h b/sql/create_options.h
index b66bbf43570..1bd6ecd81e6 100644
--- a/sql/create_options.h
+++ b/sql/create_options.h
@@ -22,7 +22,8 @@
#ifndef SQL_CREATE_OPTIONS_INCLUDED
#define SQL_CREATE_OPTIONS_INCLUDED
-#include "handler.h"
+#include "sql_class.h"
+//#include "handler.h"
class engine_option_value: public Sql_alloc
{
diff --git a/sql/datadict.h b/sql/datadict.h
index 65e40998929..f852b02f52c 100644
--- a/sql/datadict.h
+++ b/sql/datadict.h
@@ -28,7 +28,6 @@ enum frm_type_enum
FRMTYPE_VIEW
};
-
frm_type_enum dd_frm_type(THD *thd, char *path, enum legacy_db_type *dbt);
bool dd_frm_storage_engine(THD *thd, const char *db, const char *table_name,
diff --git a/sql/events.h b/sql/events.h
index 39e9510c15b..4cb93ce8415 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -42,7 +42,6 @@ class Event_scheduler;
struct TABLE_LIST;
class THD;
typedef class Item COND;
-typedef struct charset_info_st CHARSET_INFO;
/* Return codes */
enum enum_events_error_code
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 0b61c65d2b7..69df42da95f 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -32,6 +32,8 @@
#include "probes_mysql.h"
#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
diff --git a/sql/gstream.h b/sql/gstream.h
index 6bb3c9bac10..7c079c7bdb3 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -21,9 +21,6 @@
#include "my_sys.h" /* MY_ALLOW_ZERO_PTR */
#include "m_ctype.h" /* my_charset_latin1, my_charset_bin */
-typedef struct charset_info_st CHARSET_INFO;
-typedef struct st_mysql_lex_string LEX_STRING;
-
class Gis_read_stream
{
public:
diff --git a/sql/handler.cc b/sql/handler.cc
index 94b3e175ca0..1737d5554b9 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -42,11 +42,16 @@
#include "transaction.h"
#include "myisam.h"
#include "probes_mysql.h"
+#include "sql_connect.h"
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
#endif
+#ifdef WITH_ARIA_STORAGE_ENGINE
+#include "../storage/maria/ha_maria.h"
+#endif
+
/*
While we have legacy_db_type, we have this array to
check for dups and to find handlerton from legacy_db_type.
@@ -93,8 +98,6 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
static TYPELIB known_extensions= {0,"known_exts", NULL, NULL};
uint known_extensions_id= 0;
-
-
static plugin_ref ha_default_plugin(THD *thd)
{
if (thd->variables.table_plugin)
@@ -487,8 +490,6 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
if (idx == (int) DB_TYPE_DEFAULT)
{
sql_print_warning("Too many storage engines!");
- my_free(hton, MYF(0));
- plugin->data= 0;
goto err_deinit;
}
if (hton->db_type != DB_TYPE_UNKNOWN)
@@ -1159,6 +1160,10 @@ int ha_commit_trans(THD *thd, bool all)
DBUG_RETURN(2);
}
+#ifdef WITH_ARIA_STORAGE_ENGINE
+ ha_maria::implicit_commit(thd, TRUE);
+#endif
+
if (ha_info)
{
uint rw_ha_count;
@@ -1300,9 +1305,6 @@ int ha_commit_one_phase(THD *thd, bool all)
#endif
}
}
-#ifdef WITH_ARIA_STORAGE_ENGINE
- ha_maria::implicit_commit(thd, TRUE);
-#endif
/* Free resources and perform other cleanup even for 'empty' transactions. */
if (is_real_trans)
thd->transaction.cleanup();
@@ -2890,7 +2892,6 @@ void handler::print_error(int error, myf errflag)
}
}
my_error(textno, errflag, table_share->table_name.str, error);
- DBUG_ASSERT(!fatal_error || !debug_assert_if_crashed_table);
DBUG_VOID_RETURN;
}
@@ -3643,10 +3644,10 @@ void handler::update_global_table_stats()
DBUG_ASSERT(table->s && table->s->table_cache_key.str);
- pthread_mutex_lock(&LOCK_global_table_stats);
+ mysql_mutex_lock(&LOCK_global_table_stats);
/* Gets the global table stats, creating one if necessary. */
if (!(table_stats= (TABLE_STATS*)
- hash_search(&global_table_stats,
+ my_hash_search(&global_table_stats,
(uchar*) table->s->table_cache_key.str,
table->s->table_cache_key.length)))
{
@@ -3666,7 +3667,7 @@ void handler::update_global_table_stats()
if (my_hash_insert(&global_table_stats, (uchar*) table_stats))
{
/* Out of memory error is already given */
- my_free(table_stats, 0);
+ my_free(table_stats);
goto end;
}
}
@@ -3678,7 +3679,7 @@ void handler::update_global_table_stats()
1));
rows_read= rows_changed= 0;
end:
- pthread_mutex_unlock(&LOCK_global_table_stats);
+ mysql_mutex_unlock(&LOCK_global_table_stats);
}
@@ -3709,9 +3710,9 @@ void handler::update_global_index_stats()
if (!key_info->cache_name)
continue;
key_length= table->s->table_cache_key.length + key_info->name_length + 1;
- pthread_mutex_lock(&LOCK_global_index_stats);
+ mysql_mutex_lock(&LOCK_global_index_stats);
// Gets the global index stats, creating one if necessary.
- if (!(index_stats= (INDEX_STATS*) hash_search(&global_index_stats,
+ if (!(index_stats= (INDEX_STATS*) my_hash_search(&global_index_stats,
key_info->cache_name,
key_length)))
{
@@ -3724,7 +3725,7 @@ void handler::update_global_index_stats()
index_stats->index_name_length= key_length;
if (my_hash_insert(&global_index_stats, (uchar*) index_stats))
{
- my_free(index_stats, 0);
+ my_free(index_stats);
goto end;
}
}
@@ -3732,7 +3733,7 @@ void handler::update_global_index_stats()
index_stats->rows_read+= index_rows_read[index];
index_rows_read[index]= 0;
end:
- pthread_mutex_unlock(&LOCK_global_index_stats);
+ mysql_mutex_unlock(&LOCK_global_index_stats);
}
}
}
@@ -3897,7 +3898,8 @@ void st_ha_check_opt::init()
/**
Init a key cache if it has not been initied before.
*/
-int ha_init_key_cache(const char *name, KEY_CACHE *key_cache)
+int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *unused
+ __attribute__((unused)))
{
DBUG_ENTER("ha_init_key_cache");
@@ -3971,13 +3973,13 @@ int ha_repartition_key_cache(KEY_CACHE *key_cache)
if (key_cache->key_cache_inited)
{
- pthread_mutex_lock(&LOCK_global_system_variables);
+ mysql_mutex_lock(&LOCK_global_system_variables);
size_t tmp_buff_size= (size_t) key_cache->param_buff_size;
long tmp_block_size= (long) key_cache->param_block_size;
uint division_limit= key_cache->param_division_limit;
uint age_threshold= key_cache->param_age_threshold;
uint partitions= key_cache->param_partitions;
- pthread_mutex_unlock(&LOCK_global_system_variables);
+ mysql_mutex_unlock(&LOCK_global_system_variables);
DBUG_RETURN(!repartition_key_cache(key_cache, tmp_block_size,
tmp_buff_size,
division_limit, age_threshold,
@@ -4087,8 +4089,7 @@ ha_find_files(THD *thd,const char *db,const char *path,
int error= 0;
DBUG_ENTER("ha_find_files");
DBUG_PRINT("enter", ("db: '%s' path: '%s' wild: '%s' dir: %d",
- val_or_null(db), val_or_null(path),
- val_or_null(wild), dir));
+ db, path, wild, dir));
st_find_files_args args= {db, path, wild, dir, files};
plugin_foreach(thd, find_files_handlerton,
diff --git a/sql/handler.h b/sql/handler.h
index bbdc38eba4d..656c9403b8c 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,6 +1,5 @@
#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
-#error don't forget to merge mysql_priv.h!
/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
@@ -577,10 +576,10 @@ enum enum_schema_tables
SCH_PARAMETERS,
SCH_PARTITIONS,
SCH_PLUGINS,
- SCH_PROCEDURES,
SCH_PROCESSLIST,
SCH_PROFILES,
SCH_REFERENTIAL_CONSTRAINTS,
+ SCH_PROCEDURES,
SCH_SCHEMATA,
SCH_SCHEMA_PRIVILEGES,
SCH_SESSION_STATUS,
@@ -2263,6 +2262,7 @@ public:
@retval
TRUE if the engine supports virtual columns
*/
+
virtual bool check_if_supported_virtual_columns(void) { return FALSE;}
protected:
@@ -2567,7 +2567,7 @@ int ha_find_files(THD *thd,const char *db,const char *path,
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
/* key cache */
-extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
+extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_repartition_key_cache(KEY_CACHE *key_cache);
diff --git a/sql/item.cc b/sql/item.cc
index 8dd6d3b3159..f2e9e8202c5 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -40,6 +40,7 @@
// find_item_in_list,
// RESOLVED_AGAINST_ALIAS, ...
#include "log_event.h" // append_query_string
+#include "sql_expression_cache.h"
const String my_null_string("NULL", 4, default_charset_info);
@@ -432,7 +433,7 @@ Item::Item():
maybe_null=null_value=with_sum_func=unsigned_flag=0;
decimals= 0; max_length= 0;
with_subselect= 0;
- cmp_context= IMPOSSIBLE_RESULT;
+ cmp_context= (Item_result)-1;
/* Put item in free list so that we can free all items at end */
THD *thd= current_thd;
@@ -6931,7 +6932,6 @@ Item_cache_wrapper::~Item_cache_wrapper()
/* expr_value is Item so it will be destroyed from list of Items */
}
-
Item_cache_wrapper::Item_cache_wrapper(Item *item_arg)
:orig_item(item_arg), expr_cache(NULL), expr_value(NULL)
{
@@ -6979,6 +6979,12 @@ bool Item_cache_wrapper::fix_fields(THD *thd __attribute__((unused)),
return FALSE;
}
+bool Item_cache_wrapper::send(Protocol *protocol, String *buffer)
+{
+ if (result_field)
+ return protocol->store(result_field);
+ return Item::send(protocol, buffer);
+}
/**
Clean the expression cache wrapper up before reusing it.
@@ -8201,7 +8207,7 @@ String *Item_cache_datetime::val_str(String *str)
else if (!cache_value())
return NULL;
}
- return &str_value;
+ return null_value ? NULL : &str_value;
}
diff --git a/sql/item.h b/sql/item.h
index 4c5475fb080..26ee946f147 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2829,9 +2829,8 @@ public:
virtual Ref_Type ref_type() { return DIRECT_REF; }
};
-class Expression_cache;
class Item_cache;
-
+class Expression_cache;
/**
The objects of this class can store its values in an expression cache.
@@ -2879,12 +2878,7 @@ public:
bool is_null();
bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
bool get_time(MYSQL_TIME *ltime);
- bool send(Protocol *protocol, String *buffer)
- {
- if (result_field)
- return protocol->store(result_field);
- return Item::send(protocol, buffer);
- }
+ bool send(Protocol *protocol, String *buffer);
void save_org_in_field(Field *field)
{
save_val(field);
@@ -3896,4 +3890,72 @@ extern int stored_field_cmp_to_item(THD *thd, Field *field, Item *item);
extern const String my_null_string;
+/**
+ Interface for Item iterator
+*/
+
+class Item_iterator
+{
+public:
+ /**
+ Shall set this iterator to the position before the first item
+
+ @note
+ This method also may perform some other initialization actions like
+ allocation of certain resources.
+ */
+ virtual void open()= 0;
+ /**
+ Shall return the next Item (or NULL if there is no next item) and
+ move pointer to position after it.
+ */
+ virtual Item *next()= 0;
+ /**
+ Shall force iterator to free resources (if it holds them)
+
+ @note
+ One should not use the iterator without open() call after close()
+ */
+ virtual void close()= 0;
+
+ virtual ~Item_iterator() {}
+};
+
+
+/**
+ Item iterator over List_iterator_fast for Item references
+*/
+
+class Item_iterator_ref_list: public Item_iterator
+{
+ List_iterator<Item*> list;
+public:
+ Item_iterator_ref_list(List_iterator<Item*> &arg_list):
+ list(arg_list) {}
+ void open() { list.rewind(); }
+ Item *next() { return *(list++); }
+ void close() {}
+};
+
+
+/**
+ Item iterator over Item interface for rows
+*/
+
+class Item_iterator_row: public Item_iterator
+{
+ Item *base_item;
+ uint current;
+public:
+ Item_iterator_row(Item *base) : base_item(base), current(0) {}
+ void open() { current= 0; }
+ Item *next()
+ {
+ if (current >= base_item->cols())
+ return NULL;
+ return base_item->element_index(current++);
+ }
+ void close() {}
+};
+
#endif /* SQL_ITEM_INCLUDED */
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 7bddc29b812..6cb45f05efc 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -1837,7 +1837,7 @@ protected:
class Create_func_sha2 : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item* create_2_arg(THD *thd, Item *arg1, Item *arg2);
static Create_func_sha2 s_singleton;
@@ -2074,7 +2074,7 @@ protected:
class Create_func_to_seconds : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item* create_1_arg(THD *thd, Item *arg1);
static Create_func_to_seconds s_singleton;
@@ -4382,7 +4382,7 @@ Create_func_sha::create_1_arg(THD *thd, Item *arg1)
Create_func_sha2 Create_func_sha2::s_singleton;
Item*
-Create_func_sha2::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_sha2::create_2_arg(THD *thd, Item *arg1, Item *arg2)
{
return new (thd->mem_root) Item_func_sha2(arg1, arg2);
}
@@ -4570,7 +4570,7 @@ Create_func_to_days::create_1_arg(THD *thd, Item *arg1)
Create_func_to_seconds Create_func_to_seconds::s_singleton;
Item*
-Create_func_to_seconds::create(THD *thd, Item *arg1)
+Create_func_to_seconds::create_1_arg(THD *thd, Item *arg1)
{
return new (thd->mem_root) Item_func_to_seconds(arg1);
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 65585378f6a..fb4883ec393 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4392,7 +4392,6 @@ double user_var_entry::val_real(bool *null_value)
case STRING_RESULT:
return my_atof(value); // This is null terminated
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0); // Impossible
break;
}
@@ -4424,7 +4423,6 @@ longlong user_var_entry::val_int(bool *null_value) const
return my_strtoll10(value, (char**) 0, &error);// String is null terminated
}
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0); // Impossible
break;
}
@@ -4458,7 +4456,6 @@ String *user_var_entry::val_str(bool *null_value, String *str,
str= 0; // EOM error
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0); // Impossible
break;
}
@@ -4486,7 +4483,6 @@ my_decimal *user_var_entry::val_decimal(bool *null_value, my_decimal *val)
str2my_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0); // Impossible
break;
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 8e8bb6c7f09..4b87b0439ee 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2898,7 +2898,7 @@ String *Item_func_conv::val_str(String *str)
from_base, &endptr, &err);
}
- ptr= longlong2str(dec, ans, to_base, 1);
+ ptr= longlong2str(dec, ans, to_base);
if (str->copy(ans, (uint32) (ptr-ans), default_charset()))
return &my_empty_string;
return str;
@@ -3065,7 +3065,7 @@ String *Item_func_hex::val_str_ascii(String *str)
if ((null_value= args[0]->null_value))
return 0;
- ptr= longlong2str(dec,ans,16,1);
+ ptr= longlong2str(dec,ans,16);
if (str->copy(ans,(uint32) (ptr-ans), &my_charset_numeric))
return &my_empty_string; // End of memory
return str;
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 53950b70e69..a69910da700 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -3800,7 +3800,7 @@ bitmap_init_memroot(MY_BITMAP *map, uint n_bits, MEM_ROOT *mem_root)
bool subselect_hash_sj_engine::init_permanent(List<Item> *tmp_columns)
{
/* Options to create_tmp_table. */
- ulonglong tmp_create_options= thd->options | TMP_TABLE_ALL_COLUMNS;
+ ulonglong tmp_create_options= thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS;
/* | TMP_TABLE_FORCE_MYISAM; TIMOUR: force MYISAM */
DBUG_ENTER("subselect_hash_sj_engine::init_permanent");
@@ -3918,7 +3918,9 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
if (!(tmp_table_ref= (TABLE_LIST*) thd->alloc(sizeof(TABLE_LIST))))
DBUG_RETURN(TRUE);
- tmp_table_ref->init_one_table("", "materialized subselect", TL_READ);
+ tmp_table_ref->init_one_table(STRING_WITH_LEN(""),
+ STRING_WITH_LEN("materialized subselect"),
+ NULL, TL_READ);
tmp_table_ref->table= tmp_table;
context= new Name_resolution_context;
@@ -4277,7 +4279,7 @@ Ordered_key::Ordered_key(uint keyid_arg, TABLE *tbl_arg, Item *search_key_arg,
Ordered_key::~Ordered_key()
{
- my_free((char*) key_buff, MYF(0));
+ my_free(key_buff);
bitmap_free(&null_key);
}
@@ -4905,7 +4907,7 @@ subselect_rowid_merge_engine::~subselect_rowid_merge_engine()
/* None of the resources below is allocated if there are no ordered keys. */
if (keys_count)
{
- my_free((char*) row_num_to_rowid, MYF(0));
+ my_free(row_num_to_rowid);
for (uint i= 0; i < keys_count; i++)
delete merge_keys[i];
delete_queue(&pq);
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 88bd057b7f4..e4a49fe032d 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -22,6 +22,8 @@
#pragma interface /* gcc class implementation */
#endif
+#include <queues.h>
+
class st_select_lex;
class st_select_lex_unit;
class JOIN;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index a9c77e2fea5..4a7f2a54659 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -539,6 +539,11 @@ void Item_sum::update_used_tables ()
args[i]->update_used_tables();
used_tables_cache|= args[i]->used_tables();
}
+
+ used_tables_cache&= PSEUDO_TABLE_BITS;
+
+ /* the aggregate function is aggregated into its local context */
+ used_tables_cache |= (1 << aggr_sel->join->tables) - 1;
}
}
@@ -762,7 +767,7 @@ bool Aggregator_distinct::setup(THD *thd)
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
0,
(select_lex->options | thd->variables.option_bits),
- HA_POS_ERROR, "")))
+ HA_POS_ERROR, const_cast<char*>(""))))
return TRUE;
table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
table->no_rows=1;
diff --git a/sql/keycaches.cc b/sql/keycaches.cc
index 1da2f33fdad..984b5a6768b 100644
--- a/sql/keycaches.cc
+++ b/sql/keycaches.cc
@@ -145,17 +145,18 @@ void free_key_cache(const char *name, KEY_CACHE *key_cache)
}
-bool process_key_caches(process_key_cache_t func)
+bool process_key_caches(process_key_cache_t func, void *param)
{
I_List_iterator<NAMED_ILINK> it(key_caches);
NAMED_ILINK *element;
+ int res= 0;
while ((element= it++))
{
KEY_CACHE *key_cache= (KEY_CACHE *) element->data;
- func(element->name, key_cache);
+ res |= func(element->name, key_cache, param);
}
- return 0;
+ return res != 0;
}
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
diff --git a/sql/keycaches.h b/sql/keycaches.h
index 66d24b59465..52bd163a0be 100644
--- a/sql/keycaches.h
+++ b/sql/keycaches.h
@@ -21,7 +21,7 @@
extern "C"
{
- typedef int (*process_key_cache_t) (const char *, KEY_CACHE *);
+ typedef int (*process_key_cache_t) (const char *, KEY_CACHE *, void *);
}
class NAMED_ILINK;
@@ -40,6 +40,6 @@ KEY_CACHE *create_key_cache(const char *name, uint length);
KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
void free_key_cache(const char *name, KEY_CACHE *key_cache);
-bool process_key_caches(process_key_cache_t func);
+bool process_key_caches(process_key_cache_t func, void *param);
#endif /* KEYCACHES_INCLUDED */
diff --git a/sql/lock.cc b/sql/lock.cc
index 66b59fa5466..26a8a1ba35b 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -293,13 +293,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags)
if (lock_tables_check(thd, tables, count, flags))
DBUG_RETURN(NULL);
- if (! (sql_lock= get_lock_data(thd, tables, count, GET_LOCK_STORE_LOCKS)) ||
- ! sql_lock->table_count)
+ if (! (sql_lock= get_lock_data(thd, tables, count, GET_LOCK_STORE_LOCKS)))
DBUG_RETURN(NULL);
thd_proc_info(thd, "System lock");
DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
- if (lock_external(thd, sql_lock->table, sql_lock->table_count))
+ if (sql_lock->table_count && lock_external(thd, sql_lock->table,
+ sql_lock->table_count))
{
/* Clear the lock type of all lock data to avoid reusage. */
reset_lock_data_and_free(&sql_lock);
@@ -316,7 +316,8 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags)
&thd->lock_info, timeout)];
if (rc)
{
- (void) unlock_external(thd, sql_lock->table, sql_lock->table_count);
+ if (sql_lock->table_count)
+ (void) unlock_external(thd, sql_lock->table, sql_lock->table_count);
reset_lock_data_and_free(&sql_lock);
if (! thd->killed)
my_error(rc, MYF(0));
@@ -379,10 +380,10 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock)
{
DBUG_ENTER("mysql_unlock_tables");
- if (sql_lock->lock_count)
- thr_multi_unlock(sql_lock->locks,sql_lock->lock_count);
if (sql_lock->table_count)
- unlock_external(thd,sql_lock->table,sql_lock->table_count);
+ unlock_external(thd, sql_lock->table, sql_lock->table_count);
+ if (sql_lock->lock_count)
+ thr_multi_unlock(sql_lock->locks, sql_lock->lock_count, 0);
my_free(sql_lock);
DBUG_VOID_RETURN;
}
@@ -546,21 +547,8 @@ void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock)
if ((locked= get_lock_data(thd, &table, 1, GET_LOCK_UNLOCK)))
{
- if (table->children_attached)
- {
- /*
- Don't abort locks for underlying tables just because merge table
- is deleted. Doing would cause anyone accessing these tables to
- spin in open_table/close_table forever until lock is released.
- */
- thr_multi_unlock(locked->locks, locked->lock_count,
- THR_UNLOCK_UPDATE_STATUS);
- }
- else
- {
- for (uint i=0; i < locked->lock_count; i++)
- thr_abort_locks(locked->locks[i]->lock, upgrade_lock);
- }
+ for (uint i=0; i < locked->lock_count; i++)
+ thr_abort_locks(locked->locks[i]->lock, upgrade_lock);
my_free(locked);
}
DBUG_VOID_RETURN;
@@ -664,8 +652,6 @@ MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b)
/* Delete old, not needed locks */
my_free(a);
my_free(b);
-
- thr_lock_merge_status(sql_lock->locks, sql_lock->lock_count);
DBUG_RETURN(sql_lock);
}
diff --git a/sql/log.cc b/sql/log.cc
index 114cb3236b6..a9452ed1c26 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -38,6 +38,7 @@
#include "rpl_filter.h"
#include "rpl_rli.h"
#include "sql_audit.h"
+#include "log_slow.h"
#include <my_dir.h>
#include <stdarg.h>
@@ -921,13 +922,6 @@ void Log_to_file_event_handler::flush()
mysql_slow_log.reopen_file();
}
-void Log_to_file_event_handler::flush_slow_log()
-{
- /* reopen slow log file */
- if (opt_slow_log)
- mysql_slow_log.reopen_file();
-}
-
/*
Log error with all enabled log event handlers
@@ -1038,24 +1032,6 @@ bool LOGGER::flush_logs(THD *thd)
}
-#error remove percona's flush log implementation
-bool LOGGER::flush_slow_log(THD *thd)
-{
- /*
- Now we lock logger, as nobody should be able to use logging routines while
- log tables are closed
- */
- logger.lock_exclusive();
-
- /* reopen log files */
- file_log_handler->flush_slow_log();
-
- /* end of log flush */
- logger.unlock();
- return 0;
-}
-
-
/**
Close and reopen the slow log (with locks).
@@ -4748,11 +4724,11 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
#endif /* HAVE_REPLICATION */
IO_CACHE *file= NULL;
- my_org_b_tell= my_b_tell(file);
if (event_info->use_direct_logging())
{
file= &log_file;
+ my_org_b_tell= my_b_tell(file);
mysql_mutex_lock(&LOCK_log);
}
else
@@ -4842,9 +4818,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))
goto err;
- status_var_add(thd->status_var.binlog_bytes_written,
- my_b_tell(file) - my_org_b_tell);
-
error= 0;
err:
@@ -4853,9 +4826,13 @@ err:
if (!error)
{
bool synced;
+
if ((error= flush_and_sync(&synced)))
goto unlock;
+ status_var_add(thd->status_var.binlog_bytes_written,
+ my_b_tell(file) - my_org_b_tell);
+
if ((error= RUN_HOOK(binlog_storage, after_flush,
(thd, log_file_name, file->pos_in_file, synced))))
{
@@ -5966,7 +5943,7 @@ void TC_LOG_MMAP::get_active_from_pool()
}
while ((*best_p == 0 || best_free == 0) && overflow());
- safe_mutex_assert_owner(&LOCK_active);
+ mysql_mutex_assert_owner(&LOCK_active);
active=*best_p;
if ((*best_p)->next) // unlink the page from the pool
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d45fa1e1ba7..6f83e5f4db2 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5627,7 +5627,6 @@ void User_var_log_event::pack_info(Protocol* protocol)
}
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
default:
DBUG_ASSERT(0);
return;
@@ -5743,7 +5742,6 @@ bool User_var_log_event::write(IO_CACHE* file)
pos= (uchar*) val;
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
default:
DBUG_ASSERT(0);
return 0;
@@ -5927,7 +5925,6 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli)
it= new Item_string(val, val_len, charset);
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
default:
DBUG_ASSERT(0);
return 0;
@@ -8432,7 +8429,7 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
memcpy((void*)m_tblnam, tblnam, m_tbllen + 1);
memcpy(m_coltype, coltype, m_colcnt);
- my_free(memory, MYF(MY_WME));
+ my_free(memory);
DBUG_RETURN(0);
}
#endif /* MYSQL_CLIENT */
@@ -9926,3 +9923,4 @@ bool rpl_get_position_info(const char **log_file_name, ulonglong *log_pos,
return TRUE;
#endif
}
+#endif
diff --git a/sql/log_slow.h b/sql/log_slow.h
index 91b74e690a0..92a2d1bf4f6 100644
--- a/sql/log_slow.h
+++ b/sql/log_slow.h
@@ -19,11 +19,7 @@
#define LOG_SLOW_VERBOSITY_INNODB 1 << 0
#define LOG_SLOW_VERBOSITY_QUERY_PLAN 1 << 1
-/*
- We init the used query plan with a bit that is alwyas set and all 'no' bits
- to enable easy testing of what to log in sql_log.cc
-*/
-#define QPLAN_INIT (QPLAN_ALWAYS_SET | QPLAN_QC_NO)
+#define QPLAN_INIT QPLAN_QC_NO
#define QPLAN_ADMIN 1 << 0
#define QPLAN_FILESORT 1 << 1
@@ -36,7 +32,4 @@
#define QPLAN_TMP_TABLE 1 << 8
/* ... */
#define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */
-#define QPLAN_ALWAYS_SET QPLAN_MAX
-#define QPLAN_VISIBLE_MASK (~(QPLAN_ALWAYS_SET))
-#warning simplify
diff --git a/sql/mdl.h b/sql/mdl.h
index e1d4cf74dd6..b9dad0597da 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -26,6 +26,7 @@
#include "sql_plist.h"
#include <my_sys.h>
+#include <my_pthread.h>
#include <m_string.h>
#include <mysql_com.h>
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc
index 53699c47688..e539f30d978 100644
--- a/sql/multi_range_read.cc
+++ b/sql/multi_range_read.cc
@@ -1,4 +1,4 @@
-#include "mysql_priv.h"
+#include "sql_parse.h"
#include "sql_select.h"
/****************************************************************************
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 106e2a4f0f5..5d581920a21 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -51,6 +51,7 @@
#include "derror.h" // init_errmessage
#include "des_key_file.h" // load_des_key_file
#include "sql_manager.h" // stop_handle_manager, start_handle_manager
+#include "sql_expression_cache.h" // subquery_cache_miss, subquery_cache_hit
#include <m_ctype.h>
#include <my_dir.h>
@@ -291,7 +292,6 @@ static TYPELIB tc_heuristic_recover_typelib=
tc_heuristic_recover_names, NULL
};
-const int server_maturity= MariaDB_PLUGIN_MATURITY_UNKNOWN;
const char *first_keyword= "first", *binary_keyword= "BINARY";
const char *my_localhost= "localhost", *delayed_user= "DELAYED";
@@ -358,8 +358,6 @@ static bool binlog_format_used= false;
LEX_STRING opt_init_connect, opt_init_slave;
static mysql_cond_t COND_thread_cache, COND_flush_thread_cache;
-static ulong opt_my_crc_dbug_check;
-
/* Global variables */
bool opt_bin_log, opt_ignore_builtin_innodb= 0;
@@ -923,7 +921,7 @@ my_bool opt_use_ssl = 0;
char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL,
*opt_ssl_cipher= NULL, *opt_ssl_key= NULL;
-scheduler_functions *thread_scheduler, *extra_thread_scheduler;
+scheduler_functions thread_scheduler, extra_thread_scheduler;
#ifdef HAVE_OPENSSL
#include <openssl/crypto.h>
@@ -979,9 +977,9 @@ pthread_handler_t handle_connections_shared_memory(void *arg);
pthread_handler_t handle_slave(void *arg);
static void clean_up(bool print_message);
static int test_if_case_insensitive(const char *dir_name);
-static void register_mutex_order();
#ifndef EMBEDDED_LIBRARY
+static void register_mutex_order();
static void usage(void);
static void start_signal_handler(void);
static void close_server_sock();
@@ -1115,7 +1113,7 @@ static void close_connections(void)
continue;
tmp->killed= THD::KILL_CONNECTION;
- thread_scheduler.post_kill_notification(tmp);
+ MYSQL_CALLBACK(&thread_scheduler, post_kill_notification, (tmp));
mysql_mutex_lock(&tmp->LOCK_thd_data);
if (tmp->mysys_var)
{
@@ -1126,25 +1124,6 @@ static void close_connections(void)
mysql_mutex_lock(tmp->mysys_var->current_mutex);
mysql_cond_broadcast(tmp->mysys_var->current_cond);
mysql_mutex_unlock(tmp->mysys_var->current_mutex);
-#error search for mysys_var->mutex / mysys_var->current_mutex lock order
-#error or/add safe_mutex_assert every time
-#if 0
-=======
- uint i;
- for (i=0; i < 2; i++)
- {
- int ret= pthread_mutex_trylock(tmp->mysys_var->current_mutex);
- pthread_cond_broadcast(tmp->mysys_var->current_cond);
- if (!ret)
- {
- /* Thread has surely got the signal, unlock and abort */
- pthread_mutex_unlock(tmp->mysys_var->current_mutex);
- break;
- }
- sleep(1);
- }
->>>>>>> MERGE-SOURCE
-#endif
}
mysql_mutex_unlock(&tmp->mysys_var->mutex);
}
@@ -1559,7 +1538,7 @@ void clean_up(bool print_message)
if (print_message && my_default_lc_messages && server_start_time)
sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname);
cleanup_errmsgs();
- thread_scheduler.end();
+ MYSQL_CALLBACK(&thread_scheduler, end, ());
mysql_library_end();
finish_client_errs();
(void) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST); // finish server errs
@@ -1654,7 +1633,6 @@ static void clean_up_mutexes()
mysql_cond_destroy(&COND_server_started);
DBUG_VOID_RETURN;
}
-#endif /*EMBEDDED_LIBRARY*/
/**
@@ -1666,8 +1644,8 @@ static void clean_up_mutexes()
#ifdef SAFE_MUTEX
#define always_in_that_order(A,B) \
- pthread_mutex_lock(A); pthread_mutex_lock(B); \
- pthread_mutex_unlock(B); pthread_mutex_unlock(A)
+ mysql_mutex_lock(A); mysql_mutex_lock(B); \
+ mysql_mutex_unlock(B); mysql_mutex_unlock(A)
#else
#define always_in_that_order(A,B)
#endif
@@ -1682,6 +1660,7 @@ static void register_mutex_order()
}
#undef always_in_that_order
+#endif /*EMBEDDED_LIBRARY*/
/****************************************************************************
** Init IP and UNIX socket
@@ -1862,14 +1841,18 @@ static my_socket activate_tcp_port(uint port)
struct addrinfo *ai, *a;
struct addrinfo hints;
int error;
- DBUG_PRINT("general",("IP Socket is %d",mysqld_port));
+ int arg;
+ char port_buf[NI_MAXSERV];
+ my_socket ip_sock;
+ DBUG_ENTER("activate_tcp_port");
+ DBUG_PRINT("general",("IP Socket is %d",port));
bzero(&hints, sizeof (hints));
hints.ai_flags= AI_PASSIVE;
hints.ai_socktype= SOCK_STREAM;
hints.ai_family= AF_UNSPEC;
- my_snprintf(port_buf, NI_MAXSERV, "%d", mysqld_port);
+ my_snprintf(port_buf, NI_MAXSERV, "%d", port);
error= getaddrinfo(my_bind_addr_str, port_buf, &hints, &ai);
if (error != 0)
{
@@ -1926,13 +1909,15 @@ static my_socket activate_tcp_port(uint port)
Retry at second: 1, 3, 7, 13, 22, 35, 52, 74, ...
Limit the sequence by mysqld_port_timeout (set --port-open-timeout=#).
*/
+ int ret;
+ uint waited, retry, this_wait;
for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
{
if (((ret= bind(ip_sock, a->ai_addr, a->ai_addrlen)) >= 0 ) ||
(socket_errno != SOCKET_EADDRINUSE) ||
(waited >= mysqld_port_timeout))
break;
- sql_print_information("Retrying bind on TCP/IP port %u", mysqld_port);
+ sql_print_information("Retrying bind on TCP/IP port %u", port);
this_wait= retry * retry / 3 + 1;
sleep(this_wait);
}
@@ -1941,7 +1926,7 @@ static my_socket activate_tcp_port(uint port)
{
DBUG_PRINT("error",("Got error: %d from bind",socket_errno));
sql_perror("Can't start server: Bind on TCP/IP port");
- sql_print_error("Do you already have another mysqld server running on port: %d ?",mysqld_port);
+ sql_print_error("Do you already have another mysqld server running on port: %d ?",port);
unireg_abort(1);
}
if (listen(ip_sock,(int) back_log) < 0)
@@ -1959,11 +1944,10 @@ static void network_init(void)
#ifdef HAVE_SYS_UN_H
struct sockaddr_un UNIXaddr;
#endif
- int arg=1;
- char port_buf[NI_MAXSERV];
+ int arg;
DBUG_ENTER("network_init");
- if (MYSQL_CALLBACK(thread_scheduler, init, ()))
+ if (MYSQL_CALLBACK_ELSE(&thread_scheduler, init, (), 0))
unireg_abort(1); /* purecov: inspected */
set_ports();
@@ -2047,10 +2031,11 @@ static void network_init(void)
UNIXaddr.sun_family = AF_UNIX;
strmov(UNIXaddr.sun_path, mysqld_unix_port);
(void) unlink(mysqld_unix_port);
+ arg= 1;
(void) setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
sizeof(arg));
umask(0);
- if (bind(unix_sock, my_reinterpret_cast(struct sockaddr *) (&UNIXaddr),
+ if (bind(unix_sock, reinterpret_cast<struct sockaddr *>(&UNIXaddr),
sizeof(UNIXaddr)) < 0)
{
sql_perror("Can't start server : Bind on unix socket"); /* purecov: tested */
@@ -2522,7 +2507,7 @@ and this may fail.\n\n");
(ulong) dflt_key_cache->key_cache_mem_size);
fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
fprintf(stderr, "max_used_connections=%lu\n", max_used_connections);
- fprintf(stderr, "max_threads=%u\n", thread_scheduler->max_threads +
+ fprintf(stderr, "max_threads=%u\n", thread_scheduler.max_threads +
(uint) extra_max_connections);
fprintf(stderr, "thread_count=%u\n", thread_count);
fprintf(stderr, "It is possible that mysqld could use up to \n\
@@ -2530,7 +2515,7 @@ key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = %lu K\n\
bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size +
(global_system_variables.read_buff_size +
global_system_variables.sortbuff_size) *
- (thread_scheduler->max_threads + extra_max_connections) +
+ (thread_scheduler.max_threads + extra_max_connections) +
(max_connections + extra_max_connections)* sizeof(THD)) / 1024);
fprintf(stderr, "Hope that's ok; if not, decrease some variables in the equation.\n\n");
@@ -2631,7 +2616,6 @@ bugs.\n");
}
#endif
-end:
#ifndef __WIN__
/* Terminate */
exit(1);
@@ -2781,7 +2765,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
This should actually be '+ max_number_of_slaves' instead of +10,
but the +10 should be quite safe.
*/
- init_thr_alarm(thread_scheduler->max_threads + extra_max_connections +
+ init_thr_alarm(thread_scheduler.max_threads + extra_max_connections +
global_system_variables.max_insert_delayed_threads + 10);
if (test_flags & TEST_SIGINT)
{
@@ -2938,23 +2922,7 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
DBUG_ASSERT(str != NULL);
- /*
- An error should have a valid error number (!= 0), so it can be caught
- in stored procedures by SQL exception handlers.
- Calling my_error() with error == 0 is a bug.
- Remaining known places to fix:
- - storage/myisam/mi_create.c, my_printf_error()
- TODO:
- DBUG_ASSERT(error != 0);
- */
-#warning FIXME
- if (error == 0)
- {
- /* At least, prevent new abuse ... */
- DBUG_ASSERT(strncmp(str, "MyISAM table", 12) == 0 ||
- strncmp(str, "Aria table", 11) == 0);
- error= ER_UNKNOWN_ERROR;
- }
+ DBUG_ASSERT(error != 0);
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_ERROR, error, str);
if (MyFlags & ME_JUST_INFO)
@@ -3312,7 +3280,7 @@ static int init_common_variables()
(except in the embedded server, where the default continues to
be MyISAM)
*/
-#ifdef EMBEDDED_LIBRARY
+#ifndef WITH_INNOBASE_STORAGE_ENGINE
default_storage_engine= const_cast<char *>("MyISAM");
#else
default_storage_engine= const_cast<char *>("InnoDB");
@@ -3686,11 +3654,13 @@ static int init_thread_environment()
&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_connection_count,
&LOCK_connection_count, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(&LOCK_global_user_client_stats,
- MY_MUTEX_INIT_FAST);
- mysql_mutex_init(&LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(&LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_LOCK_stats, &LOCK_stats, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_LOCK_global_user_client_stats,
+ &LOCK_global_user_client_stats, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_LOCK_global_table_stats,
+ &LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_LOCK_global_index_stats,
+ &LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
#ifdef HAVE_OPENSSL
mysql_mutex_init(key_LOCK_des_key_file,
@@ -3738,7 +3708,6 @@ static int init_thread_environment()
sql_print_error("Can't create thread-keys");
return 1;
}
- register_mutex_order();
return 0;
}
@@ -3919,6 +3888,8 @@ static int init_server_components()
}
}
+ /* set up the hook before initializing plugins which may use it */
+ error_handler_hook= my_message_sql;
proc_info_hook= set_thd_proc_info;
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
@@ -4030,7 +4001,7 @@ a file name for --log-bin-index option", opt_binlog_index_name);
}
/* call ha_init_key_cache() on all key caches to init them */
- process_key_caches(&ha_init_key_cache);
+ process_key_caches(&ha_init_key_cache, 0);
init_global_table_stats();
init_global_index_stats();
@@ -4168,7 +4139,7 @@ a file name for --log-bin-index option", opt_binlog_index_name);
global_system_variables.table_plugin= plugin;
mysql_mutex_unlock(&LOCK_global_system_variables);
}
-#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES)
+#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_ARIA_FOR_TMP_TABLES)
if (!ha_storage_engine_is_enabled(maria_hton) && !opt_bootstrap)
{
sql_print_error("Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables");
@@ -4714,6 +4685,8 @@ int mysqld_main(int argc, char **argv)
unireg_abort(1);
}
+ register_mutex_order();
+
create_shutdown_thread();
start_handle_manager();
@@ -5232,17 +5205,14 @@ void handle_connections_sockets()
socket_count++
#else
fd_set readFDs,clientFDs;
- uint max_used_connection;
+ uint max_used_connection= (uint)
+ max(max(base_ip_sock, unix_sock), extra_ip_sock) + 1;
#define setup_fds(X) FD_SET(X,&clientFDs)
FD_ZERO(&clientFDs);
#endif
DBUG_ENTER("handle_connections_sockets");
- max_used_connection= (uint) (max(base_ip_sock, unix_sock));
- max_used_connection= (uint) (max(extra_ip_sock, (int) max_used_connection));
- max_used_connection++;
-
if (base_ip_sock != INVALID_SOCKET)
{
setup_fds(base_ip_sock);
@@ -6733,8 +6703,8 @@ SHOW_VAR status_vars[]= {
Expression cache used only for caching subqueries now, so its statistic
variables we call subquery_cache*.
*/
- {"Subquery_cache_hit", (char*) &subquery_cache_hit, SHOW_LONG},
- {"Subquery_cache_miss", (char*) &subquery_cache_miss, SHOW_LONG},
+ {"Subquery_cache_hit", (char*) &subquery_cache_hit, SHOW_LONG},
+ {"Subquery_cache_miss", (char*) &subquery_cache_miss, SHOW_LONG},
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_LONG},
{"Table_locks_waited", (char*) &locks_waited, SHOW_LONG},
#ifdef HAVE_MMAP
@@ -6984,7 +6954,6 @@ static int mysql_init_variables(void)
/* Variables that depends on compile options */
#ifndef DBUG_OFF
-#warning test that --disable-debug --debug works
default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
"d:t:i:o,/tmp/mysqld.trace");
current_dbug_option= default_dbug_option;
@@ -7254,8 +7223,6 @@ mysqld_get_one_option(int optid,
WARN_DEPRECATED(NULL, 7, 0, "--log-slow-queries", "'--slow-query-log'/'--slow-query-log-file'");
opt_slow_log= 1;
break;
-#endif
- break;
case (int) OPT_SAFE:
opt_specialflag|= SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC;
delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
@@ -7322,10 +7289,6 @@ mysqld_get_one_option(int optid,
case OPT_LOWER_CASE_TABLE_NAMES:
lower_case_table_names_used= 1;
break;
- case OPT_TEST_IGNORE_WRONG_OPTIONS:
- /* Used for testing options */
- opt_ignore_wrong_options= 1;
- break;
#if defined(ENABLED_DEBUG_SYNC)
case OPT_DEBUG_SYNC_TIMEOUT:
/*
@@ -7542,8 +7505,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
/* Set global MyISAM variables from delay_key_write_options */
fix_delay_key_write(0, 0, OPT_GLOBAL);
- global_system_variables.log_slow_filter=
- fix_log_slow_filter(global_system_variables.log_slow_filter);
#ifndef EMBEDDED_LIBRARY
if (mysqld_chroot)
set_root(mysqld_chroot);
@@ -7578,17 +7539,17 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
return 1;
#ifdef EMBEDDED_LIBRARY
- one_thread_scheduler(thread_scheduler);
- one_thread_scheduler(extra_thread_scheduler);
+ one_thread_scheduler(&thread_scheduler);
+ one_thread_scheduler(&extra_thread_scheduler);
#else
if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION)
- one_thread_per_connection_scheduler(thread_scheduler, &max_connections,
+ one_thread_per_connection_scheduler(&thread_scheduler, &max_connections,
&connection_count);
else if (thread_handling == SCHEDULER_NO_THREADS)
- one_thread_scheduler(thread_scheduler);
+ one_thread_scheduler(&thread_scheduler);
else
- pool_of_threads_scheduler(thread_scheduler); /* purecov: tested */
- one_thread_per_connection_scheduler(extra_thread_scheduler,
+ pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */
+ one_thread_per_connection_scheduler(&extra_thread_scheduler,
&extra_max_connections,
&extra_connection_count);
#endif
@@ -7764,19 +7725,19 @@ static int fix_paths(void)
{
if (*opt_secure_file_priv == 0)
{
- /* For easy check later */
- my_free(opt_secure_file_priv, MYF(0));
+ my_free(opt_secure_file_priv);
opt_secure_file_priv= 0;
}
else
{
- char *secure_file_real_path;
+ if (strlen(opt_secure_file_priv) >= FN_REFLEN)
+ opt_secure_file_priv[FN_REFLEN-1]= '\0';
if (my_realpath(buff, opt_secure_file_priv, 0))
{
sql_print_warning("Failed to normalize the argument for --secure-file-priv.");
DBUG_RETURN(1);
}
- secure_file_real_path= (char *)my_malloc(FN_REFLEN, MYF(MY_FAE));
+ char *secure_file_real_path= (char *)my_malloc(FN_REFLEN, MYF(MY_FAE));
convert_dirname(secure_file_real_path, buff, NullS);
my_free(opt_secure_file_priv);
opt_secure_file_priv= secure_file_real_path;
@@ -7867,7 +7828,7 @@ void refresh_status(THD *thd)
reset_status_vars();
/* Reset the counters of all key caches (default and named). */
- process_key_caches(reset_key_cache_counters);
+ process_key_caches(reset_key_cache_counters, 0);
flush_status_time= time((time_t*) 0);
mysql_mutex_unlock(&LOCK_status);
@@ -7916,7 +7877,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
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_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,
@@ -7928,6 +7889,10 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count,
key_PARTITION_LOCK_auto_inc;
+PSI_mutex_key key_LOCK_stats,
+ key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
+ key_LOCK_global_index_stats;
+
static PSI_mutex_info all_server_mutexes[]=
{
#ifdef HAVE_MMAP
@@ -7962,6 +7927,10 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOCK_status, "LOCK_status", PSI_FLAG_GLOBAL},
{ &key_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL},
{ &key_LOCK_table_share, "LOCK_table_share", PSI_FLAG_GLOBAL},
+ { &key_LOCK_stats, "LOCK_stats", PSI_FLAG_GLOBAL},
+ { &key_LOCK_global_user_client_stats, "LOCK_global_user_client_stats", PSI_FLAG_GLOBAL},
+ { &key_LOCK_global_table_stats, "LOCK_global_table_stats", PSI_FLAG_GLOBAL},
+ { &key_LOCK_global_index_stats, "LOCK_global_index_stats", PSI_FLAG_GLOBAL},
{ &key_LOCK_thd_data, "THD::LOCK_thd_data", 0},
{ &key_LOCK_user_conn, "LOCK_user_conn", PSI_FLAG_GLOBAL},
{ &key_LOCK_uuid_generator, "LOCK_uuid_generator", PSI_FLAG_GLOBAL},
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 66acf086886..a4482b655ee 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -33,16 +33,6 @@ struct scheduler_functions;
typedef struct st_mysql_const_lex_string LEX_CSTRING;
typedef struct st_mysql_show_var SHOW_VAR;
-/*
- This forward declaration is used from C files where the real
- definition is included before. Since C does not allow repeated
- typedef declarations, even when identical, the definition may not be
- repeated.
-*/
-#ifndef CHARSET_INFO_DEFINED
-typedef struct charset_info_st CHARSET_INFO;
-#endif /* CHARSET_INFO_DEFINED */
-
#if MAX_INDEXES <= 64
typedef Bitmap<64> key_map; /* Used for finding keys */
#else
@@ -239,6 +229,10 @@ extern 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_LOCK_thread_count, key_PARTITION_LOCK_auto_inc;
+extern PSI_mutex_key key_LOCK_stats,
+ key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
+ key_LOCK_global_index_stats;
+
extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock;
@@ -342,6 +336,7 @@ extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
extern MYSQL_PLUGIN_IMPORT pthread_key(THD*, THR_THD);
+#ifdef MYSQL_SERVER
/**
only options that need special treatment in get_one_option() deserve
to be listed below
@@ -394,7 +389,7 @@ enum options_mysqld
OPT_ENGINE_CONDITION_PUSHDOWN,
OPT_LOG_ERROR
};
-
+#endif
/**
Query type constants.
@@ -509,20 +504,11 @@ inline THD *_current_thd(void)
*/
extern handlerton *maria_hton;
-extern HASH global_user_stats;
-extern HASH global_client_stats;
-extern HASH global_table_stats;
-extern HASH global_index_stats;
-
-extern mysql_mutex_t LOCK_global_user_client_stats;
-extern mysql_mutex_t LOCK_global_table_stats;
-extern mysql_mutex_t LOCK_global_index_stats;
-extern mysql_mutex_t LOCK_stats;
-
extern uint extra_connection_count;
-extern my_bool opt_userstat_running, debug_assert_if_crashed_table;
+extern my_bool opt_userstat_running;
extern uint mysqld_extra_port;
extern ulong extra_max_connections;
extern ulonglong denied_connections;
extern ulong thread_created;
+extern scheduler_functions thread_scheduler, extra_thread_scheduler;
#endif /* MYSQLD_INCLUDED */
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index a2f17075ea6..5f7f0b25fc1 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -85,19 +85,14 @@ void sql_print_error(const char *format,...);
*/
extern uint test_flags;
extern ulong bytes_sent, bytes_received, net_big_packet_count;
-#ifndef MYSQL_INSTANCE_MANAGER
#ifdef HAVE_QUERY_CACHE
#define USE_QUERY_CACHE
extern void query_cache_insert(const char *packet, ulong length,
unsigned pkt_nr);
#endif // HAVE_QUERY_CACHE
#define update_statistics(A) A
-#endif /* MYSQL_INSTANCE_MANGER */
-#endif /* defined(MYSQL_SERVER) && !defined(MYSQL_INSTANCE_MANAGER) */
-
-#if !defined(MYSQL_SERVER) || defined(MYSQL_INSTANCE_MANAGER)
+#else
#define update_statistics(A)
-#define thd_increment_bytes_sent(N)
#endif
#define TEST_BLOCKING 8
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc
index 277343b81a5..572f314162a 100644
--- a/sql/opt_index_cond_pushdown.cc
+++ b/sql/opt_index_cond_pushdown.cc
@@ -1,5 +1,5 @@
-#include "mysql_priv.h"
#include "sql_select.h"
+#include "sql_test.h"
/****************************************************************************
* Index Condition Pushdown code starts
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 829d97373a1..ed39c632735 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1183,7 +1183,7 @@ QUICK_SELECT_I::QUICK_SELECT_I()
QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
bool no_alloc, MEM_ROOT *parent_alloc,
bool *create_error)
- :doing_key_read(0),/*error(0),*/free_file(0),/*in_range(0),*/cur_range(NULL),last_range(0),dont_free(0)
+ :doing_key_read(0),free_file(0),cur_range(NULL),last_range(0),dont_free(0)
{
my_bitmap_map *bitmap;
DBUG_ENTER("QUICK_RANGE_SELECT::QUICK_RANGE_SELECT");
@@ -8090,11 +8090,6 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
(table->key_read ? HA_MRR_INDEX_ONLY : 0);
if (thd->lex->sql_command != SQLCOM_SELECT)
quick->mrr_flags |= HA_MRR_USE_DEFAULT_IMPL;
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- if (!ref->null_ref_key && !key_has_nulls(key_info, range->min_key,
- ref->key_length))
- quick->mrr_flags |= HA_MRR_NO_NULL_ENDPOINTS;
-#endif
quick->mrr_buf_size= thd->variables.mrr_buff_size;
if (table->file->multi_range_read_info(quick->index, 1, (uint)records,
@@ -8815,7 +8810,7 @@ int QUICK_SELECT_DESC::get_next()
QUICK_SELECT_I *QUICK_RANGE_SELECT::make_reverse(uint used_key_parts_arg)
{
QUICK_SELECT_DESC *new_quick= new QUICK_SELECT_DESC(this, used_key_parts_arg);
- if (new_quick == NULL || new_quick->error != 0)
+ if (new_quick == NULL)
{
delete new_quick;
return NULL;
@@ -10869,14 +10864,14 @@ static int index_next_different (bool is_index_scan, handler *file,
while (!key_cmp (key_part, group_prefix, group_prefix_len))
{
- result= file->index_next(record);
+ result= file->ha_index_next(record);
if (result)
return(result);
}
return result;
}
else
- return file->index_read_map(record, group_prefix,
+ return file->ha_index_read_map(record, group_prefix,
make_prev_keypart_map(group_key_parts),
HA_READ_AFTER_KEY);
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 34335c7baf3..585f655aeac 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -832,8 +832,7 @@ public:
class QUICK_SELECT_DESC: public QUICK_RANGE_SELECT
{
public:
- QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts,
- bool *create_err);
+ QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts);
int get_next();
bool reverse_sorted() { return 1; }
int get_type() { return QS_TYPE_RANGE_DESC; }
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc
index 9eeec653355..acf22bd7a49 100644
--- a/sql/opt_range_mrr.cc
+++ b/sql/opt_range_mrr.cc
@@ -188,12 +188,12 @@ walk_right_n_up:
cur->min_key_parts +=
key_tree->next_key_part->store_min_key(seq->param->key[seq->keyno],
&cur->min_key,
- &cur->min_key_flag);
+ &cur->min_key_flag, MAX_KEY);
if (!key_tree->max_flag)
cur->max_key_parts +=
key_tree->next_key_part->store_max_key(seq->param->key[seq->keyno],
&cur->max_key,
- &cur->max_key_flag);
+ &cur->max_key_flag, MAX_KEY);
break;
}
}
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index a58313ec9fd..a4e626e90cd 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -10,10 +10,9 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "mysql_priv.h"
#include "sql_select.h"
#include "opt_subselect.h"
-
+#include "sql_test.h"
#include <my_bit.h>
// Our own:
@@ -2240,7 +2239,7 @@ bool setup_sj_materialization(JOIN_TAB *tab)
sjm->sjm_table_cols, (ORDER*) 0,
TRUE /* distinct */,
1, /*save_sum_fields*/
- thd->options | TMP_TABLE_ALL_COLUMNS,
+ thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS,
HA_POS_ERROR /*rows_limit */,
(char*)"sj-materialize")))
DBUG_RETURN(TRUE); /* purecov: inspected */
@@ -2800,7 +2799,7 @@ TABLE *create_duplicate_weedout_tmp_table(THD *thd,
if (share->db_type() == TMP_ENGINE_HTON)
{
recinfo++;
- if (create_internal_tmp_table(table, keyinfo, start_recinfo, &recinfo, 0))
+ if (create_internal_tmp_table(table, keyinfo, start_recinfo, &recinfo, 0, 0))
goto err;
}
sjtbl->start_recinfo= start_recinfo;
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index d0206b0fd05..532e43567e8 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -164,8 +164,8 @@ public:
*/
if (try_loosescan && // (1)
- (handled_sj_equalities | bound_sj_equalities) == // (2)
- PREV_BITS(ulonglong, s->emb_sj_nest->sj_in_exprs) && // (2)
+ (handled_sj_equalities | bound_sj_equalities) == // (2)
+ PREV_BITS(ulonglong, s->emb_sj_nest->sj_in_exprs) && // (2)
(PREV_BITS(key_part_map, max_loose_keypart+1) & // (3)
(found_part | loose_scan_keyparts)) == // (3)
(found_part | loose_scan_keyparts) && // (3)
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index 1e4e87ebac7..33eeec46217 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -12,7 +12,6 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "mysql_priv.h"
#include "my_bit.h"
#include "sql_select.h"
diff --git a/sql/procedure.h b/sql/procedure.h
index 5e62f4dd5cc..b0b5583dcb6 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -16,9 +16,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef PROCEDURE_INCLUDED
-#define PROCEDURE_INCLUDED
-
/* When using sql procedures */
#ifdef USE_PRAGMA_INTERFACE
diff --git a/sql/records.cc b/sql/records.cc
index a7af42fc86a..ed1edcaf487 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -30,7 +30,7 @@
#include "filesort.h" // filesort_free_buffers
#include "opt_range.h" // SQL_SELECT
#include "sql_class.h" // THD
-
+#include "sql_base.h"
static int rr_quick(READ_RECORD *info);
int rr_sequential(READ_RECORD *info);
@@ -387,7 +387,7 @@ static int rr_index_first(READ_RECORD *info)
static int rr_index_last(READ_RECORD *info)
{
- int tmp= info->file->index_last(info->record);
+ int tmp= info->file->ha_index_last(info->record);
info->read_record= rr_index_desc;
if (tmp)
tmp= rr_handle_error(info, tmp);
@@ -438,7 +438,7 @@ static int rr_index(READ_RECORD *info)
static int rr_index_desc(READ_RECORD *info)
{
- int tmp= info->file->index_prev(info->record);
+ int tmp= info->file->ha_index_prev(info->record);
if (tmp)
tmp= rr_handle_error(info, tmp);
return tmp;
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index 6dfaa1bf253..1f0b752c8c8 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -14,7 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED by other includes
+//#include "unireg.h" // REQUIRED by other includes
#include "rpl_filter.h"
#include "hash.h" // my_hash_free
#include "table.h" // TABLE_LIST
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 5f16544d855..9e59c4fe5fd 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -43,7 +43,7 @@ static pthread_key(Trans_binlog_info*, RPL_TRANS_BINLOG_INFO);
int get_user_var_int(const char *name,
long long int *value, int *null_value)
{
- my_bool null_val;
+ bool null_val;
user_var_entry *entry=
(user_var_entry*) my_hash_search(&current_thd->user_vars,
(uchar*) name, strlen(name));
@@ -58,7 +58,7 @@ int get_user_var_int(const char *name,
int get_user_var_real(const char *name,
double *value, int *null_value)
{
- my_bool null_val;
+ bool null_val;
user_var_entry *entry=
(user_var_entry*) my_hash_search(&current_thd->user_vars,
(uchar*) name, strlen(name));
@@ -74,7 +74,7 @@ int get_user_var_str(const char *name, char *value,
size_t len, unsigned int precision, int *null_value)
{
String str;
- my_bool null_val;
+ bool null_val;
user_var_entry *entry=
(user_var_entry*) my_hash_search(&current_thd->user_vars,
(uchar*) name, strlen(name));
@@ -175,7 +175,7 @@ void delegates_destroy()
for (; info; info= iter++) \
{ \
plugin_ref plugin= \
- my_plugin_lock(0, &info->plugin); \
+ my_plugin_lock(0, info->plugin); \
if (!plugin) \
{ \
/* plugin is not intialized or deleted, this is not an error */ \
@@ -336,7 +336,7 @@ int Binlog_transmit_delegate::reserve_header(THD *thd, ushort flags,
for (; info; info= iter++)
{
plugin_ref plugin=
- my_plugin_lock(thd, &info->plugin);
+ my_plugin_lock(thd, info->plugin);
if (!plugin)
{
ret= 1;
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 646593ed98f..776bb95c4e5 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -24,13 +24,6 @@
#define DEFAULT_CONNECT_RETRY 60
-// Defined in slave.cc
-int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
-int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
- const char *default_val);
-int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
-int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);
-
Master_info::Master_info(bool is_slave_recovery)
:Slave_reporting_capability("I/O"),
ssl(0), ssl_verify_server_cert(0), fd(-1), io_thd(0),
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index 4a5a99bf40e..a9146682da6 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -40,40 +40,6 @@ static bool no_threads_end(THD *thd, bool put_in_cache)
return 1; // Abort handle_one_connection
}
-static scheduler_functions one_thread_scheduler_functions=
-{
- 1, // max_threads
- NULL, NULL,
- NULL, // init
- init_new_connection_handler_thread, // init_new_connection_thread
-#ifndef EMBEDDED_LIBRARY
- handle_connection_in_main_thread, // add_connection
-#else
- NULL, // add_connection
-#endif // EMBEDDED_LIBRARY
- NULL, // thd_wait_begin
- NULL, // thd_wait_end
- NULL, // post_kill_notification
- no_threads_end, // end_thread
- NULL, // end
-};
-
-#ifndef EMBEDDED_LIBRARY
-static scheduler_functions one_thread_per_connection_scheduler_functions=
-{
- 0, // max_threads
- NULL, NULL,
- NULL, // init
- init_new_connection_handler_thread, // init_new_connection_thread
- create_thread_to_handle_connection, // add_connection
- NULL, // thd_wait_begin
- NULL, // thd_wait_end
- NULL, // post_kill_notification
- one_thread_per_connection_end, // end_thread
- NULL, // end
-};
-#endif // EMBEDDED_LIBRARY
-
/** @internal
Helper functions to allow mysys to call the thread scheduler when
waiting for locks.
@@ -102,8 +68,7 @@ static void scheduler_wait_end(void) {
mysqld.cc, so this init function will always be called.
*/
static void scheduler_init() {
- mysys_var->scheduler_before_lock_wait= &scheduler_wait_begin;
- mysys_var->scheduler_after_lock_wait= &scheduler_wait_end;
+ thr_set_lock_wait_callback(scheduler_wait_begin, scheduler_wait_end);
}
/*
@@ -111,15 +76,17 @@ static void scheduler_init() {
*/
#ifndef EMBEDDED_LIBRARY
-scheduler_functions *one_thread_per_connection_scheduler(
+void one_thread_per_connection_scheduler(scheduler_functions *func,
ulong *arg_max_connections,
uint *arg_connection_count)
{
scheduler_init();
- one_thread_per_connection_scheduler_functions.max_threads= *arg_max_connections + 1;
- one_thread_per_connection_scheduler_functions.max_connections= arg_max_connections;
- one_thread_per_connection_scheduler_functions.connection_count= arg_connection_count;
- return &one_thread_per_connection_scheduler_functions;
+ func->max_threads= *arg_max_connections + 1;
+ func->max_connections= arg_max_connections;
+ func->connection_count= arg_connection_count;
+ func->init_new_connection_thread= init_new_connection_handler_thread;
+ func->add_connection= create_thread_to_handle_connection;
+ func->end_thread= one_thread_per_connection_end;
}
#endif
@@ -127,16 +94,22 @@ scheduler_functions *one_thread_per_connection_scheduler(
Initailize scheduler for --thread-handling=no-threads
*/
-scheduler_functions *one_thread_scheduler()
+void one_thread_scheduler(scheduler_functions *func)
{
scheduler_init();
- return &one_thread_scheduler_functions;
+ func->max_threads= 1;
+ //max_connections= 1;
+ func->max_connections= &max_connections;
+ func->connection_count= &connection_count;
+#ifndef EMBEDDED_LIBRARY
+ func->init_new_connection_thread= init_new_connection_handler_thread;
+ func->add_connection= handle_connection_in_main_thread;
+#endif
+ func->end_thread= no_threads_end;
}
-/*
- Initialize scheduler for --thread-handling=one-thread-per-connection
-*/
+#ifdef HAVE_POOL_OF_THREADS
/*
thd_scheduler keeps the link between THD and events.
@@ -144,7 +117,7 @@ scheduler_functions *one_thread_scheduler()
*/
thd_scheduler::thd_scheduler()
- : m_psi(NULL), data(NULL)
+ : m_psi(NULL), logged_in(FALSE), io_event(NULL), thread_attached(FALSE)
{
#ifndef DBUG_OFF
dbug_explain[0]= '\0';
@@ -155,8 +128,11 @@ thd_scheduler::thd_scheduler()
thd_scheduler::~thd_scheduler()
{
+ my_free(io_event);
}
+#endif
+
/*
no pluggable schedulers in mariadb.
when we'll want it, we'll do it properly
@@ -204,5 +180,3 @@ extern "C" int my_thread_scheduler_reset()
{ return 1; }
#endif
-#warning restore libevent
-
diff --git a/sql/scheduler.h b/sql/scheduler.h
index 32ba3e63953..cb7568b566a 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -63,17 +63,21 @@ enum scheduler_types
SCHEDULER_TYPES_COUNT
};
-scheduler_functions *one_thread_per_connection_scheduler(ulong *, uint *);
-scheduler_functions *one_thread_scheduler();
+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
};
-/*
- To be used for pool-of-threads (implemeneted differently on various OSs)
-*/
+#if defined(HAVE_LIBEVENT) && !defined(EMBEDDED_LIBRARY)
+
+#define HAVE_POOL_OF_THREADS 1
+
+struct event;
+
class thd_scheduler
{
public:
@@ -89,7 +93,10 @@ public:
*/
PSI_thread *m_psi;
- void *data; /* scheduler-specific data structure */
+ bool logged_in;
+ struct event* io_event;
+ LIST list;
+ bool thread_attached; /* Indicates if THD is attached to the OS thread */
# ifndef DBUG_OFF
char dbug_explain[512];
@@ -98,6 +105,21 @@ public:
thd_scheduler();
~thd_scheduler();
+ bool init(THD* parent_thd);
+ bool thread_attach();
+ void thread_detach();
};
+void pool_of_threads_scheduler(scheduler_functions* func);
+#else
+
+#define pool_of_threads_scheduler(A) \
+ one_thread_per_connection_scheduler(A, &max_connections, \
+ &connection_count)
+
+class thd_scheduler
+{};
+
+#endif
+
#endif
diff --git a/sql/set_var.h b/sql/set_var.h
index 2972b430e48..17792a689d2 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -209,7 +209,7 @@ public:
plugin_ref plugin; ///< for Sys_var_plugin
Time_zone *time_zone; ///< for Sys_var_tz
LEX_STRING string_value; ///< for Sys_var_charptr and others
- void *ptr; ///< for Sys_var_struct
+ const void *ptr; ///< for Sys_var_struct
} save_result;
LEX_STRING base; /**< for structured variables, like keycache_name.variable_name */
diff --git a/sql/slave.h b/sql/slave.h
index 02095fad6b1..737e23c6cdc 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -48,6 +48,11 @@
class Relay_log_info;
class Master_info;
+int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
+int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
+ const char *default_val);
+int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
+int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);
/*****************************************************************************
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 662570d8d8b..eaac4459e99 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -123,7 +123,7 @@ void sp_cache_clear(sp_cache **cp)
void sp_cache_end()
{
- pthread_mutex_destroy(&Cversion_lock);
+ mysql_mutex_destroy(&Cversion_lock);
}
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 4dda2d7263a..41163ee629e 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -44,6 +44,9 @@
#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>
@@ -4608,14 +4611,14 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name,
ulong get_table_grant(THD *thd, TABLE_LIST *table)
{
ulong privilege;
+ Security_context *sctx= thd->security_ctx;
+ const char *db = table->db ? table->db : thd->db;
GRANT_TABLE *grant_table;
- rw_rdlock(&LOCK_grant);
+ mysql_rwlock_rdlock(&LOCK_grant);
#ifdef EMBEDDED_LIBRARY
grant_table= NULL;
#else
- Security_context *sctx= thd->security_ctx;
- const char *db = table->db ? table->db : thd->db;
grant_table= table_hash_search(sctx->host, sctx->ip, db, sctx->priv_user,
table->table_name, 0);
#endif
@@ -7486,7 +7489,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
{
DBUG_ASSERT(mpvio->acl_user == 0);
- pthread_mutex_lock(&acl_cache->lock);
+ mysql_mutex_lock(&acl_cache->lock);
for (uint i=0 ; i < acl_users.elements ; i++)
{
ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
@@ -7497,7 +7500,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
break;
}
}
- pthread_mutex_unlock(&acl_cache->lock);
+ mysql_mutex_unlock(&acl_cache->lock);
if (!mpvio->acl_user)
{
@@ -8366,10 +8369,10 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
if (command == COM_CONNECT &&
!(thd->main_security_ctx.master_access & SUPER_ACL))
{
- pthread_mutex_lock(&LOCK_connection_count);
+ mysql_mutex_lock(&LOCK_connection_count);
bool count_ok= (*thd->scheduler->connection_count <=
*thd->scheduler->max_connections);
- VOID(pthread_mutex_unlock(&LOCK_connection_count));
+ mysql_mutex_unlock(&LOCK_connection_count);
if (!count_ok)
{ // too many connections
my_error(ER_CON_COUNT_ERROR, MYF(0));
@@ -8403,7 +8406,7 @@ 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 (res == CR_OK_HANDSHAKE_COMPLETE)
- thd->main_da.disable_status();
+ thd->stmt_da->disable_status();
else
my_ok(thd);
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index d21341fac08..874e91c4040 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -40,8 +40,9 @@ static bool admin_recreate_table(THD *thd, TABLE_LIST *table_list)
trans_rollback(thd);
close_thread_tables(thd);
thd->mdl_context.release_transactional_locks();
+ DEBUG_SYNC(thd, "ha_admin_try_alter");
tmp_disable_binlog(thd); // binlogging is done by caller if wanted
- result_code= mysql_recreate_table(thd, table);
+ result_code= mysql_recreate_table(thd, table_list);
reenable_binlog(thd);
/*
mysql_recreate_table() can push OK or ERROR.
@@ -51,7 +52,7 @@ static bool admin_recreate_table(THD *thd, TABLE_LIST *table_list)
*/
if (thd->stmt_da->is_ok())
thd->stmt_da->reset_diagnostics_area();
- table->table= NULL;
+ table_list->table= NULL;
result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
DBUG_RETURN(result_code);
}
@@ -665,14 +666,13 @@ send_result_message:
reopen the table and do ha_innobase::analyze() on it.
We have to end the row, so analyze could return more rows.
*/
- if (protocol->write())
- goto err;
- DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze..."));
- DEBUG_SYNC(thd, "ha_admin_try_alter");
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(STRING_WITH_LEN(
"Table does not support optimize, doing recreate + analyze instead"),
system_charset_info);
+ if (protocol->write())
+ goto err;
+ DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze..."));
TABLE_LIST *save_next_local= table->next_local,
*save_next_global= table->next_global;
table->next_local= table->next_global= 0;
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index b7d363dc09a..3f5c96ef9ff 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -130,7 +130,7 @@ static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
}
/* lock the plugin and add it to the list */
- plugin= my_plugin_lock(NULL, &plugin);
+ plugin= my_plugin_lock(NULL, plugin);
insert_dynamic(&thd->audit_class_plugins, (uchar*) &plugin);
return 0;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index af81246253b..7116d046a8c 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -38,6 +38,7 @@
// mysql_handle_derived,
// mysql_derived_filling
#include "sql_handler.h" // mysql_ha_flush
+#include "sql_test.h"
#include "sql_partition.h" // ALTER_PARTITION_PARAM_TYPE
#include "log_event.h" // Query_log_event
#include "sql_select.h"
@@ -1360,8 +1361,10 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share,
mysql_lock_remove(thd, thd->lock, table);
/* Inform handler that table will be dropped after close */
- if (table->db_stat) /* Not true for partitioned tables. */
+#ifdef MERGE_FOR_MONTY_TO_FIX
+ if (remove_from_locked_tables && table->db_stat) /* Not true for partitioned tables. */
table->file->extra(HA_EXTRA_PREPARE_FOR_DROP);
+#endif
close_thread_table(thd, prev);
}
else
@@ -1404,6 +1407,11 @@ void close_thread_tables(THD *thd)
TABLE *table;
DBUG_ENTER("close_thread_tables");
+#ifdef WITH_ARIA_STORAGE_ENGINE
+ if (!thd->in_sub_stmt)
+ ha_maria::implicit_commit(thd, FALSE);
+#endif
+
#ifdef EXTRA_DEBUG
DBUG_PRINT("tcache", ("open tables:"));
for (table= thd->open_tables; table; table= table->next)
@@ -8786,7 +8794,6 @@ my_bool mysql_rm_tmp_tables(void)
}
-
/*****************************************************************************
unireg support functions
*****************************************************************************/
@@ -8806,8 +8813,6 @@ void tdc_flush_unused_tables()
free_cache_entry(unused_tables);
mysql_mutex_unlock(&LOCK_open);
}
-#error restore table->s->deleting
-#error restore changes from monty@askmonty.org-20101102152257-mwa7etvs9nxewjf2
/**
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h
index cd3442d306c..0449611e27a 100644
--- a/sql/sql_bitmap.h
+++ b/sql/sql_bitmap.h
@@ -157,7 +157,7 @@ public:
bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); }
bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; }
bool operator==(const Bitmap<64>& map2) const { return map == map2.map; }
- char *print(char *buf) const { longlong2str(map,buf,16,1); return buf; }
+ char *print(char *buf) const { longlong2str(map,buf,16); return buf; }
ulonglong to_ulonglong() const { return map; }
class Iterator : public Table_map_iterator
{
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index a536c5b35b4..30dd835e9eb 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -341,6 +341,7 @@ TODO list:
#include "../storage/myisammrg/ha_myisammrg.h"
#include "../storage/myisammrg/myrg_def.h"
#include "probes_mysql.h"
+#include "log_slow.h"
#ifdef EMBEDDED_LIBRARY
#include "emb_qcache.h"
@@ -945,7 +946,6 @@ Query_cache::abort(Query_cache_tls *query_cache_tls)
if (try_lock())
DBUG_VOID_RETURN;
- }
/*
While we were waiting another thread might have changed the status
@@ -997,7 +997,6 @@ void Query_cache::end_of_result(THD *thd)
if (try_lock())
DBUG_VOID_RETURN;
- }
query_block= query_cache_tls->first_query_block;
if (query_block)
diff --git a/sql/sql_callback.h b/sql/sql_callback.h
index 834d8b74c7a..ea51c107ff9 100644
--- a/sql/sql_callback.h
+++ b/sql/sql_callback.h
@@ -31,10 +31,12 @@
*/
#define MYSQL_CALLBACK(OBJ, FUNC, PARAMS) \
- (((OBJ) && ((OBJ)->FUNC)) ? (OBJ)->FUNC PARAMS : 0)
+ do { \
+ if ((OBJ) && ((OBJ)->FUNC)) \
+ (OBJ)->FUNC PARAMS; \
+ } while (0)
-#define MYSQL_CALLBACK_ELSE0(OBJ, FUNC, PARAMS, ELSE) \
+#define MYSQL_CALLBACK_ELSE(OBJ, FUNC, PARAMS, ELSE) \
(((OBJ) && ((OBJ)->FUNC)) ? (OBJ)->FUNC PARAMS : (ELSE))
-
#endif /* SQL_CALLBACK_INCLUDED */
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 2fcb6120076..7638cf8f8f6 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -59,6 +59,7 @@
#include "debug_sync.h"
#include "sql_parse.h" // is_update_query
#include "sql_callback.h"
+#include "sql_connect.h"
/*
The following is used to initialise Table_ident with a internal
@@ -236,7 +237,7 @@ bool Foreign_key::validate(List<Create_field> &table_fields)
it.rewind();
while ((sql_field= it++) &&
my_strcasecmp(system_charset_info,
- column->field_name,
+ column->field_name.str,
sql_field->field_name)) {}
if (!sql_field)
{
@@ -316,11 +317,13 @@ int thd_tablespace_op(const THD *thd)
extern "C"
-const char *set_thd_proc_info(THD *thd, const char *info,
+const char *set_thd_proc_info(void *thd_arg, const char *info,
const char *calling_function,
const char *calling_file,
const unsigned int calling_line)
{
+ THD *thd= (THD *) thd_arg;
+
if (!thd)
thd= current_thd;
@@ -1322,7 +1325,7 @@ void THD::awake(THD::killed_state state_to_set)
{
thr_alarm_kill(thread_id);
if (!slave_thread)
- MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (this));
+ MYSQL_CALLBACK(scheduler, post_kill_notification, (this));
#ifdef SIGNAL_WITH_VIO_CLOSE
if (this != current_thd)
{
@@ -1416,7 +1419,6 @@ bool THD::store_globals()
*/
thr_lock_info_init(&lock_info);
-#warning add registration of mutex order if needed
return 0;
}
@@ -1429,9 +1431,9 @@ bool THD::store_globals()
void THD::reset_globals()
{
- pthread_mutex_lock(&LOCK_thd_data);
+ mysql_mutex_lock(&LOCK_thd_data);
mysys_var= 0;
- pthread_mutex_unlock(&LOCK_thd_data);
+ mysql_mutex_unlock(&LOCK_thd_data);
}
/*
@@ -2558,7 +2560,6 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
op= &select_max_min_finder_subselect::cmp_decimal;
break;
case ROW_RESULT:
- case IMPOSSIBLE_RESULT:
// This case should never be choosen
DBUG_ASSERT(0);
op= 0;
@@ -3421,7 +3422,7 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd)
return sqlcom_can_generate_row_events(thd);
}
-#ifndef EMBEDDED_LIBRARY
+#ifdef NOT_USED /* we'll do the correctly instead */
extern "C" void thd_pool_wait_begin(MYSQL_THD thd, int wait_type);
extern "C" void thd_pool_wait_end(MYSQL_THD thd);
@@ -3448,7 +3449,7 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd);
*/
extern "C" void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
{
- MYSQL_CALLBACK(thread_scheduler, thd_wait_begin, (thd, wait_type));
+ MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
}
/**
@@ -3459,7 +3460,7 @@ extern "C" void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
*/
extern "C" void thd_wait_end(MYSQL_THD thd)
{
- MYSQL_CALLBACK(thread_scheduler, thd_wait_end, (thd));
+ MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
}
#else
extern "C" void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 4dc8abc64d5..05082a8e8fe 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -43,123 +43,6 @@
class Reprepare_observer;
-
-
-/**
- Interface for Item iterator
-*/
-
-class Item_iterator
-{
-public:
- /**
- Shall set this iterator to the position before the first item
-
- @note
- This method also may perform some other initialization actions like
- allocation of certain resources.
- */
- virtual void open()= 0;
- /**
- Shall return the next Item (or NULL if there is no next item) and
- move pointer to position after it.
- */
- virtual Item *next()= 0;
- /**
- Shall force iterator to free resources (if it holds them)
-
- @note
- One should not use the iterator without open() call after close()
- */
- virtual void close()= 0;
-
- virtual ~Item_iterator() {}
-};
-
-
-/**
- Item iterator over List_iterator_fast for Item references
-*/
-
-class Item_iterator_ref_list: public Item_iterator
-{
- List_iterator<Item*> list;
-public:
- Item_iterator_ref_list(List_iterator<Item*> &arg_list):
- list(arg_list) {}
- void open() { list.rewind(); }
- Item *next() { return *(list++); }
- void close() {}
-};
-
-
-/**
- Item iterator over Item interface for rows
-*/
-
-class Item_iterator_row: public Item_iterator
-{
- Item *base_item;
- uint current;
-public:
- Item_iterator_row(Item *base) : base_item(base), current(0) {}
- void open() { current= 0; }
- Item *next()
- {
- if (current >= base_item->cols())
- return NULL;
- return base_item->element_index(current++);
- }
- void close() {}
-};
-
-
-/**
- An interface that is used to take an action when
- the locking module notices that a table version has changed
- since the last execution. "Table" here may refer to any kind of
- table -- a base table, a temporary table, a view or an
- information schema table.
-
- When we open and lock tables for execution of a prepared
- statement, we must verify that they did not change
- since statement prepare. If some table did change, the statement
- parse tree *may* be no longer valid, e.g. in case it contains
- optimizations that depend on table metadata.
-
- This class provides an interface (a method) that is
- invoked when such a situation takes place.
- The implementation of the method simply reports an error, but
- the exact details depend on the nature of the SQL statement.
-
- At most 1 instance of this class is active at a time, in which
- case THD::m_reprepare_observer is not NULL.
-
- @sa check_and_update_table_version() for details of the
- version tracking algorithm
-
- @sa Open_tables_state::m_reprepare_observer for the life cycle
- of metadata observers.
-*/
-
-class Reprepare_observer
-{
-public:
- /**
- Check if a change of metadata is OK. In future
- the signature of this method may be extended to accept the old
- and the new versions, but since currently the check is very
- simple, we only need the THD to report an error.
- */
- bool report_error(THD *thd);
- bool is_invalidated() const { return m_invalidated; }
- void reset_reprepare_observer() { m_invalidated= FALSE; }
- Reprepare_observer() {} /* Remove gcc warning */
-private:
- bool m_invalidated;
-};
-
-
class Relay_log_info;
class Query_log_event;
@@ -353,9 +236,10 @@ public:
{}
Key(enum Keytype type_par, const char *name_arg, size_t name_len_arg,
KEY_CREATE_INFO *key_info_arg, bool generated_arg,
- List<Key_part_spec> &cols)
+ List<Key_part_spec> &cols,
+ engine_option_value *create_opt)
:type(type_par), key_create_info(*key_info_arg), columns(cols),
- generated(generated_arg)
+ option_list(create_opt), generated(generated_arg)
{
name.str= (char *)name_arg;
name.length= name_len_arg;
@@ -3230,12 +3114,15 @@ public:
int prepare2(void) { return 0; }
};
+#include <myisam.h>
-#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES)
+#ifdef WITH_ARIA_STORAGE_ENGINE
#include <maria.h>
+#endif
+
+#ifdef USE_ARIA_FOR_TMP_TABLES
#define ENGINE_COLUMNDEF MARIA_COLUMNDEF
#else
-#include <myisam.h>
#define ENGINE_COLUMNDEF MI_COLUMNDEF
#endif
@@ -4064,17 +3951,18 @@ inline int handler::ha_read_first_row(uchar *buf, uint primary_key)
#endif /* MYSQL_SERVER */
+#if 0
/**
The meat of thd_proc_info(THD*, char*), a macro that packs the last
three calling-info parameters.
*/
extern "C"
-const char *set_thd_proc_info(THD *thd, const char *info,
+const char *set_thd_proc_info(void *thd_arg, const char *info,
const char *calling_func,
const char *calling_file,
const unsigned int calling_line);
#define thd_proc_info(thd, msg) \
set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
-
+#endif
#endif /* SQL_CLASS_INCLUDED */
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 800ff7d7585..0fe43fb5ebb 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -25,7 +25,6 @@
#endif
#include "sql_audit.h"
#include "sql_connect.h"
-#include "my_global.h"
#include "probes_mysql.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" // sql_command_flags,
@@ -396,7 +395,7 @@ extern "C" uchar *get_key_user_stats(USER_STATS *user_stats, size_t *length,
void free_user_stats(USER_STATS* user_stats)
{
- my_free(user_stats, MYF(0));
+ my_free(user_stats);
}
void init_user_stats(USER_STATS *user_stats,
@@ -459,7 +458,7 @@ void init_user_stats(USER_STATS *user_stats,
}
-#ifdef COMPLEAT_PATCH_NOT_ADDED_YET
+#ifdef COMPLETE_PATCH_NOT_ADDED_YET
void add_user_stats(USER_STATS *user_stats,
uint total_connections,
@@ -513,9 +512,9 @@ void add_user_stats(USER_STATS *user_stats,
void init_global_user_stats(void)
{
- if (hash_init(&global_user_stats, system_charset_info, max_connections,
- 0, 0, (hash_get_key) get_key_user_stats,
- (hash_free_key)free_user_stats, 0))
+ if (my_hash_init(&global_user_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_user_stats,
+ (my_hash_free_key)free_user_stats, 0))
{
sql_print_error("Initializing global_user_stats failed.");
exit(1);
@@ -524,9 +523,9 @@ void init_global_user_stats(void)
void init_global_client_stats(void)
{
- if (hash_init(&global_client_stats, system_charset_info, max_connections,
- 0, 0, (hash_get_key) get_key_user_stats,
- (hash_free_key)free_user_stats, 0))
+ if (my_hash_init(&global_client_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_user_stats,
+ (my_hash_free_key)free_user_stats, 0))
{
sql_print_error("Initializing global_client_stats failed.");
exit(1);
@@ -542,14 +541,14 @@ extern "C" uchar *get_key_table_stats(TABLE_STATS *table_stats, size_t *length,
extern "C" void free_table_stats(TABLE_STATS* table_stats)
{
- my_free(table_stats, MYF(0));
+ my_free(table_stats);
}
void init_global_table_stats(void)
{
- if (hash_init(&global_table_stats, system_charset_info, max_connections,
- 0, 0, (hash_get_key) get_key_table_stats,
- (hash_free_key)free_table_stats, 0)) {
+ if (my_hash_init(&global_table_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_table_stats,
+ (my_hash_free_key)free_table_stats, 0)) {
sql_print_error("Initializing global_table_stats failed.");
exit(1);
}
@@ -564,14 +563,14 @@ extern "C" uchar *get_key_index_stats(INDEX_STATS *index_stats, size_t *length,
extern "C" void free_index_stats(INDEX_STATS* index_stats)
{
- my_free(index_stats, MYF(0));
+ my_free(index_stats);
}
void init_global_index_stats(void)
{
- if (hash_init(&global_index_stats, system_charset_info, max_connections,
- 0, 0, (hash_get_key) get_key_index_stats,
- (hash_free_key)free_index_stats, 0))
+ if (my_hash_init(&global_index_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_index_stats,
+ (my_hash_free_key)free_index_stats, 0))
{
sql_print_error("Initializing global_index_stats failed.");
exit(1);
@@ -581,22 +580,22 @@ void init_global_index_stats(void)
void free_global_user_stats(void)
{
- hash_free(&global_user_stats);
+ my_hash_free(&global_user_stats);
}
void free_global_table_stats(void)
{
- hash_free(&global_table_stats);
+ my_hash_free(&global_table_stats);
}
void free_global_index_stats(void)
{
- hash_free(&global_index_stats);
+ my_hash_free(&global_index_stats);
}
void free_global_client_stats(void)
{
- hash_free(&global_client_stats);
+ my_hash_free(&global_client_stats);
}
/*
@@ -611,7 +610,7 @@ static bool increment_count_by_name(const char *name, size_t name_length,
{
USER_STATS *user_stats;
- if (!(user_stats= (USER_STATS*) hash_search(users_or_clients, (uchar*) name,
+ if (!(user_stats= (USER_STATS*) my_hash_search(users_or_clients, (uchar*) name,
name_length)))
{
/* First connection for this user or client */
@@ -635,7 +634,7 @@ static bool increment_count_by_name(const char *name, size_t name_length,
if (my_hash_insert(users_or_clients, (uchar*)user_stats))
{
- my_free(user_stats, 0);
+ my_free(user_stats);
return TRUE; // Out of memory
}
}
@@ -664,7 +663,7 @@ static bool increment_connection_count(THD* thd, bool use_lock)
return FALSE;
if (use_lock)
- pthread_mutex_lock(&LOCK_global_user_client_stats);
+ mysql_mutex_lock(&LOCK_global_user_client_stats);
if (increment_count_by_name(user_string, strlen(user_string), user_string,
&global_user_stats, thd))
@@ -681,7 +680,7 @@ static bool increment_connection_count(THD* thd, bool use_lock)
end:
if (use_lock)
- pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ mysql_mutex_unlock(&LOCK_global_user_client_stats);
return return_value;
}
#endif
@@ -757,10 +756,10 @@ void update_global_user_stats(THD *thd, bool create_user, time_t now)
client_string= get_client_host(thd);
client_string_length= strlen(client_string);
- pthread_mutex_lock(&LOCK_global_user_client_stats);
+ mysql_mutex_lock(&LOCK_global_user_client_stats);
// Update by user name
- if ((user_stats= (USER_STATS*) hash_search(&global_user_stats,
+ if ((user_stats= (USER_STATS*) my_hash_search(&global_user_stats,
(uchar*) user_string,
user_string_length)))
{
@@ -778,7 +777,7 @@ void update_global_user_stats(THD *thd, bool create_user, time_t now)
}
/* Update by client IP */
- if ((user_stats= (USER_STATS*)hash_search(&global_client_stats,
+ if ((user_stats= (USER_STATS*)my_hash_search(&global_client_stats,
(uchar*) client_string,
client_string_length)))
{
@@ -798,7 +797,7 @@ void update_global_user_stats(THD *thd, bool create_user, time_t now)
thd->select_commands= thd->update_commands= thd->other_commands= 0;
thd->last_global_update_time= now;
- pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ mysql_mutex_unlock(&LOCK_global_user_client_stats);
}
@@ -1005,7 +1004,7 @@ bool login_connection(THD *thd)
/* Updates global user connection stats. */
if (increment_connection_count(thd, TRUE))
{
- net_send_error(thd, ER_OUTOFMEMORY); // Out of memory
+ my_error(ER_OUTOFMEMORY, MYF(0), 2*sizeof(USER_STATS));
DBUG_RETURN(1);
}
@@ -1131,11 +1130,11 @@ void do_handle_one_connection(THD *thd_arg)
thd->thr_create_utime= my_micro_time();
- if (MYSQL_CALLBACK(thread_scheduler, init_new_connection_thread, ()))
+ if (MYSQL_CALLBACK_ELSE(&thread_scheduler, init_new_connection_thread, (), 0))
{
close_connection(thd, ER_OUT_OF_RESOURCES, 1);
statistic_increment(aborted_connects,&LOCK_status);
- MYSQL_CALLBACK(thd->thread_scheduler, end_thread, (thd, 0));
+ MYSQL_CALLBACK(thd->scheduler, end_thread, (thd, 0));
return;
}
@@ -1197,7 +1196,7 @@ end_thread:
if (thd->userstat_running)
update_global_user_stats(thd, create_user, time(NULL));
- if (MYSQL_CALLBACK(thd->scheduler, end_thread, (thd, 1)))
+ if (MYSQL_CALLBACK_ELSE(thd->scheduler, end_thread, (thd, 1), 0))
return; // Probably no-threads
/*
diff --git a/sql/sql_connect.h b/sql/sql_connect.h
index 9653d3988c0..18dd2b31305 100644
--- a/sql/sql_connect.h
+++ b/sql/sql_connect.h
@@ -52,6 +52,14 @@ int get_or_create_user_conn(THD *thd, const char *user,
const char *host, USER_RESOURCES *mqh);
int check_for_max_user_connections(THD *thd, USER_CONN *uc);
+extern HASH global_user_stats;
+extern HASH global_client_stats;
+extern HASH global_table_stats;
+extern HASH global_index_stats;
+extern mysql_mutex_t LOCK_global_user_client_stats;
+extern mysql_mutex_t LOCK_global_table_stats;
+extern mysql_mutex_t LOCK_global_index_stats;
+extern mysql_mutex_t LOCK_stats;
#endif /* SQL_CONNECT_INCLUDED */
diff --git a/sql/sql_db.h b/sql/sql_db.h
index ecb8deaa397..c99bdb63fc5 100644
--- a/sql/sql_db.h
+++ b/sql/sql_db.h
@@ -19,9 +19,7 @@
#include "hash.h" /* HASH */
class THD;
-typedef struct charset_info_st CHARSET_INFO;
typedef struct st_ha_create_information HA_CREATE_INFO;
-typedef struct st_mysql_lex_string LEX_STRING;
int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 9d13fa1b01b..d80eb4d4dfe 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -59,7 +59,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
bool const_cond_result;
ha_rows deleted= 0;
bool reverse= FALSE;
- bool skip_record;
ORDER *order= (ORDER *) ((order_list && order_list->elements) ?
order_list->first : NULL);
uint usable_index= MAX_KEY;
diff --git a/sql/sql_error.h b/sql/sql_error.h
index c0f28c20286..8495a8cfa57 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -101,7 +101,7 @@ public:
void increment_warning()
{
if (m_status != DA_EMPTY)
- m_total_warn_count++;
+ m_statement_warn_count++;
}
Diagnostics_area() { reset_diagnostics_area(); }
diff --git a/sql/sql_expression_cache.cc b/sql/sql_expression_cache.cc
index 50fd7c7ee4d..d91868ca916 100644
--- a/sql/sql_expression_cache.cc
+++ b/sql/sql_expression_cache.cc
@@ -1,6 +1,7 @@
-#include "mysql_priv.h"
+#include "sql_base.h"
#include "sql_select.h"
+#include "sql_expression_cache.h"
/*
Expression cache is used only for caching subqueries now, so its statistic
@@ -91,10 +92,9 @@ void Expression_cache_tmptable::init()
if (!(cache_table= create_tmp_table(table_thd, &cache_table_param,
items, (ORDER*) NULL,
FALSE, FALSE,
- ((table_thd->options |
+ ((table_thd->variables.option_bits |
TMP_TABLE_ALL_COLUMNS) &
- ~(OPTION_BIG_TABLES |
- TMP_TABLE_FORCE_MYISAM)),
+ ~TMP_TABLE_FORCE_MYISAM),
HA_POS_ERROR,
(char *)"subquery-cache-table")))
{
@@ -155,7 +155,10 @@ error:
Expression_cache_tmptable::~Expression_cache_tmptable()
{
if (cache_table)
+ {
+ cache_table->file->ha_index_end();
free_tmp_table(table_thd, cache_table);
+ }
}
@@ -253,6 +256,7 @@ my_bool Expression_cache_tmptable::put_value(Item *value)
DBUG_RETURN(FALSE);
err:
+ cache_table->file->ha_index_end();
free_tmp_table(table_thd, cache_table);
cache_table= NULL;
DBUG_RETURN(TRUE);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index c562a5c6cb4..99a8378961e 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2491,7 +2491,7 @@ void kill_delayed_threads(void)
while ((di= it++))
{
di->thd.killed= THD::KILL_CONNECTION;
- pthread_mutex_lock(&di->thd.LOCK_thd_data);
+ mysql_mutex_lock(&di->thd.LOCK_thd_data);
if (di->thd.mysys_var)
{
mysql_mutex_lock(&di->thd.mysys_var->mutex);
@@ -2509,7 +2509,7 @@ void kill_delayed_threads(void)
}
mysql_mutex_unlock(&di->thd.mysys_var->mutex);
}
- pthread_mutex_unlock(&di->thd.LOCK_thd_data);
+ mysql_mutex_unlock(&di->thd.LOCK_thd_data);
}
mysql_mutex_unlock(&LOCK_delayed_insert); // For unlink from list
}
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 10064590a75..7a08dadf049 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -27,7 +27,8 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "mysql_priv.h"
+#include "key.h"
+#include "sql_base.h"
#include "sql_select.h"
#include "opt_subselect.h"
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 67717ebab29..b24744571e6 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -38,10 +38,6 @@ 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};
-/**
@note The order of the elements of this array must correspond to
the order of elements in enum_binlog_stmt_unsafe.
*/
@@ -131,6 +127,86 @@ void lex_free(void)
DBUG_VOID_RETURN;
}
+/**
+ Initialize lex object for use in fix_fields and parsing.
+
+ SYNOPSIS
+ init_lex_with_single_table()
+ @param thd The thread object
+ @param table The table object
+ @return Operation status
+ @retval TRUE An error occurred, memory allocation error
+ @retval FALSE Ok
+
+ DESCRIPTION
+ This function is used to initialize a lex object on the
+ stack for use by fix_fields and for parsing. In order to
+ work properly it also needs to initialize the
+ Name_resolution_context object of the lexer.
+ Finally it needs to set a couple of variables to ensure
+ proper functioning of fix_fields.
+*/
+
+int
+init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
+{
+ TABLE_LIST *table_list;
+ Table_ident *table_ident;
+ SELECT_LEX *select_lex= &lex->select_lex;
+ Name_resolution_context *context= &select_lex->context;
+ /*
+ We will call the parser to create a part_info struct based on the
+ partition string stored in the frm file.
+ We will use a local lex object for this purpose. However we also
+ need to set the Name_resolution_object for this lex object. We
+ do this by using add_table_to_list where we add the table that
+ we're working with to the Name_resolution_context.
+ */
+ thd->lex= lex;
+ lex_start(thd);
+ context->init();
+ if ((!(table_ident= new Table_ident(thd,
+ table->s->table_name,
+ table->s->db, TRUE))) ||
+ (!(table_list= select_lex->add_table_to_list(thd,
+ table_ident,
+ NULL,
+ 0))))
+ return TRUE;
+ context->resolve_in_table_list_only(table_list);
+ lex->use_only_table_context= TRUE;
+ select_lex->cur_pos_in_select_list= UNDEF_POS;
+ table->map= 1; //To ensure correct calculation of const item
+ table->get_fields_in_item_tree= TRUE;
+ table_list->table= table;
+ return FALSE;
+}
+
+/**
+ End use of local lex with single table
+
+ SYNOPSIS
+ end_lex_with_single_table()
+ @param thd The thread object
+ @param table The table object
+ @param old_lex The real lex object connected to THD
+
+ DESCRIPTION
+ This function restores the real lex object after calling
+ init_lex_with_single_table and also restores some table
+ variables temporarily set.
+*/
+
+void
+end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex)
+{
+ LEX *lex= thd->lex;
+ table->map= 0;
+ table->get_fields_in_item_tree= FALSE;
+ lex_end(lex);
+ thd->lex= old_lex;
+}
+
void
st_parsing_options::reset()
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index f40797d6829..94d698d4358 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2719,6 +2719,8 @@ extern void lex_init(void);
extern void lex_free(void);
extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
+void end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex);
+int init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
extern void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str);
diff --git a/sql/sql_list.cc b/sql/sql_list.cc
index 31f0ba28b85..a256212471d 100644
--- a/sql/sql_list.cc
+++ b/sql/sql_list.cc
@@ -18,7 +18,6 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "unireg.h"
#include "sql_list.h"
list_node end_of_list;
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 78549b73cef..cf19cf82607 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -15,17 +15,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "my_global.h"
-#include "my_sys.h"
-#include "m_string.h" /* for TRASH */
-
-
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
-void *sql_alloc(size_t);
-
#include "my_sys.h" /* alloc_root, TRASH, MY_WME,
MY_FAE, MY_ALLOW_ZERO_PTR */
#include "m_string.h" /* bfill */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 786636addfe..1a4d6d9b38d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -98,6 +98,7 @@
#include "debug_sync.h"
#include "probes_mysql.h"
#include "set_var.h"
+#include "log_slow.h"
#define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
@@ -538,9 +539,9 @@ static void handle_bootstrap_impl(THD *thd)
}
buff= (char*) thd->net.buff;
res= mysql_file_fgets(buff + length, thd->net.max_packet - length, file);
- if (!res && !feof(file))
+ if (!res && !mysql_file_feof(file))
{
- net_end_statement(thd);
+ thd->protocol->end_statement();
bootstrap_error= 1;
break;
}
@@ -1086,10 +1087,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char *beginning_of_next_stmt= (char*)
parser_state.m_lip.found_semicolon;
-#ifdef WITH_ARIA_STORAGE_ENGINE
- ha_maria::implicit_commit(thd, FALSE);
-#endif
-
/*
Multiple queries exits, execute them individually
*/
@@ -1182,7 +1179,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
packet= arg_end + 1;
- mysql_reset_thd_for_next_command(thd);
+ mysql_reset_thd_for_next_command(thd, opt_userstat_running);
lex_start(thd);
/* Must be before we init the table list. */
if (lower_case_table_names)
@@ -1247,6 +1244,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
uint32 slave_server_id;
status_var_increment(thd->status_var.com_other);
+
thd->enable_slow_log= opt_log_slow_admin_statements;
thd->query_plan_flags|= QPLAN_ADMIN;
if (check_global_access(thd, REPL_SLAVE_ACL))
@@ -1346,9 +1344,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
STATUS_VAR *current_global_status_var; // Big; Don't allocate on stack
ulong uptime;
-#if defined(SAFEMALLOC) || !defined(EMBEDDED_LIBRARY)
uint length;
-#endif
ulonglong queries_per_second1000;
char buff[250];
uint buff_len= sizeof(buff);
@@ -1485,6 +1481,8 @@ void log_slow_statement(THD *thd)
{
DBUG_ENTER("log_slow_statement");
+ thd->update_all_stats();
+
/*
The following should never be true with our current code base,
but better to keep this here so we don't accidently try to log a
@@ -1494,7 +1492,6 @@ void log_slow_statement(THD *thd)
DBUG_VOID_RETURN; // Don't set time for sub stmt
/* Follow the slow log filter configuration. */
- DBUG_ASSERT(thd->variables.log_slow_filter != 0);
if (!(thd->variables.log_slow_filter & thd->query_plan_flags))
DBUG_VOID_RETURN;
@@ -2638,7 +2635,6 @@ end_with_restore_list:
}
#endif /* HAVE_REPLICATION */
-#error set QPLAN_ADMIN somehow universally, not per statement
case SQLCOM_RENAME_TABLE:
{
if (execute_rename_table(thd, first_table, all_tables))
@@ -4345,6 +4341,7 @@ create_sp_error:
case SQLCOM_REPAIR:
case SQLCOM_TRUNCATE:
case SQLCOM_ALTER_TABLE:
+ thd->query_plan_flags|= QPLAN_ADMIN;
DBUG_ASSERT(first_table == all_tables && first_table != 0);
/* fall through */
case SQLCOM_SIGNAL:
@@ -4876,6 +4873,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
(db ? db : (thd->db ?
thd->db :
"unknown")));
+ }
DBUG_RETURN(TRUE);
}
diff --git a/sql/sql_parse.h b/sql/sql_parse.h
index ef19df682dc..11177a9bcf7 100644
--- a/sql/sql_parse.h
+++ b/sql/sql_parse.h
@@ -85,7 +85,7 @@ bool alloc_query(THD *thd, const char *packet, uint packet_length);
void mysql_init_select(LEX *lex);
void mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state);
-void mysql_reset_thd_for_next_command(THD *thd);
+void mysql_reset_thd_for_next_command(THD *thd, my_bool calculate_userstat);
bool mysql_new_select(LEX *lex, bool move_down);
void create_select_for_variable(const char *var_name);
void create_table_set_open_action_and_adjust_tables(LEX *lex);
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 9ab4e0c5226..2d15ca24733 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -951,86 +951,11 @@ int check_signed_flag(partition_info *part_info)
return error;
}
-/**
- Initialize lex object for use in fix_fields and parsing.
-
- SYNOPSIS
- init_lex_with_single_table()
- @param thd The thread object
- @param table The table object
- @return Operation status
- @retval TRUE An error occurred, memory allocation error
- @retval FALSE Ok
-
- DESCRIPTION
- This function is used to initialize a lex object on the
- stack for use by fix_fields and for parsing. In order to
- work properly it also needs to initialize the
- Name_resolution_context object of the lexer.
- Finally it needs to set a couple of variables to ensure
- proper functioning of fix_fields.
-*/
-
-static int
-init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
-{
- TABLE_LIST *table_list;
- Table_ident *table_ident;
- SELECT_LEX *select_lex= &lex->select_lex;
- Name_resolution_context *context= &select_lex->context;
- /*
- We will call the parser to create a part_info struct based on the
- partition string stored in the frm file.
- We will use a local lex object for this purpose. However we also
- need to set the Name_resolution_object for this lex object. We
- do this by using add_table_to_list where we add the table that
- we're working with to the Name_resolution_context.
- */
- thd->lex= lex;
- lex_start(thd);
- context->init();
- if ((!(table_ident= new Table_ident(thd,
- table->s->table_name,
- table->s->db, TRUE))) ||
- (!(table_list= select_lex->add_table_to_list(thd,
- table_ident,
- NULL,
- 0))))
- return TRUE;
- context->resolve_in_table_list_only(table_list);
- lex->use_only_table_context= TRUE;
- select_lex->cur_pos_in_select_list= UNDEF_POS;
- table->map= 1; //To ensure correct calculation of const item
- table->get_fields_in_item_tree= TRUE;
- table_list->table= table;
- return FALSE;
-}
-
-/**
- End use of local lex with single table
-
- SYNOPSIS
- end_lex_with_single_table()
- @param thd The thread object
- @param table The table object
- @param old_lex The real lex object connected to THD
-
- DESCRIPTION
- This function restores the real lex object after calling
- init_lex_with_single_table and also restores some table
- variables temporarily set.
+/*
+ init_lex_with_single_table and end_lex_with_single_table
+ are now in sql_lex.cc
*/
-static void
-end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex)
-{
- LEX *lex= thd->lex;
- table->map= 0;
- table->get_fields_in_item_tree= FALSE;
- lex_end(lex);
- thd->lex= old_lex;
-}
-
/*
The function uses a new feature in fix_fields where the flag
GET_FIXED_FIELDS_FLAG is set for all fields in the item tree.
@@ -2033,7 +1958,7 @@ static int add_int(File fptr, longlong number)
static int add_uint(File fptr, ulonglong number)
{
char buff[32];
- longlong2str(number, buff, 10, 1);
+ longlong2str(number, buff, 10);
return add_string(fptr, buff);
}
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index fee33303a04..795760c855c 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -15,7 +15,6 @@
#include "sql_parse.h" // check_one_table_access
#include "sql_table.h" // mysql_alter_table, etc.
-#include "sql_lex.h" // Sql_statement
#include "sql_truncate.h" // mysql_truncate_table,
// Truncate_statement
#include "sql_admin.h" // Analyze/Check/.._table_statement
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index e046a9fc273..066a7512eaf 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -35,8 +35,8 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
-extern struct st_mysql_plugin *mysql_optional_plugins[];
-extern struct st_mysql_plugin *mysql_mandatory_plugins[];
+extern struct st_maria_plugin *mysql_optional_plugins[];
+extern struct st_maria_plugin *mysql_mandatory_plugins[];
/**
@note The order of the enumeration is critical.
@@ -53,7 +53,7 @@ static TYPELIB global_plugin_typelib=
char *opt_plugin_load= NULL;
char *opt_plugin_dir_ptr;
char opt_plugin_dir[FN_REFLEN];
-uint plugin_maturity;
+ulong plugin_maturity;
/*
not really needed now, this map will become essential when we add more
@@ -885,7 +885,7 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc)
}
-plugin_ref plugin_lock(THD *thd, plugin_ref *ptr)
+plugin_ref plugin_lock(THD *thd, plugin_ref ptr)
{
LEX *lex= thd ? thd->lex : 0;
plugin_ref rc;
@@ -911,7 +911,7 @@ plugin_ref plugin_lock(THD *thd, plugin_ref *ptr)
DBUG_RETURN(ptr);
#endif
mysql_mutex_lock(&LOCK_plugin);
- rc= my_intern_plugin_lock_ci(lex, *ptr);
+ rc= my_intern_plugin_lock_ci(lex, ptr);
mysql_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(rc);
}
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index 756328579f1..478bc787d40 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -54,7 +54,6 @@ enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
typedef enum enum_mysql_show_type SHOW_TYPE;
typedef struct st_mysql_show_var SHOW_VAR;
-typedef struct st_mysql_lex_string LEX_STRING;
#define MYSQL_ANY_PLUGIN -1
@@ -133,7 +132,7 @@ extern char *opt_plugin_load;
extern char *opt_plugin_dir_ptr;
extern char opt_plugin_dir[FN_REFLEN];
extern const LEX_STRING plugin_type_names[];
-extern uint plugin_maturity;
+extern ulong plugin_maturity;
extern TYPELIB plugin_maturity_values;
extern const char *plugin_maturity_names[];
@@ -145,7 +144,7 @@ extern bool plugin_is_ready(const LEX_STRING *name, int type);
#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C)
#define my_plugin_lock(A,B) plugin_lock(A,B)
#define my_plugin_lock_ci(A,B) plugin_lock(A,B)
-extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr CALLER_INFO_PROTO);
+extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr);
extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name,
int type);
extern void plugin_unlock(THD *thd, plugin_ref plugin);
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 9cd5d498c14..c57c9dacceb 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1245,8 +1245,8 @@ static bool mysql_test_insert(Prepared_statement *stmt,
if (insert_precheck(thd, table_list))
goto error;
- upgrade_lock_type_for_insert(thd, &table_list->lock_type, duplic,
- values_list.elements > 1);
+ //upgrade_lock_type_for_insert(thd, &table_list->lock_type, duplic,
+ // values_list.elements > 1);
/*
open temporary memory pool for temporary data allocated by derived
tables & preparation procedure
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 7bca41f1265..ee9f1b5066f 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -372,7 +372,7 @@ Increase max_allowed_packet on master";
*/
static ulonglong get_heartbeat_period(THD * thd)
{
- my_bool null_value;
+ bool null_value;
LEX_STRING name= { C_STRING_WITH_LEN("master_heartbeat_period")};
user_var_entry *entry=
(user_var_entry*) my_hash_search(&thd->user_vars, (uchar*) name.str,
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 32387d676c9..171e9a7f7a5 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -49,19 +49,12 @@
#include "filesort.h" // filesort_free_buffers
#include "sql_union.h" // mysql_union
#include "opt_subselect.h"
+#include "log_slow.h"
#include <m_ctype.h>
#include <my_bit.h>
#include <hash.h>
#include <ft_global.h>
-//#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES)
-//#include "../storage/maria/ha_maria.h"
-//#define TMP_ENGINE_HTON maria_hton
-//#else
-//#define TMP_ENGINE_HTON myisam_hton
-//#endif
-
-#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref",
"MAYBE_REF","ALL","range","index","fulltext",
@@ -83,7 +76,6 @@ static bool update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,
static int sort_keyuse(KEYUSE *a,KEYUSE *b);
static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
table_map used_tables);
-bool choose_plan(JOIN *join,table_map join_tables);
void best_access_path(JOIN *join, JOIN_TAB *s,
table_map remaining_tables, uint idx,
@@ -149,30 +141,24 @@ static COND *optimize_cond(JOIN *join, COND *conds,
List<TABLE_LIST> *join_list,
Item::cond_result *cond_value,
COND_EQUAL **cond_equal);
-static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
+bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool create_internal_tmp_table_from_heap2(THD *, TABLE *,
ENGINE_COLUMNDEF *, ENGINE_COLUMNDEF **,
int, bool, handlerton *, const char *);
static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table,
Procedure *proc);
-static enum_nested_loop_state
-evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
- int error);
+static enum_nested_loop_state evaluate_join_record(JOIN *, JOIN_TAB *, int);
static enum_nested_loop_state
evaluate_null_complemented_join_record(JOIN *join, JOIN_TAB *join_tab);
static enum_nested_loop_state
end_send(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
-enum_nested_loop_state
-end_send_group(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
static enum_nested_loop_state
end_write(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
static enum_nested_loop_state
end_update(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
static enum_nested_loop_state
end_unique_update(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
-enum_nested_loop_state
-end_write_group(JOIN *join, JOIN_TAB *join_tab, bool end_of_records);
static int test_if_group_changed(List<Cached_item> &list);
static int join_read_const_table(JOIN_TAB *tab, POSITION *pos);
@@ -770,6 +756,7 @@ err:
int
JOIN::optimize()
{
+ bool need_distinct= TRUE;
ulonglong select_opts_for_readinfo;
uint no_jbuf_after;
@@ -1084,6 +1071,9 @@ JOIN::optimize()
conds=new Item_int((longlong) 0,1); // Always false
}
+ /* Cache constant expressions in WHERE, HAVING, ON clauses. */
+ cache_const_exprs();
+
if (make_join_select(this, select, conds))
{
zero_result_cause=
@@ -1437,7 +1427,6 @@ JOIN::optimize()
single table queries, thus it is sufficient to test only the first
join_tab element of the plan for its access method.
*/
- bool need_distinct= TRUE;
if (join_tab->is_using_loose_index_scan())
{
tmp_table_param.precomputed_group_by= TRUE;
@@ -2821,6 +2810,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
if (bitmap_is_set(stat[j].dependent, i) &&
bitmap_is_set(stat[i].dependent, k))
bitmap_set_bit(stat[j].dependent, k);
+ }
}
}
*/
@@ -9253,8 +9243,7 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
pointer to the transformed condition containing multiple equalities
*/
-static COND *build_equal_items(THD *thd, COND *cond,
- COND_EQUAL *inherited,
+static COND *build_equal_items(THD *thd, COND *cond, COND_EQUAL *inherited,
List<TABLE_LIST> *join_list,
COND_EQUAL **cond_equal_ref)
{
@@ -12265,7 +12254,7 @@ bool open_tmp_table(TABLE *table)
}
-#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES)
+#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_ARIA_FOR_TMP_TABLES)
/*
Create internal (MyISAM or Maria) temporary table
@@ -19060,7 +19049,7 @@ static void print_join(THD *thd,
*/
if ((*table)->sj_inner_tables)
{
- TABLE_LIST **end= table + tables->elements;
+ TABLE_LIST **end= table + non_const_tables;
for (TABLE_LIST **t2= table; t2!=end; t2++)
{
if (!(*t2)->sj_inner_tables)
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 1c24ed37581..8d487021a04 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -16,9 +16,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef SQL_SELECT_INCLUDED
-#define SQL_SELECT_INCLUDED
/**
@file
@@ -37,8 +34,10 @@
#include "opt_range.h" /* SQL_SELECT, QUICK_SELECT_I */
-#if defined(WITH_ARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES)
+#if defined(WITH_ARIA_STORAGE_ENGINE)
#include "../storage/maria/ha_maria.h"
+#endif
+#if defined(USE_ARIA_FOR_TMP_TABLES)
#define TMP_ENGINE_HTON maria_hton
#else
#define TMP_ENGINE_HTON myisam_hton
@@ -779,7 +778,7 @@ public:
void reset_join(JOIN *j) { join= j; }
void free()
{
- x_free(buff);
+ my_free(buff);
buff= 0;
}
@@ -2065,7 +2064,7 @@ void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok);
TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ORDER *group, bool distinct, bool save_sum_fields,
ulonglong select_options, ha_rows rows_limit,
- char* alias);
+ const char* alias);
void free_tmp_table(THD *thd, TABLE *entry);
bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
ENGINE_COLUMNDEF *start_recinfo,
@@ -2074,7 +2073,7 @@ bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
ENGINE_COLUMNDEF *start_recinfo,
ENGINE_COLUMNDEF **recinfo,
- ulonglong options);
+ ulonglong options, my_bool big_tables);
bool open_tmp_table(TABLE *table);
void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index c7cdab06d7b..ea17cd73e1c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -41,6 +41,7 @@
#include "sp_pcontext.h"
#include "set_var.h"
#include "sql_trigger.h"
+#include "sql_connect.h"
#include "authors.h"
#include "contributors.h"
#include "sql_partition.h"
@@ -52,6 +53,7 @@
#include "lock.h" // MYSQL_OPEN_IGNORE_FLUSH
#include "debug_sync.h"
#include "datadict.h" // dd_frm_type()
+#include "keycaches.h"
#define STR_OR_NIL(S) ((S) ? (S) : "<nil>")
@@ -1110,7 +1112,7 @@ static bool get_field_default_value(THD *thd, Field *timestamp_field,
if (field_type == MYSQL_TYPE_BIT)
{
longlong dec= field->val_int();
- char *ptr= longlong2str(dec, tmp + 2, 2, 1);
+ char *ptr= longlong2str(dec, tmp + 2, 2);
uint32 length= (uint32) (ptr - tmp);
tmp[0]= 'b';
tmp[1]= '\'';
@@ -2380,7 +2382,6 @@ static bool show_status_array(THD *thd, const char *wild,
DBUG_ASSERT(0);
break;
}
- pthread_mutex_unlock(&LOCK_global_system_variables);
table->field[1]->store(pos, (uint32) (end - pos), charset);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
table->field[1]->set_notnull();
@@ -2400,7 +2401,7 @@ end:
DBUG_RETURN(res);
}
-#ifdef COMPLEAT_PATCH_NOT_ADDED_YET
+#ifdef COMPLETE_PATCH_NOT_ADDED_YET
/*
Aggregate values for mapped_user entries by their role.
@@ -2417,10 +2418,10 @@ end:
static int aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
{
DBUG_ENTER("aggregate_user_stats");
- if (hash_init(agg_user_stats, system_charset_info,
+ if (my_hash_init(agg_user_stats, system_charset_info,
max(all_user_stats->records, 1),
- 0, 0, (hash_get_key)get_key_user_stats,
- (hash_free_key)free_user_stats, 0))
+ 0, 0, (my_hash_get_key)get_key_user_stats,
+ (my_hash_free_key)free_user_stats, 0))
{
sql_print_error("Malloc in aggregate_user_stats failed");
DBUG_RETURN(1);
@@ -2428,11 +2429,11 @@ static int aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
for (uint i= 0; i < all_user_stats->records; i++)
{
- USER_STATS *user= (USER_STATS*)hash_element(all_user_stats, i);
+ USER_STATS *user= (USER_STATS*)my_hash_element(all_user_stats, i);
USER_STATS *agg_user;
uint name_length= strlen(user->priv_user);
- if (!(agg_user= (USER_STATS*) hash_search(agg_user_stats,
+ if (!(agg_user= (USER_STATS*) my_hash_search(agg_user_stats,
(uchar*)user->priv_user,
name_length)))
{
@@ -2511,7 +2512,7 @@ int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
for (uint i= 0; i < all_user_stats->records; i++)
{
uint j= 0;
- USER_STATS *user_stats= (USER_STATS*) hash_element(all_user_stats, i);
+ USER_STATS *user_stats= (USER_STATS*) my_hash_element(all_user_stats, i);
table->field[j++]->store(user_stats->user, user_stats->user_name_length,
system_charset_info);
@@ -2574,9 +2575,9 @@ int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
Pattern matching on the client IP is supported.
*/
- pthread_mutex_lock(&LOCK_global_user_client_stats);
+ mysql_mutex_lock(&LOCK_global_user_client_stats);
result= send_user_stats(thd, &global_user_stats, table) != 0;
- pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ mysql_mutex_unlock(&LOCK_global_user_client_stats);
DBUG_PRINT("exit", ("result: %d", result));
DBUG_RETURN(result);
@@ -2609,9 +2610,9 @@ int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
Pattern matching on the client IP is supported.
*/
- pthread_mutex_lock(&LOCK_global_user_client_stats);
+ mysql_mutex_lock(&LOCK_global_user_client_stats);
result= send_user_stats(thd, &global_client_stats, table) != 0;
- pthread_mutex_unlock(&LOCK_global_user_client_stats);
+ mysql_mutex_unlock(&LOCK_global_user_client_stats);
DBUG_PRINT("exit", ("result: %d", result));
DBUG_RETURN(result);
@@ -2625,12 +2626,12 @@ int fill_schema_table_stats(THD *thd, TABLE_LIST *tables, COND *cond)
TABLE *table= tables->table;
DBUG_ENTER("fill_schema_table_stats");
- pthread_mutex_lock(&LOCK_global_table_stats);
+ mysql_mutex_lock(&LOCK_global_table_stats);
for (uint i= 0; i < global_table_stats.records; i++)
{
char *end_of_schema;
TABLE_STATS *table_stats=
- (TABLE_STATS*)hash_element(&global_table_stats, i);
+ (TABLE_STATS*)my_hash_element(&global_table_stats, i);
TABLE_LIST tmp_table;
size_t schema_length, table_name_length;
@@ -2642,9 +2643,8 @@ int fill_schema_table_stats(THD *thd, TABLE_LIST *tables, COND *cond)
tmp_table.db= table_stats->table;
tmp_table.table_name= end_of_schema+1;
tmp_table.grant.privilege= 0;
- if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
- &tmp_table.grant.privilege, 0, 0,
- is_schema_db(tmp_table.db)) ||
+ if (check_access(thd, SELECT_ACL, tmp_table.db,
+ &tmp_table.grant.privilege, NULL, 0, 1) ||
check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX,
1))
continue;
@@ -2659,11 +2659,11 @@ int fill_schema_table_stats(THD *thd, TABLE_LIST *tables, COND *cond)
TRUE);
if (schema_table_store_record(thd, table))
{
- VOID(pthread_mutex_unlock(&LOCK_global_table_stats));
+ mysql_mutex_unlock(&LOCK_global_table_stats);
DBUG_RETURN(1);
}
}
- pthread_mutex_unlock(&LOCK_global_table_stats);
+ mysql_mutex_unlock(&LOCK_global_table_stats);
DBUG_RETURN(0);
}
@@ -2675,11 +2675,11 @@ int fill_schema_index_stats(THD *thd, TABLE_LIST *tables, COND *cond)
TABLE *table= tables->table;
DBUG_ENTER("fill_schema_index_stats");
- pthread_mutex_lock(&LOCK_global_index_stats);
+ mysql_mutex_lock(&LOCK_global_index_stats);
for (uint i= 0; i < global_index_stats.records; i++)
{
INDEX_STATS *index_stats =
- (INDEX_STATS*) hash_element(&global_index_stats, i);
+ (INDEX_STATS*) my_hash_element(&global_index_stats, i);
TABLE_LIST tmp_table;
char *index_name;
size_t schema_name_length, table_name_length, index_name_length;
@@ -2688,9 +2688,8 @@ int fill_schema_index_stats(THD *thd, TABLE_LIST *tables, COND *cond)
tmp_table.db= index_stats->index;
tmp_table.table_name= strend(index_stats->index)+1;
tmp_table.grant.privilege= 0;
- if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
- &tmp_table.grant.privilege, 0, 0,
- is_schema_db(tmp_table.db)) ||
+ if (check_access(thd, SELECT_ACL, tmp_table.db,
+ &tmp_table.grant.privilege, NULL, 0, 1) ||
check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
continue;
@@ -2709,11 +2708,11 @@ int fill_schema_index_stats(THD *thd, TABLE_LIST *tables, COND *cond)
if (schema_table_store_record(thd, table))
{
- VOID(pthread_mutex_unlock(&LOCK_global_index_stats));
+ mysql_mutex_unlock(&LOCK_global_index_stats);
DBUG_RETURN(1);
}
}
- pthread_mutex_unlock(&LOCK_global_index_stats);
+ mysql_mutex_unlock(&LOCK_global_index_stats);
DBUG_RETURN(0);
}
@@ -4114,8 +4113,8 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond)
if (get_lookup_field_values(thd, cond, tables, &lookup_field_vals))
DBUG_RETURN(0);
DBUG_PRINT("INDEX VALUES",("db_name: %s table_name: %s",
- val_or_null(lookup_field_vals.db_value.str),
- val_or_null(lookup_field_vals.table_value.str)));
+ lookup_field_vals.db_value.str,
+ lookup_field_vals.table_value.str));
if (make_db_list(thd, &db_names, &lookup_field_vals,
&with_i_schema))
DBUG_RETURN(1);
@@ -7256,43 +7255,44 @@ int store_key_cache_table_record(THD *thd, TABLE *table,
DBUG_RETURN(err);
}
-
-int fill_key_cache_tables(THD *thd, TABLE_LIST *tables, COND *cond)
+int run_fill_key_cache_tables(const char *name, KEY_CACHE *key_cache, void *p)
{
- TABLE *table= tables->table;
- I_List_iterator<NAMED_LIST> it(key_caches);
- NAMED_LIST *element;
- DBUG_ENTER("fill_key_cache_tables");
-
- while ((element= it++))
- {
- KEY_CACHE *key_cache= (KEY_CACHE *) element->data;
+ DBUG_ENTER("run_fill_key_cache_tables");
- if (!key_cache->key_cache_inited)
- continue;
+ if (!key_cache->key_cache_inited)
+ DBUG_RETURN(0);
- uint partitions= key_cache->partitions;
- DBUG_ASSERT(partitions <= MAX_KEY_CACHE_PARTITIONS);
+ TABLE *table= (TABLE *)p;
+ THD *thd= table->in_use;
+ uint partitions= key_cache->partitions;
+ size_t namelen= strlen(name);
+ DBUG_ASSERT(partitions <= MAX_KEY_CACHE_PARTITIONS);
- if (partitions)
+ if (partitions)
+ {
+ for (uint i= 0; i < partitions; i++)
{
- for (uint i= 0; i < partitions; i++)
- {
- if (store_key_cache_table_record(thd, table,
- element->name, element->name_length,
- key_cache, partitions, i+1))
- DBUG_RETURN(1);
- }
+ if (store_key_cache_table_record(thd, table, name, namelen,
+ key_cache, partitions, i+1))
+ DBUG_RETURN(1);
}
-
- if (store_key_cache_table_record(thd, table,
- element->name, element->name_length,
- key_cache, partitions, 0))
- DBUG_RETURN(1);
}
+
+ if (store_key_cache_table_record(thd, table, name, namelen,
+ key_cache, partitions, 0))
+ DBUG_RETURN(1);
DBUG_RETURN(0);
}
+int fill_key_cache_tables(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_key_cache_tables");
+
+ int res= process_key_caches(run_fill_key_cache_tables, tables->table);
+
+ DBUG_RETURN(res);
+}
+
ST_FIELD_INFO schema_fields_info[]=
{
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 6c185b4a61d..98a45f14a36 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -19,9 +19,9 @@
#include "my_global.h" /* uchar */
#include "my_base.h" /* ha_rows */
#include "my_sys.h" /* qsort2_cmp */
+#include "queues.h"
typedef struct st_buffpek BUFFPEK;
-typedef struct st_queue QUEUE;
typedef struct st_sort_field SORT_FIELD;
class Field;
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 058af3c6826..c5544164dbf 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -916,64 +916,6 @@ my_copy_with_hex_escaping(CHARSET_INFO *cs,
return dst - dst0;
}
-/*
- Optimized for quick copying of ASCII characters in the range 0x00..0x7F.
-*/
-uint32
-copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
- const char *from, uint32 from_length, CHARSET_INFO *from_cs,
- uint *errors)
-{
- /*
- If any of the character sets is not ASCII compatible,
- immediately switch to slow mb_wc->wc_mb method.
- */
- if ((to_cs->state | from_cs->state) & MY_CS_NONASCII)
- return copy_and_convert_extended(to, to_length, to_cs,
- from, from_length, from_cs, errors);
-
- uint32 length= min(to_length, from_length), length2= length;
-
-#if defined(__i386__)
- /*
- Special loop for i386, it allows to refer to a
- non-aligned memory block as UINT32, which makes
- it possible to copy four bytes at once. This
- gives about 10% performance improvement comparing
- to byte-by-byte loop.
- */
- for ( ; length >= 4; length-= 4, from+= 4, to+= 4)
- {
- if ((*(uint32*)from) & 0x80808080)
- break;
- *((uint32*) to)= *((const uint32*) from);
- }
-#endif
-
- for (; ; *to++= *from++, length--)
- {
- if (!length)
- {
- *errors= 0;
- return length2;
- }
- if (*((unsigned char*) from) > 0x7F) /* A non-ASCII character */
- {
- uint32 copied_length= length2 - length;
- to_length-= copied_length;
- from_length-= copied_length;
- return copied_length + copy_and_convert_extended(to, to_length,
- to_cs,
- from, from_length,
- from_cs,
- errors);
- }
- }
-
- DBUG_ASSERT(FALSE); // Should never get to here
- return 0; // Make compiler happy
-}
-
/*
copy a string,
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 880edce0e77..c25a9cd8214 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -31,7 +31,6 @@
#endif
class String;
-typedef struct charset_info_st CHARSET_INFO;
typedef struct st_io_cache IO_CACHE;
typedef struct st_mem_root MEM_ROOT;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 98b3e4ebaf2..1a7162313f5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4142,7 +4142,7 @@ bool mysql_create_table_no_lock(THD *thd,
/* Give warnings for not supported table options */
if (create_info->transactional && !file->ht->commit)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
file->engine_name()->str,
@@ -5729,8 +5729,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint candidate_key_count= 0;
bool no_pk;
ulong explicit_used_fields= 0;
- enum ha_extra_function extra_func= thd->locked_tables ? HA_EXTRA_NOT_USED
- : HA_EXTRA_FORCE_REOPEN;
+ enum ha_extra_function extra_func= thd->locked_tables_mode
+ ? HA_EXTRA_NOT_USED
+ : HA_EXTRA_FORCE_REOPEN;
DBUG_ENTER("mysql_alter_table");
/*
@@ -6509,8 +6510,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
/* Add the indexes. */
if ((error= table->file->add_index(table, key_info, index_add_count)))
{
-#warning fix the following
-#ifdef UNKNOWN_MONTY_ADDITION
+#ifdef MERGE_MONTY_ADDITION_THAT_BREAKS_5_5_TESTS
/* Only report error if handler has not already reported an error */
if (!thd->main_da.is_error())
#endif
@@ -7199,10 +7199,8 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
{
/* Call ->checksum() if the table checksum matches 'old_mode' settings */
if (!(check_opt->flags & T_EXTEND) &&
- (((t->file->ha_table_flags() & HA_HAS_OLD_CHECKSUM) &&
- thd->variables.old_mode) ||
- ((t->file->ha_table_flags() & HA_HAS_NEW_CHECKSUM) &&
- !thd->variables.old_mode)))
+ (((t->file->ha_table_flags() & HA_HAS_OLD_CHECKSUM) && old_mode) ||
+ ((t->file->ha_table_flags() & HA_HAS_NEW_CHECKSUM) && !old_mode)))
protocol->store((ulonglong)t->file->checksum());
else if (check_opt->flags & T_QUICK)
protocol->store_null();
@@ -7252,8 +7250,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
{
Field *f= t->field[i];
- if (! thd->variables.old_mode &&
- f->is_real_null(0))
+ if (! old_mode && f->is_real_null(0))
continue;
/*
BLOB and VARCHAR have pointers in their field, we must convert
diff --git a/sql/sql_table.h b/sql/sql_table.h
index bc32235aaff..a2df9ee7572 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -30,7 +30,6 @@ typedef struct st_ha_create_information HA_CREATE_INFO;
typedef struct st_key KEY;
typedef struct st_key_cache KEY_CACHE;
typedef struct st_lock_param_type ALTER_PARTITION_PARAM_TYPE;
-typedef struct st_mysql_lex_string LEX_STRING;
typedef struct st_order ORDER;
class Alter_table_change_level;
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 9dda1113294..d567624ba44 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -253,7 +253,7 @@ void print_keyuse(KEYUSE *keyuse)
fieldname= "FT_KEYPART";
else
fieldname= keyuse->table->key_info[keyuse->key].key_part[keyuse->keypart].field->field_name;
- longlong2str(keyuse->used_tables, buf2, 16, 0);
+ ll2str(keyuse->used_tables, buf2, 16, 0);
DBUG_LOCK_FILE;
fprintf(DBUG_FILE, "KEYUSE: %s.%s=%s optimize= %d used_tables=%s "
"ref_table_rows= %lu keypart_map= %0lx\n",
@@ -399,11 +399,6 @@ void print_sjm(SJ_MATERIALIZATION_INFO *sjm)
#endif
-C_MODE_START
-static int dl_compare(const void *p1, const void *p2);
-static int print_key_cache_status(const char *name, KEY_CACHE *key_cache);
-C_MODE_END
-
typedef struct st_debug_lock
{
ulong thread_id;
@@ -413,6 +408,7 @@ typedef struct st_debug_lock
enum thr_lock_type type;
} TABLE_LOCK_INFO;
+C_MODE_START
static int dl_compare(const void *p1, const void *p2)
{
TABLE_LOCK_INFO *a, *b;
@@ -430,6 +426,7 @@ static int dl_compare(const void *p1, const void *p2)
return -1;
return 1;
}
+C_MODE_END
static void push_locks_into_array(DYNAMIC_ARRAY *ar, THR_LOCK_DATA *data,
@@ -516,8 +513,9 @@ end:
delete_dynamic(&saved_table_locks);
}
-
-static int print_key_cache_status(const char *name, KEY_CACHE *key_cache)
+C_MODE_START
+static int print_key_cache_status(const char *name, KEY_CACHE *key_cache,
+ void *unused __attribute__((unused)))
{
char llbuff1[22];
char llbuff2[22];
@@ -550,7 +548,7 @@ reads: %10s\n\n",
(ulong)key_cache->param_block_size,
(ulong)key_cache->param_division_limit,
(ulong)key_cache->param_age_threshold,
- key_cache->param_partitions,
+ (ulong)key_cache->param_partitions,
(ulong)stats.blocks_used,
(ulong)stats.blocks_changed,
llstr(stats.write_requests,llbuff1),
@@ -560,6 +558,7 @@ reads: %10s\n\n",
}
return 0;
}
+C_MODE_END
void mysql_print_status()
@@ -579,7 +578,7 @@ void mysql_print_status()
#endif
/* Print key cache status */
puts("\nKey caches:");
- process_key_caches(print_key_cache_status);
+ process_key_caches(print_key_cache_status, 0);
mysql_mutex_lock(&LOCK_status);
printf("\nhandler status:\n\
read_key: %10lu\n\
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 5c158bae398..26bc59a5886 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -527,7 +527,8 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
Ignore the return value for now. It's better to
keep master/slave in consistent state.
*/
- thd->locked_tables_list.reopen_tables(thd);
+ if (thd->locked_tables_list.reopen_tables(thd))
+ thd->clear_error();
end:
if (!result)
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 608a105efaa..9f34180662c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -12872,7 +12872,6 @@ keyword_sp:
| SIMPLE_SYM {}
| SHARE_SYM {}
| SHUTDOWN {}
- | SLOW_SYM {}
| SNAPSHOT_SYM {}
| SOUNDS_SYM {}
| SOURCE_SYM {}
@@ -13419,6 +13418,8 @@ table_lock:
bool lock_for_write= (lock_type >= TL_WRITE_ALLOW_WRITE);
if (!Select->add_table_to_list(YYTHD, $1, $2, 0, lock_type,
(lock_for_write ?
+ lock_type == TL_WRITE_CONCURRENT_INSERT ?
+ MDL_SHARED_WRITE :
MDL_SHARED_NO_READ_WRITE :
MDL_SHARED_READ)))
MYSQL_YYABORT;
diff --git a/sql/strfunc.h b/sql/strfunc.h
index f1eb83ff0de..6aa446e59ac 100644
--- a/sql/strfunc.h
+++ b/sql/strfunc.h
@@ -18,8 +18,6 @@
#include "my_global.h" /* ulonglong, uint */
-typedef struct charset_info_st CHARSET_INFO;
-typedef struct st_mysql_lex_string LEX_STRING;
typedef struct st_typelib TYPELIB;
ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
diff --git a/sql/structs.h b/sql/structs.h
index 327b28fe79c..fb2f2f6fec8 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -25,6 +25,7 @@
#include "my_time.h" /* enum_mysql_timestamp_type */
#include "thr_lock.h" /* thr_lock_type */
#include "my_base.h" /* ha_rows, ha_key_alg */
+#include <mysql_com.h> /* USERNAME_LENGTH */
struct TABLE;
class Field;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index c4f9e131e58..56440368acf 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -44,20 +44,14 @@
// mysql_user_table_is_in_short_password_format
#include "derror.h" // read_texts
#include "sql_base.h" // close_cached_tables
+#include <myisam.h>
+#include "log_slow.h"
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#include "../storage/perfschema/pfs_server.h"
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
/*
- This forward declaration is needed because including sql_base.h
- causes further includes. [TODO] Eliminate this forward declaration
- and include a file with the prototype instead.
-*/
-extern void close_thread_tables(THD *thd);
-#warning remove that
-
-/*
The rule for this file: everything should be 'static'. When a sys_var
variable or a function from this file is - in very rare cases - needed
elsewhere it should be explicitly declared 'export' here to show that it's
@@ -70,7 +64,6 @@ extern void close_thread_tables(THD *thd);
#define PFS_TRAILING_PROPERTIES \
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), \
0, NULL, sys_var::PARSE_EARLY
-#warning move PARSE_EARLY where it belongs
static Sys_var_mybool Sys_pfs_enabled(
"performance_schema",
@@ -399,7 +392,7 @@ static bool check_charset(sys_var *self, THD *thd, set_var *var)
else if (!(var->save_result.ptr= get_charset_by_csname(res->c_ptr(),
MY_CS_PRIMARY,
MYF(0))) &&
- !(var->save_result.ptr= get_old_charset_by_name(res->c_ptr())))
+ !(var->save_result.ptr=get_old_charset_by_name(res->c_ptr())))
{
ErrConvString err(res);
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
@@ -1685,7 +1678,7 @@ static Sys_var_ulong Sys_trans_prealloc_size(
static const char *thread_handling_names[]=
{
"one-thread-per-connection", "no-threads",
-#if HAVE_POOL_OF_THREADS == 1
+#ifdef HAVE_POOL_OF_THREADS
"pool-of-threads",
#endif
0
@@ -1693,9 +1686,9 @@ static const char *thread_handling_names[]=
static Sys_var_enum Sys_thread_handling(
"thread_handling",
"Define threads usage for handling queries, one of "
- "one-thread-per-connection, no-threads, "
-#if HAVE_POOL_OF_THREADS == 1
- "pool-of-threads"
+ "one-thread-per-connection, no-threads"
+#ifdef HAVE_POOL_OF_THREADS
+ ", pool-of-threads"
#endif
, READ_ONLY GLOBAL_VAR(thread_handling), CMD_LINE(REQUIRED_ARG),
thread_handling_names, DEFAULT(0));
@@ -2024,7 +2017,7 @@ static Sys_var_ulong Sys_thread_cache_size(
GLOBAL_VAR(thread_cache_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 16384), DEFAULT(0), BLOCK_SIZE(1));
-#if HAVE_POOL_OF_THREADS == 1
+#ifdef HAVE_POOL_OF_THREADS
static Sys_var_ulong Sys_thread_pool_size(
"thread_pool_size",
"How many threads we should create to handle query requests in "
@@ -3125,13 +3118,13 @@ static Sys_var_tz Sys_time_zone(
SESSION_VAR(time_zone), NO_CMD_LINE,
DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG);
-const char *plugin_maturity_names[]=
+export const char *plugin_maturity_names[]=
{ "unknown", "experimental", "alpha", "beta", "gamma", "stable", 0 };
static Sys_var_enum Sys_plugin_maturity(
"plugin_maturity",
"The lowest desirable plugin maturity. Plugins less mature than "
"that will not be installed or loaded.",
- READ_ONLY GLOBAL_VAR(server_maturity), CMD_LINE(REQUIRED_ARG),
+ READ_ONLY GLOBAL_VAR(plugin_maturity), CMD_LINE(REQUIRED_ARG),
plugin_maturity_names, DEFAULT(MariaDB_PLUGIN_MATURITY_UNKNOWN));
static Sys_var_ulong Sys_deadlock_search_depth_short(
@@ -3172,7 +3165,6 @@ static Sys_var_uint Sys_extra_port(
"one-thread-per-connection manner. 0 means don't use another port",
READ_ONLY GLOBAL_VAR(mysqld_extra_port), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1));
-#warning generalize that
static Sys_var_ulong Sys_extra_max_connections(
"extra_max_connections", "The number of connections on extra-port",
@@ -3207,8 +3199,8 @@ static Sys_var_set Sys_log_slow_filter(
"slave, filesort, filesort_on_disk, full_join, full_scan, query_cache, "
"query_cache_miss, tmp_table, tmp_table_on_disk",
SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
- log_slow_filter_names, DEFAULT(QPLAN_ALWAYS_SET));
-#warning fix log-slow-slave-statements and log-slow-admin-statements
+ log_slow_filter_names,
+ DEFAULT(MAX_SET(array_elements(log_slow_filter_names)-1)));
static Sys_var_ulong Sys_log_slow_rate_limit(
"log_slow_rate_limit",
@@ -3222,7 +3214,7 @@ static const char *log_slow_verbosity_names[]= { "innodb", "query_plan", 0 };
static Sys_var_set Sys_log_slow_verbosity(
"log_slow_verbosity",
"log-slow-verbosity=[value[,value ...]] where value is one of "
- "'innodb', 'query_plan'"
+ "'innodb', 'query_plan'",
SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
log_slow_verbosity_names, DEFAULT(LOG_SLOW_VERBOSITY_INIT));
@@ -3234,6 +3226,15 @@ static Sys_var_ulong Sys_join_cache_level(
SESSION_VAR(join_cache_level), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 8), DEFAULT(1), BLOCK_SIZE(1));
+static const char *optimizer_use_mrr_names[]= {"auto", "force", "disable", 0};
+static Sys_var_enum Sys_optimizer_use_mrr(
+ "optimizer_use_mrr", "Whether the server should use "
+ "multi-read-range optimization when resolving queries, "
+ "one of AUTO (as appropriate), FORCE (always where applicable), "
+ "DISABLE (never)",
+ SESSION_VAR(optimizer_use_mrr), CMD_LINE(REQUIRED_ARG),
+ optimizer_use_mrr_names, DEFAULT(1));
+
static Sys_var_ulong Sys_mrr_buffer_size(
"mrr_buffer_size",
"Size of buffer to use when using MRR with range access",
@@ -3249,7 +3250,7 @@ static Sys_var_ulong Sys_rowid_merge_buff_size(
"rowid_merge_buff_size",
"The size of the buffers used [NOT] IN evaluation via partial matching",
SESSION_VAR(rowid_merge_buff_size), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(0, MAX_MEM_TABLE_SIZE/2), DEFAULT(8*1024*1024),
+ VALID_RANGE(0, ((ulonglong)~(intptr)0)/2), DEFAULT(8*1024*1024),
BLOCK_SIZE(1));
static Sys_var_mybool Sys_userstat(
@@ -3257,4 +3258,4 @@ static Sys_var_mybool Sys_userstat(
"Enables statistics gathering for USER_STATISTICS, CLIENT_STATISTICS, "
"INDEX_STATISTICS and TABLE_STATISTICS tables in the INFORMATION_SCHEMA",
GLOBAL_VAR(opt_userstat_running),
- CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index e0769836e61..25ad412e62c 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -693,7 +693,7 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
mysql_mutex_unlock(&LOCK_global_system_variables);
if (!key_cache->key_cache_inited)
- error= ha_init_key_cache(0, key_cache);
+ error= ha_init_key_cache(0, key_cache, 0);
else
error= ha_resize_key_cache(key_cache);
@@ -705,7 +705,7 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
static bool update_keycache(THD *thd, KEY_CACHE *key_cache,
ptrdiff_t offset, ulonglong new_value,
- (int)(*)(KEY_CACHE *) func)
+ int (*func)(KEY_CACHE *))
{
bool error= false;
DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size));
@@ -987,7 +987,7 @@ public:
global_var(ulonglong)= def_val;
DBUG_ASSERT(typelib.count > 0);
DBUG_ASSERT(typelib.count <= 64);
- DBUG_ASSERT(def_val < MAX_SET(typelib.count));
+ DBUG_ASSERT(def_val <= MAX_SET(typelib.count));
DBUG_ASSERT(size == sizeof(ulonglong));
}
bool do_check(THD *thd, set_var *var)
@@ -1130,7 +1130,7 @@ public:
plugin_ref oldval= *valptr;
if (oldval != newval)
{
- *valptr= my_plugin_lock(NULL, &newval);
+ *valptr= my_plugin_lock(NULL, newval);
plugin_unlock(NULL, oldval);
}
}
@@ -1149,7 +1149,7 @@ public:
void session_save_default(THD *thd, set_var *var)
{
plugin_ref plugin= global_var(plugin_ref);
- var->save_result.plugin= my_plugin_lock(thd, &plugin);
+ var->save_result.plugin= my_plugin_lock(thd, plugin);
}
void global_save_default(THD *thd, set_var *var)
{
@@ -1164,7 +1164,7 @@ public:
plugin= my_plugin_lock_by_name(thd, &pname, plugin_type);
DBUG_ASSERT(plugin);
- var->save_result.plugin= my_plugin_lock(thd, &plugin);
+ var->save_result.plugin= my_plugin_lock(thd, plugin);
}
bool check_update_type(Item_result type)
{ return type != STRING_RESULT; }
@@ -1508,12 +1508,12 @@ public:
{ return false; }
bool session_update(THD *thd, set_var *var)
{
- session_var(thd, void*)= var->save_result.ptr;
+ session_var(thd, const void*)= var->save_result.ptr;
return false;
}
bool global_update(THD *thd, set_var *var)
{
- global_var(void*)= var->save_result.ptr;
+ global_var(const void*)= var->save_result.ptr;
return false;
}
void session_save_default(THD *thd, set_var *var)
diff --git a/sql/table.cc b/sql/table.cc
index 2bde110f57f..a7fd0715f0f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1726,7 +1726,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
}
if (parse_engine_table_options(thd, handler_file->partition_ht(), share))
goto free_and_err;
- my_free(buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(buff);
if (share->found_next_number_field)
{
@@ -1790,7 +1790,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
DBUG_RETURN (0);
free_and_err:
- my_free(buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(buff);
err:
share->error= error;
share->open_errno= my_errno;
@@ -1869,64 +1869,22 @@ bool fix_vcol_expr(THD *thd,
{
Virtual_column_info *vcol_info= vcol_field->vcol_info;
Item* func_expr= vcol_info->expr_item;
- uint dir_length, home_dir_length;
bool result= TRUE;
TABLE_LIST tables;
- TABLE_LIST *save_table_list, *save_first_table, *save_last_table;
int error;
- Name_resolution_context *context;
const char *save_where;
- char* db_name;
- char db_name_string[FN_REFLEN];
- bool save_use_only_table_context;
Field **ptr, *field;
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
DBUG_ASSERT(func_expr);
DBUG_ENTER("fix_vcol_expr");
- /*
- Set-up the TABLE_LIST object to be a list with a single table
- Set the object to zero to create NULL pointers and set alias
- and real name to table name and get database name from file name.
- */
-
- bzero((void*)&tables, sizeof(TABLE_LIST));
- tables.alias= tables.table_name= (char*) table->s->table_name.str;
- tables.table= table;
- tables.next_local= 0;
- tables.next_name_resolution_table= 0;
- strmov(db_name_string, table->s->normalized_path.str);
- dir_length= dirname_length(db_name_string);
- db_name_string[dir_length - 1]= 0;
- home_dir_length= dirname_length(db_name_string);
- db_name= &db_name_string[home_dir_length];
- tables.db= db_name;
-
thd->mark_used_columns= MARK_COLUMNS_NONE;
- context= thd->lex->current_context();
- table->map= 1; //To ensure correct calculation of const item
- table->get_fields_in_item_tree= TRUE;
- save_table_list= context->table_list;
- save_first_table= context->first_name_resolution_table;
- save_last_table= context->last_name_resolution_table;
- context->table_list= &tables;
- context->first_name_resolution_table= &tables;
- context->last_name_resolution_table= NULL;
- func_expr->walk(&Item::change_context_processor, 0, (uchar*) context);
save_where= thd->where;
thd->where= "virtual column function";
- /* Save the context before fixing the fields*/
- save_use_only_table_context= thd->lex->use_only_table_context;
- thd->lex->use_only_table_context= TRUE;
/* Fix fields referenced to by the virtual column function */
error= func_expr->fix_fields(thd, (Item**)0);
- /* Restore the original context*/
- thd->lex->use_only_table_context= save_use_only_table_context;
- context->table_list= save_table_list;
- context->first_name_resolution_table= save_first_table;
- context->last_name_resolution_table= save_last_table;
if (unlikely(error))
{
@@ -2030,6 +1988,8 @@ bool unpack_vcol_info_from_frm(THD *thd,
Query_arena backup_arena;
Query_arena *vcol_arena= 0;
Parser_state parser_state;
+ LEX *old_lex= thd->lex;
+ LEX lex;
DBUG_ENTER("unpack_vcol_info_from_frm");
DBUG_ASSERT(vcol_expr);
@@ -2082,6 +2042,9 @@ bool unpack_vcol_info_from_frm(THD *thd,
thd->set_n_backup_active_arena(vcol_arena, &backup_arena);
thd->stmt_arena= vcol_arena;
+ if (init_lex_with_single_table(thd, table, &lex))
+ goto end;
+
thd->lex->parse_vcol_expr= TRUE;
/*
@@ -2106,12 +2069,12 @@ bool unpack_vcol_info_from_frm(THD *thd,
err:
rc= TRUE;
- thd->lex->parse_vcol_expr= FALSE;
thd->free_items();
end:
thd->stmt_arena= backup_stmt_arena_ptr;
if (vcol_arena)
thd->restore_active_arena(vcol_arena, &backup_arena);
+ end_lex_with_single_table(thd, table, old_lex);
thd->variables.character_set_client= old_character_set_client;
DBUG_RETURN(rc);
@@ -2404,12 +2367,10 @@ partititon_err:
/* Check virtual columns against table's storage engine. */
if (share->vfields &&
((outparam->file &&
- !outparam->file->check_if_supported_virtual_columns()) ||
- (!outparam->file && share->db_type() &&
- share->db_type()->db_type == DB_TYPE_CSV_DB))) // Workaround for CSV
+ !outparam->file->check_if_supported_virtual_columns())))
{
my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN,
- MYF(0),
+ MYF(0), share->db_plugin ? plugin_name(share->db_plugin)->str :
"Specified storage engine");
error_reported= TRUE;
goto err;
@@ -5409,7 +5370,7 @@ void TABLE::mark_columns_needed_for_insert()
FALSE otherwise
*/
-bool st_table::mark_virtual_col(Field *field)
+bool TABLE::mark_virtual_col(Field *field)
{
bool res;
DBUG_ASSERT(field->vcol_info);
@@ -5451,7 +5412,7 @@ bool st_table::mark_virtual_col(Field *field)
be added to read_set either.
*/
-void st_table::mark_virtual_columns_for_write(bool insert_fl)
+void TABLE::mark_virtual_columns_for_write(bool insert_fl)
{
Field **vfield_ptr, *tmp_vfield;
bool bitmap_updated= FALSE;
@@ -5675,10 +5636,10 @@ Item_subselect *TABLE_LIST::containing_subselect()
DESCRIPTION
The parser collects the index hints for each table in a "tagged list"
(TABLE_LIST::index_hints). Using the information in this tagged list
- this function sets the members st_table::keys_in_use_for_query,
- st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
- st_table::force_index, st_table::force_index_order,
- st_table::force_index_group and st_table::covering_keys.
+ this function sets the members TABLE::keys_in_use_for_query,
+ TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by,
+ TABLE::force_index, TABLE::force_index_order,
+ TABLE::force_index_group and TABLE::covering_keys.
Current implementation of the runtime does not allow mixing FORCE INDEX
and USE INDEX, so this is checked here. Then the FORCE INDEX list
diff --git a/sql/table.h b/sql/table.h
index 2ba4b9dccd3..5b0a74a2828 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -676,7 +676,6 @@ struct TABLE_SHARE
bool is_view;
bool deleting; /* going to delete this table */
bool can_cmp_whole_record;
-#warning look at can_cmp_whole_record
ulong table_map_id; /* for row-based replication */
/*
@@ -1456,7 +1455,7 @@ struct TABLE_LIST
db_length= db_length_arg;
table_name= (char*) table_name_arg;
table_name_length= table_name_length_arg;
- alias= (char*) alias_arg;
+ alias= (char*) (alias_arg ? alias_arg : table_name_arg);
lock_type= lock_type_arg;
mdl_request.init(MDL_key::TABLE, db, table_name,
(lock_type >= TL_WRITE_ALLOW_WRITE) ?
diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h
index 6b372a285a2..52e6752ab70 100644
--- a/sql/thr_malloc.h
+++ b/sql/thr_malloc.h
@@ -18,7 +18,6 @@
#include "my_global.h" // uint, size_t
-typedef struct charset_info_st CHARSET_INFO;
typedef struct st_mem_root MEM_ROOT;
void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size);
diff --git a/storage/federated/CMakeLists.txt b/storage/federated/CMakeLists.txt
index 74f29b1f8bd..a0c601ab01a 100644
--- a/storage/federated/CMakeLists.txt
+++ b/storage/federated/CMakeLists.txt
@@ -21,4 +21,4 @@ IF(NOT WITH_FEDERATED AND NOT WITH_FEDERATED_STORAGE_ENGINE)
# mysqld and are optimized away by the linker.
SET(FEDERATED_SOURCES ${FEDERATED_SOURCES} ${CMAKE_SOURCE_DIR}/mysys/string.c)
ENDIF()
-MYSQL_ADD_PLUGIN(federated ${FEDERATED_SOURCES} STORAGE_ENGINE)
+MYSQL_ADD_PLUGIN(federated ${FEDERATED_SOURCES} STORAGE_ENGINE MODULE_ONLY)
diff --git a/storage/federatedx/federatedx_io.cc b/storage/federatedx/federatedx_io.cc
index 10023bec35b..3e79c3f6d76 100644
--- a/storage/federatedx/federatedx_io.cc
+++ b/storage/federatedx/federatedx_io.cc
@@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*#define MYSQL_SERVER 1*/
-#include "mysql_priv.h"
+#include "sql_priv.h"
#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index d6844fab2c6..a2ba496ea47 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -27,13 +27,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*#define MYSQL_SERVER 1*/
-#include "mysql_priv.h"
+#define MYSQL_SERVER 1
+#include "sql_priv.h"
#include <mysql/plugin.h>
#include "ha_federatedx.h"
#include "m_string.h"
+#include "sql_servers.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
@@ -420,7 +421,7 @@ int federatedx_io_mysql::actual_query(const char *buffer, uint length)
int error;
DBUG_ENTER("federatedx_io_mysql::actual_query");
- if (!mysql.master)
+ if (!mysql.net.vio)
{
if (!(mysql_init(&mysql)))
DBUG_RETURN(-1);
@@ -463,7 +464,7 @@ my_ulonglong federatedx_io_mysql::affected_rows() const
my_ulonglong federatedx_io_mysql::last_insert_id() const
{
- return mysql.last_used_con->insert_id;
+ return mysql.insert_id;
}
diff --git a/storage/federatedx/federatedx_io_null.cc b/storage/federatedx/federatedx_io_null.cc
index 49f93ab6546..4322422ef37 100644
--- a/storage/federatedx/federatedx_io_null.cc
+++ b/storage/federatedx/federatedx_io_null.cc
@@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*#define MYSQL_SERVER 1*/
-#include "mysql_priv.h"
+#include "sql_priv.h"
#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/federatedx/federatedx_txn.cc b/storage/federatedx/federatedx_txn.cc
index a6ca3acc744..84c7cd50e8d 100644
--- a/storage/federatedx/federatedx_txn.cc
+++ b/storage/federatedx/federatedx_txn.cc
@@ -26,19 +26,19 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef USE_PRAGMA_IMPLEMENTATION
+#pragma implementation // gcc: Class implementation
+#endif
-/*#define MYSQL_SERVER 1*/
-#include "mysql_priv.h"
+#define MYSQL_SERVER 1
+#include "sql_priv.h"
#include <mysql/plugin.h>
#include "ha_federatedx.h"
#include "m_string.h"
-
-#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
-#endif
-
+#include "table.h"
+#include "sql_servers.h"
federatedx_txn::federatedx_txn()
: txn_list(0), savepoint_level(0), savepoint_stmt(0), savepoint_next(0)
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 2749034cba2..0d79ffe38a6 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -307,25 +307,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-#define MYSQL_SERVER 1
-#include "mysql_priv.h"
-#include <mysql/plugin.h>
-
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
-#include "ha_federatedx.h"
-
-#include "m_string.h"
-
+#define MYSQL_SERVER 1
#include <mysql/plugin.h>
+#include "ha_federatedx.h"
+#include "sql_servers.h"
+#include "sql_analyse.h" // append_escaped()
+#include "sql_show.h" // append_identifier()
/* Variables for federatedx share methods */
-static HASH federatedx_open_tables; // To track open tables
-static HASH federatedx_open_servers; // To track open servers
-pthread_mutex_t federatedx_mutex; // To init the hash
+static HASH federatedx_open_tables; // To track open tables
+static HASH federatedx_open_servers; // To track open servers
+pthread_mutex_t federatedx_mutex; // To init the hash
const char ident_quote_char= '`'; // Character for quoting
// identifiers
const char value_quote_char= '\''; // Character for quoting
@@ -404,15 +400,15 @@ int federatedx_db_init(void *p)
if (pthread_mutex_init(&federatedx_mutex, MY_MUTEX_INIT_FAST))
goto error;
- if (!hash_init(&federatedx_open_tables, &my_charset_bin, 32, 0, 0,
- (hash_get_key) federatedx_share_get_key, 0, 0) &&
- !hash_init(&federatedx_open_servers, &my_charset_bin, 32, 0, 0,
- (hash_get_key) federatedx_server_get_key, 0, 0))
+ if (!my_hash_init(&federatedx_open_tables, &my_charset_bin, 32, 0, 0,
+ (my_hash_get_key) federatedx_share_get_key, 0, 0) &&
+ !my_hash_init(&federatedx_open_servers, &my_charset_bin, 32, 0, 0,
+ (my_hash_get_key) federatedx_server_get_key, 0, 0))
{
DBUG_RETURN(FALSE);
}
- VOID(pthread_mutex_destroy(&federatedx_mutex));
+ pthread_mutex_destroy(&federatedx_mutex);
error:
DBUG_RETURN(TRUE);
}
@@ -430,9 +426,9 @@ error:
int federatedx_done(void *p)
{
- hash_free(&federatedx_open_tables);
- hash_free(&federatedx_open_servers);
- VOID(pthread_mutex_destroy(&federatedx_mutex));
+ my_hash_free(&federatedx_open_tables);
+ my_hash_free(&federatedx_open_servers);
+ pthread_mutex_destroy(&federatedx_mutex);
return 0;
}
@@ -1498,7 +1494,7 @@ static FEDERATEDX_SERVER *get_server(FEDERATEDX_SHARE *share, TABLE *table)
fill_server(&mem_root, &tmp_server, share, table ? table->s->table_charset : 0);
- if (!(server= (FEDERATEDX_SERVER *) hash_search(&federatedx_open_servers,
+ if (!(server= (FEDERATEDX_SERVER *) my_hash_search(&federatedx_open_servers,
tmp_server.key,
tmp_server.key_length)))
{
@@ -1561,7 +1557,7 @@ static FEDERATEDX_SHARE *get_share(const char *table_name, TABLE *table)
goto error;
/* TODO: change tmp_share.scheme to LEX_STRING object */
- if (!(share= (FEDERATEDX_SHARE *) hash_search(&federatedx_open_tables,
+ if (!(share= (FEDERATEDX_SHARE *) my_hash_search(&federatedx_open_tables,
(uchar*) tmp_share.share_key,
tmp_share.
share_key_length)))
@@ -1620,7 +1616,7 @@ static int free_server(federatedx_txn *txn, FEDERATEDX_SERVER *server)
pthread_mutex_lock(&federatedx_mutex);
if ((destroy= !--server->use_count))
- hash_delete(&federatedx_open_servers, (uchar*) server);
+ my_hash_delete(&federatedx_open_servers, (uchar*) server);
pthread_mutex_unlock(&federatedx_mutex);
if (destroy)
@@ -1659,7 +1655,7 @@ static int free_share(federatedx_txn *txn, FEDERATEDX_SHARE *share)
pthread_mutex_lock(&federatedx_mutex);
if ((destroy= !--share->use_count))
- hash_delete(&federatedx_open_tables, (uchar*) share);
+ my_hash_delete(&federatedx_open_tables, (uchar*) share);
pthread_mutex_unlock(&federatedx_mutex);
if (destroy)
@@ -1965,7 +1961,6 @@ int ha_federatedx::write_row(uchar *buf)
values_string.length(0);
insert_field_value_string.length(0);
- ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
@@ -2572,7 +2567,6 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index,
*result= 0; // In case of errors
index_string.length(0);
sql_query.length(0);
- ha_statistic_increment(&SSV::ha_read_key_count);
sql_query.append(share->select_query);
@@ -2708,7 +2702,6 @@ int ha_federatedx::read_range_next()
int ha_federatedx::index_next(uchar *buf)
{
DBUG_ENTER("ha_federatedx::index_next");
- ha_statistic_increment(&SSV::ha_read_next_count);
DBUG_RETURN(read_next(buf, stored_result));
}
@@ -2965,7 +2958,6 @@ int ha_federatedx::rnd_pos(uchar *buf, uchar *pos)
int retval;
FEDERATEDX_IO_RESULT *result= stored_result;
DBUG_ENTER("ha_federatedx::rnd_pos");
- ha_statistic_increment(&SSV::ha_read_rnd_count);
/* We have to move this to 'ref' to get things aligned */
bmove(ref, pos, ref_length);
@@ -3212,7 +3204,7 @@ int ha_federatedx::delete_all_rows()
ident_quote_char);
/* no need for savepoint in autocommit mode */
- if (!(ha_thd()->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (!(ha_thd()->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
txn->stmt_autocommit();
/*
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index 2820f8a6c29..96763f7ce31 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -32,6 +32,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface /* gcc class implementation */
+#endif
+
+//#include <mysql.h>
+#include <my_global.h>
+#include <thr_lock.h>
+#include "handler.h"
+
class federatedx_io;
/*
@@ -68,12 +77,6 @@ typedef struct st_fedrated_server {
that you can implement.
*/
-#ifdef USE_PRAGMA_INTERFACE
-#pragma interface /* gcc class implementation */
-#endif
-
-#include <mysql.h>
-
/*
handler::print_error has a case statement for error numbers.
This value is (10000) is far out of range and will envoke the
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index e993aa0d96a..93665c39482 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -274,7 +274,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ELSE()
# New plugin support, cross-platform , base name for shared module is "ha_innodb"
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
- DEFAULT
+ MODULE_ONLY
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY})
ENDIF()
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 067406b896b..c32d8fc4ae9 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2870,7 +2870,7 @@ innobase_rollback_to_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_rollback_to_savepoint_for_mysql(trx, name,
&mysql_binlog_cache_pos);
@@ -2901,7 +2901,7 @@ innobase_release_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_release_savepoint_for_mysql(trx, name);
@@ -2948,7 +2948,7 @@ innobase_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
char name[64];
- longlong2str((ulint)savepoint,name,36,1);
+ longlong2str((ulint)savepoint,name,36);
error = (int) trx_savepoint_for_mysql(trx, name, (ib_int64_t)0);
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 7b5b190bd57..4095c1fc594 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -13,6 +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(CMakeDependentOption)
+
SET(ARIA_SOURCES ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c
ma_rnext.c ma_rnext_same.c
ma_search.c ma_page.c ma_key_recover.c ma_key.c
@@ -82,3 +84,6 @@ IF (MSVC)
SET_TARGET_PROPERTIES(aria_chk aria_pack PROPERTIES LINK_FLAGS "setargv.obj")
ENDIF()
+CMAKE_DEPENDENT_OPTION(USE_ARIA_FOR_TMP_TABLES "Use Aria for temporary tables" ON
+ "WITH_ARIA_STORAGE_ENGINE" OFF)
+
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 27958285a2e..8227449679e 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -20,7 +20,6 @@
#endif
#define MYSQL_SERVER 1
-#include "mysql_priv.h"
#include <mysql/plugin.h>
#include <m_ctype.h>
#include <my_dir.h>
@@ -39,6 +38,13 @@ C_MODE_START
#include "ma_recovery.h"
C_MODE_END
+//#include "sql_priv.h"
+#include "protocol.h"
+#include "sql_class.h"
+#include "key.h"
+#include "log.h"
+#include "sql_parse.h"
+
/*
Note that in future versions, only *transactional* Maria tables can
rollback, so this flag should be up or down conditionally.
@@ -262,12 +268,12 @@ static MYSQL_SYSVAR_ENUM(sync_log_dir, sync_log_dir, PLUGIN_VAR_RQCMDARG,
"\"always\").", NULL, NULL, TRANSLOG_SYNC_DIR_NEWFILE,
&maria_sync_log_dir_typelib);
-#ifdef USE_MARIA_FOR_TMP_TABLES
-#define USE_MARIA_FOR_TMP_TABLES_VAL 1
+#ifdef USE_ARIA_FOR_TMP_TABLES
+#define USE_ARIA_FOR_TMP_TABLES_VAL 1
#else
-#define USE_MARIA_FOR_TMP_TABLES_VAL 0
+#define USE_ARIA_FOR_TMP_TABLES_VAL 0
#endif
-my_bool use_maria_for_temp_tables= USE_MARIA_FOR_TMP_TABLES_VAL;
+my_bool use_maria_for_temp_tables= USE_ARIA_FOR_TMP_TABLES_VAL;
static MYSQL_SYSVAR_BOOL(used_for_temp_tables,
use_maria_for_temp_tables, PLUGIN_VAR_READONLY | PLUGIN_VAR_NOCMDOPT,
@@ -768,7 +774,7 @@ static int maria_create_trn_for_mysql(MARIA_HA *info)
if (unlikely(!trn))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
THD_TRN= trn;
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+ if (thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
trans_register_ha(thd, TRUE, maria_hton);
}
_ma_set_trn_for_table(info, trn);
@@ -972,7 +978,7 @@ int ha_maria::dump(THD * thd, int fd)
}
err:
- my_free((uchar*) buf, MYF(0));
+ my_free(buf);
return error;
}
#endif /* HAVE_REPLICATION */
@@ -1015,11 +1021,11 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked)
file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref;
if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE))
- VOID(maria_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0));
+ maria_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0);
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
- VOID(maria_extra(file, HA_EXTRA_WAIT_LOCK, 0));
+ maria_extra(file, HA_EXTRA_WAIT_LOCK, 0);
if ((data_file_type= file->s->data_file_type) != STATIC_RECORD)
int_table_flags |= HA_REC_NOT_IN_SEQ;
if (!file->s->base.born_transactional)
@@ -1215,131 +1221,6 @@ int ha_maria::analyze(THD *thd, HA_CHECK_OPT * check_opt)
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
}
-
-int ha_maria::restore(THD * thd, HA_CHECK_OPT *check_opt)
-{
- HA_CHECK_OPT tmp_check_opt;
- char *backup_dir= thd->lex->backup_dir;
- char src_path[FN_REFLEN], dst_path[FN_REFLEN];
- char table_name[FN_REFLEN];
- int error;
- const char *errmsg;
- DBUG_ENTER("restore");
-
- VOID(tablename_to_filename(table->s->table_name.str, table_name,
- sizeof(table_name)));
-
- if (fn_format_relative_to_data_home(src_path, table_name, backup_dir,
- MARIA_NAME_DEXT))
- DBUG_RETURN(HA_ADMIN_INVALID);
-
- strxmov(dst_path, table->s->normalized_path.str, MARIA_NAME_DEXT, NullS);
- if (my_copy(src_path, dst_path, MYF(MY_WME)))
- {
- error= HA_ADMIN_FAILED;
- errmsg= "Failed in my_copy (Error %d)";
- goto err;
- }
-
- tmp_check_opt.init();
- tmp_check_opt.flags |= T_VERY_SILENT | T_CALC_CHECKSUM | T_QUICK;
- DBUG_RETURN(repair(thd, &tmp_check_opt));
-
-err:
- {
- /*
- Don't allocate param on stack here as this may be huge and it's
- also allocated by repair()
- */
- HA_CHECK *param;
- if (!(param= (HA_CHECK*) my_malloc(sizeof(*param), MYF(MY_WME | MY_FAE))))
- DBUG_RETURN(error);
- maria_chk_init(param);
- param->thd= thd;
- param->op_name= "restore";
- param->db_name= table->s->db.str;
- param->table_name= table->s->table_name.str;
- param->testflag= 0;
- _ma_check_print_error(param, errmsg, my_errno);
- my_free(param, MYF(0));
- DBUG_RETURN(error);
- }
-}
-
-
-int ha_maria::backup(THD * thd, HA_CHECK_OPT *check_opt)
-{
- char *backup_dir= thd->lex->backup_dir;
- char src_path[FN_REFLEN], dst_path[FN_REFLEN];
- char table_name[FN_REFLEN];
- int error;
- const char *errmsg;
- DBUG_ENTER("ha_maria::backup");
-
- VOID(tablename_to_filename(table->s->table_name.str, table_name,
- sizeof(table_name)));
-
- if (fn_format_relative_to_data_home(dst_path, table_name, backup_dir,
- reg_ext))
- {
- errmsg= "Failed in fn_format() for .frm file (errno: %d)";
- error= HA_ADMIN_INVALID;
- goto err;
- }
-
- strxmov(src_path, table->s->normalized_path.str, reg_ext, NullS);
- if (my_copy(src_path, dst_path,
- MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)))
- {
- error= HA_ADMIN_FAILED;
- errmsg= "Failed copying .frm file (errno: %d)";
- goto err;
- }
-
- /* Change extension */
- if (fn_format_relative_to_data_home(dst_path, table_name, backup_dir,
- MARIA_NAME_DEXT))
- {
- errmsg= "Failed in fn_format() for .MYD file (errno: %d)";
- error= HA_ADMIN_INVALID;
- goto err;
- }
-
- strxmov(src_path, table->s->normalized_path.str, MARIA_NAME_DEXT, NullS);
- if (_ma_flush_table_files(file, MARIA_FLUSH_DATA, FLUSH_FORCE_WRITE,
- FLUSH_KEEP))
- {
- error= HA_ADMIN_FAILED;
- errmsg= "Failed in flush (Error %d)";
- goto err;
- }
- if (my_copy(src_path, dst_path,
- MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)))
- {
- errmsg= "Failed copying .MYD file (errno: %d)";
- error= HA_ADMIN_FAILED;
- goto err;
- }
- DBUG_RETURN(HA_ADMIN_OK);
-
-err:
- {
- HA_CHECK &param= *(HA_CHECK*) thd->alloc(sizeof(param));
- if (!&param)
- return HA_ADMIN_INTERNAL_ERROR;
-
- maria_chk_init(&param);
- param.thd= thd;
- param.op_name= "backup";
- param.db_name= table->s->db.str;
- param.table_name= table->s->table_name.str;
- param.testflag= 0;
- _ma_check_print_error(&param, errmsg, my_errno);
- DBUG_RETURN(error);
- }
-}
-
-
int ha_maria::repair(THD * thd, HA_CHECK_OPT *check_opt)
{
int error;
@@ -1497,7 +1378,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
strmov(fixed_name, share->open_file_name.str);
// Don't lock tables if we have used LOCK TABLE
- if (!thd->locked_tables &&
+ if (!thd->locked_tables_mode &&
maria_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK))
{
_ma_check_print_error(param, ER(ER_CANT_LOCK), my_errno);
@@ -1600,7 +1481,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
(local_testflag &
T_STATISTICS ? UPDATE_STAT : 0));
info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
- HA_STATUS_CONST, 0);
+ HA_STATUS_CONST);
if (rows != file->state->records && !(param->testflag & T_VERY_SILENT))
{
char llbuff[22], llbuff2[22];
@@ -1620,7 +1501,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
}
pthread_mutex_unlock(&share->intern_lock);
thd_proc_info(thd, old_proc_info);
- if (!thd->locked_tables)
+ if (!thd->locked_tables_mode)
maria_lock_database(file, F_UNLCK);
/* Reset trn, that may have been set by repair */
@@ -2087,9 +1968,9 @@ bool ha_maria::check_and_repair(THD *thd)
check_opt.flags |= T_QUICK;
old_query= thd->query_string;
- pthread_mutex_lock(&LOCK_thread_count);
+ mysql_mutex_lock(&LOCK_thread_count);
thd->query_string= table->s->table_name;
- pthread_mutex_unlock(&LOCK_thread_count);
+ mysql_mutex_unlock(&LOCK_thread_count);
if (!(crashed= maria_is_crashed(file)))
{
@@ -2107,9 +1988,9 @@ bool ha_maria::check_and_repair(THD *thd)
if (repair(thd, &check_opt))
error= 1;
}
- pthread_mutex_lock(&LOCK_thread_count);
+ mysql_mutex_lock(&LOCK_thread_count);
thd->query_string= old_query;
- pthread_mutex_unlock(&LOCK_thread_count);
+ mysql_mutex_unlock(&LOCK_thread_count);
DBUG_RETURN(error);
}
@@ -2333,11 +2214,6 @@ void ha_maria::position(const uchar *record)
int ha_maria::info(uint flag)
{
- return info(flag, table->s->tmp_table == NO_TMP_TABLE);
-}
-
-int ha_maria::info(uint flag, my_bool lock_table_share)
-{
MARIA_INFO maria_info;
char name_buff[FN_REFLEN];
@@ -2364,8 +2240,6 @@ int ha_maria::info(uint flag, my_bool lock_table_share)
stats.mrr_length_per_rec= maria_info.reflength + 8; // 8 = max(sizeof(void *))
/* Update share */
- if (lock_table_share)
- pthread_mutex_lock(&share->mutex);
share->keys_in_use.set_prefix(share->keys);
share->keys_in_use.intersect_extended(maria_info.key_map);
share->keys_for_keyread.intersect(share->keys_in_use);
@@ -2377,8 +2251,6 @@ int ha_maria::info(uint flag, my_bool lock_table_share)
for (end= to+ share->key_parts ; to < end ; to++, from++)
*to= (ulong) (*from + 0.5);
}
- if (lock_table_share)
- pthread_mutex_unlock(&share->mutex);
/*
Set data_file_name and index_file_name to point at the symlink value
@@ -2472,8 +2344,8 @@ int ha_maria::delete_all_rows()
(void) translog_log_debug_info(file->trn, LOGREC_DEBUG_INFO_QUERY,
(uchar*) thd->query(), thd->query_length());
if (file->s->now_transactional &&
- ((table->in_use->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) ||
- table->in_use->locked_tables))
+ ((table->in_use->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) ||
+ table->in_use->locked_tables_mode))
{
/*
We are not in autocommit mode or user have done LOCK TABLES.
@@ -2602,7 +2474,7 @@ int ha_maria::external_lock(THD *thd, int lock_type)
This is a bit excessive, ACID requires this only if there are some
changes to commit (rollback shouldn't be tested).
*/
- DBUG_ASSERT(!thd->main_da.is_sent ||
+ DBUG_ASSERT(!thd->stmt_da->is_sent ||
thd->killed == THD::KILL_CONNECTION);
/* autocommit ? rollback a transaction */
#ifdef MARIA_CANNOT_ROLLBACK
@@ -2610,7 +2482,7 @@ int ha_maria::external_lock(THD *thd, int lock_type)
DBUG_RETURN(1);
THD_TRN= 0;
#else
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
trnman_rollback_trn(trn);
DBUG_PRINT("info", ("THD_TRN set to 0x0"));
@@ -2693,23 +2565,19 @@ int ha_maria::implicit_commit(THD *thd, bool new_trn)
int error= 0;
TABLE *table;
DBUG_ENTER("ha_maria::implicit_commit");
- if (!new_trn && thd->locked_tables)
+ if (!maria_hton)
+ DBUG_RETURN(0);
+ if (!new_trn && (thd->locked_tables_mode == LTM_LOCK_TABLES ||
+ thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES))
{
/*
- "we are under LOCK TABLES" <=> "we shouldn't commit".
- As thd->locked_tables is true, we are either under LOCK TABLES, or in
- prelocking; prelocking can be under LOCK TABLES, or not (and in this
- latter case only we should commit).
+ No commit inside LOCK TABLES.
+
Note that we come here only at the end of the top statement
(dispatch_command()), we are never committing inside a sub-statement./
*/
- enum prelocked_mode_type prelocked_mode= thd->prelocked_mode;
- if ((prelocked_mode == NON_PRELOCKED) ||
- (prelocked_mode == PRELOCKED_UNDER_LOCK_TABLES))
- {
- DBUG_PRINT("info", ("locked_tables, skipping"));
- DBUG_RETURN(0);
- }
+ DBUG_PRINT("info", ("locked_tables, skipping"));
+ DBUG_RETURN(0);
}
if ((trn= THD_TRN) != NULL)
{
@@ -2780,10 +2648,10 @@ THR_LOCK_DATA **ha_maria::store_lock(THD *thd,
that only does reading that are not SELECT.
*/
if (lock_type <= TL_READ_HIGH_PRIORITY &&
- !thd->current_stmt_binlog_row_based &&
+ !thd->is_current_stmt_binlog_format_row() &&
(sql_command != SQLCOM_SELECT &&
sql_command != SQLCOM_LOCK_TABLES) &&
- (thd->options & OPTION_BIN_LOG) &&
+ (thd->variables.option_bits & OPTION_BIN_LOG) &&
mysql_bin_log.is_open())
lock_type= TL_READ_NO_INSERT;
else if (lock_type == TL_WRITE_CONCURRENT_INSERT)
@@ -2953,7 +2821,7 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
0, (MARIA_UNIQUEDEF *) 0,
&create_info, create_flags);
- my_free((uchar*) recinfo, MYF(0));
+ my_free(recinfo);
DBUG_RETURN(error);
}
@@ -3111,7 +2979,7 @@ static int maria_commit(handlerton *hton __attribute__ ((unused)),
trnman_set_flags(trn, trnman_get_flags(trn) & ~TRN_STATE_INFO_LOGGED);
/* statement or transaction ? */
- if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && !all)
+ if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && !all)
DBUG_RETURN(0); // end of statement
DBUG_PRINT("info", ("THD_TRN set to 0x0"));
THD_TRN= 0;
@@ -3126,7 +2994,7 @@ static int maria_rollback(handlerton *hton __attribute__ ((unused)),
DBUG_ENTER("maria_rollback");
trnman_reset_locked_tables(trn, 0);
/* statement or transaction ? */
- if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && !all)
+ if ((thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && !all)
{
trnman_rollback_statement(trn);
DBUG_RETURN(0); // end of statement
@@ -3335,6 +3203,11 @@ static int ha_maria_init(void *p)
int res;
copy_variable_aliases();
const char *log_dir= maria_data_root;
+
+#ifdef HAVE_PSI_INTERFACE
+ init_aria_psi_keys();
+#endif
+
maria_hton= (handlerton *)p;
maria_hton->state= SHOW_OPTION_YES;
maria_hton->db_type= DB_TYPE_UNKNOWN;
@@ -3589,9 +3462,9 @@ static void update_log_file_size(MYSQL_THD thd,
SHOW_VAR status_variables[]= {
- {"pagecache_blocks_not_flushed", (char*) &maria_pagecache_var.global_blocks_changed, SHOW_LONG_NOFLUSH},
- {"pagecache_blocks_unused", (char*) &maria_pagecache_var.blocks_unused, SHOW_LONG_NOFLUSH},
- {"pagecache_blocks_used", (char*) &maria_pagecache_var.blocks_used, SHOW_LONG_NOFLUSH},
+ {"pagecache_blocks_not_flushed", (char*) &maria_pagecache_var.global_blocks_changed, SHOW_LONG},
+ {"pagecache_blocks_unused", (char*) &maria_pagecache_var.blocks_unused, SHOW_LONG},
+ {"pagecache_blocks_used", (char*) &maria_pagecache_var.blocks_used, SHOW_LONG},
{"pagecache_read_requests", (char*) &maria_pagecache_var.global_cache_r_requests, SHOW_LONGLONG},
{"pagecache_reads", (char*) &maria_pagecache_var.global_cache_read, SHOW_LONGLONG},
{"pagecache_write_requests", (char*) &maria_pagecache_var.global_cache_w_requests, SHOW_LONGLONG},
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 605ad1d3a20..1e540fd5e7b 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -1,3 +1,5 @@
+#ifndef HA_MARIA_INCLUDED
+#define HA_MARIA_INCLUDED
/* Copyright (C) 2006,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
@@ -13,9 +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 */
-#ifndef HA_MARIA_INCLUDED
-#define HA_MARIA_INCLUDED
-
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
@@ -23,6 +22,8 @@
/* class for the maria handler */
#include <maria.h>
+#include "handler.h"
+#include "table.h"
#define HA_RECOVER_NONE 0 /* No automatic recover */
#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */
diff --git a/storage/maria/lockman.c b/storage/maria/lockman.c
index d6d4dcd44e6..56d2e261da4 100644
--- a/storage/maria/lockman.c
+++ b/storage/maria/lockman.c
@@ -541,7 +541,7 @@ void lockman_destroy(LOCKMAN *lm)
if (el->hashnr & 1)
lf_alloc_direct_free(&lm->alloc, el);
else
- my_free((void *)el, MYF(0));
+ my_free((void *)el);
el= (LOCK *)next;
}
lf_alloc_destroy(&lm->alloc);
@@ -571,7 +571,7 @@ static void initialize_bucket(LOCKMAN *lm, LOCK * volatile *node,
DBUG_ASSERT(res & (ALREADY_HAVE_THE_LOCK | RESOURCE_WAS_UNLOCKED));
if (res & ALREADY_HAVE_THE_LOCK)
{
- my_free((void *)dummy, MYF(0));
+ my_free((void *)dummy);
dummy= cur;
}
my_atomic_casptr((void **)node, (void **)(char*) &tmp, dummy);
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index c0763b0612d..83e0d276417 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -271,7 +271,7 @@ my_bool _ma_bitmap_end(MARIA_SHARE *share)
pthread_mutex_destroy(&share->bitmap.bitmap_lock);
pthread_cond_destroy(&share->bitmap.bitmap_cond);
delete_dynamic(&share->bitmap.pinned_pages);
- my_free(share->bitmap.map, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(share->bitmap.map);
share->bitmap.map= 0;
return res;
}
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index fd02e2ac0ec..df5a16d7efd 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -541,10 +541,10 @@ err:
void _ma_end_block_record(MARIA_HA *info)
{
DBUG_ENTER("_ma_end_block_record");
- my_free(info->cur_row.empty_bits, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->cur_row.empty_bits);
delete_dynamic(&info->bitmap_blocks);
- my_free(info->cur_row.extents, MYF(MY_ALLOW_ZERO_PTR));
- my_free(info->blob_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->cur_row.extents);
+ my_free(info->blob_buff);
/*
The data file is closed, when needed, in ma_once_end_block_record().
The following protects us from doing an extra, not allowed, close
@@ -2787,8 +2787,7 @@ static my_bool write_block_record(MARIA_HA *info,
if (!*blob_lengths) /* Null or "" */
continue;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((uchar*) &tmp_pos, record + column->offset + length,
- sizeof(char*));
+ memcpy(&tmp_pos, record + column->offset + length, sizeof(char*));
memcpy(data, tmp_pos, *blob_lengths);
data+= *blob_lengths;
/*
@@ -2876,8 +2875,7 @@ static my_bool write_block_record(MARIA_HA *info,
{
uint length;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((uchar *) &blob_pos, record + column->offset + length,
- sizeof(char*));
+ memcpy(&blob_pos, record + column->offset + length, sizeof(char*));
length= *blob_lengths % FULL_PAGE_SIZE(block_size); /* tail size */
if (length != *blob_lengths)
blob_full_pages_exists= 1;
@@ -3235,8 +3233,7 @@ static my_bool write_block_record(MARIA_HA *info,
blob_length-= (blob_length % FULL_PAGE_SIZE(block_size));
if (blob_length)
{
- memcpy_fixed((uchar*) &log_array_pos->str,
- record + tmp_column->offset + length,
+ memcpy(&log_array_pos->str, record + tmp_column->offset + length,
sizeof(uchar*));
log_array_pos->length= blob_length;
log_entry_length+= blob_length;
@@ -3264,7 +3261,7 @@ static my_bool write_block_record(MARIA_HA *info,
(uint) (log_array_pos - log_array),
log_array, log_data, NULL);
if (log_array != tmp_log_array)
- my_free(log_array, MYF(0));
+ my_free(log_array);
if (error)
goto disk_err;
}
@@ -3401,8 +3398,7 @@ static my_bool write_block_record(MARIA_HA *info,
if (!*blob_lengths) /* Null or "" */
continue;
length= column->length - portable_sizeof_char_ptr;
- memcpy_fixed((uchar*) &blob_pos, record + column->offset + length,
- sizeof(char*));
+ memcpy(&blob_pos, record + column->offset + length, sizeof(char*));
/* remove tail part */
blob_length= *blob_lengths;
if (block[block->sub_blocks - 1].used & BLOCKUSED_TAIL)
@@ -4875,8 +4871,8 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
}
memcpy(field_pos, field_length_data, column_size_length);
- memcpy_fixed(field_pos + column_size_length, (uchar *) &blob_buffer,
- sizeof(char*));
+ memcpy(field_pos + column_size_length, (uchar *) &blob_buffer,
+ sizeof(char*));
field_length_data+= column_size_length;
/*
@@ -5116,7 +5112,7 @@ my_bool _ma_cmp_block_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
error= _ma_unique_comp(def, record, old_record, def->null_are_equal);
if (info->s->base.blobs)
{
- my_free(info->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->rec_buff);
info->rec_buff= org_rec_buff;
info->rec_buff_size= org_rec_buff_size;
}
@@ -5180,11 +5176,11 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info)
void _ma_scan_end_block_record(MARIA_HA *info)
{
DBUG_ENTER("_ma_scan_end_block_record");
- my_free(info->scan.bitmap_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->scan.bitmap_buff);
info->scan.bitmap_buff= 0;
if (info->scan_save)
{
- my_free(info->scan_save, MYF(0));
+ my_free(info->scan_save);
info->scan_save= 0;
}
DBUG_VOID_RETURN;
@@ -5706,8 +5702,8 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record,
if (blob_length)
{
uchar *blob_pos;
- memcpy_fixed(&blob_pos, record + column->offset + size_length,
- sizeof(blob_pos));
+ memcpy(&blob_pos, record + column->offset + size_length,
+ sizeof(blob_pos));
log_parts->str= blob_pos;
log_parts->length= blob_length;
row_length+= log_parts->length;
@@ -5889,15 +5885,13 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
{
uint size_length= column->length - portable_sizeof_char_ptr;
old_column_length= _ma_calc_blob_length(size_length, old_column_pos);
- memcpy_fixed((uchar*) &old_column_pos,
- oldrec + column->offset + size_length,
- sizeof(old_column_pos));
+ memcpy(&old_column_pos, oldrec + column->offset + size_length,
+ sizeof(old_column_pos));
if (!new_column_is_empty)
{
new_column_length= _ma_calc_blob_length(size_length, new_column_pos);
- memcpy_fixed((uchar*) &new_column_pos,
- newrec + column->offset + size_length,
- sizeof(old_column_pos));
+ memcpy(&new_column_pos, newrec + column->offset + size_length,
+ sizeof(old_column_pos));
}
break;
}
@@ -7119,7 +7113,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn,
&row_pos, undo_lsn, 0))
goto err;
- my_free(record, MYF(0));
+ my_free(record);
DBUG_RETURN(0);
err:
@@ -7127,7 +7121,7 @@ err:
if (info->non_flushable_state)
_ma_bitmap_flushable(info, -1);
_ma_unpin_all_pages_and_finalize_row(info, LSN_IMPOSSIBLE);
- my_free(record, MYF(0));
+ my_free(record);
DBUG_RETURN(1);
}
@@ -7265,7 +7259,7 @@ my_bool _ma_apply_undo_row_update(MARIA_HA *info, LSN undo_lsn,
{
uint size_length= column->length - portable_sizeof_char_ptr;
_ma_store_blob_length(orig_field_pos, size_length, field_length);
- memcpy_fixed(orig_field_pos + size_length, &header, sizeof(header));
+ memcpy(orig_field_pos + size_length, &header, sizeof(header));
header+= field_length;
break;
}
@@ -7294,7 +7288,7 @@ my_bool _ma_apply_undo_row_update(MARIA_HA *info, LSN undo_lsn,
error= 0;
end:
- my_free(current_record, MYF(0));
+ my_free(current_record);
DBUG_RETURN(error);
err:
diff --git a/storage/maria/ma_changed.c b/storage/maria/ma_changed.c
index 4d0964581f6..eb20db5669e 100644
--- a/storage/maria/ma_changed.c
+++ b/storage/maria/ma_changed.c
@@ -25,7 +25,7 @@ int maria_is_changed(MARIA_HA *info)
DBUG_ENTER("maria_is_changed");
if (fast_ma_readinfo(info))
DBUG_RETURN(-1);
- VOID(_ma_writeinfo(info,0));
+ _ma_writeinfo(info, 0);
result=(int) info->data_changed;
info->data_changed=0;
DBUG_PRINT("exit",("result: %d",result));
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 307befab5c7..41944753c98 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -1117,7 +1117,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
if (param->testflag & T_WRITE_LOOP && param->records % WRITE_COUNT == 0)
{
printf("%s\r", llstr(param->records, llbuff));
- VOID(fflush(stdout));
+ fflush(stdout);
}
/* Check if keys match the record */
@@ -1471,9 +1471,9 @@ static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend,
start_recpos= pos;
param->splits++;
- VOID(_ma_pack_get_block_info(info, &info->bit_buff, &block_info,
+ _ma_pack_get_block_info(info, &info->bit_buff, &block_info,
&info->rec_buff, &info->rec_buff_size, -1,
- start_recpos));
+ start_recpos);
pos=block_info.filepos+block_info.rec_len;
if (block_info.rec_len < (uint) share->min_pack_length ||
block_info.rec_len > (uint) share->max_pack_length)
@@ -2054,7 +2054,8 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend)
if (param->testflag & T_WRITE_LOOP)
{
- VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
+ fputs(" \r",stdout);
+ fflush(stdout);
}
if (param->records != share->state.state.records)
{
@@ -2185,11 +2186,11 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend)
llstr(param->max_found_trid, llbuff));
}
}
- my_free(record,MYF(0));
+ my_free(record);
DBUG_RETURN (error);
err:
- my_free(record,MYF(0));
+ my_free(record);
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1);
} /* maria_chk_data_link */
@@ -2678,7 +2679,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
if (param->testflag & T_WRITE_LOOP)
{
- VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
+ fputs(" \r",stdout); fflush(stdout);
}
if (my_chsize(share->kfile.file, share->state.state.key_file_length, 0, MYF(0)))
{
@@ -2708,7 +2709,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
}
}
- VOID(end_io_cache(&sort_info.new_info->rec_cache));
+ end_io_cache(&sort_info.new_info->rec_cache);
info->opt_flag&= ~WRITE_CACHE_USED;
/*
@@ -2779,8 +2780,8 @@ err:
maria_scan_end(sort_info.info);
_ma_reset_state(info);
- VOID(end_io_cache(&param->read_cache));
- VOID(end_io_cache(&sort_info.new_info->rec_cache));
+ end_io_cache(&param->read_cache);
+ end_io_cache(&sort_info.new_info->rec_cache);
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
sort_info.new_info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
/* this below could fail, shouldn't we detect error? */
@@ -2797,8 +2798,8 @@ err:
}
if (new_file >= 0)
{
- VOID(my_close(new_file,MYF(0)));
- VOID(my_delete(param->temp_filename, MYF(MY_WME)));
+ my_close(new_file,MYF(0));
+ my_delete(param->temp_filename, MYF(MY_WME));
}
maria_mark_crashed_on_repair(info);
}
@@ -2807,9 +2808,9 @@ err:
_ma_reenable_logging_for_table(info, FALSE);
restore_table_state_after_repair(info, &backup_share);
- my_free(sort_param.rec_buff, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.rec_buff);
+ my_free(sort_param.record);
+ my_free(sort_info.buff);
if (!got_error && (param->testflag & T_UNPACK))
restore_data_file_type(share);
share->state.changed|= (STATE_NOT_OPTIMIZED_KEYS | STATE_NOT_SORTED_PAGES |
@@ -3054,10 +3055,10 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
share->r_locks= share->w_locks= share->tot_locks= 0;
(void) _ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
pthread_mutex_lock(&share->intern_lock);
- VOID(my_close(share->kfile.file, MYF(MY_WME)));
+ my_close(share->kfile.file, MYF(MY_WME));
share->kfile.file = -1;
pthread_mutex_unlock(&share->intern_lock);
- VOID(my_close(new_file,MYF(MY_WME)));
+ my_close(new_file, MYF(MY_WME));
if (maria_change_to_newfile(share->index_file_name.str, MARIA_NAME_IEXT,
INDEX_TMP_EXT, sync_dir) ||
_ma_open_keyfile(share))
@@ -3090,9 +3091,9 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
DBUG_RETURN(0);
err:
- VOID(my_close(new_file,MYF(MY_WME)));
+ my_close(new_file, MYF(MY_WME));
err2:
- VOID(my_delete(param->temp_filename,MYF(MY_WME)));
+ my_delete(param->temp_filename,MYF(MY_WME));
DBUG_RETURN(-1);
} /* maria_sort_index */
@@ -3525,7 +3526,7 @@ int maria_filecopy(HA_CHECK *param, File to,File from,my_off_t start,
buff=tmp_buff; buff_length=IO_SIZE;
}
- VOID(my_seek(from,start,MY_SEEK_SET,MYF(0)));
+ my_seek(from, start, MY_SEEK_SET,MYF(0));
while (length > buff_length)
{
if (my_read(from, buff, buff_length, MYF(MY_NABP)) ||
@@ -3537,11 +3538,11 @@ int maria_filecopy(HA_CHECK *param, File to,File from,my_off_t start,
my_write(to, buff, (size_t) length,param->myf_rw))
goto err;
if (buff != tmp_buff)
- my_free(buff,MYF(0));
+ my_free(buff);
DBUG_RETURN(0);
err:
if (buff != tmp_buff)
- my_free(buff,MYF(0));
+ my_free(buff);
_ma_check_print_error(param,"Can't copy %s to tempfile, error %d",
type,my_errno);
DBUG_RETURN(1);
@@ -3902,7 +3903,8 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
if (param->testflag & T_WRITE_LOOP)
{
- VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
+ fputs(" \r",stdout);
+ fflush(stdout);
}
if (rep_quick && del+sort_info.dupp != share->state.state.del)
@@ -3961,8 +3963,8 @@ err:
maria_scan_end(sort_info.info);
_ma_reset_state(info);
- VOID(end_io_cache(&sort_info.new_info->rec_cache));
- VOID(end_io_cache(&param->read_cache));
+ end_io_cache(&sort_info.new_info->rec_cache);
+ end_io_cache(&param->read_cache);
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
sort_info.new_info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
if (got_error)
@@ -3977,8 +3979,8 @@ err:
}
if (new_file >= 0)
{
- VOID(my_close(new_file,MYF(0)));
- VOID(my_delete(param->temp_filename, MYF(MY_WME)));
+ my_close(new_file, MYF(0));
+ my_delete(param->temp_filename, MYF(MY_WME));
}
maria_mark_crashed_on_repair(info);
}
@@ -4011,11 +4013,11 @@ err:
_ma_reenable_logging_for_table(info, FALSE);
restore_table_state_after_repair(info, &backup_share);
- my_free(sort_param.rec_buff, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.key_block, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.rec_buff);
+ my_free(sort_param.record);
+ my_free(sort_info.key_block);
+ my_free(sort_info.ft_buf);
+ my_free(sort_info.buff);
DBUG_RETURN(got_error);
}
@@ -4480,8 +4482,8 @@ err:
the share by remove_io_thread() or it was not yet started (if the
error happend before creating the thread).
*/
- VOID(end_io_cache(&sort_info.new_info->rec_cache));
- VOID(end_io_cache(&param->read_cache));
+ end_io_cache(&sort_info.new_info->rec_cache);
+ end_io_cache(&param->read_cache);
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
sort_info.new_info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
/*
@@ -4491,7 +4493,7 @@ err:
creating the threads).
*/
if (!rep_quick)
- VOID(end_io_cache(&new_data_cache));
+ end_io_cache(&new_data_cache);
if (!got_error)
{
/* Replace the actual file with the temporary file */
@@ -4515,8 +4517,8 @@ err:
(void)_ma_flush_table_files_before_swap(param, info);
if (new_file >= 0)
{
- VOID(my_close(new_file,MYF(0)));
- VOID(my_delete(param->temp_filename, MYF(MY_WME)));
+ my_close(new_file,MYF(0));
+ my_delete(param->temp_filename, MYF(MY_WME));
if (info->dfile.file == new_file)
info->dfile.file= -1;
}
@@ -4537,10 +4539,10 @@ err:
_ma_reenable_logging_for_table(info, FALSE);
restore_table_state_after_repair(info, &backup_share);
- my_free(sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_param,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_info.ft_buf);
+ my_free(sort_info.key_block);
+ my_free(sort_param);
+ my_free(sort_info.buff);
if (!got_error && (param->testflag & T_UNPACK))
restore_data_file_type(share);
DBUG_RETURN(got_error);
@@ -5319,7 +5321,7 @@ int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param)
{
char llbuff[22];
printf("%s\r", llstr(share->state.state.records,llbuff));
- VOID(fflush(stdout));
+ fflush(stdout);
}
}
DBUG_RETURN(0);
@@ -5937,7 +5939,7 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
set_if_bigger(file_length,tmp_length);
set_if_bigger(file_length,(ulonglong) share.base.max_data_file_length);
- VOID(maria_close(*org_info));
+ maria_close(*org_info);
bzero((char*) &create_info,sizeof(create_info));
create_info.max_rows=max(max_records,share.base.records);
@@ -5993,7 +5995,7 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename)
}
/* We are modifing */
(*org_info)->s->options&= ~HA_OPTION_READ_ONLY_DATA;
- VOID(_ma_readinfo(*org_info,F_WRLCK,0));
+ _ma_readinfo(*org_info,F_WRLCK,0);
(*org_info)->s->state.state.records= info.state->records;
if (share.state.create_time)
(*org_info)->s->state.create_time=share.state.create_time;
@@ -6146,7 +6148,7 @@ void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info,
if (my_errno != HA_ERR_END_OF_FILE)
{
maria_extra(info,HA_EXTRA_NO_KEYREAD,0);
- my_free((char*) record, MYF(0));
+ my_free(record);
_ma_check_print_error(param,"%d when reading last record",my_errno);
DBUG_VOID_RETURN;
}
@@ -6163,7 +6165,7 @@ void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info,
set_if_bigger(share->state.auto_increment, param->auto_increment_value);
}
maria_extra(info,HA_EXTRA_NO_KEYREAD,0);
- my_free((char*) record, MYF(0));
+ my_free(record);
maria_update_state_info(param, info, UPDATE_AUTO_INC);
DBUG_VOID_RETURN;
}
diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h
index 8cda285bb99..d692b2de94c 100644
--- a/storage/maria/ma_check_standalone.h
+++ b/storage/maria/ma_check_standalone.h
@@ -13,6 +13,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/* almost every standalone maria program will need it */
+void _mi_report_crashed(void *file __attribute__((unused)),
+ const char *message __attribute__((unused)),
+ const char *sfile __attribute__((unused)),
+ uint sline __attribute__((unused)))
+{
+}
+
+/* only those that included myisamchk.h may need and can use the below */
+#ifdef _myisamchk_h
/*
All standalone programs which need to use functions from ma_check.c
(like maria_repair()) must define their version of _ma_killed_ptr()
@@ -46,8 +56,8 @@ void _ma_check_print_info(HA_CHECK *param __attribute__((unused)),
DBUG_PRINT("enter", ("format: %s", fmt));
va_start(args,fmt);
- VOID(vfprintf(stdout, fmt, args));
- VOID(fputc('\n',stdout));
+ vfprintf(stdout, fmt, args);
+ fputc('\n',stdout);
va_end(args);
DBUG_VOID_RETURN;
}
@@ -71,8 +81,8 @@ void _ma_check_print_warning(HA_CHECK *param, const char *fmt,...)
param->warning_printed=1;
va_start(args,fmt);
fprintf(stderr,"%s: warning: ",my_progname_short);
- VOID(vfprintf(stderr, fmt, args));
- VOID(fputc('\n',stderr));
+ vfprintf(stderr, fmt, args);
+ fputc('\n',stderr);
fflush(stderr);
va_end(args);
DBUG_VOID_RETURN;
@@ -96,9 +106,11 @@ void _ma_check_print_error(HA_CHECK *param, const char *fmt,...)
param->error_printed|=1;
va_start(args,fmt);
fprintf(stderr,"%s: error: ",my_progname_short);
- VOID(vfprintf(stderr, fmt, args));
- VOID(fputc('\n',stderr));
+ vfprintf(stderr, fmt, args);
+ fputc('\n',stderr);
fflush(stderr);
va_end(args);
DBUG_VOID_RETURN;
}
+#endif
+
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index cf13cee9452..7a0c89b1a15 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -290,7 +290,7 @@ err:
end:
for (i= 0; i < (sizeof(record_pieces)/sizeof(record_pieces[0])); i++)
- my_free(record_pieces[i].str, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(record_pieces[i].str);
pthread_mutex_lock(&LOCK_checkpoint);
checkpoint_in_progress= CHECKPOINT_NONE;
checkpoints_total++;
@@ -428,8 +428,8 @@ void ma_checkpoint_end(void)
if (checkpoint_control.inited)
{
ma_service_thread_control_end(&checkpoint_control);
- my_free((uchar *)dfiles, MYF(MY_ALLOW_ZERO_PTR));
- my_free((uchar *)kfiles, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(dfiles);
+ my_free(kfiles);
dfiles= kfiles= NULL;
}
DBUG_VOID_RETURN;
@@ -1067,7 +1067,7 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
pthread_mutex_destroy(&share->intern_lock);
pthread_mutex_unlock(&share->close_lock);
pthread_mutex_destroy(&share->close_lock);
- my_free((uchar *)share, MYF(0));
+ my_free(share);
}
else
{
@@ -1180,7 +1180,7 @@ err:
{
/* maria_close() left us to free the share */
pthread_mutex_destroy(&share->intern_lock);
- my_free((uchar *)share, MYF(0));
+ my_free(share);
}
else
{
@@ -1190,7 +1190,7 @@ err:
}
pthread_mutex_unlock(&THR_LOCK_maria);
}
- my_free((uchar *)distinct_shares, MYF(MY_ALLOW_ZERO_PTR));
- my_free((uchar *)state_copies, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(distinct_shares);
+ my_free(state_copies);
DBUG_RETURN(error);
}
diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c
index df525d45d14..2da40dcb8f6 100644
--- a/storage/maria/ma_close.c
+++ b/storage/maria/ma_close.c
@@ -64,7 +64,7 @@ int maria_close(register MARIA_HA *info)
flag= !--share->reopen;
maria_open_list=list_delete(maria_open_list,&info->open_list);
- my_free(info->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->rec_buff);
(*share->end)(info);
if (flag)
@@ -119,9 +119,9 @@ int maria_close(register MARIA_HA *info)
{
int i,keys;
keys = share->state.header.keys;
- VOID(rwlock_destroy(&share->mmap_lock));
+ rwlock_destroy(&share->mmap_lock);
for(i=0; i<keys; i++) {
- VOID(rwlock_destroy(&share->keyinfo[i].root_lock));
+ rwlock_destroy(&share->keyinfo[i].root_lock);
}
}
#endif
@@ -164,7 +164,7 @@ int maria_close(register MARIA_HA *info)
history->create_rename_lsn= share->state.create_rename_lsn;
history->state_history= share->state_history;
if (my_hash_insert(&maria_stored_state, (uchar*) history))
- my_free(history, MYF(0));
+ my_free(history);
}
/* Marker for concurrent checkpoint */
share->state_history= 0;
@@ -178,14 +178,14 @@ int maria_close(register MARIA_HA *info)
(void) pthread_mutex_destroy(&share->intern_lock);
(void) pthread_mutex_destroy(&share->close_lock);
(void) pthread_cond_destroy(&share->key_del_cond);
- my_free((uchar *)share, MYF(0));
+ my_free(share);
/*
If share cannot be freed, it's because checkpoint has previously
recorded to include this share in the checkpoint and so is soon going to
look at some of its content (share->in_checkpoint/id/last_version).
*/
}
- my_free(info->ftparser_param, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->ftparser_param);
if (info->dfile.file >= 0)
{
/*
@@ -197,7 +197,7 @@ int maria_close(register MARIA_HA *info)
}
delete_dynamic(&info->pinned_pages);
- my_free(info, MYF(0));
+ my_free(info);
if (error)
{
diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c
index 9cf042ed21e..d544e019932 100644
--- a/storage/maria/ma_create.c
+++ b/storage/maria/ma_create.c
@@ -841,7 +841,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
*/
if (_ma_test_if_reopen(filename))
{
- my_printf_error(0, "Aria table '%s' is in use "
+ my_printf_error(HA_ERR_TABLE_EXIST, "Aria table '%s' is in use "
"(most likely by a MERGE table). Try FLUSH TABLES.",
MYF(0), name + dirname_length(name));
my_errno= HA_ERR_TABLE_EXIST;
@@ -966,11 +966,11 @@ int maria_create(const char *name, enum data_file_type datafile_type,
column_array[col_order[i]->column_nr]= i;
if (_ma_columndef_write(file, col_order[i]))
{
- my_free(col_order, MYF(0));
+ my_free(col_order);
goto err;
}
}
- my_free(col_order, MYF(0));
+ my_free(col_order);
}
else
{
@@ -1086,7 +1086,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
if (_ma_update_state_lsns_sub(&share, lsn, trnman_get_min_safe_trid(),
FALSE, TRUE))
goto err;
- my_free(log_data, MYF(0));
+ my_free(log_data);
}
if (!(flags & HA_DONT_TOUCH_DATA))
@@ -1155,7 +1155,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
}
pthread_mutex_unlock(&THR_LOCK_maria);
res= 0;
- my_free((char*) rec_per_key_part,MYF(0));
+ my_free((char*) rec_per_key_part);
errpos=0;
if (my_close(file,MYF(0)))
res= my_errno;
@@ -1168,7 +1168,7 @@ err_no_lock:
save_errno=my_errno;
switch (errpos) {
case 3:
- VOID(my_close(dfile,MYF(0)));
+ my_close(dfile, MYF(0));
/* fall through */
case 2:
if (! (flags & HA_DONT_TOUCH_DATA))
@@ -1177,14 +1177,14 @@ err_no_lock:
sync_dir);
/* fall through */
case 1:
- VOID(my_close(file,MYF(0)));
+ my_close(file, MYF(0));
if (! (flags & HA_DONT_TOUCH_DATA))
my_delete_with_symlink(fn_format(filename,name,"",MARIA_NAME_IEXT,
MY_UNPACK_FILENAME | MY_APPEND_EXT),
sync_dir);
}
- my_free(log_data, MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) rec_per_key_part, MYF(0));
+ my_free(log_data);
+ my_free(rec_per_key_part);
DBUG_RETURN(my_errno=save_errno); /* return the fatal errno */
}
diff --git a/storage/maria/ma_dbug.c b/storage/maria/ma_dbug.c
index af90a108e2a..c8c928dd097 100644
--- a/storage/maria/ma_dbug.c
+++ b/storage/maria/ma_dbug.c
@@ -36,12 +36,12 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
const uchar *end;
const uchar *key_end= key + length;
- VOID(fputs("Key: \"",stream));
+ fputs("Key: \"",stream);
flag=0;
for (; keyseg->type && key < key_end ;keyseg++)
{
if (flag++)
- VOID(putc('-',stream));
+ putc('-',stream);
end= key+ keyseg->length;
if (keyseg->flag & HA_NULL_PART)
{
@@ -58,7 +58,7 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
case HA_KEYTYPE_BINARY:
if (!(keyseg->flag & HA_SPACE_PACK) && keyseg->length == 1)
{ /* packed binary digit */
- VOID(fprintf(stream,"%d",(uint) *key++));
+ fprintf(stream,"%d",(uint) *key++);
break;
}
/* fall through */
@@ -66,58 +66,58 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
case HA_KEYTYPE_NUM:
if (keyseg->flag & HA_SPACE_PACK)
{
- VOID(fprintf(stream,"%.*s",(int) *key,key+1));
+ fprintf(stream,"%.*s",(int) *key,key+1);
key+= (int) *key+1;
}
else
{
- VOID(fprintf(stream,"%.*s",(int) keyseg->length,key));
+ fprintf(stream,"%.*s",(int) keyseg->length,key);
key=end;
}
break;
case HA_KEYTYPE_INT8:
- VOID(fprintf(stream,"%d",(int) *((const signed char*) key)));
+ fprintf(stream,"%d",(int) *((const signed char*) key));
key=end;
break;
case HA_KEYTYPE_SHORT_INT:
s_1= mi_sint2korr(key);
- VOID(fprintf(stream,"%d",(int) s_1));
+ fprintf(stream,"%d",(int) s_1);
key=end;
break;
case HA_KEYTYPE_USHORT_INT:
{
ushort u_1;
u_1= mi_uint2korr(key);
- VOID(fprintf(stream,"%u",(uint) u_1));
+ fprintf(stream,"%u",(uint) u_1);
key=end;
break;
}
case HA_KEYTYPE_LONG_INT:
l_1=mi_sint4korr(key);
- VOID(fprintf(stream,"%ld",l_1));
+ fprintf(stream,"%ld",l_1);
key=end;
break;
case HA_KEYTYPE_ULONG_INT:
l_1=mi_uint4korr(key);
- VOID(fprintf(stream,"%lu",(ulong) l_1));
+ fprintf(stream,"%lu",(ulong) l_1);
key=end;
break;
case HA_KEYTYPE_INT24:
- VOID(fprintf(stream,"%ld",(long) mi_sint3korr(key)));
+ fprintf(stream,"%ld",(long) mi_sint3korr(key));
key=end;
break;
case HA_KEYTYPE_UINT24:
- VOID(fprintf(stream,"%lu",(ulong) mi_uint3korr(key)));
+ fprintf(stream,"%lu",(ulong) mi_uint3korr(key));
key=end;
break;
case HA_KEYTYPE_FLOAT:
mi_float4get(f_1,key);
- VOID(fprintf(stream,"%g",(double) f_1));
+ fprintf(stream,"%g",(double) f_1);
key=end;
break;
case HA_KEYTYPE_DOUBLE:
mi_float8get(d_1,key);
- VOID(fprintf(stream,"%g",d_1));
+ fprintf(stream,"%g",d_1);
key=end;
break;
#ifdef HAVE_LONG_LONG
@@ -125,7 +125,7 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
{
char buff[21];
longlong10_to_str(mi_sint8korr(key),buff,-10);
- VOID(fprintf(stream,"%s",buff));
+ fprintf(stream,"%s",buff);
key=end;
break;
}
@@ -133,7 +133,7 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
{
char buff[21];
longlong10_to_str(mi_sint8korr(key),buff,10);
- VOID(fprintf(stream,"%s",buff));
+ fprintf(stream,"%s",buff);
key=end;
break;
}
@@ -158,14 +158,14 @@ void _ma_print_keydata(FILE *stream, register HA_KEYSEG *keyseg,
The following command sometimes gives a warning from valgrind.
Not yet sure if the bug is in valgrind, glibc or mysqld
*/
- VOID(fprintf(stream,"%.*s",(int) tmp_length,key));
+ fprintf(stream,"%.*s",(int) tmp_length,key);
key+=tmp_length;
break;
}
default: break; /* This never happens */
}
}
- VOID(fputs("\"\n",stream));
+ fputs("\"\n",stream);
return;
} /* print_key */
diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c
index 5c04f358b14..2c13ddfe5bb 100644
--- a/storage/maria/ma_delete.c
+++ b/storage/maria/ma_delete.c
@@ -117,7 +117,7 @@ int maria_delete(MARIA_HA *info,const uchar *record)
info->state->changed=1;
mi_sizestore(lastpos, info->cur_row.lastpos);
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
allow_break(); /* Allow SIGHUP & SIGINT */
if (info->invalidator != 0)
{
@@ -140,7 +140,7 @@ err:
maria_print_error(share, HA_ERR_CRASHED);
maria_mark_crashed(info); /* mark table crashed */
}
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND)
@@ -170,8 +170,6 @@ my_bool _ma_ck_delete(MARIA_HA *info, MARIA_KEY *key)
MARIA_KEY org_key;
DBUG_ENTER("_ma_ck_delete");
- LINT_INIT_STRUCT(org_key);
-
save_key_data= key->data;
if (share->now_transactional)
{
diff --git a/storage/maria/ma_delete_all.c b/storage/maria/ma_delete_all.c
index 4661ea0ab59..2eb966bd7a7 100644
--- a/storage/maria/ma_delete_all.c
+++ b/storage/maria/ma_delete_all.c
@@ -132,7 +132,7 @@ int maria_delete_all_rows(MARIA_HA *info)
goto err;
}
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
#ifdef HAVE_MMAP
/* Map again */
if (share->file_map)
@@ -144,7 +144,7 @@ int maria_delete_all_rows(MARIA_HA *info)
err:
{
int save_errno=my_errno;
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c
index 57b76b713f4..6668d0e5f3d 100644
--- a/storage/maria/ma_dynrec.c
+++ b/storage/maria/ma_dynrec.c
@@ -41,7 +41,7 @@ static my_bool _ma_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
#undef my_alloca
#undef my_afree
#define my_alloca(A) my_malloc((A),MYF(0))
-#define my_afree(A) my_free((A),MYF(0))
+#define my_afree(A) my_free((A))
#endif
/* Interface function from MARIA_HA */
@@ -109,8 +109,8 @@ void _ma_remap_file(MARIA_HA *info, my_off_t size)
{
if (info->s->file_map)
{
- VOID(my_munmap((char*) info->s->file_map,
- (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
+ my_munmap((char*) info->s->file_map,
+ (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
_ma_dynmap_file(info, size);
}
}
@@ -981,7 +981,7 @@ uint _ma_rec_pack(MARIA_HA *info, register uchar *to,
char *temp_pos;
size_t tmp_length=length-portable_sizeof_char_ptr;
memcpy(to,from,tmp_length);
- memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*));
+ memcpy(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(to+tmp_length,temp_pos,(size_t) blob->length);
to+=tmp_length+blob->length;
}
@@ -1315,7 +1315,7 @@ ulong _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from,
goto err;
memcpy(to, from, (size_t) size_length);
from+=size_length;
- memcpy_fixed(to+size_length,(uchar*) &from,sizeof(char*));
+ memcpy(to+size_length,(uchar*) &from,sizeof(char*));
from+=blob_length;
}
else
@@ -1576,7 +1576,7 @@ my_bool _ma_cmp_dynamic_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
error=_ma_unique_comp(def, record, old_record, def->null_are_equal) != 0;
if (info->s->base.blobs)
{
- my_free(info->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(info->rec_buff);
info->rec_buff= old_rec_buff;
info->rec_buff_size= old_rec_buff_size;
}
@@ -1920,7 +1920,7 @@ uint _ma_get_block_info(MARIA_BLOCK_INFO *info, File file, my_off_t filepos)
pointer set to the end of the header after this function.
my_pread() may leave the file pointer untouched.
*/
- VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
+ my_seek(file,filepos,MY_SEEK_SET,MYF(0));
if (my_read(file, header, sizeof(info->header),MYF(0)) !=
sizeof(info->header))
goto err;
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index 0783f679843..10df277510d 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -180,7 +180,7 @@ typedef struct st_my_ftb_param
static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *info)
{
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
@@ -227,7 +227,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
if (! ftb_param->up_quot) break;
phrase_word= (FT_WORD *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FT_WORD));
tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST));
- phrase_word->pos= (uchar*) word;
+ phrase_word->pos= (uchar*)word;
phrase_word->len= word_len;
tmp_element->data= (void *)phrase_word;
ftb_param->ftbe->phrase= list_add(ftb_param->ftbe->phrase, tmp_element);
@@ -253,7 +253,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
if (info->yesno > 0) ftbe->up->ythresh++;
ftb_param->ftbe= ftbe;
ftb_param->depth++;
- ftb_param->up_quot= (uchar*) info->quot;
+ ftb_param->up_quot= (uchar*)info->quot;
break;
case FT_TOKEN_RIGHT_PAREN:
if (ftb_param->ftbe->document)
@@ -282,24 +282,24 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *query, mysql_ft_size_t len)
+ const char *query, int len)
{
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
MYSQL_FTPARSER_BOOLEAN_INFO info;
CHARSET_INFO *cs= ftb_param->ftb->charset;
- const uchar **start= &query;
- const uchar *end= query + len;
+ const uchar **start= (const uchar**) &query;
+ uchar *end= (uchar*) query + len;
FT_WORD w;
info.prev= ' ';
info.quot= 0;
while (maria_ft_get_word(cs, start, end, &w, &info))
- param->mysql_add_word(param, w.pos, w.len, &info);
+ param->mysql_add_word(param, (char*)w.pos, w.len, &info);
return(0);
}
-static int _ftb_parse_query(FTB *ftb, uchar *query, size_t len,
+static int _ftb_parse_query(FTB *ftb, uchar *query, uint len,
struct st_mysql_ftparser *parser)
{
MYSQL_FTPARSER_PARAM *param;
@@ -321,7 +321,7 @@ static int _ftb_parse_query(FTB *ftb, uchar *query, size_t len,
param->mysql_add_word= ftb_query_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= query;
+ param->doc= (char*)query;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO;
@@ -540,7 +540,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr,
- uchar *query, size_t query_len,
+ uchar *query, uint query_len,
CHARSET_INFO *cs)
{
FTB *ftb;
@@ -599,7 +599,7 @@ FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr,
return ftb;
err:
free_root(& ftb->mem_root, MYF(0));
- my_free(ftb, MYF(0));
+ my_free(ftb);
return 0;
}
@@ -616,14 +616,14 @@ typedef struct st_my_ftb_phrase_param
static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO
*boolean_info __attribute__((unused)))
{
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
FT_WORD *w= (FT_WORD *)phrase_param->document->data;
LIST *phrase, *document;
- w->pos= (uchar*) word;
+ w->pos= (uchar*)word;
w->len= word_len;
phrase_param->document= phrase_param->document->prev;
if (phrase_param->phrase_length > phrase_param->document_length)
@@ -649,16 +649,15 @@ static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *document,
- mysql_ft_size_t len)
+ const char *document, int len)
{
FT_WORD word;
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
- const uchar *docend= document + len;
- while (maria_ft_simple_get_word(phrase_param->cs, &document,
+ const uchar *docend= (uchar*)document + len;
+ while (maria_ft_simple_get_word(phrase_param->cs, (uchar**)&document,
docend, &word, FALSE))
{
- param->mysql_add_word(param, word.pos, word.len, 0);
+ param->mysql_add_word(param, (char*)word.pos, word.len, 0);
if (phrase_param->match)
break;
}
@@ -681,7 +680,7 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
-1 is returned if error occurs.
*/
-static int _ftb_check_phrase(FTB *ftb, const uchar *document, size_t len,
+static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len,
FTB_EXPR *ftbe, struct st_mysql_ftparser *parser)
{
MY_FTB_PHRASE_PARAM ftb_param;
@@ -702,7 +701,7 @@ static int _ftb_check_phrase(FTB *ftb, const uchar *document, size_t len,
param->mysql_add_word= ftb_phrase_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= document;
+ param->doc= (char *)document;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_WITH_STOPWORDS;
@@ -851,7 +850,7 @@ int maria_ft_boolean_read_next(FT_INFO *ftb, char *record)
{
info->update|= HA_STATE_AKTIV; /* Record is read */
if (ftb->with_scan &&
- maria_ft_boolean_find_relevance(ftb, (uchar *) record, 0)==0)
+ maria_ft_boolean_find_relevance(ftb, (uchar*)record, 0)==0)
continue; /* no match */
my_errno=0;
goto err;
@@ -875,7 +874,7 @@ typedef struct st_my_ftb_find_param
static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t len,
+ const char *word, int len,
MYSQL_FTPARSER_BOOLEAN_INFO
*boolean_info __attribute__((unused)))
{
@@ -937,14 +936,14 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param,
- const uchar *doc, mysql_ft_size_t len)
+ const char *doc, int len)
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
- const uchar *end= doc + len;
+ uchar *end= (uchar*) doc + len;
FT_WORD w;
- while (maria_ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
- param->mysql_add_word(param, w.pos, w.len, 0);
+ while (maria_ft_simple_get_word(ftb->charset, (uchar**)&doc, end, &w, TRUE))
+ param->mysql_add_word(param, (char*)w.pos, w.len, 0);
return(0);
}
@@ -1001,7 +1000,7 @@ float maria_ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length)
{
if (!ftsi.pos)
continue;
- param->doc= ftsi.pos;
+ param->doc= (char *)ftsi.pos;
param->length= ftsi.len;
if (unlikely(parser->parse(param)))
return 0;
@@ -1026,7 +1025,7 @@ void maria_ft_boolean_close_search(FT_INFO *ftb)
delete_tree(& ftb->no_dupes);
}
free_root(& ftb->mem_root, MYF(0));
- my_free(ftb, MYF(0));
+ my_free(ftb);
}
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index 3bb7defcaaf..26fd4fcf5eb 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -203,12 +203,12 @@ static int walk_and_push(FT_SUPERDOC *from,
static int FT_DOC_cmp(void *unused __attribute__((unused)),
FT_DOC *a, FT_DOC *b)
{
- return sgn(b->weight - a->weight);
+ return CMP_NUM(b->weight, a->weight);
}
FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, uchar *query,
- size_t query_len, uint flags, uchar *record)
+ uint query_len, uint flags, uchar *record)
{
TREE wtree;
ALL_IN_ONE aio;
@@ -363,7 +363,7 @@ float maria_ft_nlq_find_relevance(FT_INFO *handler,
void maria_ft_nlq_close_search(FT_INFO *handler)
{
- my_free(handler, MYF(0));
+ my_free(handler);
}
diff --git a/storage/maria/ma_ft_parser.c b/storage/maria/ma_ft_parser.c
index b35c2227ca2..3dd6fab5214 100644
--- a/storage/maria/ma_ft_parser.c
+++ b/storage/maria/ma_ft_parser.c
@@ -41,7 +41,7 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word->weight=LWS_IN_USE;
docstat->sum+=word->weight;
- memcpy_fixed((docstat->list)++,word,sizeof(FT_WORD));
+ memcpy((docstat->list)++, word, sizeof(FT_WORD));
return 0;
}
@@ -204,11 +204,11 @@ ret:
return param->type;
}
-uchar maria_ft_simple_get_word(CHARSET_INFO *cs, const uchar **start,
+uchar maria_ft_simple_get_word(CHARSET_INFO *cs, uchar **start,
const uchar *end, FT_WORD *word,
my_bool skip_stopwords)
{
- const uchar *doc= *start;
+ uchar *doc= *start;
uint mwc, length;
int ctype, mbl;
DBUG_ENTER("maria_ft_simple_get_word");
@@ -261,7 +261,7 @@ void maria_ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
static int maria_ft_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info
__attribute__((unused)))
{
@@ -279,7 +279,7 @@ static int maria_ft_add_word(MYSQL_FTPARSER_PARAM *param,
w.pos= ptr;
}
else
- w.pos= word;
+ w.pos= (uchar*) word;
w.len= word_len;
if (!tree_insert(wtree, &w, 0, wtree->custom_arg))
{
@@ -291,24 +291,24 @@ static int maria_ft_add_word(MYSQL_FTPARSER_PARAM *param,
static int maria_ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *doc_arg,
- mysql_ft_size_t doc_len)
+ const char *doc_arg,
+ int doc_len)
{
- const uchar *doc= doc_arg;
- const uchar *end= doc + doc_len;
+ uchar *doc= (uchar*) doc_arg;
+ uchar *end= doc + doc_len;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
TREE *wtree= ft_param->wtree;
FT_WORD w;
DBUG_ENTER("maria_ft_parse_internal");
while (maria_ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE))
- if (param->mysql_add_word(param, w.pos, w.len, 0))
+ if (param->mysql_add_word(param, (char*)w.pos, w.len, 0))
DBUG_RETURN(1);
DBUG_RETURN(0);
}
-int maria_ft_parse(TREE *wtree, uchar *doc, size_t doclen,
+int maria_ft_parse(TREE *wtree, uchar *doc, int doclen,
struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
@@ -322,7 +322,7 @@ int maria_ft_parse(TREE *wtree, uchar *doc, size_t doclen,
param->mysql_add_word= maria_ft_add_word;
param->mysql_ftparam= &my_param;
param->cs= wtree->custom_arg;
- param->doc= doc;
+ param->doc= (char*)doc;
param->length= doclen;
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
DBUG_RETURN(parser->parse(param));
@@ -382,8 +382,8 @@ MYSQL_FTPARSER_PARAM *maria_ftparser_call_initializer(MARIA_HA *info,
mysql_add_word != 0 - parser is initialized, or no
initialization needed. */
info->ftparser_param[ftparser_nr].mysql_add_word=
- (int (*)(struct st_mysql_ftparser_param *, const uchar *,
- mysql_ft_size_t, MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
+ (int (*)(struct st_mysql_ftparser_param *, const char *,
+ int, MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
if (parser->init && parser->init(&info->ftparser_param[ftparser_nr]))
return 0;
}
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index f38990efab9..3e47f09c1fa 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -83,8 +83,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_BLOB_PART)
{
ftsi->len= _ma_calc_blob_length(ftsi->seg->bit_start,ftsi->pos);
- memcpy_fixed((char*) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start,
- sizeof(char*));
+ memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*));
DBUG_RETURN(1);
}
ftsi->len=ftsi->seg->length;
diff --git a/storage/maria/ma_ftdefs.h b/storage/maria/ma_ftdefs.h
index 4ce4e9e22ba..9ec3d344e8c 100644
--- a/storage/maria/ma_ftdefs.h
+++ b/storage/maria/ma_ftdefs.h
@@ -101,14 +101,14 @@ typedef struct st_maria_ft_word {
double weight;
} FT_WORD;
-int is_stopword(char *word, uint len);
+int is_stopword(const char *word, size_t len);
MARIA_KEY *_ma_ft_make_key(MARIA_HA *, MARIA_KEY *, uint , uchar *, FT_WORD *,
my_off_t);
uchar maria_ft_get_word(CHARSET_INFO *, const uchar **, const uchar *,
FT_WORD *, MYSQL_FTPARSER_BOOLEAN_INFO *);
-uchar maria_ft_simple_get_word(CHARSET_INFO *, const uchar **, const uchar *,
+uchar maria_ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *,
FT_WORD *, my_bool);
typedef struct _st_maria_ft_seg_iterator {
@@ -122,16 +122,16 @@ void _ma_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *);
uint _ma_ft_segiterator(FT_SEG_ITERATOR *);
void maria_ft_parse_init(TREE *, CHARSET_INFO *);
-int maria_ft_parse(TREE *, uchar *, size_t, struct st_mysql_ftparser *parser,
+int maria_ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
FT_WORD * maria_ft_linearize(TREE *, MEM_ROOT *);
FT_WORD * _ma_ft_parserecord(MARIA_HA *, uint, const uchar *, MEM_ROOT *);
uint _ma_ft_parse(TREE *, MARIA_HA *, uint, const uchar *,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
-FT_INFO *maria_ft_init_nlq_search(MARIA_HA *, uint, uchar *, size_t, uint,
+FT_INFO *maria_ft_init_nlq_search(MARIA_HA *, uint, uchar *, uint, uint,
uchar *);
-FT_INFO *maria_ft_init_boolean_search(MARIA_HA *, uint, uchar *, size_t,
+FT_INFO *maria_ft_init_boolean_search(MARIA_HA *, uint, uchar *, uint,
CHARSET_INFO *);
extern const struct _ft_vft _ma_ft_vft_nlq;
diff --git a/storage/maria/ma_info.c b/storage/maria/ma_info.c
index 1bbfa3cbf7e..6392da31298 100644
--- a/storage/maria/ma_info.c
+++ b/storage/maria/ma_info.c
@@ -43,7 +43,7 @@ int maria_status(MARIA_HA *info, register MARIA_INFO *x, uint flag)
if (!(flag & HA_STATUS_NO_LOCK))
{
pthread_mutex_lock(&share->intern_lock);
- VOID(_ma_readinfo(info,F_RDLCK,0));
+ _ma_readinfo(info,F_RDLCK,0);
fast_ma_writeinfo(info);
pthread_mutex_unlock(&share->intern_lock);
}
diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c
index 902f06d93e5..34f55bd0bf8 100644
--- a/storage/maria/ma_init.c
+++ b/storage/maria/ma_init.c
@@ -34,9 +34,9 @@ void history_state_free(MARIA_STATE_HISTORY_CLOSED *closed_history)
for (history= closed_history->state_history; history ; history= next)
{
next= history->next;
- my_free(history, MYF(0));
+ my_free(history);
}
- my_free(closed_history, MYF(0));
+ my_free(closed_history);
}
@@ -72,8 +72,8 @@ int maria_init(void)
maria_create_trn_hook= dummy_maria_create_trn_hook;
my_handler_error_register();
}
- hash_init(&maria_stored_state, &my_charset_bin, 32,
- 0, sizeof(LSN), 0, (hash_free_key) history_state_free, 0);
+ my_hash_init(&maria_stored_state, &my_charset_bin, 32,
+ 0, sizeof(LSN), 0, (my_hash_free_key) history_state_free, 0);
DBUG_PRINT("info",("dummy_transaction_object: %p",
&dummy_transaction_object));
return 0;
@@ -110,7 +110,7 @@ void maria_end(void)
end_pagecache(maria_pagecache, TRUE);
ma_control_file_end();
pthread_mutex_destroy(&THR_LOCK_maria);
- hash_free(&maria_stored_state);
+ my_hash_free(&maria_stored_state);
}
}
diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c
index ac23bf5fef6..0e1891fb249 100644
--- a/storage/maria/ma_key.c
+++ b/storage/maria/ma_key.c
@@ -269,7 +269,7 @@ MARIA_KEY *_ma_make_key(MARIA_HA *info, MARIA_KEY *int_key, uint keynr,
{
uint tmp_length= _ma_calc_blob_length(keyseg->bit_start,pos);
uchar *blob_pos;
- memcpy_fixed(&blob_pos, pos+keyseg->bit_start,sizeof(char*));
+ memcpy(&blob_pos, pos+keyseg->bit_start,sizeof(char*));
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, blob_pos, length, char_length);
store_key_length_inc(key,char_length);
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index 6bb308e5959..534acc9ddfa 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -163,7 +163,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
}
}
#endif
- VOID(_ma_test_if_changed(info));
+ _ma_test_if_changed(info);
share->r_locks++;
share->tot_locks++;
info->lock_type=lock_type;
@@ -211,7 +211,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
}
}
#endif /* defined(MARIA_EXTERNAL_LOCKING) */
- VOID(_ma_test_if_changed(info));
+ _ma_test_if_changed(info);
info->lock_type=lock_type;
info->invalidator=share->invalidator;
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index dc99554a08d..f6495e8e5ff 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1044,7 +1044,7 @@ static TRANSLOG_FILE *get_current_logfile()
DBUG_RETURN(file);
}
-uchar NEAR maria_trans_file_magic[]=
+uchar maria_trans_file_magic[]=
{ (uchar) 254, (uchar) 254, (uchar) 11, '\001', 'M', 'A', 'R', 'I', 'A',
'L', 'O', 'G' };
#define LOG_HEADER_DATA_SIZE (sizeof(maria_trans_file_magic) + \
@@ -1461,7 +1461,7 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
{
LOGHANDLER_FILE_INFO info;
File fd;
- LINT_INIT_STRUCT(info);
+
fd= open_logfile_by_number_no_cache(file);
if ((fd < 0) ||
(translog_read_file_header(&info, fd) | my_close(fd, MYF(MY_WME))))
@@ -1514,9 +1514,9 @@ static my_bool translog_buffer_init(struct st_translog_buffer *buffer, int num)
/* list of waiting buffer ready threads */
buffer->waiting_flush= 0;
/*
- Buffers locked by fallowing mutex. As far as buffers create logical
+ Buffers locked by the following mutex. As far as buffers create logical
circle (after last buffer goes first) it trigger false alarm of deadlock
- detect system, so we remove check of deadlock for this buffers. In deed
+ detect system, so we remove check of deadlock for this buffers. Indeed
all mutex locks concentrated around current buffer except flushing
thread (but it is only one thread). One thread can't take more then
2 buffer locks at once. So deadlock is impossible here.
@@ -1526,10 +1526,8 @@ static my_bool translog_buffer_init(struct st_translog_buffer *buffer, int num)
only one of eight buffers from deadlock detection hardly can hide other
possible problems which include this mutexes.
*/
- if (my_pthread_mutex_init(&buffer->mutex, MY_MUTEX_INIT_FAST,
- "translog_buffer->mutex",
- (num == TRANSLOG_BUFFERS_NO - 2 ?
- MYF_NO_DEADLOCK_DETECTION : 0)) ||
+
+ if (pthread_mutex_init(&buffer->mutex, MY_MUTEX_INIT_FAST) ||
pthread_cond_init(&buffer->prev_sent_to_disk_cond, 0))
DBUG_RETURN(1);
buffer->is_closing_buffer= 0;
@@ -1565,7 +1563,7 @@ static my_bool translog_close_log_file(TRANSLOG_FILE *file)
translog_syncs++;
}
rc|= my_close(file->handler.file, MYF(MY_WME));
- my_free(file, MYF(0));
+ my_free(file);
return test(rc);
}
@@ -3810,7 +3808,7 @@ my_bool translog_init_with_table(const char *directory,
*dynamic_element(&log_descriptor.open_files, j,
TRANSLOG_FILE **);
my_close(el->handler.file, MYF(MY_WME));
- my_free(el, MYF(0));
+ my_free(el);
}
if (file)
{
@@ -3970,7 +3968,6 @@ my_bool translog_init_with_table(const char *directory,
if (!old_log_was_recovered && old_flags == flags)
{
LOGHANDLER_FILE_INFO info;
- LINT_INIT_STRUCT(info);
/*
Accessing &log_descriptor.open_files without mutex is safe
@@ -4300,7 +4297,7 @@ void translog_destroy()
my_close(log_descriptor.directory_fd, MYF(MY_WME));
my_atomic_rwlock_destroy(&LOCK_id_to_share);
if (id_to_share != NULL)
- my_free((id_to_share + 1), MYF(MY_WME));
+ my_free(id_to_share + 1);
DBUG_VOID_RETURN;
}
@@ -6467,7 +6464,7 @@ void translog_free_record_header(TRANSLOG_HEADER_BUFFER *buff)
DBUG_ENTER("translog_free_record_header");
if (buff->groups_no != 0)
{
- my_free(buff->groups, MYF(0));
+ my_free(buff->groups);
buff->groups_no= 0;
}
DBUG_VOID_RETURN;
@@ -6990,7 +6987,7 @@ translog_variable_length_header(uchar *page, translog_size_t page_offset,
DBUG_RETURN(buffer_length);
exit_and_free:
- my_free(buff->groups, MYF(0));
+ my_free(buff->groups);
buff->groups_no= 0; /* prevent try to use of buff->groups */
DBUG_RETURN(rc);
}
@@ -8914,9 +8911,8 @@ static struct my_option my_long_options[] =
static void print_version(void)
{
- VOID(printf("%s Ver 1.0 for %s on %s\n",
- my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
- NETWARE_SET_SCREEN_MODE(1);
+ printf("%s Ver 1.0 for %s on %s\n",
+ my_progname_short, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -8928,7 +8924,7 @@ static void usage(void)
puts("and you are welcome to modify and redistribute it under the GPL license\n");
puts("Dump content of aria log pages.");
- VOID(printf("\nUsage: %s -f file OPTIONS\n", my_progname_short));
+ printf("\nUsage: %s -f file OPTIONS\n", my_progname_short);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
@@ -8980,7 +8976,7 @@ static void dump_header_page(uchar *buff)
{
LOGHANDLER_FILE_INFO desc;
char strbuff[21];
- LINT_INIT_STRUCT(desc);
+
translog_interpret_file_header(&desc, buff);
printf(" This can be header page:\n"
" Timestamp: %s\n"
@@ -9313,4 +9309,7 @@ err:
free_defaults(default_argv);
exit(1);
}
+
+#include "ma_check_standalone.h"
#endif
+
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 63e1801a39a..606959c56a0 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -219,11 +219,11 @@ err:
case 6:
(*share->end)(&info);
delete_dynamic(&info.pinned_pages);
- my_free(m_info, MYF(0));
+ my_free(m_info);
/* fall through */
case 5:
if (data_file < 0)
- VOID(my_close(info.dfile.file, MYF(0)));
+ my_close(info.dfile.file, MYF(0));
break;
}
my_errno=save_errno;
@@ -806,7 +806,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
(keys ? MARIA_INDEX_BLOCK_MARGIN *
share->block_size * keys : 0));
share->block_size= share->base.block_size;
- my_free(disk_cache, MYF(0));
+ my_free(disk_cache);
_ma_setup_functions(share);
if ((*share->once_init)(share, info.dfile.file))
goto err;
@@ -815,7 +815,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
/* Setup initial state that is visible for all */
MARIA_STATE_HISTORY_CLOSED *history;
if ((history= (MARIA_STATE_HISTORY_CLOSED *)
- hash_search(&maria_stored_state,
+ my_hash_search(&maria_stored_state,
(uchar*) &share->state.create_rename_lsn, 0)))
{
/*
@@ -825,7 +825,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
share->state_history=
_ma_remove_not_visible_states(history->state_history, 0, 0);
history->state_history= 0;
- (void) hash_delete(&maria_stored_state, (uchar*) history);
+ (void) my_hash_delete(&maria_stored_state, (uchar*) history);
}
else
{
@@ -845,8 +845,8 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
pthread_cond_init(&share->key_del_cond, 0);
pthread_mutex_init(&share->close_lock, MY_MUTEX_INIT_FAST);
for (i=0; i<keys; i++)
- VOID(my_rwlock_init(&share->keyinfo[i].root_lock, NULL));
- VOID(my_rwlock_init(&share->mmap_lock, NULL));
+ my_rwlock_init(&share->keyinfo[i].root_lock, NULL);
+ my_rwlock_init(&share->mmap_lock, NULL);
share->row_is_visible= _ma_row_visible_always;
share->lock.get_status= _ma_reset_update_flag;
@@ -950,19 +950,19 @@ err:
switch (errpos) {
case 5:
if (data_file >= 0)
- VOID(my_close(data_file, MYF(0)));
+ my_close(data_file, MYF(0));
if (old_info)
break; /* Don't remove open table */
(*share->once_end)(share);
/* fall through */
case 4:
- my_free(share,MYF(0));
+ my_free(share);
/* fall through */
case 3:
- my_free(disk_cache, MYF(0));
+ my_free(disk_cache);
/* fall through */
case 1:
- VOID(my_close(kfile,MYF(0)));
+ my_close(kfile,MYF(0));
/* fall through */
case 0:
default:
@@ -1283,7 +1283,7 @@ uint _ma_state_info_write_sub(File file, MARIA_STATE_INFO *state, uint pWrite)
size_t res;
DBUG_ENTER("_ma_state_info_write_sub");
- memcpy_fixed(ptr,&state->header,sizeof(state->header));
+ memcpy(ptr,&state->header,sizeof(state->header));
ptr+=sizeof(state->header);
/* open_count must be first because of _ma_mark_file_changed ! */
@@ -1353,7 +1353,7 @@ uint _ma_state_info_write_sub(File file, MARIA_STATE_INFO *state, uint pWrite)
static uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
{
uint i,keys,key_parts;
- memcpy_fixed(&state->header,ptr, sizeof(state->header));
+ memcpy(&state->header,ptr, sizeof(state->header));
ptr+= sizeof(state->header);
keys= (uint) state->header.keys;
key_parts= mi_uint2korr(state->header.key_parts);
diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c
index 4df00d9bb88..00433426cb7 100644
--- a/storage/maria/ma_packrec.c
+++ b/storage/maria/ma_packrec.c
@@ -156,8 +156,8 @@ my_bool _ma_once_end_pack_row(MARIA_SHARE *share)
{
if (share->decode_trees)
{
- my_free(share->decode_trees,MYF(0));
- my_free(share->decode_tables,MYF(0));
+ my_free(share->decode_trees);
+ my_free(share->decode_tables);
}
return 0;
}
@@ -332,9 +332,9 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
err3:
my_errno=HA_ERR_WRONG_IN_RECORD;
err2:
- my_free(share->decode_tables, MYF(0));
+ my_free(share->decode_tables);
err1:
- my_free(share->decode_trees, MYF(0));
+ my_free(share->decode_trees);
err0:
DBUG_RETURN(1);
}
@@ -1097,8 +1097,7 @@ static void uf_blob(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff,
decode_bytes(rec, bit_buff, bit_buff->blob_pos,
bit_buff->blob_pos + length);
_ma_store_blob_length(to, pack_length, length);
- memcpy_fixed((uchar*) to+pack_length,(uchar*) &bit_buff->blob_pos,
- sizeof(uchar*));
+ memcpy(to+pack_length, &bit_buff->blob_pos, sizeof(uchar*));
bit_buff->blob_pos+=length;
}
}
@@ -1421,7 +1420,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
We can't use my_pread() here because _ma_read_rnd_pack_record assumes
position is ok
*/
- VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
+ my_seek(file,filepos,MY_SEEK_SET,MYF(0));
if (my_read(file, header,ref_length,MYF(MY_NABP)))
return BLOCK_FATAL_ERROR;
DBUG_DUMP("header", header, ref_length);
@@ -1565,8 +1564,8 @@ my_bool _ma_memmap_file(MARIA_HA *info)
void _ma_unmap_file(MARIA_HA *info)
{
- VOID(my_munmap((char*) info->s->file_map,
- (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
+ my_munmap((char*) info->s->file_map,
+ (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
}
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 441310a60ea..566131ec77b 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -129,8 +129,6 @@ my_bool my_disable_flush_pagecache_blocks= 0;
#define COND_FOR_WRLOCK 2 /* queue of write lock */
#define COND_SIZE 3 /* number of COND_* queues */
-typedef pthread_cond_t KEYCACHE_CONDVAR;
-
/* descriptor of the page in the page cache block buffer */
struct st_pagecache_page
{
@@ -305,7 +303,7 @@ struct st_pagecache_block_link
PAGECACHE_PIN_INFO *pin_list;
PAGECACHE_LOCK_INFO *lock_list;
#endif
- KEYCACHE_CONDVAR *condvar; /* condition variable for 'no readers' event */
+ mysql_cond_t *condvar; /* condition variable for 'no readers' event */
uchar *buffer; /* buffer for the block page */
pthread_t write_locker;
@@ -728,8 +726,9 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem,
pagecache->disk_blocks= -1;
if (! pagecache->inited)
{
- if (pthread_mutex_init(&pagecache->cache_lock, MY_MUTEX_INIT_FAST) ||
- hash_init(&pagecache->files_in_flush, &my_charset_bin, 32,
+ if (mysql_mutex_init(ma_key_mutex_PAGECACHE_cache_lock,
+ &pagecache->cache_lock, MY_MUTEX_INIT_FAST) ||
+ my_hash_init(&pagecache->files_in_flush, &my_charset_bin, 32,
offsetof(struct st_file_in_flush, file),
sizeof(((struct st_file_in_flush *)NULL)->file),
NULL, NULL, 0))
@@ -789,7 +788,7 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem,
if ((pagecache->block_root=
(PAGECACHE_BLOCK_LINK*) my_malloc((size_t) length, MYF(0))))
break;
- my_large_free(pagecache->block_mem, MYF(0));
+ my_large_free(pagecache->block_mem);
pagecache->block_mem= 0;
}
blocks= blocks / 4*3;
@@ -858,12 +857,12 @@ err:
pagecache->blocks= 0;
if (pagecache->block_mem)
{
- my_large_free(pagecache->block_mem, MYF(0));
+ my_large_free(pagecache->block_mem);
pagecache->block_mem= NULL;
}
if (pagecache->block_root)
{
- my_free(pagecache->block_root, MYF(0));
+ my_free(pagecache->block_root);
pagecache->block_root= NULL;
}
my_errno= error;
@@ -962,7 +961,7 @@ ulong resize_pagecache(PAGECACHE *pagecache,
DBUG_RETURN(pagecache->disk_blocks);
}
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
#ifdef THREAD
wqueue= &pagecache->resize_queue;
@@ -971,7 +970,7 @@ ulong resize_pagecache(PAGECACHE *pagecache,
while (wqueue->last_thread->next != thread)
{
- pagecache_pthread_cond_wait(&thread->suspend, &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
#endif
@@ -991,7 +990,7 @@ ulong resize_pagecache(PAGECACHE *pagecache,
{
KEYCACHE_DBUG_PRINT("resize_pagecache: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend, &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
#else
KEYCACHE_DBUG_ASSERT(pagecache->cnt_for_resize_op == 0);
@@ -1011,10 +1010,10 @@ finish:
{
KEYCACHE_DBUG_PRINT("resize_pagecache: signal",
("thread %ld", wqueue->last_thread->next->id));
- pagecache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
+ mysql_cond_signal(&wqueue->last_thread->next->suspend);
}
#endif
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_RETURN(blocks);
}
#endif /* 0 */
@@ -1042,7 +1041,7 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache)
{
KEYCACHE_DBUG_PRINT("dec_counter_for_resize_op: signal",
("thread %ld", last_thread->next->id));
- pagecache_pthread_cond_signal(&last_thread->next->suspend);
+ mysql_cond_signal(&last_thread->next->suspend);
}
#else
pagecache->cnt_for_resize_op--;
@@ -1072,14 +1071,14 @@ void change_pagecache_param(PAGECACHE *pagecache, uint division_limit,
{
DBUG_ENTER("change_pagecache_param");
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (division_limit)
pagecache->min_warm_blocks= (pagecache->disk_blocks *
division_limit / 100 + 1);
if (age_threshold)
pagecache->age_threshold= (pagecache->disk_blocks *
age_threshold / 100);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -1108,9 +1107,9 @@ void end_pagecache(PAGECACHE *pagecache, my_bool cleanup)
{
if (pagecache->block_mem)
{
- my_large_free(pagecache->block_mem, MYF(0));
+ my_large_free(pagecache->block_mem);
pagecache->block_mem= NULL;
- my_free(pagecache->block_root, MYF(0));
+ my_free(pagecache->block_root);
pagecache->block_root= NULL;
}
pagecache->disk_blocks= -1;
@@ -1129,8 +1128,8 @@ void end_pagecache(PAGECACHE *pagecache, my_bool cleanup)
if (cleanup)
{
- hash_free(&pagecache->files_in_flush);
- pthread_mutex_destroy(&pagecache->cache_lock);
+ my_hash_free(&pagecache->files_in_flush);
+ mysql_mutex_destroy(&pagecache->cache_lock);
pagecache->inited= pagecache->can_be_used= 0;
PAGECACHE_DEBUG_CLOSE;
}
@@ -1269,7 +1268,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block,
if ((PAGECACHE_HASH_LINK *) thread->opt_info == hash_link)
{
KEYCACHE_DBUG_PRINT("link_block: signal", ("thread: %ld", thread->id));
- pagecache_pthread_cond_signal(&thread->suspend);
+ mysql_cond_signal(&thread->suspend);
wqueue_unlink_from_queue(&pagecache->waiting_for_block, thread);
block->requests++;
}
@@ -1488,7 +1487,7 @@ static inline void remove_reader(PAGECACHE_BLOCK_LINK *block)
DBUG_ASSERT(block->hash_link->requests > 0);
#ifdef THREAD
if (! --block->hash_link->requests && block->condvar)
- pagecache_pthread_cond_signal(block->condvar);
+ mysql_cond_signal(block->condvar);
#else
--block->hash_link->requests;
#endif
@@ -1513,7 +1512,7 @@ static inline void wait_for_readers(PAGECACHE *pagecache
("suspend thread: %ld block: %u",
thread->id, PCBLOCK_NUMBER(pagecache, block)));
block->condvar= &thread->suspend;
- pagecache_pthread_cond_wait(&thread->suspend, &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
block->condvar= NULL;
}
#else
@@ -1578,7 +1577,7 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link)
page->pageno == hash_link->pageno)
{
KEYCACHE_DBUG_PRINT("unlink_hash: signal", ("thread %ld", thread->id));
- pagecache_pthread_cond_signal(&thread->suspend);
+ mysql_cond_signal(&thread->suspend);
wqueue_unlink_from_queue(&pagecache->waiting_for_hash_link, thread);
}
}
@@ -1713,9 +1712,8 @@ restart:
thread->opt_info= (void *) &page;
wqueue_link_into_queue(&pagecache->waiting_for_hash_link, thread);
KEYCACHE_DBUG_PRINT("get_hash_link: wait",
- ("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ ("suspend thread %ld", thread->id));
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
thread->opt_info= NULL;
#else
KEYCACHE_DBUG_ASSERT(0);
@@ -1847,8 +1845,7 @@ restart:
{
KEYCACHE_DBUG_PRINT("find_block: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
while(thread->next);
#else
@@ -1903,8 +1900,7 @@ restart:
{
KEYCACHE_DBUG_PRINT("find_block: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
while(thread->next);
#else
@@ -1988,8 +1984,7 @@ restart:
{
KEYCACHE_DBUG_PRINT("find_block: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
while (thread->next);
thread->opt_info= NULL;
@@ -2037,7 +2032,7 @@ restart:
KEYCACHE_DBUG_PRINT("find_block", ("block is dirty"));
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
/*
The call is thread safe because only the current
thread might change the block->hash_link value
@@ -2049,7 +2044,7 @@ restart:
block->hash_link->pageno,
block->type,
pagecache->readwrite_flags);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
pagecache->global_cache_write++;
}
@@ -2175,7 +2170,7 @@ static void remove_pin(PAGECACHE_BLOCK_LINK *block, my_bool any
PAGECACHE_PIN_INFO *info= info_find(block->pin_list, my_thread_var, any);
DBUG_ASSERT(info != 0);
info_unlink(info);
- my_free(info, MYF(0));
+ my_free(info);
}
#endif
DBUG_VOID_RETURN;
@@ -2197,7 +2192,7 @@ static void info_remove_lock(PAGECACHE_BLOCK_LINK *block)
my_thread_var, FALSE);
DBUG_ASSERT(info != 0);
info_unlink((PAGECACHE_PIN_INFO *)info);
- my_free(info, MYF(0));
+ my_free(info);
}
static void info_change_lock(PAGECACHE_BLOCK_LINK *block, my_bool wl)
{
@@ -2246,8 +2241,7 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache,
{
KEYCACHE_DBUG_PRINT("get_wrlock: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
while(thread->next);
#else
@@ -2612,7 +2606,7 @@ static void read_block(PAGECACHE *pagecache,
pagecache->global_cache_read++;
/* Page is not in buffer yet, is to be read from disk */
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
/*
Here other threads may step in and register as secondary readers.
They will register in block->wqueue[COND_FOR_REQUESTED].
@@ -2621,7 +2615,7 @@ static void read_block(PAGECACHE *pagecache,
block->buffer,
block->hash_link->pageno,
pagecache->readwrite_flags);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (error)
{
block->status|= PCBLOCK_ERROR;
@@ -2665,8 +2659,7 @@ static void read_block(PAGECACHE *pagecache,
{
DBUG_PRINT("read_block: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
- &pagecache->cache_lock);
+ mysql_cond_wait(&thread->suspend, &pagecache->cache_lock);
}
while (thread->next);
#else
@@ -2763,7 +2756,7 @@ void pagecache_unlock(PAGECACHE *pagecache,
DBUG_ASSERT(lock != PAGECACHE_LOCK_READ);
DBUG_ASSERT(lock != PAGECACHE_LOCK_WRITE);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
/*
As soon as we keep lock cache can be used, and we have lock because want
to unlock.
@@ -2823,7 +2816,7 @@ void pagecache_unlock(PAGECACHE *pagecache,
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -2852,7 +2845,7 @@ void pagecache_unpin(PAGECACHE *pagecache,
DBUG_ENTER("pagecache_unpin");
DBUG_PRINT("enter", ("fd: %u page: %lu",
(uint) file->file, (ulong) pageno));
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
/*
As soon as we keep lock cache can be used, and we have lock bacause want
aunlock.
@@ -2890,7 +2883,7 @@ void pagecache_unpin(PAGECACHE *pagecache,
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -2941,13 +2934,13 @@ void pagecache_unlock_by_link(PAGECACHE *pagecache,
DBUG_ASSERT(pin != PAGECACHE_PIN_LEFT_UNPINNED);
DBUG_ASSERT(lock != PAGECACHE_LOCK_READ);
DBUG_ASSERT(lock != PAGECACHE_LOCK_WRITE);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (pin == PAGECACHE_PIN_LEFT_UNPINNED &&
lock == PAGECACHE_LOCK_READ_UNLOCK)
{
if (make_lock_and_pin(pagecache, block, lock, pin, FALSE))
DBUG_ASSERT(0); /* should not happend */
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -3016,7 +3009,7 @@ void pagecache_unlock_by_link(PAGECACHE *pagecache,
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -3045,7 +3038,7 @@ void pagecache_unpin_by_link(PAGECACHE *pagecache,
(uint) block->hash_link->file.file,
(ulong) block->hash_link->pageno));
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
/*
As soon as we keep lock cache can be used, and we have lock because want
unlock.
@@ -3078,7 +3071,7 @@ void pagecache_unpin_by_link(PAGECACHE *pagecache,
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_VOID_RETURN;
}
@@ -3292,10 +3285,10 @@ restart:
uint status;
int page_st;
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (!pagecache->can_be_used)
{
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
goto no_key_cache;
}
@@ -3347,7 +3340,7 @@ restart:
*/
if (reg_request)
unreg_request(pagecache, block, 1);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_PRINT("info", ("restarting..."));
goto restart;
}
@@ -3371,15 +3364,15 @@ restart:
if (!(status & PCBLOCK_ERROR))
{
#if !defined(SERIALIZED_READ_FROM_CACHE)
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
#endif
DBUG_ASSERT((pagecache->block_size & 511) == 0);
/* Copy data from the cache buffer */
- bmove512(buff, block->buffer, pagecache->block_size);
+ memcpy(buff, block->buffer, pagecache->block_size);
#if !defined(SERIALIZED_READ_FROM_CACHE)
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
#endif
}
else
@@ -3407,7 +3400,7 @@ restart:
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
if (status & PCBLOCK_ERROR)
{
@@ -3458,7 +3451,7 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache,
KEYCACHE_DBUG_PRINT("find_block", ("block is dirty"));
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
/*
The call is thread safe because only the current
thread might change the block->hash_link value
@@ -3470,7 +3463,7 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache,
block->hash_link->pageno,
block->type,
pagecache->readwrite_flags);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
pagecache->global_cache_write++;
if (error)
@@ -3539,7 +3532,7 @@ my_bool pagecache_delete_by_link(PAGECACHE *pagecache,
if (pagecache->can_be_used)
{
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (!pagecache->can_be_used)
goto end;
@@ -3565,7 +3558,7 @@ my_bool pagecache_delete_by_link(PAGECACHE *pagecache,
error= pagecache_delete_internal(pagecache, block, block->hash_link,
flush);
end:
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
}
DBUG_RETURN(error);
@@ -3656,7 +3649,7 @@ restart:
reg1 PAGECACHE_BLOCK_LINK *block;
PAGECACHE_HASH_LINK **unused_start, *page_link;
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (!pagecache->can_be_used)
goto end;
@@ -3665,7 +3658,7 @@ restart:
if (!page_link)
{
DBUG_PRINT("info", ("There is no such page in the cache"));
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_RETURN(0);
}
block= page_link->block;
@@ -3691,7 +3684,7 @@ restart:
*/
if (pin == PAGECACHE_PIN)
unreg_request(pagecache, block, 1);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_PRINT("info", ("restarting..."));
goto restart;
}
@@ -3701,7 +3694,7 @@ restart:
error= pagecache_delete_internal(pagecache, block, page_link, flush);
end:
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
}
DBUG_RETURN(error);
@@ -3848,10 +3841,10 @@ restart:
int page_st;
my_bool need_page_ready_signal= FALSE;
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (!pagecache->can_be_used)
{
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
goto no_key_cache;
}
@@ -3868,7 +3861,7 @@ restart:
DBUG_ASSERT(write_mode != PAGECACHE_WRITE_DONE);
/* It happens only for requests submitted during resize operation */
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
/* Write to the disk key cache is in resize at the moment*/
goto no_key_cache;
}
@@ -3912,7 +3905,7 @@ restart:
*/
if (reg_request)
unreg_request(pagecache, block, 1);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_PRINT("info", ("restarting..."));
goto restart;
}
@@ -3927,10 +3920,7 @@ restart:
else
{
/* Copy data from buff */
- if (!(size & 511))
- bmove512(block->buffer + offset, buff, size);
- else
- memcpy(block->buffer + offset, buff, size);
+ memcpy(block->buffer + offset, buff, size);
block->status= PCBLOCK_READ;
/*
The read_callback can change the page content (removing page
@@ -3963,10 +3953,7 @@ restart:
if (! (block->status & PCBLOCK_CHANGED))
link_to_changed_list(pagecache, block);
- if (!(size & 511))
- bmove512(block->buffer + offset, buff, size);
- else
- memcpy(block->buffer + offset, buff, size);
+ memcpy(block->buffer + offset, buff, size);
block->status|= PCBLOCK_READ;
/* Page is correct again if we made a full write in it */
if (size == pagecache->block_size)
@@ -4018,7 +4005,7 @@ restart:
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
goto end;
}
@@ -4175,14 +4162,14 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
*first_errno= 0;
/* Don't lock the cache during the flush */
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
/*
As all blocks referred in 'cache' are marked by PCBLOCK_IN_FLUSH
we are guaranteed that no thread will change them
*/
qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
for (; cache != end; cache++)
{
PAGECACHE_BLOCK_LINK *block= *cache;
@@ -4223,7 +4210,7 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
DBUG_PRINT("info", ("block: %u (0x%lx) to be flushed",
PCBLOCK_NUMBER(pagecache, block), (ulong)block));
PCBLOCK_INFO(block);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_PRINT("info", ("block: %u (0x%lx) pins: %u",
PCBLOCK_NUMBER(pagecache, block), (ulong)block,
block->pins));
@@ -4242,7 +4229,7 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
block->hash_link->pageno,
block->type,
pagecache->readwrite_flags);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
if (make_lock_and_pin(pagecache, block,
PAGECACHE_LOCK_READ_UNLOCK,
@@ -4367,8 +4354,8 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache,
us_flusher.flush_queue.last_thread= NULL;
us_flusher.first_in_switch= FALSE;
while ((other_flusher= (struct st_file_in_flush *)
- hash_search(&pagecache->files_in_flush, (uchar *)&file->file,
- sizeof(file->file))))
+ my_hash_search(&pagecache->files_in_flush, (uchar *)&file->file,
+ sizeof(file->file))))
{
/*
File is in flush already: wait, unless FLUSH_KEEP_LAZY. "Flusher"
@@ -4387,7 +4374,7 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache,
{
KEYCACHE_DBUG_PRINT("flush_pagecache_blocks_int: wait1",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
+ mysql_cond_wait(&thread->suspend,
&pagecache->cache_lock);
}
while (thread->next);
@@ -4401,17 +4388,17 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache,
are going to remove themselves from the hash, and thus memory will
appear again. However, this memory may be stolen by yet another thread
(for a purpose unrelated to page cache), before we retry
- hash_insert(). So the loop may run for long. Only if the thread was
+ my_hash_insert(). So the loop may run for long. Only if the thread was
killed do we abort the loop, returning 1 (error) which can cause the
table to be marked as corrupted (cf maria_chk_size(), maria_close())
and thus require a table check.
*/
DBUG_ASSERT(0);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
if (my_thread_var->abort)
DBUG_RETURN(1); /* End if aborted by user */
sleep(10);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
}
#endif
@@ -4547,7 +4534,7 @@ restart:
{
KEYCACHE_DBUG_PRINT("flush_pagecache_blocks_int: wait2",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
+ mysql_cond_wait(&thread->suspend,
&pagecache->cache_lock);
}
while (thread->next);
@@ -4594,7 +4581,7 @@ restart:
}
#ifdef THREAD
/* wake up others waiting to flush this file */
- hash_delete(&pagecache->files_in_flush, (uchar *)&us_flusher);
+ my_hash_delete(&pagecache->files_in_flush, (uchar *)&us_flusher);
if (us_flusher.flush_queue.last_thread)
wqueue_release_queue(&us_flusher.flush_queue);
#endif
@@ -4605,7 +4592,7 @@ restart:
test_key_cache(pagecache, "end of flush_pagecache_blocks", 0););
#endif
if (cache != cache_buff)
- my_free(cache, MYF(0));
+ my_free(cache);
if (rc != 0)
{
if (last_errno)
@@ -4647,11 +4634,11 @@ int flush_pagecache_blocks_with_filter(PAGECACHE *pagecache,
if (pagecache->disk_blocks <= 0)
DBUG_RETURN(0);
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
inc_counter_for_resize_op(pagecache);
res= flush_pagecache_blocks_int(pagecache, file, type, filter, filter_arg);
dec_counter_for_resize_op(pagecache);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
DBUG_RETURN(res);
}
@@ -4728,14 +4715,14 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
We lock the entire cache but will be quick, just reading/writing a few MBs
of memory at most.
*/
- pagecache_pthread_mutex_lock(&pagecache->cache_lock);
+ mysql_mutex_lock(&pagecache->cache_lock);
#ifdef THREAD
for (;;)
{
struct st_file_in_flush *other_flusher;
for (file_hash= 0;
(other_flusher= (struct st_file_in_flush *)
- hash_element(&pagecache->files_in_flush, file_hash)) != NULL &&
+ my_hash_element(&pagecache->files_in_flush, file_hash)) != NULL &&
!other_flusher->first_in_switch;
file_hash++)
{}
@@ -4758,7 +4745,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
{
KEYCACHE_DBUG_PRINT("pagecache_collect_changed_blocks_with_lsn: wait",
("suspend thread %ld", thread->id));
- pagecache_pthread_cond_wait(&thread->suspend,
+ mysql_cond_wait(&thread->suspend,
&pagecache->cache_lock);
}
while (thread->next);
@@ -4837,7 +4824,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
}
}
end:
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
+ mysql_mutex_unlock(&pagecache->cache_lock);
*min_rec_lsn= minimum_rec_lsn;
DBUG_RETURN(error);
diff --git a/storage/maria/ma_pagecache.h b/storage/maria/ma_pagecache.h
index 821728ef374..648f93d5c74 100644
--- a/storage/maria/ma_pagecache.h
+++ b/storage/maria/ma_pagecache.h
@@ -137,10 +137,10 @@ typedef struct st_pagecache
PAGECACHE_HASH_LINK *free_hash_list;/* list of free hash links */
PAGECACHE_BLOCK_LINK *free_block_list;/* list of free blocks */
PAGECACHE_BLOCK_LINK *block_root;/* memory for block links */
- uchar HUGE_PTR *block_mem; /* memory for block buffers */
+ uchar *block_mem; /* memory for block buffers */
PAGECACHE_BLOCK_LINK *used_last;/* ptr to the last block of the LRU chain */
PAGECACHE_BLOCK_LINK *used_ins;/* ptr to the insertion block in LRU chain */
- pthread_mutex_t cache_lock; /* to lock access to the cache structure */
+ mysql_mutex_t cache_lock; /* to lock access to the cache structure */
WQUEUE resize_queue; /* threads waiting during resize operation */
WQUEUE waiting_for_hash_link;/* waiting for a free hash link */
WQUEUE waiting_for_block; /* requests waiting for a free block */
diff --git a/storage/maria/ma_preload.c b/storage/maria/ma_preload.c
index 6dfb4e437b6..10cabca9cfc 100644
--- a/storage/maria/ma_preload.c
+++ b/storage/maria/ma_preload.c
@@ -107,10 +107,10 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves)
LSN_IMPOSSIBLE, LSN_IMPOSSIBLE, FALSE, FALSE);
}
- my_free(buff, MYF(0));
+ my_free(buff);
DBUG_RETURN(0);
err:
- my_free(buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(buff);
DBUG_RETURN(my_errno= errno);
}
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index 7a7286e26f9..b473bb14995 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -55,7 +55,7 @@ static my_bool in_redo_phase;
static my_bool trns_created;
static ulong skipped_undo_phase;
static ulonglong now; /**< for tracking execution time of phases */
-static int (*save_error_handler_hook)(uint, const char *,myf);
+static void (*save_error_handler_hook)(uint, const char *,myf);
static uint recovery_warnings; /**< count of warnings */
static uint recovery_found_crashed_tables;
@@ -163,7 +163,7 @@ static enum recovery_message_type
/* Hook to ensure we get nicer output if we get an error */
-int maria_recover_error_handler_hook(uint error, const char *str,
+void maria_recover_error_handler_hook(uint error, const char *str,
myf flags)
{
if (procent_printed)
@@ -172,7 +172,7 @@ int maria_recover_error_handler_hook(uint error, const char *str,
fputc('\n', stderr);
fflush(stderr);
}
- return (*save_error_handler_hook)(error, str, flags);
+ (*save_error_handler_hook)(error, str, flags);
}
/* Define this if you want gdb to break in some interesting situations */
@@ -467,15 +467,15 @@ err2:
}
end:
error_handler_hook= save_error_handler_hook;
- hash_free(&all_dirty_pages);
+ my_hash_free(&all_dirty_pages);
bzero(&all_dirty_pages, sizeof(all_dirty_pages));
- my_free(dirty_pages_pool, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(dirty_pages_pool);
dirty_pages_pool= NULL;
- my_free(all_tables, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(all_tables);
all_tables= NULL;
- my_free(all_active_trans, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(all_active_trans);
all_active_trans= NULL;
- my_free(log_record_buffer.str, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(log_record_buffer.str);
log_record_buffer.str= NULL;
log_record_buffer.length= 0;
ma_checkpoint_end();
@@ -2737,13 +2737,13 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
char llbuf[22];
LSN addr;
- hash_free(&all_dirty_pages);
+ my_hash_free(&all_dirty_pages);
/*
hash_free() can be called multiple times probably, but be safe if that
changes
*/
bzero(&all_dirty_pages, sizeof(all_dirty_pages));
- my_free(dirty_pages_pool, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(dirty_pages_pool);
dirty_pages_pool= NULL;
llstr(max_long_trid, llbuf);
@@ -2822,7 +2822,7 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
#endif
}
- my_free(all_active_trans, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(all_active_trans);
all_active_trans= NULL;
/*
@@ -3247,10 +3247,10 @@ static LSN parse_checkpoint_record(LSN lsn)
ptr+= 8;
tprint(tracef, "%lu dirty pages\n", (ulong) nb_dirty_pages);
- if (hash_init(&all_dirty_pages, &my_charset_bin, (ulong)nb_dirty_pages,
- offsetof(struct st_dirty_page, file_and_page_id),
- sizeof(((struct st_dirty_page *)NULL)->file_and_page_id),
- NULL, NULL, 0))
+ if (my_hash_init(&all_dirty_pages, &my_charset_bin, (ulong)nb_dirty_pages,
+ offsetof(struct st_dirty_page, file_and_page_id),
+ sizeof(((struct st_dirty_page *)NULL)->file_and_page_id),
+ NULL, NULL, 0))
return LSN_ERROR;
dirty_pages_pool=
(struct st_dirty_page *)my_malloc((size_t)nb_dirty_pages *
diff --git a/storage/maria/ma_recovery_util.c b/storage/maria/ma_recovery_util.c
index 19e61daf4ef..53f3c2f94b1 100644
--- a/storage/maria/ma_recovery_util.c
+++ b/storage/maria/ma_recovery_util.c
@@ -132,7 +132,7 @@ my_bool _ma_redo_not_needed_for_page(uint16 shortid, LSN lsn,
uint64 file_and_page_id=
(((uint64)((index << 16) | shortid)) << 40) | page;
struct st_dirty_page *dirty_page= (struct st_dirty_page *)
- hash_search(&all_dirty_pages,
+ my_hash_search(&all_dirty_pages,
(uchar *)&file_and_page_id, sizeof(file_and_page_id));
DBUG_PRINT("info", ("in dirty pages list: %d", dirty_page != NULL));
if ((dirty_page == NULL) ||
diff --git a/storage/maria/ma_rsame.c b/storage/maria/ma_rsame.c
index 4bdbfd526ba..9ddd487a8a3 100644
--- a/storage/maria/ma_rsame.c
+++ b/storage/maria/ma_rsame.c
@@ -63,8 +63,8 @@ int maria_rsame(MARIA_HA *info, uchar *record, int inx)
info->cur_row.trid);
if (info->s->lock_key_trees)
rw_rdlock(&keyinfo->root_lock);
- VOID(_ma_search(info, &info->last_key, SEARCH_SAME,
- info->s->state.key_root[inx]));
+ _ma_search(info, &info->last_key, SEARCH_SAME,
+ info->s->state.key_root[inx]);
if (info->s->lock_key_trees)
rw_unlock(&keyinfo->root_lock);
}
diff --git a/storage/maria/ma_rt_index.c b/storage/maria/ma_rt_index.c
index 62474dbbad8..8feac7711e2 100644
--- a/storage/maria/ma_rt_index.c
+++ b/storage/maria/ma_rt_index.c
@@ -1200,7 +1200,7 @@ my_bool maria_rtree_real_delete(MARIA_HA *info, MARIA_KEY *key,
}
}
my_afree(page_buf);
- my_free(ReinsertList.pages, MYF(0));
+ my_free(ReinsertList.pages);
}
/* check for redundant root (not leaf, 1 child) and eliminate */
diff --git a/storage/maria/ma_rt_test.c b/storage/maria/ma_rt_test.c
index af54e6b27be..4c0ffcf72b1 100644
--- a/storage/maria/ma_rt_test.c
+++ b/storage/maria/ma_rt_test.c
@@ -684,6 +684,8 @@ static void usage()
my_print_variables(my_long_options);
}
+#include "ma_check_standalone.h"
+
#else
int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
{
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 9f1e8e2554b..9e5513f388b 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -73,7 +73,7 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
{
if (nextflag & SEARCH_SAVE_BUFF)
{
- bmove512(info->keyread_buff, page_buff, info->s->block_size);
+ memcpy(info->keyread_buff, page_buff, info->s->block_size);
/* Save position for a possible read next / previous */
info->int_keypos= info->keyread_buff + info->keypos_offset;
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index f7f79f90cf0..c994f19d309 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -43,7 +43,7 @@
Pointers of functions for store and read keys from temp file
*/
-extern void print_error _VARARGS((const char *fmt,...));
+extern void print_error(const char *fmt,...);
/* Functions defined in this file */
@@ -166,7 +166,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2))
{
- my_free(sort_keys,MYF(0));
+ my_free(sort_keys);
sort_keys= 0;
}
else
@@ -252,7 +252,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
error =0;
err:
- my_free(sort_keys, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_keys);
delete_dynamic(&buffpek);
close_cached_file(&tempfile);
close_cached_file(&tempfile_for_exceptions);
@@ -391,7 +391,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2))
{
- my_free(sort_keys, MYF(0));
+ my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */
}
else
@@ -463,7 +463,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
err:
DBUG_PRINT("error", ("got some error"));
sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */
- my_free(sort_keys,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_keys);
sort_param->sort_keys=0;
delete_dynamic(& sort_param->buffpek);
close_cached_file(&sort_param->tempfile);
@@ -516,7 +516,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
if (!sinfo->sort_keys)
{
got_error=1;
- my_free(sinfo->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sinfo->rec_buff);
continue;
}
if (!got_error)
@@ -541,8 +541,8 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
sinfo->notnull : NULL,
(ulonglong) share->state.state.records);
}
- my_free(sinfo->sort_keys,MYF(0));
- my_free(sinfo->rec_buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sinfo->sort_keys);
+ my_free(sinfo->rec_buff);
sinfo->sort_keys=0;
}
@@ -654,7 +654,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
}
}
}
- my_free(mergebuf,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mergebuf);
DBUG_RETURN(got_error);
}
#endif /* THREAD */
@@ -908,7 +908,7 @@ static int write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused)),
If to_file == 0 then use info->key_write
*/
-static int NEAR_F
+static int
merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb)
@@ -982,7 +982,7 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
uchar *base= buffpek->base;
uint max_keys=buffpek->max_keys;
- VOID(queue_remove_top(&queue));
+ queue_remove_top(&queue);
/* Put room used by buffer to use in other buffer */
for (refpek= (BUFFPEK**) &queue_top(&queue);
@@ -1052,7 +1052,7 @@ err:
/* Do a merge to output-file (save only positions) */
-static int NEAR_F
+static int
merge_index(MARIA_SORT_PARAM *info, uint keys, uchar **sort_keys,
BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile)
{
@@ -1070,7 +1070,7 @@ static int flush_maria_ft_buf(MARIA_SORT_PARAM *info)
if (info->sort_info->ft_buf)
{
err=_ma_sort_ft_buf_flush(info);
- my_free(info->sort_info->ft_buf, MYF(0));
+ my_free(info->sort_info->ft_buf);
info->sort_info->ft_buf=0;
}
return err;
diff --git a/storage/maria/ma_sp_key.c b/storage/maria/ma_sp_key.c
index 22944a5db0a..e64dd2c6f59 100644
--- a/storage/maria/ma_sp_key.c
+++ b/storage/maria/ma_sp_key.c
@@ -57,7 +57,7 @@ MARIA_KEY *_ma_sp_make_key(MARIA_HA *info, MARIA_KEY *ret_key, uint keynr,
ret_key->data= key;
dlen = _ma_calc_blob_length(keyseg->bit_start, pos);
- memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
+ memcpy(&dptr, pos + keyseg->bit_start, sizeof(char*));
if (!dptr)
{
my_errno= HA_ERR_NULL_IN_SPATIAL;
diff --git a/storage/maria/ma_sp_test.c b/storage/maria/ma_sp_test.c
index b8c00753acb..1aa16e0d5e1 100644
--- a/storage/maria/ma_sp_test.c
+++ b/storage/maria/ma_sp_test.c
@@ -335,7 +335,7 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
len=sint4korr(pos);
pos+=4;
printf(" len=%d ",len);
- memcpy_fixed(&ptr,pos,sizeof(char*));
+ memcpy(&ptr,pos,sizeof(char*));
if (ptr)
maria_rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
@@ -368,7 +368,7 @@ static void create_point(uchar *record,uint rownr)
pos+=4;
ptr=blob_key;
- memcpy_fixed(pos,&ptr,sizeof(char*));
+ memcpy(pos,&ptr,sizeof(char*));
}
#endif
@@ -397,7 +397,7 @@ static void create_linestring(uchar *record,uint rownr)
pos+=4;
ptr=blob_key;
- memcpy_fixed(pos,&ptr,sizeof(char*));
+ memcpy(pos,&ptr,sizeof(char*));
}
@@ -560,6 +560,8 @@ static void maria_rtree_PrintWKB(uchar *wkb, uint n_dims)
}
}
+#include "ma_check_standalone.h"
+
#else
int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
{
diff --git a/storage/maria/ma_state.c b/storage/maria/ma_state.c
index ca94d58264b..49ba5da6460 100644
--- a/storage/maria/ma_state.c
+++ b/storage/maria/ma_state.c
@@ -170,7 +170,7 @@ MARIA_STATE_HISTORY
{
DBUG_PRINT("info", ("removing history->trid: %lu next: %lu",
(ulong) history->trid, (ulong) last_trid));
- my_free(history, MYF(0));
+ my_free(history);
continue;
}
*parent= history;
@@ -184,7 +184,7 @@ MARIA_STATE_HISTORY
/* There is only one state left. Delete this if it's visible for all */
if (last_trid < trnman_get_min_trid())
{
- my_free(org_history, MYF(0));
+ my_free(org_history);
org_history= 0;
}
}
@@ -248,7 +248,7 @@ void _ma_reset_state(MARIA_HA *info)
for (history= history->next ; history ; history= next)
{
next= history->next;
- my_free(history, MYF(0));
+ my_free(history);
}
share->state_history->next= 0;
share->state_history->trid= 0; /* Visibile for all */
@@ -346,11 +346,11 @@ void _ma_update_status_with_lock(MARIA_HA *info)
if (info->state == &info->state_save)
{
locked= 1;
- pthread_mutex_lock(&info->s->lock.mutex);
+ mysql_mutex_lock(&info->s->lock.mutex);
}
(*info->s->lock.update_status)(info);
if (locked)
- pthread_mutex_unlock(&info->s->lock.mutex);
+ mysql_mutex_unlock(&info->s->lock.mutex);
}
@@ -477,7 +477,7 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit,
/* purecov: begin inspected */
error= 1;
pthread_mutex_unlock(&share->intern_lock);
- my_free(tables, MYF(0));
+ my_free(tables);
continue;
/* purecov: end */
}
@@ -526,7 +526,7 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit,
pthread_mutex_unlock(&share->intern_lock);
#endif
}
- my_free(tables, MYF(0));
+ my_free(tables);
}
trn->used_tables= 0;
DBUG_RETURN(error);
@@ -561,7 +561,7 @@ void _ma_remove_table_from_trnman(MARIA_SHARE *share, TRN *trn)
*prev= tables->next;
share->in_trans--;
DBUG_PRINT("info", ("in_trans: %d", share->in_trans));
- my_free(tables, MYF(0));
+ my_free(tables);
break;
}
prev= &tables->next;
@@ -744,7 +744,7 @@ void _ma_reset_history(MARIA_SHARE *share)
for (; history; history= next)
{
next= history->next;
- my_free(history, MYF(0));
+ my_free(history);
}
DBUG_VOID_RETURN;
}
diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c
index 917385f9568..8c572b45547 100644
--- a/storage/maria/ma_static.c
+++ b/storage/maria/ma_static.c
@@ -107,3 +107,25 @@ static int always_valid(const char *filename __attribute__((unused)))
}
int (*maria_test_invalid_symlink)(const char *filename)= always_valid;
+
+#ifdef HAVE_PSI_INTERFACE
+PSI_mutex_key ma_key_mutex_PAGECACHE_cache_lock;
+
+static PSI_mutex_info all_mutexes[]=
+{
+ { &ma_key_mutex_PAGECACHE_cache_lock, "PAGECACHE::cache_lock", 0}
+};
+
+void init_aria_psi_keys()
+{
+ const char* category= "aria";
+ int count;
+
+ if (PSI_server == NULL)
+ return;
+
+ count= array_elements(all_mutexes);
+ PSI_server->register_mutex(category, all_mutexes, count);
+}
+#endif /* HAVE_PSI_INTERFACE */
+
diff --git a/storage/maria/ma_statrec.c b/storage/maria/ma_statrec.c
index 0aa3a3acbc1..9e01e5d062a 100644
--- a/storage/maria/ma_statrec.c
+++ b/storage/maria/ma_statrec.c
@@ -284,7 +284,7 @@ int _ma_read_rnd_static_record(MARIA_HA *info, uchar *buf,
info->s->base.pack_reclength - info->s->base.reclength);
}
if (locked)
- VOID(_ma_writeinfo(info,0)); /* Unlock keyfile */
+ _ma_writeinfo(info,0); /* Unlock keyfile */
if (!error)
{
if (!buf[0])
diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c
index affa3a71634..90c9b4a9c7f 100644
--- a/storage/maria/ma_test1.c
+++ b/storage/maria/ma_test1.c
@@ -226,7 +226,7 @@ static int run_test(const char *filename)
{
if (testflag)
break;
- VOID(maria_close(file));
+ maria_close(file);
exit(0);
}
j=i%25 +1;
@@ -314,7 +314,7 @@ static int run_test(const char *filename)
found=0;
while ((error= maria_scan(file,read_record)) == 0)
{
- if (--update_count == 0) { VOID(maria_close(file)) ; exit(0) ; }
+ if (--update_count == 0) { maria_close(file); exit(0) ; }
memcpy(record,read_record,rec_length);
update_record(record);
if (maria_update(file,read_record,record))
@@ -596,7 +596,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_key);
int4store(pos,tmp);
ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
+ memcpy(pos+4,&ptr,sizeof(char*));
pos+=recinfo[0].length;
}
else if (recinfo[0].type == FIELD_VARCHAR)
@@ -624,7 +624,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_record);
int4store(pos,tmp);
ptr=blob_record;
- memcpy_fixed(pos+4,&ptr,sizeof(char*));
+ memcpy(pos+4,&ptr,sizeof(char*));
}
else if (recinfo[1].type == FIELD_VARCHAR)
{
@@ -653,10 +653,10 @@ static void update_record(uchar *record)
uchar *column,*ptr;
int length;
length=uint4korr(pos); /* Long blob */
- memcpy_fixed(&column,pos+4,sizeof(char*));
+ memcpy(&column,pos+4,sizeof(char*));
memcpy(blob_key,column,length); /* Move old key */
ptr=blob_key;
- memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */
+ memcpy(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */
if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM)
default_charset_info->cset->casedn(default_charset_info,
(char*) blob_key, length,
@@ -686,13 +686,13 @@ static void update_record(uchar *record)
uchar *column;
int length;
length=uint4korr(pos);
- memcpy_fixed(&column,pos+4,sizeof(char*));
+ memcpy(&column,pos+4,sizeof(char*));
memcpy(blob_record,column,length);
bfill(blob_record+length,20,'.'); /* Make it larger */
length+=20;
int4store(pos,length);
column=blob_record;
- memcpy_fixed(pos+4,&column,sizeof(char*));
+ memcpy(pos+4,&column,sizeof(char*));
}
else if (recinfo[1].type == FIELD_VARCHAR)
{
@@ -897,3 +897,6 @@ static void usage()
my_print_help(my_long_options);
my_print_variables(my_long_options);
}
+
+#include "ma_check_standalone.h"
+
diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c
index 9e2f32f767b..25684bdb61c 100644
--- a/storage/maria/ma_test2.c
+++ b/storage/maria/ma_test2.c
@@ -887,7 +887,7 @@ int main(int argc, char *argv[])
{
ulong blob_length,pos;
uchar *ptr;
- memcpy_fixed(&ptr, read_record+blob_pos+4, sizeof(ptr));
+ memcpy(&ptr, read_record+blob_pos+4, sizeof(ptr));
blob_length= uint4korr(read_record+blob_pos);
for (pos=0 ; pos < blob_length ; pos++)
{
@@ -1015,7 +1015,7 @@ reads: %10lu\n",
(ulong) maria_pagecache->global_cache_read);
}
maria_end();
- my_free(blob_buffer, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(blob_buffer);
my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO);
return(0);
err:
@@ -1024,7 +1024,7 @@ err:
{
if (maria_commit(file))
goto err;
- VOID(maria_close(file));
+ maria_close(file);
}
maria_end();
return(1);
@@ -1221,7 +1221,7 @@ static void put_blob_in_record(uchar *blob_pos, char **blob_buffer,
for (i=0 ; i < length ; i++)
(*blob_buffer)[i]=(char) (length+i);
int4store(blob_pos,length);
- memcpy_fixed(blob_pos+4,(char*) blob_buffer,sizeof(char*));
+ memcpy(blob_pos+4, blob_buffer, sizeof(char*));
*blob_length= length;
}
else
@@ -1244,3 +1244,6 @@ static void copy_key(MARIA_HA *info,uint inx,uchar *rec,uchar *key_buff)
}
return;
}
+
+#include "ma_check_standalone.h"
+
diff --git a/storage/maria/ma_test3.c b/storage/maria/ma_test3.c
index 040d6fa78c2..d2ce68fc063 100644
--- a/storage/maria/ma_test3.c
+++ b/storage/maria/ma_test3.c
@@ -15,7 +15,7 @@
/* Test av locking */
-#if !(defined (__NETWARE_) || defined (_WIN32)) /*no fork() in Windows*/
+#ifndef _WIN32 /*no fork() in Windows*/
#include "maria.h"
#include <sys/types.h>
@@ -114,7 +114,7 @@ int main(int argc,char **argv)
sleep(1);
return 0;
}
- VOID(rnd(1));
+ rnd(1);
}
for (i=0 ; i < forks ; i++)
@@ -460,7 +460,7 @@ int test_update(MARIA_HA *file,int id,int lock_type)
}
}
}
- memcpy_fixed(new_record.id,record.id,sizeof(record.id));
+ memcpy(new_record.id,record.id,sizeof(record.id));
tmp=rnd(20000)+40000;
int4store(new_record.nr,tmp);
if (!maria_update(file,record.id,new_record.id))
@@ -488,14 +488,17 @@ int test_update(MARIA_HA *file,int id,int lock_type)
return 0;
}
-#else /* __NETWARE__ || __WIN__ */
+#include "ma_check_standalone.h"
+
+#else /* _WIN32 */
#include <stdio.h>
int main()
{
- fprintf(stderr,"this test has not been ported to Netware or Windows\n");
+ fprintf(stderr,"this test has not been ported to Windows\n");
return 0;
}
-#endif /* __NETWARE__|| __WIN__ */
+#endif /* _WIN32 */
+
diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c
index a90578c2162..d9f8306488e 100644
--- a/storage/maria/ma_unique.c
+++ b/storage/maria/ma_unique.c
@@ -123,7 +123,7 @@ ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const uchar *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length= _ma_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy(&pos,pos+keyseg->bit_start,sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
@@ -218,8 +218,8 @@ my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const uchar *a, const uchar *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
- memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
- memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
+ memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*));
+ memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c
index 7b9e006ec43..31459d8587a 100644
--- a/storage/maria/ma_update.c
+++ b/storage/maria/ma_update.c
@@ -185,7 +185,7 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
ma_update() must always pass !0 value as operation, since even if
there is no index change there could be data change.
*/
- VOID(_ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
allow_break(); /* Allow SIGHUP & SIGINT */
if (info->invalidator != 0)
{
@@ -242,7 +242,7 @@ err:
key_changed);
err_end:
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 02eeec754ee..9af17e14978 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -294,7 +294,7 @@ int maria_write(MARIA_HA *info, uchar *record)
info->state->changed= 1;
info->cur_row.lastpos= filepos;
- VOID(_ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
if (info->invalidator != 0)
{
DBUG_PRINT("info", ("invalidator... '%s' (update)",
@@ -399,7 +399,7 @@ err2:
if (!save_errno)
save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */
DBUG_PRINT("error", ("got error: %d", save_errno));
- VOID(_ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
+ _ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
} /* maria_write */
@@ -444,7 +444,7 @@ static my_bool _ma_ck_write_btree(MARIA_HA *info, MARIA_KEY *key)
if (!error)
error= _ma_ft_convert_to_ft2(info, key);
delete_dynamic(info->ft1_to_ft2);
- my_free(info->ft1_to_ft2, MYF(0));
+ my_free(info->ft1_to_ft2);
info->ft1_to_ft2=0;
}
DBUG_RETURN(error);
@@ -469,7 +469,6 @@ static my_bool _ma_ck_write_btree_with_log(MARIA_HA *info, MARIA_KEY *key,
MARIA_KEY org_key;
DBUG_ENTER("_ma_ck_write_btree_with_log");
- LINT_INIT_STRUCT(org_key);
if (share->now_transactional)
{
/* Save original value as the key may change */
@@ -1789,7 +1788,7 @@ void maria_end_bulk_insert(MARIA_HA *info)
delete_tree(&info->bulk_insert[i]);
}
}
- my_free(info->bulk_insert, MYF(0));
+ my_free(info->bulk_insert);
info->bulk_insert= 0;
}
DBUG_VOID_RETURN;
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index 4e19d5878ea..8de969b9b07 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -27,7 +27,6 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
-SET_STACK_SIZE(9000) /* Minimum stack size for program */
#ifndef USE_RAID
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
@@ -150,8 +149,8 @@ int main(int argc, char **argv)
int new_error=maria_chk(&check_param, *(argv++));
if ((check_param.testflag & T_REP_ANY) != T_REP)
check_param.testflag&= ~T_REP;
- VOID(fflush(stdout));
- VOID(fflush(stderr));
+ fflush(stdout);
+ fflush(stderr);
if ((check_param.error_printed | check_param.warning_printed) &&
(check_param.testflag & T_FORCE_CREATE) &&
(!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS |
@@ -163,8 +162,8 @@ int main(int argc, char **argv)
check_param.testflag&= ~T_EXTEND; /* Not needed */
error|=maria_chk(&check_param, argv[-1]);
check_param.testflag= old_testflag;
- VOID(fflush(stdout));
- VOID(fflush(stderr));
+ fflush(stdout);
+ fflush(stderr);
}
else
error|=new_error;
@@ -172,7 +171,7 @@ int main(int argc, char **argv)
check_param.testflag & T_INFO))
{
puts("\n---------\n");
- VOID(fflush(stdout));
+ fflush(stdout);
}
}
end:
@@ -421,13 +420,10 @@ static struct my_option my_long_options[] =
};
-#include <help_start.h>
-
static void print_version(void)
{
printf("%s Ver 1.0 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
- NETWARE_SET_SCREEN_MODE(1);
}
@@ -564,8 +560,6 @@ Recover (repair)/ options (When using '--recover' or '--safe-recover'):\n\
my_print_variables(my_long_options);
}
-#include <help_end.h>
-
const char *maria_stats_method_names[] = {"nulls_unequal", "nulls_equal",
"nulls_ignored", NullS};
TYPELIB maria_stats_method_typelib= {
@@ -874,9 +868,8 @@ static void get_options(register int *argc,register char ***argv)
if ((check_param.testflag & T_UNPACK) &&
(check_param.testflag & (T_QUICK | T_SORT_RECORDS)))
{
- VOID(fprintf(stderr,
- "%s: --unpack can't be used with --quick or --sort-records\n",
- my_progname_short));
+ fprintf(stderr, "%s: --unpack can't be used with --quick or --sort-records\n",
+ my_progname_short);
exit(1);
}
if ((check_param.testflag & T_READONLY) &&
@@ -884,9 +877,8 @@ static void get_options(register int *argc,register char ***argv)
(T_REP_ANY | T_STATISTICS | T_AUTO_INC |
T_SORT_RECORDS | T_SORT_INDEX | T_FORCE_CREATE)))
{
- VOID(fprintf(stderr,
- "%s: Can't use --readonly when repairing or sorting\n",
- my_progname_short));
+ fprintf(stderr, "%s: Can't use --readonly when repairing or sorting\n",
+ my_progname_short);
exit(1);
}
@@ -1065,9 +1057,8 @@ static int maria_chk(HA_CHECK *param, char *filename)
param->language= set_collation->number;
if (maria_recreate_table(param, &info,filename))
{
- VOID(fprintf(stderr,
- "Aria table '%s' is not fixed because of errors\n",
- filename));
+ fprintf(stderr, "Aria table '%s' is not fixed because of errors\n",
+ filename);
return(-1);
}
recreate=1;
@@ -1209,7 +1200,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
#ifndef TO_BE_REMOVED
if (param->out_flag & O_NEW_DATA)
{ /* Change temp file to org file */
- VOID(my_close(info->dfile.file, MYF(MY_WME))); /* Close new file */
+ my_close(info->dfile.file, MYF(MY_WME)); /* Close new file */
error|=maria_change_to_newfile(filename,MARIA_NAME_DEXT,DATA_TMP_EXT,
MYF(0));
if (_ma_open_datafile(info,info->s, NullS, -1))
@@ -1286,20 +1277,20 @@ static int maria_chk(HA_CHECK *param, char *filename)
if ((!rep_quick && !error) ||
!(param->testflag & (T_FAST | T_FORCE_CREATE)))
{
- VOID(init_io_cache(&param->read_cache,datafile,
+ init_io_cache(&param->read_cache,datafile,
(uint) param->read_buffer_length,
READ_CACHE,
(param->start_check_pos ?
param->start_check_pos :
share->pack.header_length),
1,
- MYF(MY_WME)));
+ MYF(MY_WME));
maria_lock_memory(param);
if ((info->s->data_file_type != STATIC_RECORD) ||
(param->testflag & (T_EXTEND | T_MEDIUM)))
error|=maria_chk_data_link(param, info,
test(param->testflag & T_EXTEND));
- VOID(end_io_cache(&param->read_cache));
+ end_io_cache(&param->read_cache);
}
if (!error)
{
@@ -1368,31 +1359,31 @@ end2:
llstr(param->max_found_trid, buff));
}
- VOID(fflush(stdout)); VOID(fflush(stderr));
+ fflush(stdout);
+ fflush(stderr);
if (param->error_printed)
{
if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))
{
- VOID(fprintf(stderr,
- "Aria table '%s' is not fixed because of errors\n",
- filename));
+ fprintf(stderr, "Aria table '%s' is not fixed because of errors\n",
+ filename);
if (param->testflag & T_REP_ANY)
- VOID(fprintf(stderr,
- "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n"));
+ fprintf(stderr, "Try fixing it by using the --safe-recover (-o), "
+ "the --force (-f) option or by not using the --quick (-q) "
+ "flag\n");
}
else if (!(param->error_printed & 2) &&
!(param->testflag & T_FORCE_CREATE))
- VOID(fprintf(stderr,
- "Aria table '%s' is corrupted\nFix it using switch \"-r\" or \"-o\"\n",
- filename));
+ fprintf(stderr, "Aria table '%s' is corrupted\nFix it using switch "
+ "\"-r\" or \"-o\"\n", filename);
}
else if (param->warning_printed &&
! (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX |
T_FORCE_CREATE)))
- VOID(fprintf(stderr, "Aria table '%s' is usable but should be fixed\n",
- filename));
- VOID(fflush(stderr));
+ fprintf(stderr, "Aria table '%s' is usable but should be fixed\n",
+ filename);
+ fflush(stderr);
DBUG_RETURN(error);
} /* maria_chk */
@@ -1528,7 +1519,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
printf("Recordlength: %16d\n",(int) share->base.pack_reclength);
if (! maria_is_all_keys_active(share->state.key_map, share->base.keys))
{
- longlong2str(share->state.key_map,buff,2,1);
+ longlong2str(share->state.key_map,buff,2);
printf("Using only keys '%s' of %d possibly keys\n",
buff, share->base.keys);
}
@@ -1536,7 +1527,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
printf("Key Start Len Index Type");
if (param->testflag & T_VERBOSE)
printf(" Rec/key Root Blocksize");
- VOID(putchar('\n'));
+ putchar('\n');
for (key=keyseg_nr=0, keyinfo= &share->keyinfo[0] ;
key < share->base.keys;
@@ -1575,7 +1566,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
printf("%9.0f %12s %10d",
share->state.rec_per_key_part[keyseg_nr++],
buff,keyinfo->block_length);
- VOID(putchar('\n'));
+ putchar('\n');
while ((++keyseg)->type != HA_KEYTYPE_END)
{
pos=buff;
@@ -1594,7 +1585,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
(long) keyseg->start+1,keyseg->length,buff);
if (param->testflag & T_VERBOSE)
printf("%11.0f", share->state.rec_per_key_part[keyseg_nr++]);
- VOID(putchar('\n'));
+ putchar('\n');
}
keyseg++;
}
@@ -1632,7 +1623,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
printf("\nField Start Length Nullpos Nullbit Type");
if (share->options & HA_OPTION_COMPRESS_RECORD)
printf(" Huff tree Bits");
- VOID(putchar('\n'));
+ putchar('\n');
for (field=0 ; field < share->base.fields ; field++)
{
@@ -1672,7 +1663,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
(uint) (share->columndef[field].huff_tree-share->decode_trees)+1,
share->columndef[field].huff_tree->quick_table_bits);
}
- VOID(putchar('\n'));
+ putchar('\n');
}
if (share->data_file_type == BLOCK_RECORD)
{
@@ -1839,7 +1830,7 @@ static int maria_sort_records(HA_CHECK *param,
goto err;
}
- VOID(my_close(info->dfile.file, MYF(MY_WME)));
+ my_close(info->dfile.file, MYF(MY_WME));
param->out_flag|=O_NEW_DATA; /* Data in new file */
info->dfile.file= new_file; /* Use new datafile */
_ma_set_data_pagecache_callbacks(&info->dfile, info->s);
@@ -1855,14 +1846,15 @@ static int maria_sort_records(HA_CHECK *param,
if (param->testflag & T_WRITE_LOOP)
{
- VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
+ fputs(" \r",stdout);
+ fflush(stdout);
}
got_error=0;
err:
if (got_error && new_file >= 0)
{
- VOID(end_io_cache(&info->rec_cache));
+ end_io_cache(&info->rec_cache);
(void) my_close(new_file,MYF(MY_WME));
(void) my_delete(param->temp_filename, MYF(MY_WME));
}
@@ -1870,10 +1862,10 @@ err:
{
my_afree(temp_buff);
}
- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.record);
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
- VOID(end_io_cache(&info->rec_cache));
- my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ end_io_cache(&info->rec_cache);
+ my_free(sort_info.buff);
sort_info.buff=0;
share->state.sortkey=sort_key;
DBUG_RETURN(got_error);
@@ -1919,7 +1911,6 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param,
endpos= ma_page->buff + used_length;
for ( ;; )
{
- _sanity(__FILE__,__LINE__);
if (nod_flag)
{
next_page= _ma_kpos(nod_flag, keypos);
@@ -1937,7 +1928,6 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param,
new_file, update_index))
goto err;
}
- _sanity(__FILE__,__LINE__);
if (keypos >= endpos ||
!(*keyinfo->get_key)(&tmp_key, page_flag, nod_flag, &keypos))
break;
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index ba97684b1aa..e1ebde515dd 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -1188,11 +1188,11 @@ int _ma_flush_table_files(MARIA_HA *info, uint flush_data_or_index,
See ma_check_standalone.h .
*/
int _ma_killed_ptr(HA_CHECK *param);
-void _ma_check_print_error _VARARGS((HA_CHECK *param, const char *fmt, ...))
+void _ma_check_print_error(HA_CHECK *param, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
-void _ma_check_print_warning _VARARGS((HA_CHECK *param, const char *fmt, ...))
+void _ma_check_print_warning(HA_CHECK *param, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
-void _ma_check_print_info _VARARGS((HA_CHECK *param, const char *fmt, ...))
+void _ma_check_print_info(HA_CHECK *param, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
my_bool write_log_record_for_repair(const HA_CHECK *param, MARIA_HA *info);
C_MODE_END
@@ -1265,3 +1265,18 @@ extern PAGECACHE *maria_log_pagecache;
extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func,
void *func_arg);
int ma_check_index_cond(register MARIA_HA *info, uint keynr, uchar *record);
+
+#ifdef HAVE_PSI_INTERFACE
+extern PSI_mutex_key ma_key_mutex_PAGECACHE_cache_lock;
+
+//extern PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_key_root_lock;
+
+//extern PSI_cond_key mi_key_cond_MI_SORT_INFO_cond;
+
+//extern PSI_file_key mi_key_file_datatmp;
+
+//extern PSI_thread_key mi_key_thread_find_all_keys;
+
+void init_aria_psi_keys();
+#endif /* HAVE_PSI_INTERFACE */
+
diff --git a/storage/maria/maria_ftdump.c b/storage/maria/maria_ftdump.c
index 870d07fa96e..92e57fa9a1e 100644
--- a/storage/maria/maria_ftdump.c
+++ b/storage/maria/maria_ftdump.c
@@ -259,18 +259,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
-#include <help_start.h>
static void usage()
{
printf("Use: aria_ft_dump <table_name> <index_num>\n");
my_print_help(my_long_options);
my_print_variables(my_long_options);
- NETWARE_SET_SCREEN_MODE(1);
exit(1);
}
-#include <help_end.h>
static void complain(int val) /* Kinda assert :-) */
{
@@ -280,3 +277,6 @@ static void complain(int val) /* Kinda assert :-) */
exit(1);
}
}
+
+#include "ma_check_standalone.h"
+
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index 1d2d3995bd8..351a2014059 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -239,8 +239,8 @@ int main(int argc, char **argv)
}
if (ok && isamchk_neaded && !silent)
puts("Remember to run aria_chk -rq on compressed tables");
- VOID(fflush(stdout));
- VOID(fflush(stderr));
+ fflush(stdout);
+ fflush(stderr);
free_defaults(default_argv);
maria_end();
my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
@@ -289,13 +289,10 @@ static struct my_option my_long_options[] =
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-#include <help_start.h>
static void print_version(void)
{
- VOID(printf("%s Ver 1.0 for %s on %s\n",
- my_progname, SYSTEM_TYPE, MACHINE_TYPE));
- NETWARE_SET_SCREEN_MODE(1);
+ printf("%s Ver 1.0 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -312,13 +309,12 @@ static void usage(void)
puts("You should give the .MAI file as the filename argument.");
puts("To unpack a packed table, run aria_chk -u on the table");
- VOID(printf("\nUsage: %s [OPTIONS] filename...\n", my_progname));
+ printf("\nUsage: %s [OPTIONS] filename...\n", my_progname);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
}
-#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@@ -410,7 +406,7 @@ static MARIA_HA *open_maria_file(char *name,int mode)
(opt_wait ? HA_OPEN_WAIT_IF_LOCKED :
HA_OPEN_ABORT_IF_LOCKED))))
{
- VOID(fprintf(stderr, "%s gave error %d on open\n", name, my_errno));
+ fprintf(stderr, "%s gave error %d on open\n", name, my_errno);
DBUG_RETURN(0);
}
share=isam_file->s;
@@ -418,8 +414,8 @@ static MARIA_HA *open_maria_file(char *name,int mode)
{
if (!force_pack)
{
- VOID(fprintf(stderr, "%s is already compressed\n", name));
- VOID(maria_close(isam_file));
+ fprintf(stderr, "%s is already compressed\n", name);
+ maria_close(isam_file);
DBUG_RETURN(0);
}
if (verbose)
@@ -430,11 +426,11 @@ static MARIA_HA *open_maria_file(char *name,int mode)
(share->state.state.records <= 1 ||
share->state.state.data_file_length < 1024))
{
- VOID(fprintf(stderr, "%s is too small to compress\n", name));
- VOID(maria_close(isam_file));
+ fprintf(stderr, "%s is too small to compress\n", name);
+ maria_close(isam_file);
DBUG_RETURN(0);
}
- VOID(maria_lock_database(isam_file,F_WRLCK));
+ maria_lock_database(isam_file,F_WRLCK);
maria_ignore_trids(isam_file);
DBUG_RETURN(isam_file);
}
@@ -477,12 +473,12 @@ static my_bool open_maria_files(PACK_MRG_INFO *mrg,char **names,uint count)
return 0;
diff_file:
- VOID(fprintf(stderr, "%s: Tables '%s' and '%s' are not identical\n",
- my_progname, names[j], names[j+1]));
+ fprintf(stderr, "%s: Tables '%s' and '%s' are not identical\n",
+ my_progname, names[j], names[j+1]);
error:
while (i--)
maria_close(mrg->file[i]);
- my_free(mrg->file, MYF(0));
+ my_free(mrg->file);
return 1;
}
@@ -510,11 +506,9 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
/* Create temporary or join file */
if (backup)
- VOID(fn_format(org_name,isam_file->s->open_file_name.str,
- "",MARIA_NAME_DEXT, 2));
+ fn_format(org_name,isam_file->s->open_file_name.str, "",MARIA_NAME_DEXT, 2);
else
- VOID(fn_format(org_name,isam_file->s->open_file_name.str,
- "",MARIA_NAME_DEXT, 2+4+16));
+ fn_format(org_name,isam_file->s->open_file_name.str, "",MARIA_NAME_DEXT, 2+4+16);
if (init_pagecache(maria_pagecache, MARIA_MIN_PAGE_CACHE_SIZE, 0, 0,
maria_block_size, MY_WME) == 0)
@@ -529,7 +523,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
uint length;
uchar *buff;
strmov(org_name,result_table); /* Fix error messages */
- VOID(fn_format(new_name,result_table,"",MARIA_NAME_IEXT,2));
+ fn_format(new_name,result_table,"",MARIA_NAME_IEXT,2);
if ((join_maria_file=my_create(new_name,0,tmpfile_createflag,MYF(MY_WME)))
< 0)
goto err;
@@ -540,16 +534,16 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
my_write(join_maria_file,buff,length,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
{
- my_free(buff,MYF(0));
+ my_free(buff);
goto err;
}
- my_free(buff,MYF(0));
- VOID(fn_format(new_name,result_table,"",MARIA_NAME_DEXT,2));
+ my_free(buff);
+ fn_format(new_name,result_table,"",MARIA_NAME_DEXT,2);
}
else if (!tmp_dir[0])
- VOID(make_new_name(new_name,org_name));
+ make_new_name(new_name,org_name);
else
- VOID(fn_format(new_name,org_name,tmp_dir,DATA_TMP_EXT,1+2+4));
+ fn_format(new_name,org_name,tmp_dir,DATA_TMP_EXT,1+2+4);
if (!test_only &&
(new_file=my_create(new_name,0,tmpfile_createflag,MYF(MY_WME))) < 0)
goto err;
@@ -565,22 +559,21 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
(ulong) mrg->records));
if (write_loop || verbose)
{
- VOID(printf("Compressing %s: (%lu records)\n",
- result_table ? new_name : org_name, (ulong) mrg->records));
+ printf("Compressing %s: (%lu records)\n",
+ result_table ? new_name : org_name, (ulong) mrg->records);
}
trees=fields=share->base.fields;
huff_counts=init_huff_count(isam_file,mrg->records);
- QUICK_SAFEMALLOC;
/*
Read the whole data file(s) for statistics.
*/
DBUG_PRINT("info", ("- Calculating statistics"));
if (write_loop || verbose)
- VOID(printf("- Calculating statistics\n"));
+ printf("- Calculating statistics\n");
if (get_statistic(mrg,huff_counts))
goto err;
- NORMAL_SAFEMALLOC;
+
old_length=0;
for (i=0; i < mrg->count ; i++)
old_length+= (mrg->file[i]->s->state.state.data_file_length -
@@ -627,7 +620,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
*/
file_buffer.pos_in_file=HEAD_LENGTH;
if (! test_only)
- VOID(my_seek(new_file,file_buffer.pos_in_file,MY_SEEK_SET,MYF(0)));
+ my_seek(new_file,file_buffer.pos_in_file,MY_SEEK_SET,MYF(0));
/*
Write field infos: field type, pack type, length bits, tree number.
@@ -653,7 +646,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
*/
DBUG_PRINT("info", ("- Compressing file"));
if (write_loop || verbose)
- VOID(printf("- Compressing file\n"));
+ printf("- Compressing file\n");
error=compress_maria_file(mrg,huff_counts);
new_length=file_buffer.pos_in_file;
if (!error && !test_only)
@@ -680,9 +673,9 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
mrg->min_pack_length, mrg->max_pack_length,
(ulong) (mrg->records ? (new_length/mrg->records) : 0)));
if (verbose && mrg->records)
- VOID(printf("Min record length: %6d Max length: %6d "
+ printf("Min record length: %6d Max length: %6d "
"Mean total length: %6ld\n", mrg->min_pack_length,
- mrg->max_pack_length, (ulong) (new_length/mrg->records)));
+ mrg->max_pack_length, (ulong) (new_length/mrg->records));
/* Close source and target file. */
if (!test_only)
@@ -720,9 +713,9 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
error=my_rename(new_name,org_name,MYF(MY_WME));
if (!error)
{
- VOID(my_copystat(temp_name,org_name,MYF(MY_COPYTIME)));
+ my_copystat(temp_name,org_name,MYF(MY_COPYTIME));
if (tmp_dir[0])
- VOID(my_delete(new_name,MYF(MY_WME)));
+ my_delete(new_name,MYF(MY_WME));
}
}
}
@@ -733,7 +726,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
error=my_copy(new_name,org_name,
MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_COPYTIME));
if (!error)
- VOID(my_delete(new_name,MYF(MY_WME)));
+ my_delete(new_name,MYF(MY_WME));
}
else
error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME));
@@ -747,16 +740,16 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
error|=my_close(join_maria_file,MYF(MY_WME));
if (error)
{
- VOID(fprintf(stderr, "Aborting: %s is not compressed\n", org_name));
- VOID(my_delete(new_name,MYF(MY_WME)));
+ fprintf(stderr, "Aborting: %s is not compressed\n", org_name);
+ my_delete(new_name,MYF(MY_WME));
DBUG_RETURN(-1);
}
if (write_loop || verbose)
{
if (old_length)
- VOID(printf("%.4g%% \n",
+ printf("%.4g%% \n",
(((longlong) (old_length - new_length)) * 100.0 /
- (longlong) old_length)));
+ (longlong) old_length));
else
puts("Empty file saved in compressed format");
}
@@ -766,11 +759,11 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
end_pagecache(maria_pagecache, 1);
free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields);
if (new_file >= 0)
- VOID(my_close(new_file,MYF(0)));
+ my_close(new_file,MYF(0));
if (join_maria_file >= 0)
- VOID(my_close(join_maria_file,MYF(0)));
+ my_close(join_maria_file,MYF(0));
mrg_close(mrg);
- VOID(fprintf(stderr, "Aborted: %s is not compressed\n", org_name));
+ fprintf(stderr, "Aborted: %s is not compressed\n", org_name);
DBUG_RETURN(-1);
}
@@ -828,11 +821,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
for (i=0 ; i < trees ; i++)
{
if (huff_trees[i].element_buffer)
- my_free(huff_trees[i].element_buffer,MYF(0));
+ my_free(huff_trees[i].element_buffer);
if (huff_trees[i].code)
- my_free(huff_trees[i].code,MYF(0));
+ my_free(huff_trees[i].code);
}
- my_free(huff_trees,MYF(0));
+ my_free(huff_trees);
}
if (huff_counts)
{
@@ -840,11 +833,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
{
if (huff_counts[i].tree_buff)
{
- my_free(huff_counts[i].tree_buff,MYF(0));
+ my_free(huff_counts[i].tree_buff);
delete_tree(&huff_counts[i].int_tree);
}
}
- my_free(huff_counts, MYF(0));
+ my_free(huff_counts);
}
delete_queue(&queue); /* This is safe to free */
return;
@@ -940,7 +933,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
count->int_tree.elements_in_tree > 1))
{
delete_tree(&count->int_tree);
- my_free(count->tree_buff,MYF(0));
+ my_free(count->tree_buff);
count->tree_buff=0;
}
else
@@ -1019,7 +1012,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint field_length=count->field_length -portable_sizeof_char_ptr;
ulong blob_length= _ma_calc_blob_length(field_length, start_pos);
- memcpy_fixed((char*) &pos, start_pos+field_length,sizeof(char*));
+ memcpy(&pos, start_pos+field_length,sizeof(char*));
end_pos=pos+blob_length;
tot_blob_length+=blob_length;
set_if_bigger(count->max_length,blob_length);
@@ -1078,13 +1071,13 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
record_count++;
if (write_loop && record_count % WRITE_COUNT == 0)
{
- VOID(printf("%lu\r", (ulong) record_count));
- VOID(fflush(stdout));
+ printf("%lu\r", (ulong) record_count);
+ fflush(stdout);
}
}
else if (error != HA_ERR_RECORD_DELETED)
{
- VOID(fprintf(stderr, "Got error %d while reading rows\n", error));
+ fprintf(stderr, "Got error %d while reading rows\n", error);
break;
}
@@ -1092,8 +1085,8 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
}
if (write_loop)
{
- VOID(printf(" \r"));
- VOID(fflush(stdout));
+ printf(" \r");
+ fflush(stdout);
}
/*
@@ -1105,8 +1098,8 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_PRINT("info", ("Found the following number of incidents "
"of the uchar codes:"));
if (verbose >= 2)
- VOID(printf("Found the following number of incidents "
- "of the uchar codes:\n"));
+ printf("Found the following number of incidents "
+ "of the uchar codes:\n");
for (count= huff_counts ; count < end_count; count++)
{
uint idx;
@@ -1115,16 +1108,16 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_PRINT("info", ("column: %3u", (uint) (count - huff_counts + 1)));
if (verbose >= 2)
- VOID(printf("column: %3u\n", (uint) (count - huff_counts + 1)));
+ printf("column: %3u\n", (uint) (count - huff_counts + 1));
if (count->tree_buff)
{
DBUG_PRINT("info", ("number of distinct values: %u",
(uint) ((count->tree_pos - count->tree_buff) /
count->field_length)));
if (verbose >= 2)
- VOID(printf("number of distinct values: %u\n",
+ printf("number of distinct values: %u\n",
(uint) ((count->tree_pos - count->tree_buff) /
- count->field_length)));
+ count->field_length));
}
total_count= 0;
for (idx= 0; idx < 256; idx++)
@@ -1135,16 +1128,16 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_PRINT("info", ("counts[0x%02x]: %12s", idx,
llstr((longlong) count->counts[idx], llbuf)));
if (verbose >= 2)
- VOID(printf("counts[0x%02x]: %12s\n", idx,
- llstr((longlong) count->counts[idx], llbuf)));
+ printf("counts[0x%02x]: %12s\n", idx,
+ llstr((longlong) count->counts[idx], llbuf));
}
}
DBUG_PRINT("info", ("total: %12s", llstr((longlong) total_count,
llbuf)));
if ((verbose >= 2) && total_count)
{
- VOID(printf("total: %12s\n",
- llstr((longlong) total_count, llbuf)));
+ printf("total: %12s\n",
+ llstr((longlong) total_count, llbuf));
}
}
@@ -1337,12 +1330,12 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
}
else
{
- my_free(huff_counts->tree_buff,MYF(0));
+ my_free(huff_counts->tree_buff);
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff=0;
}
if (tree.element_buffer)
- my_free(tree.element_buffer,MYF(0));
+ my_free(tree.element_buffer);
}
if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS)
space_fields++;
@@ -1361,7 +1354,7 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
field_count[FIELD_INTERVALL],
field_count[FIELD_ZERO]));
if (verbose)
- VOID(printf("\nnormal: %3d empty-space: %3d "
+ printf("\nnormal: %3d empty-space: %3d "
"empty-zero: %3d empty-fill: %3d\n"
"pre-space: %3d end-space: %3d "
"intervall-fields: %3d zero: %3d\n",
@@ -1370,7 +1363,7 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
field_count[FIELD_SKIP_PRESPACE],
field_count[FIELD_SKIP_ENDSPACE],
field_count[FIELD_INTERVALL],
- field_count[FIELD_ZERO]));
+ field_count[FIELD_ZERO]);
DBUG_VOID_RETURN;
}
@@ -1460,8 +1453,8 @@ static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees)
if (make_huff_tree(huff_tree+tree,huff_counts+tree))
{
while (tree--)
- my_free(huff_tree[tree].element_buffer,MYF(0));
- my_free(huff_tree,MYF(0));
+ my_free(huff_tree[tree].element_buffer);
+ my_free(huff_tree);
DBUG_RETURN(0);
}
}
@@ -1861,9 +1854,8 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i->tree->tree_pack_length+j->tree->tree_pack_length+
ALLOWED_JOIN_DIFF)
{
- memcpy_fixed((uchar*) i->counts,(uchar*) count.counts,
- sizeof(count.counts[0])*256);
- my_free((uchar*) j->tree->element_buffer,MYF(0));
+ memcpy(i->counts,(uchar*) count.counts, sizeof(count.counts[0])*256);
+ my_free(j->tree->element_buffer);
j->tree->element_buffer=0;
j->tree=i->tree;
bmove((uchar*) i->counts,(uchar*) count.counts,
@@ -1878,7 +1870,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
DBUG_PRINT("info", ("Original trees: %d After join: %d",
trees, tree_number));
if (verbose)
- VOID(printf("Original trees: %d After join: %d\n", trees, tree_number));
+ printf("Original trees: %d After join: %d\n", trees, tree_number);
return tree_number; /* Return trees left */
}
@@ -2012,7 +2004,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
uchar *buff= (uchar*) file_buffer.pos;
bzero(buff,HEAD_LENGTH);
- memcpy_fixed(buff,maria_pack_file_magic,4);
+ memcpy(buff,maria_pack_file_magic,4);
int4store(buff+4,head_length);
int4store(buff+8, mrg->min_pack_length);
int4store(buff+12,mrg->max_pack_length);
@@ -2024,7 +2016,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
buff[27]= (uchar) maria_get_pointer_length((ulonglong) filelength,2);
if (test_only)
return 0;
- VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0)));
+ my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0));
return my_write(file_buffer.file,(const uchar *) file_buffer.pos,HEAD_LENGTH,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
}
@@ -2057,24 +2049,24 @@ static void write_field_info(HUFF_COUNTS *counts, uint fields, uint trees)
DBUG_PRINT("info", (" "));
if (verbose >= 2)
{
- VOID(printf("\n"));
- VOID(printf("column types:\n"));
- VOID(printf("FIELD_NORMAL 0\n"));
- VOID(printf("FIELD_SKIP_ENDSPACE 1\n"));
- VOID(printf("FIELD_SKIP_PRESPACE 2\n"));
- VOID(printf("FIELD_SKIP_ZERO 3\n"));
- VOID(printf("FIELD_BLOB 4\n"));
- VOID(printf("FIELD_CONSTANT 5\n"));
- VOID(printf("FIELD_INTERVALL 6\n"));
- VOID(printf("FIELD_ZERO 7\n"));
- VOID(printf("FIELD_VARCHAR 8\n"));
- VOID(printf("FIELD_CHECK 9\n"));
- VOID(printf("\n"));
- VOID(printf("pack type as a set of flags:\n"));
- VOID(printf("PACK_TYPE_SELECTED 1\n"));
- VOID(printf("PACK_TYPE_SPACE_FIELDS 2\n"));
- VOID(printf("PACK_TYPE_ZERO_FILL 4\n"));
- VOID(printf("\n"));
+ printf("\n");
+ printf("column types:\n");
+ printf("FIELD_NORMAL 0\n");
+ printf("FIELD_SKIP_ENDSPACE 1\n");
+ printf("FIELD_SKIP_PRESPACE 2\n");
+ printf("FIELD_SKIP_ZERO 3\n");
+ printf("FIELD_BLOB 4\n");
+ printf("FIELD_CONSTANT 5\n");
+ printf("FIELD_INTERVALL 6\n");
+ printf("FIELD_ZERO 7\n");
+ printf("FIELD_VARCHAR 8\n");
+ printf("FIELD_CHECK 9\n");
+ printf("\n");
+ printf("pack type as a set of flags:\n");
+ printf("PACK_TYPE_SELECTED 1\n");
+ printf("PACK_TYPE_SPACE_FIELDS 2\n");
+ printf("PACK_TYPE_ZERO_FILL 4\n");
+ printf("\n");
}
for (i=0 ; i++ < fields ; counts++)
{
@@ -2091,10 +2083,10 @@ static void write_field_info(HUFF_COUNTS *counts, uint fields, uint trees)
counts->max_zero_fill, counts->length_bits,
counts->tree->tree_number, counts->field_length));
if (verbose >= 2)
- VOID(printf("column: %3u type: %2u pack: %2u zero: %4u lbits: %2u "
+ printf("column: %3u type: %2u pack: %2u zero: %4u lbits: %2u "
"tree: %2u length: %4u\n", i , counts->field_type,
counts->pack_type, counts->max_zero_fill, counts->length_bits,
- counts->tree->tree_number, counts->field_length));
+ counts->tree->tree_number, counts->field_length);
}
flush_bits();
return;
@@ -2129,7 +2121,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
DBUG_PRINT("info", (" "));
if (verbose >= 2)
- VOID(printf("\n"));
+ printf("\n");
tree_no= 0;
intervall_length=0;
for (elements=0; trees-- ; huff_tree++)
@@ -2140,7 +2132,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
tree_no++;
DBUG_PRINT("info", (" "));
if (verbose >= 3)
- VOID(printf("\n"));
+ printf("\n");
/* Count the total number of elements (byte codes or column values). */
elements+=huff_tree->elements;
huff_tree->max_offset=2;
@@ -2159,8 +2151,8 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
*/
if (huff_tree->max_offset >= IS_OFFSET)
{ /* This should be impossible */
- VOID(fprintf(stderr, "Tree offset got too big: %d, aborted\n",
- huff_tree->max_offset));
+ fprintf(stderr, "Tree offset got too big: %d, aborted\n",
+ huff_tree->max_offset);
my_afree(packed_tree);
return 0;
}
@@ -2199,19 +2191,19 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
"bufflen" : "min_chr", huff_tree->counts->tree_buff ?
int_length : huff_tree->min_chr, huff_tree->height));
if (verbose >= 2)
- VOID(printf("tree: %2u elements: %4u char_bits: %2u offset_bits: %2u "
+ printf("tree: %2u elements: %4u char_bits: %2u offset_bits: %2u "
"%s: %5u codelen: %2u\n", tree_no, huff_tree->elements,
huff_tree->char_bits, huff_tree->offset_bits,
huff_tree->counts->tree_buff ? "bufflen" : "min_chr",
huff_tree->counts->tree_buff ? int_length :
- huff_tree->min_chr, huff_tree->height));
+ huff_tree->min_chr, huff_tree->height);
/* Check that the code tree length matches the element count. */
length=(uint) (offset-packed_tree);
if (length != huff_tree->elements*2-2)
{
- VOID(fprintf(stderr, "error: Huff-tree-length: %d != calc_length: %d\n",
- length, huff_tree->elements * 2 - 2));
+ fprintf(stderr, "error: Huff-tree-length: %d != calc_length: %d\n",
+ length, huff_tree->elements * 2 - 2);
errors++;
break;
}
@@ -2228,10 +2220,10 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
" -> " : "", (packed_tree[i] & IS_OFFSET) ?
packed_tree[i] - IS_OFFSET + i : packed_tree[i]));
if (verbose >= 3)
- VOID(printf("tree[0x%04x]: %s0x%04x\n",
+ printf("tree[0x%04x]: %s0x%04x\n",
i, (packed_tree[i] & IS_OFFSET) ? " -> " : "",
(packed_tree[i] & IS_OFFSET) ?
- packed_tree[i] - IS_OFFSET + i : packed_tree[i]));
+ packed_tree[i] - IS_OFFSET + i : packed_tree[i]);
}
flush_bits();
@@ -2253,9 +2245,9 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
bindigits(huff_tree->code[i],
huff_tree->code_len[i])));
if (verbose >= 3)
- VOID(printf("code[0x%04x]: 0x%s bits: %2u bin: %s\n", i,
+ printf("code[0x%04x]: 0x%s bits: %2u bin: %s\n", i,
hexdigits(huff_tree->code[i]), huff_tree->code_len[i],
- bindigits(huff_tree->code[i], huff_tree->code_len[i])));
+ bindigits(huff_tree->code[i], huff_tree->code_len[i]));
/* Check that the encode table decodes correctly. */
code= 0;
@@ -2268,9 +2260,9 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
{
if (! len)
{
- VOID(fflush(stdout));
- VOID(fprintf(stderr, "error: code 0x%s with %u bits not found\n",
- hexdigits(huff_tree->code[i]), huff_tree->code_len[i]));
+ fflush(stdout);
+ fprintf(stderr, "error: code 0x%s with %u bits not found\n",
+ hexdigits(huff_tree->code[i]), huff_tree->code_len[i]);
errors++;
break;
}
@@ -2279,18 +2271,17 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
bits++;
if (bits > 8 * sizeof(code))
{
- VOID(fflush(stdout));
- VOID(fprintf(stderr, "error: Huffman code too long: %u/%u\n",
- bits, (uint) (8 * sizeof(code))));
+ fflush(stdout);
+ fprintf(stderr, "error: Huffman code too long: %u/%u\n",
+ bits, (uint) (8 * sizeof(code)));
errors++;
break;
}
idx+= (uint) code & 1;
if (idx >= length)
{
- VOID(fflush(stdout));
- VOID(fprintf(stderr, "error: illegal tree offset: %u/%u\n",
- idx, length));
+ fflush(stdout);
+ fprintf(stderr, "error: illegal tree offset: %u/%u\n", idx, length);
errors++;
break;
}
@@ -2305,9 +2296,9 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
DBUG_EXECUTE_IF("forcechkerr4", packed_tree[idx]++;);
if (packed_tree[idx] != i)
{
- VOID(fflush(stdout));
- VOID(fprintf(stderr, "error: decoded value 0x%04x should be: 0x%04x\n",
- packed_tree[idx], i));
+ fflush(stdout);
+ fprintf(stderr, "error: decoded value 0x%04x should be: 0x%04x\n",
+ packed_tree[idx], i);
errors++;
break;
}
@@ -2324,19 +2315,19 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
DBUG_PRINT("info", ("column_values[0x%04x]: 0x%02x",
i, (uchar) huff_tree->counts->tree_buff[i]));
if (verbose >= 3)
- VOID(printf("column_values[0x%04x]: 0x%02x\n",
- i, (uchar) huff_tree->counts->tree_buff[i]));
+ printf("column_values[0x%04x]: 0x%02x\n",
+ i, (uchar) huff_tree->counts->tree_buff[i]);
}
}
flush_bits();
}
DBUG_PRINT("info", (" "));
if (verbose >= 2)
- VOID(printf("\n"));
+ printf("\n");
my_afree(packed_tree);
if (errors)
{
- VOID(fprintf(stderr, "Error: Generated decode trees are corrupt. Stop.\n"));
+ fprintf(stderr, "Error: Generated decode trees are corrupt. Stop.\n");
return 0;
}
return elements;
@@ -2680,8 +2671,7 @@ static int compress_maria_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT("fields", ("FIELD_BLOB %lu bytes, bits: %2u",
blob_length, count->length_bits));
write_bits(blob_length,count->length_bits);
- memcpy_fixed(&blob,end_pos-portable_sizeof_char_ptr,
- sizeof(char*));
+ memcpy(&blob,end_pos-portable_sizeof_char_ptr, sizeof(char*));
blob_end=blob+blob_length;
/* Encode the blob bytes. */
for ( ; blob < blob_end ; blob++)
@@ -2770,8 +2760,8 @@ static int compress_maria_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
record_count++;
if (write_loop && record_count % WRITE_COUNT == 0)
{
- VOID(printf("%lu\r", (ulong) record_count));
- VOID(fflush(stdout));
+ printf("%lu\r", (ulong) record_count);
+ fflush(stdout);
}
}
else if (error != HA_ERR_RECORD_DELETED)
@@ -2781,11 +2771,10 @@ static int compress_maria_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
error=0;
else
{
- VOID(fprintf(stderr, "%s: Got error %d reading records\n",
- my_progname, error));
+ fprintf(stderr, "%s: Got error %d reading records\n", my_progname, error);
}
if (verbose >= 2)
- VOID(printf("wrote %s records.\n", llstr((longlong) record_count, llbuf)));
+ printf("wrote %s records.\n", llstr((longlong) record_count, llbuf));
my_afree(record);
mrg->ref_length=max_pack_length;
@@ -2880,7 +2869,7 @@ static int flush_buffer(ulong neaded_length)
static void end_file_buffer(void)
{
- my_free(file_buffer.buffer, MYF(0));
+ my_free(file_buffer.buffer);
}
/* output `bits` low bits of `value' */
@@ -2914,7 +2903,7 @@ static void write_bits(register ulonglong value, register uint bits)
if (bits != 8 * sizeof(value))
value&= (((ulonglong) 1) << bits) - 1;
if (file_buffer.pos >= file_buffer.end)
- VOID(flush_buffer(~ (ulong) 0));
+ flush_buffer(~ (ulong) 0);
file_buffer.bits=(int) (BITS_SAVED - bits);
file_buffer.bitbucket= value << (BITS_SAVED - bits);
}
@@ -2937,7 +2926,7 @@ static void flush_bits(void)
*file_buffer.pos++= (uchar) (bit_buffer >> bits);
}
if (file_buffer.pos >= file_buffer.end)
- VOID(flush_buffer(~ (ulong) 0));
+ flush_buffer(~ (ulong) 0);
file_buffer.bits= BITS_SAVED;
file_buffer.bitbucket= 0;
}
@@ -2993,7 +2982,7 @@ static int save_state(MARIA_HA *isam_file,PACK_MRG_INFO *mrg,
share->changed=1; /* Force write of header */
share->state.open_count=0;
share->global_changed=0;
- VOID(my_chsize(share->kfile.file, share->base.keystart, 0, MYF(0)));
+ my_chsize(share->kfile.file, share->base.keystart, 0, MYF(0));
if (share->base.keys)
isamchk_neaded=1;
DBUG_RETURN(_ma_state_info_write_sub(share->kfile.file,
@@ -3103,7 +3092,7 @@ static int mrg_close(PACK_MRG_INFO *mrg)
for (i=0 ; i < mrg->count ; i++)
error|=maria_close(mrg->file[i]);
if (mrg->free_file)
- my_free(mrg->file, MYF(0));
+ my_free(mrg->file);
DBUG_RETURN(error);
}
@@ -3166,7 +3155,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count)
*/
if (huff_counts->tree_buff)
{
- my_free(huff_counts->tree_buff, MYF(0));
+ my_free(huff_counts->tree_buff);
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff= NULL;
DBUG_PRINT("fakebigcodes", ("freed distinct column values"));
@@ -3232,3 +3221,6 @@ static int fakecmp(my_off_t **count1, my_off_t **count2)
(**count1 > **count2) ? -1 : 0);
}
#endif
+
+#include "ma_check_standalone.h"
+
diff --git a/storage/maria/maria_read_log.c b/storage/maria/maria_read_log.c
index de45eb0bcb6..6f273b11ce8 100644
--- a/storage/maria/maria_read_log.c
+++ b/storage/maria/maria_read_log.c
@@ -232,13 +232,11 @@ static struct my_option my_long_options[] =
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-#include <help_start.h>
static void print_version(void)
{
- VOID(printf("%s Ver 1.3 for %s on %s\n",
- my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
- NETWARE_SET_SCREEN_MODE(1);
+ printf("%s Ver 1.3 for %s on %s\n",
+ my_progname_short, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -257,14 +255,13 @@ static void usage(void)
"files created during normal execution. This should be ok, except for\n"
"test scripts that tries to compare files before and after recovery.");
#endif
- VOID(printf("\nUsage: %s OPTIONS\n", my_progname_short));
+ printf("\nUsage: %s OPTIONS\n", my_progname_short);
puts("You need to use one of -d or -a");
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
}
-#include <help_end.h>
static my_bool
get_one_option(int optid __attribute__((unused)),
@@ -306,3 +303,4 @@ static void get_options(int *argc,char ***argv)
exit(1);
maria_tmpdir= &maria_chk_tmpdir;
}
+
diff --git a/storage/maria/plug.in b/storage/maria/plug.in
index 008d82250c8..00b974c356a 100644
--- a/storage/maria/plug.in
+++ b/storage/maria/plug.in
@@ -14,6 +14,6 @@ AC_ARG_WITH(aria-tmp-tables,
if test "$with_aria_tmp_tables" = "yes"
then
- AC_DEFINE([USE_MARIA_FOR_TMP_TABLES], [1], [Aria is used for internal temporary tables])
+ AC_DEFINE([USE_ARIA_FOR_TMP_TABLES], [1], [Aria is used for internal temporary tables])
fi
])
diff --git a/storage/maria/tablockman.c b/storage/maria/tablockman.c
index 1bb8889aaa7..8e664b261e9 100644
--- a/storage/maria/tablockman.c
+++ b/storage/maria/tablockman.c
@@ -225,12 +225,10 @@ struct st_table_lock {
uchar lock_type;
};
-#define hash_insert my_hash_insert /* for consistency :) */
-
static inline
TABLE_LOCK *find_by_loid(LOCKED_TABLE *table, uint16 loid)
{
- return (TABLE_LOCK *)hash_search(& table->latest_locks,
+ return (TABLE_LOCK *)my_hash_search(& table->latest_locks,
(uchar *)& loid, sizeof(loid));
}
@@ -485,8 +483,8 @@ tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo,
/* update the latest_locks hash */
if (old)
- hash_delete(& table->latest_locks, (uchar *)old);
- hash_insert(& table->latest_locks, (uchar *)new);
+ my_hash_delete(& table->latest_locks, (uchar *)old);
+ my_hash_insert(& table->latest_locks, (uchar *)new);
new->upgraded_from= old;
@@ -569,7 +567,7 @@ void tablockman_release_locks(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo)
/* TODO ? group locks by table to reduce the number of mutex locks */
pthread_mutex_lock(mutex);
- hash_delete(& cur->table->latest_locks, (uchar *)cur);
+ my_hash_delete(& cur->table->latest_locks, (uchar *)cur);
if (cur->prev)
cur->prev->next= cur->next;
@@ -616,7 +614,7 @@ void tablockman_destroy(TABLOCKMAN *lm)
{
TABLE_LOCK *tmp= lm->pool;
lm->pool= tmp->next;
- my_free((void *)tmp, MYF(0));
+ my_free(tmp);
}
pthread_mutex_destroy(& lm->pool_mutex);
}
@@ -632,7 +630,7 @@ void tablockman_init_locked_table(LOCKED_TABLE *lt, int initial_hash_size)
{
bzero(lt, sizeof(*lt));
pthread_mutex_init(& lt->mutex, MY_MUTEX_INIT_FAST);
- hash_init(& lt->latest_locks, & my_charset_bin, initial_hash_size,
+ my_hash_init(& lt->latest_locks, & my_charset_bin, initial_hash_size,
offsetof(TABLE_LOCK, loid),
sizeof(((TABLE_LOCK*)0)->loid), 0, 0, 0);
}
@@ -647,7 +645,7 @@ void tablockman_destroy_locked_table(LOCKED_TABLE *lt)
for (i= 0; i<LOCK_TYPES; i++)
DBUG_ASSERT(lt->active_locks[i] == 0);
- hash_free(& lt->latest_locks);
+ my_hash_free(& lt->latest_locks);
pthread_mutex_destroy(& lt->mutex);
}
diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c
index 05330baed76..4a0088a2617 100644
--- a/storage/maria/trnman.c
+++ b/storage/maria/trnman.c
@@ -217,14 +217,14 @@ void trnman_destroy()
pool= pool->next;
DBUG_ASSERT(trn->wt == NULL);
pthread_mutex_destroy(&trn->state_lock);
- my_free((void *)trn, MYF(0));
+ my_free(trn);
}
lf_hash_destroy(&trid_to_trn);
DBUG_PRINT("info", ("pthread_mutex_destroy LOCK_trn_list"));
pthread_mutex_destroy(&LOCK_trn_list);
my_atomic_rwlock_destroy(&LOCK_short_trid_to_trn);
my_atomic_rwlock_destroy(&LOCK_pool);
- my_free((void *)(short_trid_to_active_trn+1), MYF(0));
+ my_free(short_trid_to_active_trn+1);
short_trid_to_active_trn= NULL;
DBUG_VOID_RETURN;
diff --git a/storage/maria/unittest/ma_control_file-t.c b/storage/maria/unittest/ma_control_file-t.c
index 164ea284f31..aad1a6978b2 100644
--- a/storage/maria/unittest/ma_control_file-t.c
+++ b/storage/maria/unittest/ma_control_file-t.c
@@ -93,16 +93,16 @@ static void get_options(int argc, char *argv[]);
/* Used to ignore error messages from ma_control_file_open() */
-static int my_ignore_message(uint error __attribute__((unused)),
+static void my_ignore_message(uint error __attribute__((unused)),
const char *str __attribute__((unused)),
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_message_no_curses");
DBUG_PRINT("enter",("message: %s",str));
- DBUG_RETURN(0);
+ DBUG_VOID_RETURN;
}
-int (*default_error_handler_hook)(uint my_err, const char *str,
+void (*default_error_handler_hook)(uint my_err, const char *str,
myf MyFlags) = 0;
@@ -590,3 +590,5 @@ static void usage(void)
my_print_help(my_long_options);
my_print_variables(my_long_options);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
index 7dbdba433c6..d9b814e92f1 100644
--- a/storage/maria/unittest/ma_pagecache_consist.c
+++ b/storage/maria/unittest/ma_pagecache_consist.c
@@ -299,7 +299,7 @@ static void *test_thread_reader(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "reader%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -322,7 +322,7 @@ static void *test_thread_writer(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "writer%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -402,7 +402,7 @@ int main(int argc __attribute__((unused)),
}
#ifdef HAVE_THR_SETCONCURRENCY
- VOID(thr_setconcurrency(2));
+ thr_setconcurrency(2);
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
@@ -496,3 +496,5 @@ int main(int argc __attribute__((unused)),
return exit_status();
}
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist.c b/storage/maria/unittest/ma_pagecache_rwconsist.c
index a1a22b5e18d..88ecbe864e8 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist.c
@@ -170,7 +170,7 @@ static void *test_thread_reader(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "reader%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -192,7 +192,7 @@ static void *test_thread_writer(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "writer%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -272,7 +272,7 @@ int main(int argc __attribute__((unused)),
}
#ifdef HAVE_THR_SETCONCURRENCY
- VOID(thr_setconcurrency(2));
+ thr_setconcurrency(2);
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
@@ -360,3 +360,5 @@ int main(int argc __attribute__((unused)),
return exit_status();
}
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist2.c b/storage/maria/unittest/ma_pagecache_rwconsist2.c
index 34183a2d0ab..e63d45ceb3a 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist2.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist2.c
@@ -166,7 +166,7 @@ static void *test_thread_reader(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "reader%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -188,7 +188,7 @@ static void *test_thread_writer(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "writer%d: done", param);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -268,7 +268,7 @@ int main(int argc __attribute__((unused)),
}
#ifdef HAVE_THR_SETCONCURRENCY
- VOID(thr_setconcurrency(2));
+ thr_setconcurrency(2);
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
@@ -356,3 +356,5 @@ int main(int argc __attribute__((unused)),
return exit_status();
}
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c
index 32e588e165a..3291346a8b5 100644
--- a/storage/maria/unittest/ma_pagecache_single.c
+++ b/storage/maria/unittest/ma_pagecache_single.c
@@ -671,9 +671,9 @@ int simple_big_test()
reset_file(&file1, file1_name);
err:
- my_free(buffw, 0);
- my_free(buffr, 0);
- my_free(desc, 0);
+ my_free(buffw);
+ my_free(buffr);
+ my_free(desc);
DBUG_RETURN(res);
}
@@ -711,7 +711,7 @@ static void *test_thread(void *arg)
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
my_thread_end();
@@ -798,7 +798,7 @@ int main(int argc __attribute__((unused)),
}
#ifdef HAVE_THR_SETCONCURRENCY
- VOID(thr_setconcurrency(2));
+ thr_setconcurrency(2);
#endif
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
@@ -851,3 +851,5 @@ int main(int argc __attribute__((unused)),
}
return exit_status();
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index ffac9b04839..2de06914412 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -659,3 +659,5 @@ err:
return(test(exit_status()));
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
index 06d9a00c04c..e941d860adb 100644
--- a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
@@ -158,3 +158,5 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
exit(0);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
index 64f486b8cf1..924daac5f3c 100644
--- a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
@@ -154,3 +154,5 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
exit(0);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
index 7ba7ce3176d..44c174ee1b0 100644
--- a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
@@ -178,7 +178,7 @@ static void usage(void)
puts("and you are welcome to modify and redistribute it under the GPL license\n");
puts("Unit test of maria engine");
- VOID(printf("\nUsage: %s [OPTIONS]\n", my_progname_short));
+ printf("\nUsage: %s [OPTIONS]\n", my_progname_short);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
@@ -744,3 +744,5 @@ err:
return (test(exit_status()));
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index 354f5d12e08..1e9120e655f 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -219,7 +219,7 @@ static void *test_thread_writer(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
ok(1, "writer finished"); /* just to show progress */
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are
ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
@@ -246,7 +246,7 @@ static void *test_thread_flusher(void *arg)
pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
ok(1, "flusher finished"); /* just to show progress */
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are
ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((uchar*) arg);
@@ -334,7 +334,7 @@ int main(int argc __attribute__((unused)),
}
#ifdef HAVE_THR_SETCONCURRENCY
- VOID(thr_setconcurrency(2));
+ thr_setconcurrency(2);
#endif
my_thread_global_init();
@@ -554,3 +554,5 @@ err:
return(exit_status());
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_noflush-t.c b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
index 973dfd03bcf..2994ead8c3a 100644
--- a/storage/maria/unittest/ma_test_loghandler_noflush-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
@@ -144,3 +144,5 @@ err:
exit(rc);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_nologs-t.c b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
index 34508d1d751..32ada1e58bd 100644
--- a/storage/maria/unittest/ma_test_loghandler_nologs-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
@@ -193,3 +193,5 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
exit(0);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
index 1644aa4885c..5b115b426b7 100644
--- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
@@ -198,3 +198,5 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(0);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_purge-t.c b/storage/maria/unittest/ma_test_loghandler_purge-t.c
index d37b45bc3ca..e7b604eb172 100644
--- a/storage/maria/unittest/ma_test_loghandler_purge-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_purge-t.c
@@ -190,3 +190,5 @@ int main(int argc __attribute__((unused)), char *argv[])
exit(1);
exit(0);
}
+
+#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/test_file.c b/storage/maria/unittest/test_file.c
index 5f7e3939592..567f4ef8b94 100644
--- a/storage/maria/unittest/test_file.c
+++ b/storage/maria/unittest/test_file.c
@@ -113,6 +113,6 @@ int test_file(PAGECACHE_FILE file, char *file_name,
}
err:
- my_free(buffr, 0);
+ my_free(buffr);
return res;
}
diff --git a/storage/maria/unittest/trnman-t.c b/storage/maria/unittest/trnman-t.c
index 43cf982a7f2..5d27fe39d14 100644
--- a/storage/maria/unittest/trnman-t.c
+++ b/storage/maria/unittest/trnman-t.c
@@ -99,7 +99,7 @@ void run_test(const char *test, pthread_handler handler, int n, int m)
pthread_join(threads[i], 0);
now= my_getsystime()-now;
ok(litmus == 0, "Tested %s in %g secs (%d)", test, ((double)now)/1e7, litmus);
- my_free((void*)threads, MYF(0));
+ my_free(threads);
}
#define ok_read_from(T1, T2, RES) \
@@ -173,3 +173,4 @@ int main(int argc __attribute__((unused)), char **argv)
return exit_status();
}
+#include "../ma_check_standalone.h"
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 7d615d837d3..bf0af370838 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -182,7 +182,7 @@ typedef struct st_my_ftb_param
static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *info)
{
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
@@ -284,24 +284,24 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *query, mysql_ft_size_t len)
+ const char *query, int len)
{
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
MYSQL_FTPARSER_BOOLEAN_INFO info;
CHARSET_INFO *cs= ftb_param->ftb->charset;
- const uchar **start= &query;
- const uchar *end= query + len;
+ const uchar **start= (const uchar**) &query;
+ uchar *end= (uchar*) query + len;
FT_WORD w;
info.prev= ' ';
info.quot= 0;
while (ft_get_word(cs, start, end, &w, &info))
- param->mysql_add_word(param, w.pos, w.len, &info);
+ param->mysql_add_word(param, (char*) w.pos, w.len, &info);
return(0);
}
-static int _ftb_parse_query(FTB *ftb, uchar *query, mysql_ft_size_t len,
+static int _ftb_parse_query(FTB *ftb, uchar *query, uint len,
struct st_mysql_ftparser *parser)
{
MYSQL_FTPARSER_PARAM *param;
@@ -323,7 +323,7 @@ static int _ftb_parse_query(FTB *ftb, uchar *query, mysql_ft_size_t len,
param->mysql_add_word= ftb_query_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= query;
+ param->doc= (char*) query;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO;
@@ -484,7 +484,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
static void _ftb_init_index_search(FT_INFO *ftb)
{
- uint i;
+ int i;
FTB_WORD *ftbw;
if (ftb->state == UNINITIALIZED || ftb->keynr == NO_SUCH_KEY)
@@ -492,7 +492,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
ftb->state=INDEX_SEARCH;
for (i= queue_last_element(&ftb->queue);
- (int) i >= (int) queue_first_element(&ftb->queue);
+ i >= (int) queue_first_element(&ftb->queue);
i--)
{
ftbw=(FTB_WORD *)(queue_element(&ftb->queue, i));
@@ -554,7 +554,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query,
- mysql_ft_size_t query_len, CHARSET_INFO *cs)
+ uint query_len, CHARSET_INFO *cs)
{
FTB *ftb;
FTB_EXPR *ftbe;
@@ -606,7 +606,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query,
sizeof(FTB_WORD *)*ftb->queue.elements);
memcpy(ftb->list, &queue_top(&ftb->queue), sizeof(FTB_WORD *)*ftb->queue.elements);
my_qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *),
- (qsort2_cmp)FTB_WORD_cmp_list, (void*) ftb->charset);
+ (qsort2_cmp)FTB_WORD_cmp_list, (void*)ftb->charset);
if (ftb->queue.elements<2) ftb->with_scan &= ~FTB_FLAG_TRUNC;
ftb->state=READY;
return ftb;
@@ -629,7 +629,7 @@ typedef struct st_my_ftb_phrase_param
static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
+ const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
@@ -661,16 +661,15 @@ static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *document,
- mysql_ft_size_t len)
+ const char *document, int len)
{
FT_WORD word;
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
const uchar *docend= (uchar*) document + len;
- while (ft_simple_get_word(phrase_param->cs, &document, docend,
+ while (ft_simple_get_word(phrase_param->cs, (uchar**) &document, docend,
&word, FALSE))
{
- param->mysql_add_word(param, word.pos, word.len, 0);
+ param->mysql_add_word(param, (char*) word.pos, word.len, 0);
if (phrase_param->match)
break;
}
@@ -693,8 +692,7 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
-1 is returned if error occurs.
*/
-static int _ftb_check_phrase(FTB *ftb, const uchar *document,
- mysql_ft_size_t len,
+static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len,
FTB_EXPR *ftbe, struct st_mysql_ftparser *parser)
{
MY_FTB_PHRASE_PARAM ftb_param;
@@ -716,7 +714,7 @@ static int _ftb_check_phrase(FTB *ftb, const uchar *document,
param->mysql_add_word= ftb_phrase_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= document;
+ param->doc= (char *) document;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_WITH_STOPWORDS;
@@ -889,9 +887,8 @@ typedef struct st_my_ftb_find_param
static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t len,
- MYSQL_FTPARSER_BOOLEAN_INFO
- *boolean_info __attribute__((unused)))
+ const char *word, int len,
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
@@ -904,8 +901,8 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2)
{
ftbw= ftb->list[c];
- if (ha_compare_text(ftb->charset, word, len,
- ftbw->word+1, ftbw->len-1,
+ if (ha_compare_text(ftb->charset, (uchar*)word, len,
+ (uchar*)ftbw->word+1, ftbw->len-1,
(my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0)
b= c;
else
@@ -931,8 +928,8 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
for (; c >= 0; c--)
{
ftbw= ftb->list[c];
- if (ha_compare_text(ftb->charset, word, len,
- ftbw->word + 1,ftbw->len - 1,
+ if (ha_compare_text(ftb->charset, (uchar*)word, len,
+ (uchar*)ftbw->word + 1,ftbw->len - 1,
(my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0))
{
if (ftb->with_scan & FTB_FLAG_TRUNC)
@@ -951,14 +948,14 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param,
- const uchar *doc, mysql_ft_size_t len)
+ const char *doc, int len)
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
- const uchar *end= doc + len;
+ uchar *end= (uchar*) doc + len;
FT_WORD w;
- while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
- param->mysql_add_word(param, w.pos, w.len, 0);
+ while (ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE))
+ param->mysql_add_word(param, (char*) w.pos, w.len, 0);
return(0);
}
@@ -1014,7 +1011,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length)
{
if (!ftsi.pos)
continue;
- param->doc= ftsi.pos;
+ param->doc= (char *)ftsi.pos;
param->length= ftsi.len;
if (unlikely(parser->parse(param)))
return 0;
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index e19765efe3e..deb645b3b15 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -199,14 +199,12 @@ static int walk_and_push(FT_SUPERDOC *from,
static int FT_DOC_cmp(void *unused __attribute__((unused)),
FT_DOC *a, FT_DOC *b)
{
- double c= b->weight - a->weight;
- return ((c < 0) ? -1 : (c > 0) ? 1 : 0);
+ return CMP_NUM(b->weight, a->weight);
}
FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query,
- mysql_ft_size_t query_len, uint flags,
- uchar *record)
+ uint query_len, uint flags, uchar *record)
{
TREE wtree;
ALL_IN_ONE aio;
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index af16240bca2..31e72e8e0a6 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -109,7 +109,7 @@ my_bool ft_boolean_check_syntax_string(const uchar *str)
uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end,
FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
{
- const uchar *doc= *start;
+ const uchar *doc=*start;
int ctype;
uint mwc, length;
int mbl;
@@ -174,7 +174,7 @@ uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end,
if ((param->trunc=(doc<end && *doc == FTB_TRUNC)))
doc++;
- if (((length >= ft_min_word_len && !is_stopword(word->pos,
+ if (((length >= ft_min_word_len && !is_stopword((char*) word->pos,
word->len))
|| param->trunc) && length < ft_max_word_len)
{
@@ -199,11 +199,10 @@ ret:
return param->type;
}
-uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start,
- const uchar *end, FT_WORD *word,
- my_bool skip_stopwords)
+uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end,
+ FT_WORD *word, my_bool skip_stopwords)
{
- const uchar *doc= *start;
+ uchar *doc= *start;
uint mwc, length;
int mbl;
int ctype;
@@ -215,7 +214,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start,
{
if (doc >= end)
DBUG_RETURN(0);
- mbl= cs->cset->ctype(cs, &ctype, doc, end);
+ mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
}
@@ -224,7 +223,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start,
for (word->pos= doc; doc < end; length++,
doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
- mbl= cs->cset->ctype(cs, &ctype, doc, end);
+ mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
mwc= 0;
else if (!misc_word_char(*doc) || mwc)
@@ -237,7 +236,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start,
if (skip_stopwords == FALSE ||
(length >= ft_min_word_len && length < ft_max_word_len &&
- !is_stopword(word->pos, word->len)))
+ !is_stopword((char*) word->pos, word->len)))
{
*start= doc;
DBUG_RETURN(1);
@@ -250,16 +249,14 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
{
DBUG_ENTER("ft_parse_init");
if (!is_tree_inited(wtree))
- init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL,
- (void*) cs);
+ init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,0,(void*)cs);
DBUG_VOID_RETURN;
}
static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
- const uchar *word, mysql_ft_size_t word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info
- __attribute__((unused)))
+ const char *word, int word_len,
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{
TREE *wtree;
FT_WORD w;
@@ -287,23 +284,23 @@ static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
- const uchar *doc_arg, mysql_ft_size_t doc_len)
+ const char *doc_arg, int doc_len)
{
- const uchar *doc= doc_arg;
- const uchar *end= doc + doc_len;
+ uchar *doc= (uchar*) doc_arg;
+ uchar *end= doc + doc_len;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
TREE *wtree= ft_param->wtree;
FT_WORD w;
DBUG_ENTER("ft_parse_internal");
while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE))
- if (param->mysql_add_word(param, w.pos, w.len, 0))
+ if (param->mysql_add_word(param, (char*) w.pos, w.len, 0))
DBUG_RETURN(1);
DBUG_RETURN(0);
}
-int ft_parse(TREE *wtree, const uchar *doc, mysql_ft_size_t doclen,
+int ft_parse(TREE *wtree, uchar *doc, int doclen,
struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
@@ -318,7 +315,7 @@ int ft_parse(TREE *wtree, const uchar *doc, mysql_ft_size_t doclen,
param->mysql_add_word= ft_add_word;
param->mysql_ftparam= &my_param;
param->cs= wtree->custom_arg;
- param->doc= doc;
+ param->doc= (char*) doc;
param->length= doclen;
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
DBUG_RETURN(parser->parse(param));
@@ -378,8 +375,8 @@ MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
mysql_add_word != 0 - parser is initialized, or no
initialization needed. */
info->ftparser_param[ftparser_nr].mysql_add_word=
- (int (*)(struct st_mysql_ftparser_param *, const uchar *,
- mysql_ft_size_t, MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
+ (int (*)(struct st_mysql_ftparser_param *, const char *, int,
+ MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
if (parser->init && parser->init(&info->ftparser_param[ftparser_nr]))
return 0;
}
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index 1079cf83417..b0911403996 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -24,8 +24,8 @@ static CHARSET_INFO *ft_stopword_cs= NULL;
typedef struct st_ft_stopwords
{
- const uchar* pos;
- size_t len;
+ const char * pos;
+ uint len;
} FT_STOPWORD;
static TREE *stopwords3=NULL;
@@ -34,8 +34,8 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)),
FT_STOPWORD *w1, FT_STOPWORD *w2)
{
return ha_compare_text(ft_stopword_cs,
- w1->pos, w1->len,
- w2->pos, w2->len, 0, 0);
+ (uchar *)w1->pos,w1->len,
+ (uchar *)w2->pos,w2->len,0,0);
}
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
@@ -48,10 +48,9 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
static int ft_add_stopword(const char *w)
{
FT_STOPWORD sw;
- return (!w ||
- (((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >=
- ft_min_word_len) &&
- (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)));
+ return !w ||
+ (((sw.len= (uint) strlen(sw.pos=w)) >= ft_min_word_len) &&
+ (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL));
}
int ft_init_stopwords()
@@ -79,8 +78,7 @@ int ft_init_stopwords()
{
File fd;
uint len;
- uchar *buffer;
- const uchar *start, *end;
+ uchar *buffer, *start, *end;
FT_WORD w;
int error=-1;
@@ -122,8 +120,7 @@ err0:
DBUG_RETURN(0);
}
-
-int is_stopword(const uchar *word, size_t len)
+int is_stopword(const char *word, size_t len)
{
FT_STOPWORD sw;
sw.pos=word;
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h
index b26fa523b42..cf00594629c 100644
--- a/storage/myisam/ftdefs.h
+++ b/storage/myisam/ftdefs.h
@@ -101,18 +101,17 @@ typedef struct st_ft_word {
size_t len;
} FT_WORD;
-int is_stopword(const uchar *word, size_t len);
+int is_stopword(const char *word, size_t len);
uint _ft_make_key(MI_INFO *, uint , uchar *, FT_WORD *, my_off_t);
uchar ft_get_word(CHARSET_INFO *, const uchar **, const uchar *, FT_WORD *,
MYSQL_FTPARSER_BOOLEAN_INFO *);
-uchar ft_simple_get_word(CHARSET_INFO *, const uchar **, const uchar *,
+uchar ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *,
FT_WORD *, my_bool);
typedef struct _st_ft_seg_iterator {
- uint num;
- mysql_ft_size_t len;
+ uint num, len;
HA_KEYSEG *seg;
const uchar *rec, *pos;
} FT_SEG_ITERATOR;
@@ -122,16 +121,15 @@ void _mi_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *);
uint _mi_ft_segiterator(FT_SEG_ITERATOR *);
void ft_parse_init(TREE *, CHARSET_INFO *);
-int ft_parse(TREE *, const uchar *, int, struct st_mysql_ftparser *parser,
+int ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
FT_WORD * ft_linearize(TREE *, MEM_ROOT *);
FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const uchar *, MEM_ROOT *);
uint _mi_ft_parse(TREE *, MI_INFO *, uint, const uchar *,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
-FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, mysql_ft_size_t, uint,
- uchar *);
-FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, mysql_ft_size_t, CHARSET_INFO *);
+FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, uint, uint, uchar *);
+FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, uint, CHARSET_INFO *);
extern const struct _ft_vft _ft_vft_nlq;
int ft_nlq_read_next(FT_INFO *, char *);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index fc6a9829072..2913cdc421d 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -68,7 +68,7 @@ static MYSQL_SYSVAR_SET(recover_options, myisam_recover_options,
PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY,
"Syntax: myisam-recover-options[=option[,option...]], where option can be "
"DEFAULT, BACKUP, FORCE, QUICK, or OFF",
- NULL, NULL, 0, &myisam_recover_typelib);
+ NULL, NULL, 1, &myisam_recover_typelib);
static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG,
"If larger than 1, when repairing a MyISAM table all indexes will be "
@@ -706,8 +706,6 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER)))
return (my_errno ? my_errno : -1);
- file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref;
-
if (!table->s->tmp_table) /* No need to perform a check for tmp table */
{
if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs)))
@@ -1678,7 +1676,6 @@ int ha_myisam::index_last(uchar *buf)
DBUG_ASSERT(inited==INDEX);
int error=mi_rlast(file, buf, active_index);
MYSQL_INDEX_READ_ROW_DONE(error);
-#warning move that to wrappers
return error;
}
@@ -2113,7 +2110,7 @@ static int myisam_init(void *p)
#endif
/* Set global variables based on startup options */
- if (myisam_recover_options)
+ if (myisam_recover_options && myisam_recover_options != HA_RECOVER_OFF)
ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
else
myisam_recover_options= HA_RECOVER_OFF;
@@ -2222,13 +2219,13 @@ maria_declare_plugin(myisam)
&myisam_storage_engine,
"MyISAM",
"MySQL AB",
- "Default engine as of MySQL 3.23 with great performance",
+ "MyISAM storage engine",
PLUGIN_LICENSE_GPL,
myisam_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */
NULL, /* status variables */
- NULL, /* system variables */
+ myisam_sysvars, /* system variables */
"1.0", /* string version */
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 89644e5f978..a69ed41f67d 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1333,7 +1333,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
if (splits != info->s->state.split)
{
mi_check_print_warning(param,
- "Found %10s parts. Should be: %s",
+ "Found %10s key parts. Should be: %s",
llstr(splits,llbuff),
llstr(info->s->state.split,llbuff2));
}
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 3a842b966ab..7222542847d 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -633,7 +633,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
*/
if (test_if_reopen(filename))
{
- my_printf_error(0, "MyISAM table '%s' is in use "
+ my_printf_error(HA_ERR_TABLE_EXIST, "MyISAM table '%s' is in use "
"(most likely by a MERGE table). Try FLUSH TABLES.",
MYF(0), name + dirname_length(name));
my_errno= HA_ERR_TABLE_EXIST;
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index 16ec536dbc6..d1512970683 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -258,7 +258,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
break;
case HA_EXTRA_PREPARE_FOR_DROP:
/* Signals about intent to delete this table */
- share->deleting= TRUE;
+ //share->deleting= TRUE;
share->global_changed= FALSE; /* force writing changed flag */
_mi_mark_file_changed(info);
/* Fall trough */
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index be308797286..aa4a01db3bc 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -328,12 +328,6 @@ void mi_update_status(void* param)
(long) info->s->state.state.data_file_length));
#endif
info->s->state.state= *info->state;
-#ifdef HAVE_QUERY_CACHE
- DBUG_PRINT("info", ("invalidator... '%s' (status update)",
- info->filename));
- DBUG_ASSERT(info->s->chst_invalidator != NULL);
- (*info->s->chst_invalidator)((const char *)info->filename);
-#endif
}
info->state= &info->s->state.state;
info->append_insert_at_end= 0;
@@ -365,11 +359,11 @@ static void mi_update_status_with_lock(MI_INFO *info)
if (info->state == &info->save_state)
{
locked= 1;
- pthread_mutex_lock(&info->s->lock.mutex);
+ mysql_mutex_lock(&info->s->lock.mutex);
}
mi_update_status(info);
if (locked)
- pthread_mutex_unlock(&info->s->lock.mutex);
+ mysql_mutex_unlock(&info->s->lock.mutex);
}
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 2403bf70434..abc731aead6 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -648,7 +648,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
mysql_mutex_unlock(&THR_LOCK_myisam);
bzero(info.buff, share->base.max_key_block_length * 2);
- my_free(rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(rec_per_key_part);
if (myisam_log_file >= 0)
{
@@ -678,7 +678,7 @@ err:
case 3:
if (! lock_error)
(void) my_lock(kfile, F_UNLCK, 0L, F_TO_EOF, MYF(MY_SEEK_NOT_DONE));
- my_free(rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(rec_per_key_part);
/* fall through */
case 2:
my_afree(disk_cache);
diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c
index f5b3514faf6..3ca6cdd257f 100644
--- a/storage/myisam/mi_rkey.c
+++ b/storage/myisam/mi_rkey.c
@@ -87,7 +87,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
if (share->concurrent_insert)
- rw_unlock(&share->key_root_lock[inx]);
+ mysql_rwlock_unlock(&share->key_root_lock[inx]);
goto err;
}
break;
@@ -150,7 +150,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
{
info->lastpos= HA_OFFSET_ERROR;
if (share->concurrent_insert)
- rw_unlock(&share->key_root_lock[inx]);
+ mysql_rwlock_unlock(&share->key_root_lock[inx]);
DBUG_RETURN((my_errno= HA_ERR_KEY_NOT_FOUND));
}
/*
diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c
index 43b071bc464..29de0e98d3d 100644
--- a/storage/myisam/mi_rnext.c
+++ b/storage/myisam/mi_rnext.c
@@ -118,7 +118,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
if (!error && res == ICP_OUT_OF_RANGE)
{
if (info->s->concurrent_insert)
- rw_unlock(&info->s->key_root_lock[inx]);
+ mysql_rwlock_unlock(&info->s->key_root_lock[inx]);
info->lastpos= HA_OFFSET_ERROR;
DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
}
diff --git a/storage/myisam/mi_rprev.c b/storage/myisam/mi_rprev.c
index 89612b5a661..95aa8069e1d 100644
--- a/storage/myisam/mi_rprev.c
+++ b/storage/myisam/mi_rprev.c
@@ -72,7 +72,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx)
if (!error && res == 2)
{
if (share->concurrent_insert)
- rw_unlock(&share->key_root_lock[inx]);
+ mysql_rwlock_unlock(&share->key_root_lock[inx]);
info->lastpos= HA_OFFSET_ERROR;
DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
}
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index 9babf7ad4f0..a3303428a08 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -775,7 +775,7 @@ int main(int argc, char *argv[])
{
ulong blob_length,pos;
uchar *ptr;
- memcpy_fixed(&ptr, read_record+blob_pos+4, sizeof(ptr));
+ memcpy(&ptr, read_record+blob_pos+4, sizeof(ptr));
blob_length= uint4korr(read_record+blob_pos);
for (pos=0 ; pos < blob_length ; pos++)
{
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index f8eb3cb1bde..70406203f63 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -1276,7 +1276,7 @@ static void descript(HA_CHECK *param, register MI_INFO *info, char * name)
printf("Recordlength: %13d\n",(int) share->base.pack_reclength);
if (! mi_is_all_keys_active(share->state.key_map, share->base.keys))
{
- longlong2str(share->state.key_map,buff,2,1);
+ longlong2str(share->state.key_map,buff,2);
printf("Using only keys '%s' of %d possibly keys\n",
buff, share->base.keys);
}
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 304150601d7..894ec827b85 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -191,10 +191,7 @@ typedef struct st_mi_isam_share
const uchar *record, my_off_t pos);
size_t (*file_read) (MI_INFO *, uchar *, size_t, my_off_t, myf);
size_t (*file_write) (MI_INFO *, const uchar *, size_t, my_off_t, myf);
- /* query cache invalidator for merged tables */
- invalidator_by_filename invalidator;
- /* query cache invalidator for changing state */
- invalidator_by_filename chst_invalidator;
+ invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_process; /* processid */
ulong last_process; /* For table-change-check */
ulong last_version; /* Version on start */
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 6e0271088d3..ef7cd5712e8 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1379,7 +1379,7 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd,
pointers to the children. Use of a mutex here and in
myrg_attach_children() forces consistent data.
*/
- pthread_mutex_lock(&this->file->mutex);
+ mysql_mutex_lock(&this->file->mutex);
/*
When MERGE table is open, but not yet attached, other threads
@@ -1396,7 +1396,7 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd,
open_table->table->lock.priority|= THR_LOCK_MERGE_PRIV;
end:
- pthread_mutex_unlock(&this->file->mutex);
+ mysql_mutex_unlock(&this->file->mutex);
return to;
}
diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp
index 0e782ba9214..8a23802e797 100644
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp
@@ -20,7 +20,7 @@
class Ndb;
struct charset_info_st;
-typedef struct charset_info_st CHARSET_INFO;
+typedef const struct charset_info_st CHARSET_INFO;
/**
* @class NdbDictionary
diff --git a/storage/ndb/include/util/NdbSqlUtil.hpp b/storage/ndb/include/util/NdbSqlUtil.hpp
index 8d063f1908b..a65332c1537 100644
--- a/storage/ndb/include/util/NdbSqlUtil.hpp
+++ b/storage/ndb/include/util/NdbSqlUtil.hpp
@@ -20,7 +20,7 @@
#include <kernel/ndb_limits.h>
struct charset_info_st;
-typedef struct charset_info_st CHARSET_INFO;
+typedef const struct charset_info_st CHARSET_INFO;
class NdbSqlUtil {
public:
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 8c096681b58..4f2cb877bc2 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -2249,7 +2249,7 @@ int Dbtup::interpreterNextLab(Signal* signal,
Uint32 TattrDesc1 = tableDescriptor[TattrDescrIndex].tabDescr;
Uint32 TattrDesc2 = tableDescriptor[TattrDescrIndex+1].tabDescr;
Uint32 typeId = AttributeDescriptor::getType(TattrDesc1);
- void * cs = 0;
+ const void * cs = 0;
if(AttributeOffset::getCharsetFlag(TattrDesc2))
{
Uint32 pos = AttributeOffset::getCharsetPos(TattrDesc2);
diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt
index 01723f04e16..31016ba47b8 100644
--- a/storage/oqgraph/CMakeLists.txt
+++ b/storage/oqgraph/CMakeLists.txt
@@ -11,10 +11,10 @@ IF(BOOST_OK)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF(MSVC)
+ IF(CMAKE_CXX_FLAGS)
+ STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ ENDIF()
- SET(OQGRAPH_PLUGIN_STATIC "oqgraph")
- SET(OQGRAPH_PLUGIN_DYNAMIC "ha_oqgraph")
- SET(OQGRAPH_SOURCES ha_oqgraph.cc graphcore.cc)
- MYSQL_ADD_PLUGIN(oqgraph ${OQGRAPH_SOURCES} STORAGE_ENGINE)
+ MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE)
ENDIF(BOOST_OK)
-#error same fix here as in plugin.m4
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index e0c66134858..a46269f8883 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -28,17 +28,19 @@
#pragma implementation // gcc: Class implementation
#endif
-#define MYSQL_SERVER // to have THD
-#include "mysql_priv.h"
-#if MYSQL_VERSION_ID >= 50100
-#include <mysql/plugin.h>
-#endif
-
#ifdef HAVE_OQGRAPH
+#include <mysql_version.h>
#include "ha_oqgraph.h"
#include "graphcore.h"
+#define MYSQL_SERVER // to have THD
+#include <mysql/plugin.h>
+#include "table.h"
+#include "field.h"
+#include "key.h"
+//#include "sql_class.h"
+
#define OQGRAPH_STATS_UPDATE_THRESHOLD 10
using namespace open_query;
@@ -91,7 +93,7 @@ statistic_increment(table->in_use->status_var.X, &LOCK_status)
#define MOVE(X) move_field(X)
#define RECORDS records
#else
-#define STATISTIC_INCREMENT(X) ha_statistic_increment(&SSV::X)
+#define STATISTIC_INCREMENT(X) /* nothing */
#define MOVE(X) move_field_offset(X)
#define RECORDS stats.records
#endif
@@ -131,7 +133,7 @@ static bool oqgraph_init()
#endif
if (pthread_mutex_init(&LOCK_oqgraph, MY_MUTEX_INIT_FAST))
goto error;
- if (hash_init(&oqgraph_open_tables, &my_charset_bin, 32, 0, 0,
+ if (my_hash_init(&oqgraph_open_tables, &my_charset_bin, 32, 0, 0,
get_key, 0, 0))
{
pthread_mutex_destroy(&LOCK_oqgraph);
@@ -155,7 +157,7 @@ error:
#if MYSQL_VERSION_ID >= 50100
static int oqgraph_fini(void *)
{
- hash_free(&oqgraph_open_tables);
+ my_hash_free(&oqgraph_open_tables);
pthread_mutex_destroy(&LOCK_oqgraph);
oqgraph_init_done= FALSE;
return 0;
@@ -168,7 +170,7 @@ static OQGRAPH_INFO *get_share(const char *name, TABLE *table=0)
uint length= strlen(name);
safe_mutex_assert_owner(&LOCK_oqgraph);
- if (!(share= (OQGRAPH_INFO*) hash_search(&oqgraph_open_tables,
+ if (!(share= (OQGRAPH_INFO*) my_hash_search(&oqgraph_open_tables,
(byte*) name, length)))
{
if (!table ||
@@ -202,7 +204,7 @@ static int free_share(OQGRAPH_INFO *share, bool drop=0)
if (drop)
{
share->dropped= true;
- hash_delete(&oqgraph_open_tables, (byte*) share);
+ my_hash_delete(&oqgraph_open_tables, (byte*) share);
}
if (!--share->use_count)
{
@@ -942,7 +944,7 @@ int ha_oqgraph::rename_table(const char * from, const char * to)
if (OQGRAPH_INFO *share= get_share(from))
{
strmov(share->name, to);
- hash_update(&oqgraph_open_tables, (byte*) share,
+ my_hash_update(&oqgraph_open_tables, (byte*) share,
(byte*) from, strlen(from));
}
pthread_mutex_unlock(&LOCK_oqgraph);
@@ -1020,7 +1022,7 @@ void ha_oqgraph::update_create_info(HA_CREATE_INFO *create_info)
struct st_mysql_storage_engine oqgraph_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
-mysql_declare_plugin(oqgraph)
+maria_declare_plugin(oqgraph)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
&oqgraph_storage_engine,
@@ -1033,9 +1035,11 @@ mysql_declare_plugin(oqgraph)
0x0200, /* Version: 2.0 */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ "2.0",
+ MariaDB_PLUGIN_MATURITY_BETA
}
-mysql_declare_plugin_end;
+maria_declare_plugin_end;
+
#endif
#endif
diff --git a/storage/oqgraph/ha_oqgraph.h b/storage/oqgraph/ha_oqgraph.h
index dcc14b074da..97f8cb54081 100644
--- a/storage/oqgraph/ha_oqgraph.h
+++ b/storage/oqgraph/ha_oqgraph.h
@@ -28,12 +28,10 @@
#pragma interface /* gcc class implementation */
#endif
+#include "handler.h"
typedef struct oqgraph_info_st OQGRAPH_INFO;
-
-#if MYSQL_VERSION_ID >= 50120
typedef uchar byte;
-#endif
namespace open_query
{
@@ -61,7 +59,7 @@ public:
ulonglong table_flags() const;
#else
ha_oqgraph(TABLE *table);
- ulong table_flags() const;
+ Table_flags table_flags() const;
#endif
~ha_oqgraph() {}
const char *table_type() const
diff --git a/storage/pbxt/src/datadic_xt.cc b/storage/pbxt/src/datadic_xt.cc
index 6a58d23d980..4cc64a0aea9 100644
--- a/storage/pbxt/src/datadic_xt.cc
+++ b/storage/pbxt/src/datadic_xt.cc
@@ -37,7 +37,7 @@
#ifdef DRIZZLED
//#include <drizzled/common_includes.h>
#else
-#include "mysql_priv.h"
+//#include "sql_priv.h"
#endif
#endif
diff --git a/storage/pbxt/src/datalog_xt.cc b/storage/pbxt/src/datalog_xt.cc
index 3238f0cbd17..449eaa9450c 100644
--- a/storage/pbxt/src/datalog_xt.cc
+++ b/storage/pbxt/src/datalog_xt.cc
@@ -31,7 +31,7 @@
#include <stdlib.h>
#ifndef DRIZZLED
-#include "mysql_priv.h"
+//#include "mysql_priv.h"
#endif
#include "ha_pbxt.h"
diff --git a/storage/pbxt/src/discover_xt.cc b/storage/pbxt/src/discover_xt.cc
index 7f7281d8c30..ee52c182a73 100644
--- a/storage/pbxt/src/discover_xt.cc
+++ b/storage/pbxt/src/discover_xt.cc
@@ -24,9 +24,15 @@
#include "xt_config.h"
#ifndef DRIZZLED
-#include "mysql_priv.h"
-#include "item_create.h"
#include <m_ctype.h>
+#include "item.h"
+#include "item_create.h"
+#include "sql_table.h"
+#include "sql_class.h"
+#include "strfunc.h"
+#include "sql_parse.h"
+#include "sql_base.h"
+#include "sql_partition.h" // mem_alloc_error()
#else
#include <drizzled/session.h>
#include <drizzled/server_includes.h>
@@ -1402,7 +1408,7 @@ static bool mysql_create_table_no_lock(THD *thd,
{
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
{
- create_info->table_existed= 1; // Mark that table existed
+ //create_info->table_existed= 1; // Mark that table existed
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
alias);
@@ -1474,7 +1480,7 @@ static bool mysql_create_table_no_lock(THD *thd,
}
thd_proc_info(thd, "creating table");
- create_info->table_existed= 0; // Mark that table is created
+ //create_info->table_existed= 0; // Mark that table is created
create_info->table_options=db_options;
@@ -1487,17 +1493,9 @@ static bool mysql_create_table_no_lock(THD *thd,
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
/* Open table and put in temporary table list */
-#if MYSQL_VERSION_ID >= 50404
- if (!(open_temporary_table(thd, path, db, table_name, 1, OTM_OPEN)))
-#else
if (!(open_temporary_table(thd, path, db, table_name, 1)))
-#endif
{
-#if MYSQL_VERSION_ID >= 50404
- (void) rm_temporary_table(create_info->db_type, path, false);
-#else
(void) rm_temporary_table(create_info->db_type, path);
-#endif
goto unlock_and_end;
}
thd->thread_specific_used= TRUE;
@@ -1539,7 +1537,7 @@ warn:
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
alias);
- create_info->table_existed= 1; // Mark that table existed
+ //create_info->table_existed= 1; // Mark that table existed
goto unlock_and_end;
}
@@ -1617,10 +1615,6 @@ int xt_create_table_frm(handlerton *hton, THD* thd, const char *db, const char *
#else
if (add_field_to_list(thd, &field_name, info->field_type, field_length_ptr, info->field_decimal_length,
info->field_flags,
-#if MYSQL_VERSION_ID >= 50404
- HA_SM_DISK,
- COLUMN_FORMAT_TYPE_FIXED,
-#endif
NULL /*default_value*/, NULL /*on_update_value*/, &comment, NULL /*change*/,
NULL /*interval_list*/, info->field_charset, 0 /*uint_geom_type*/
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 50200
diff --git a/storage/pbxt/src/discover_xt.h b/storage/pbxt/src/discover_xt.h
index 733974ad59f..f6f5a08ff6d 100644
--- a/storage/pbxt/src/discover_xt.h
+++ b/storage/pbxt/src/discover_xt.h
@@ -26,7 +26,8 @@
#ifdef DRIZZLED
#include <drizzled/common.h>
#else
-#include "mysql_priv.h"
+//#include "mysql_priv.h"
+#include <mysql_com.h>
#endif
/*
diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc
index ef0ae582c07..0746958bf4c 100644
--- a/storage/pbxt/src/ha_pbxt.cc
+++ b/storage/pbxt/src/ha_pbxt.cc
@@ -59,8 +59,10 @@ using drizzled::plugin::InfoSchemaTable;
using drizzled::plugin::InfoSchemaMethods;
#else
-#include "mysql_priv.h"
#include <mysql/plugin.h>
+#include "sql_class.h"
+#include "sql_priv.h"
+#include "sql_lex.h"
#endif
#include "ha_pbxt.h"
@@ -1132,7 +1134,7 @@ static int pbxt_init(void *p)
* library that some symbol was not found.
*/
void *dummy = my_malloc(100, MYF(0));
- my_free((byte *) dummy, MYF(0));
+ my_free((byte *) dummy);
if (!pbxt_inited) {
XTThreadPtr self = NULL;
@@ -4049,27 +4051,7 @@ int ha_pbxt::info(uint flag)
#define WHICH_MUTEX mutex
#endif
-#ifdef SAFE_MUTEX
-
-#if MYSQL_VERSION_ID < 50404
-#if MYSQL_VERSION_ID < 50123
- safe_mutex_lock(&share->mutex,__FILE__,__LINE__);
-#else
- safe_mutex_lock(&share->mutex,0,__FILE__,__LINE__);
-#endif
-#else
- safe_mutex_lock(&share->WHICH_MUTEX,0,__FILE__,__LINE__);
-#endif
-
-#else // SAFE_MUTEX
-
-#ifdef MY_PTHREAD_FASTMUTEX
- my_pthread_fastmutex_lock(&share->WHICH_MUTEX);
-#else
- pthread_mutex_lock(&share->WHICH_MUTEX);
-#endif
-
-#endif // SAFE_MUTEX
+ mysql_mutex_lock(&share->WHICH_MUTEX);
#ifdef DRIZZLED
set_prefix(share->keys_in_use, share->keys);
share->keys_for_keyread&= share->keys_in_use;
@@ -4092,15 +4074,7 @@ int ha_pbxt::info(uint flag)
table->key_info[i].rec_per_key[j] = (ulong) rec_per_key;
}
if (share->tmp_table == NO_TMP_TABLE)
-#ifdef SAFE_MUTEX
- safe_mutex_unlock(&share->WHICH_MUTEX,__FILE__,__LINE__);
-#else
-#ifdef MY_PTHREAD_FASTMUTEX
- pthread_mutex_unlock(&share->WHICH_MUTEX.mutex);
-#else
- pthread_mutex_unlock(&share->WHICH_MUTEX);
-#endif
-#endif
+ mysql_mutex_unlock(&share->WHICH_MUTEX);
/*
Set data_file_name and index_file_name to point at the symlink value
if table is symlinked (Ie; Real name is not same as generated name)
@@ -5953,7 +5927,7 @@ static void pbxt_record_cache_size_func(THD *XT_UNUSED(thd), struct st_mysql_sys
if (var->flags & PLUGIN_VAR_MEMALLOC)
{
*(char **)tgt= my_strdup(*(char **) save, MYF(0));
- my_free(old, MYF(0));
+ my_free(old);
}
record_cache_size = ha_set_variable(&pbxt_record_cache_size, &vp_record_cache_size);
xt_tc_set_cache_size((size_t) record_cache_size);
diff --git a/storage/pbxt/src/ha_pbxt.h b/storage/pbxt/src/ha_pbxt.h
index a7548d6fa86..112e581f042 100644
--- a/storage/pbxt/src/ha_pbxt.h
+++ b/storage/pbxt/src/ha_pbxt.h
@@ -31,7 +31,8 @@
#include <drizzled/cursor.h>
#else
-#include "mysql_priv.h"
+#include <thr_lock.h>
+#include <handler.h>
#endif
#include "xt_defs.h"
diff --git a/storage/pbxt/src/ha_xtsys.h b/storage/pbxt/src/ha_xtsys.h
index 16fb4a140ae..220ca4dd21a 100644
--- a/storage/pbxt/src/ha_xtsys.h
+++ b/storage/pbxt/src/ha_xtsys.h
@@ -34,7 +34,7 @@
#include <drizzled/current_session.h>
#include <drizzled/cursor.h>
#else
-#include "mysql_priv.h"
+#include "handler.h"
#endif
#include "xt_defs.h"
diff --git a/storage/pbxt/src/index_xt.cc b/storage/pbxt/src/index_xt.cc
index f6c4b4d8aa3..f339bf05ebf 100644
--- a/storage/pbxt/src/index_xt.cc
+++ b/storage/pbxt/src/index_xt.cc
@@ -37,7 +37,8 @@
#ifdef DRIZZLED
#include <drizzled/base.h>
#else
-#include "mysql_priv.h"
+#include <my_base.h>
+//#include "sql_priv.h"
#endif
#include "pthread_xt.h"
diff --git a/storage/pbxt/src/myxt_xt.cc b/storage/pbxt/src/myxt_xt.cc
index 410bf2d2f3c..d36f7334cfd 100644
--- a/storage/pbxt/src/myxt_xt.cc
+++ b/storage/pbxt/src/myxt_xt.cc
@@ -39,8 +39,14 @@
//extern "C" struct charset_info_st *session_charset(Session *session);
extern pthread_key_t THR_Session;
#else
-#include "mysql_priv.h"
#include <mysql/plugin.h>
+#include "field.h"
+#include "sql_class.h"
+#include "sql_lex.h"
+#include "strfunc.h"
+#include "sql_table.h"
+#include "sql_base.h"
+#include "sql_show.h"
#endif
#ifdef HAVE_ISNAN
@@ -711,7 +717,7 @@ static void mx_set_length_and_data(Field *field, char *dest, xtWord4 len, char *
xtWord4 packlength = ((Field_blob *) field)->pack_length() - field->table->s->blob_ptr_size;
((Field_blob *) field)->store_length((byte *) from, packlength, len);
- memcpy_fixed(((char *) from)+packlength, &data, sizeof(char*));
+ memcpy(((char *) from)+packlength, &data, sizeof(char*));
if (data)
mx_set_notnull_in_record(field, dest);
diff --git a/storage/pbxt/src/pthread_xt.h b/storage/pbxt/src/pthread_xt.h
index dccc5779aad..6e8ac866ceb 100755
--- a/storage/pbxt/src/pthread_xt.h
+++ b/storage/pbxt/src/pthread_xt.h
@@ -28,10 +28,8 @@
#ifdef XT_WIN
#include <windef.h>
-#include <my_pthread.h>
-#else
-#include <pthread.h>
#endif
+#include <my_pthread.h>
#include "locklist_xt.h"
@@ -142,35 +140,6 @@ int xt_p_join(pthread_t thread, void **value);
#else // XT_WIN
-/* Finger weg! */
-#ifdef pthread_mutex_t
-#undef pthread_mutex_t
-#endif
-#ifdef pthread_rwlock_t
-#undef pthread_rwlock_t
-#endif
-#ifdef pthread_mutex_init
-#undef pthread_mutex_init
-#endif
-#ifdef pthread_mutex_destroy
-#undef pthread_mutex_destroy
-#endif
-#ifdef pthread_mutex_lock
-#undef pthread_mutex_lock
-#endif
-#ifdef pthread_mutex_unlock
-#undef pthread_mutex_unlock
-#endif
-#ifdef pthread_cond_wait
-#undef pthread_cond_wait
-#endif
-#ifdef pthread_cond_broadcast
-#undef pthread_cond_broadcast
-#endif
-#ifdef pthread_mutex_trylock
-#undef pthread_mutex_trylock
-#endif
-
/*
* -----------------------------------------------------------------------
* Reedefinition of pthread locking, for debugging
diff --git a/storage/pbxt/src/restart_xt.cc b/storage/pbxt/src/restart_xt.cc
index 93720f2b113..162ec90d754 100644
--- a/storage/pbxt/src/restart_xt.cc
+++ b/storage/pbxt/src/restart_xt.cc
@@ -29,7 +29,7 @@
#include <time.h>
#ifndef DRIZZLED
-#include "mysql_priv.h"
+//#include "mysql_priv.h"
#endif
#include "ha_pbxt.h"
diff --git a/storage/pbxt/src/systab_xt.cc b/storage/pbxt/src/systab_xt.cc
index 783debca115..de6738618f5 100644
--- a/storage/pbxt/src/systab_xt.cc
+++ b/storage/pbxt/src/systab_xt.cc
@@ -33,6 +33,8 @@
#ifdef DRIZZLED
#include <drizzled/server_includes.h>
#include <drizzled/current_session.h>
+#else
+#include "field.h"
#endif
#include "ha_pbxt.h"
diff --git a/storage/pbxt/src/systab_xt.h b/storage/pbxt/src/systab_xt.h
index 408a8749dd0..afd45ab2e72 100644
--- a/storage/pbxt/src/systab_xt.h
+++ b/storage/pbxt/src/systab_xt.h
@@ -70,6 +70,8 @@ CREATE TABLE pbms_reference (
#include "discover_xt.h"
#include "thread_xt.h"
+#include "thr_lock.h"
+
struct XTSystemTableShare;
struct XTDatabase;
diff --git a/storage/pbxt/src/table_xt.cc b/storage/pbxt/src/table_xt.cc
index 2d93f161ac9..c6eaeeba2a1 100644
--- a/storage/pbxt/src/table_xt.cc
+++ b/storage/pbxt/src/table_xt.cc
@@ -36,7 +36,7 @@
#include <mysys/thr_lock.h>
#include <drizzled/dtcollation.h>
#else
-#include "mysql_priv.h"
+//#include "mysql_priv.h"
#endif
#include "table_xt.h"
diff --git a/storage/pbxt/src/xt_config.h b/storage/pbxt/src/xt_config.h
index cb3009ecb79..e99373221e2 100644
--- a/storage/pbxt/src/xt_config.h
+++ b/storage/pbxt/src/xt_config.h
@@ -124,7 +124,7 @@ const int max_connections = 500;
#ifndef DRIZZLED
#if MYSQL_VERSION_ID >= 50404
-#define MYSQL_SUPPORTS_BACKUP
+//#define MYSQL_SUPPORTS_BACKUP
#endif
#endif
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index e5e324d6c6b..b6438808869 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -170,6 +170,24 @@ mysql_declare_plugin(perfschema)
}
mysql_declare_plugin_end;
+maria_declare_plugin(perfschema)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &pfs_storage_engine,
+ pfs_engine_name,
+ "Marc Alff, Oracle",
+ "Performance Schema",
+ PLUGIN_LICENSE_GPL,
+ pfs_init_func,
+ pfs_done_func,
+ 0x0001,
+ pfs_status_vars,
+ NULL,
+ "0.1",
+ MariaDB_PLUGIN_MATURITY_GAMMA /* because MySQL-5.5 is RC */
+}
+maria_declare_plugin_end;
+
ha_perfschema::ha_perfschema(handlerton *hton, TABLE_SHARE *share)
: handler(hton, share), m_table_share(NULL), m_table(NULL)
{}
diff --git a/storage/sphinx/CMakeLists.txt b/storage/sphinx/CMakeLists.txt
index 15034f615d3..136c49336a3 100644
--- a/storage/sphinx/CMakeLists.txt
+++ b/storage/sphinx/CMakeLists.txt
@@ -1,5 +1,5 @@
-SET(SPHINX_SOURCES ha_sphinx.cc)
-LINK_LIBRARIES(ws2_32)
-SET(SPHINX_PLUGIN_STATIC "sphinx")
-SET(SPHINX_PLUGIN_DYNAMIC "ha_sphinx")
-MYSQL_ADD_PLUGIN(sphinx ${SPHINX_SOURCES} STORAGE_ENGINE)
+ADD_DEFINITIONS(-DMYSQL_SERVER)
+IF(MSVC)
+ TARGET_LINK_LIBRARIES(ws2_32)
+ENDIF(MSVC)
+MYSQL_ADD_PLUGIN(sphinx ha_sphinx.cc STORAGE_ENGINE)
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index e88464eb16c..5a810e032b4 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -14,7 +14,6 @@
#include <mysql_version.h>
#if MYSQL_VERSION_ID>50100
-#include "mysql_priv.h"
#include <mysql/plugin.h>
#else
#include "../mysql_priv.h"
@@ -22,6 +21,11 @@
#include <mysys_err.h>
#include <my_sys.h>
+#include "sql_array.h"
+#include "table.h"
+#include "field.h"
+#include "item.h"
+#include <mysqld_error.h>
#ifndef __WIN__
// UNIX-specific
@@ -647,8 +651,8 @@ static int sphinx_init_func ( void * p )
if ( !sphinx_init )
{
sphinx_init = 1;
- VOID ( pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST ) );
- hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0,
+ pthread_mutex_init ( &sphinx_mutex, MY_MUTEX_INIT_FAST );
+ my_hash_init ( &sphinx_open_tables, system_charset_info, 32, 0, 0,
sphinx_get_key, 0, 0 );
#if MYSQL_VERSION_ID > 50100
@@ -699,7 +703,7 @@ static int sphinx_done_func ( void * )
sphinx_init = 0;
if ( sphinx_open_tables.records )
error = 1;
- hash_free ( &sphinx_open_tables );
+ my_hash_free ( &sphinx_open_tables );
pthread_mutex_destroy ( &sphinx_mutex );
}
@@ -1072,12 +1076,12 @@ static CSphSEShare * get_share ( const char * table_name, TABLE * table )
{
// check if we already have this share
#if MYSQL_VERSION_ID>=50120
- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, (const uchar *) table_name, strlen(table_name) );
+ pShare = (CSphSEShare*) my_hash_search ( &sphinx_open_tables, (const uchar *) table_name, strlen(table_name) );
#else
#ifdef __WIN__
- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, (const byte *) table_name, strlen(table_name) );
+ pShare = (CSphSEShare*) my_hash_search ( &sphinx_open_tables, (const byte *) table_name, strlen(table_name) );
#else
- pShare = (CSphSEShare*) hash_search ( &sphinx_open_tables, table_name, strlen(table_name) );
+ pShare = (CSphSEShare*) my_hash_search ( &sphinx_open_tables, table_name, strlen(table_name) );
#endif // win
#endif // pre-5.1.20
@@ -1127,7 +1131,7 @@ static int free_share ( CSphSEShare * pShare )
if ( !--pShare->m_iUseCount )
{
- hash_delete ( &sphinx_open_tables, (byte *)pShare );
+ my_hash_delete ( &sphinx_open_tables, (byte *)pShare );
SafeDelete ( pShare );
}
@@ -2004,26 +2008,31 @@ int ha_sphinx::ConnectToSearchd ( const char * sQueryHost, int iQueryPort )
memcpy ( &sin.sin_addr, &ip_addr, sizeof(ip_addr) );
} else
{
- int tmp_errno;
- struct hostent tmp_hostent, *hp;
- char buff2 [ GETHOSTBYNAME_BUFF_SIZE ];
-
- hp = my_gethostbyname_r ( sHost, &tmp_hostent,
- buff2, sizeof(buff2), &tmp_errno );
- if ( !hp )
+ int err_code;
+ struct addrinfo hints;
+ struct addrinfo *addr_info_list;
+
+ memset(&hints, 0, sizeof (struct addrinfo));
+ hints.ai_flags= AI_PASSIVE;
+ hints.ai_socktype= SOCK_STREAM;
+ hints.ai_family= AF_UNSPEC;
+
+ err_code= getaddrinfo(sHost, NULL, &hints,
+ &addr_info_list);
+
+ if ( err_code )
{
- my_gethostbyname_r_free();
-
char sError[256];
my_snprintf ( sError, sizeof(sError), "failed to resolve searchd host (name=%s)", sHost );
my_error ( ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), sError );
SPH_RET(-1);
}
-
- memcpy ( &sin.sin_addr, hp->h_addr,
- Min ( sizeof(sin.sin_addr), (size_t)hp->h_length ) );
- my_gethostbyname_r_free();
+
+ memcpy ( &sin.sin_addr, addr_info_list->ai_addr,
+ Min ( sizeof(sin.sin_addr), (size_t)addr_info_list->ai_addrlen ) );
+
+ freeaddrinfo(addr_info_list);
}
} else
{
diff --git a/storage/sphinx/ha_sphinx.h b/storage/sphinx/ha_sphinx.h
index 3f517062cff..4435eb4724e 100644
--- a/storage/sphinx/ha_sphinx.h
+++ b/storage/sphinx/ha_sphinx.h
@@ -8,7 +8,7 @@
#if MYSQL_VERSION_ID>50100
-#define TABLE_ARG st_table_share
+#define TABLE_ARG TABLE_SHARE
#else
#define TABLE_ARG st_table
#endif
@@ -18,6 +18,7 @@
typedef uchar byte;
#endif
+#include "handler.h"
/// forward decls
class THD;
diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc
index 961d1a92ed1..c25873bce28 100644
--- a/storage/sphinx/snippets_udf.cc
+++ b/storage/sphinx/snippets_udf.cc
@@ -14,7 +14,6 @@
#include <mysql_version.h>
#if MYSQL_VERSION_ID>50100
-#include "mysql_priv.h"
#include <mysql/plugin.h>
#else
#include "../mysql_priv.h"
@@ -30,6 +29,11 @@
#include <mysys_err.h>
#include <my_sys.h>
+#include <mysqld_error.h>
+
+#include <my_net.h>
+#include <mysql_com.h>
+
#if MYSQL_VERSION_ID>=50120
typedef uchar byte;
#endif
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt.disabled
index 789dbd5327e..789dbd5327e 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt.disabled
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index f511918e845..4a341b4a83e 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -47,14 +47,17 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#define MYSQL_SERVER
#endif
-#include <mysql_priv.h>
-#ifdef MYSQL_SERVER
-#include <log_event.h>
-#endif /* MYSQL_SERVER */
+#include <sql_table.h> // explain_filename, nz2, EXPLAIN_PARTITIONS_AS_COMMENT,
+ // EXPLAIN_FILENAME_MAX_EXTRA_LENGTH
+#include <sql_acl.h> // PROCESS_ACL
+#include <slave.h> // relay_log_info_file
+#include <log_event.h> // rpl_get_position_info
#include <m_ctype.h>
#include <mysys_err.h>
#include <mysql/plugin.h>
+#include <mysql/innodb_priv.h>
+//#include <mysql/psi/psi.h>
/** @file ha_innodb.cc */
@@ -2282,8 +2285,7 @@ skip_relay:
"InnoDB: syntax error in innodb_data_file_path");
mem_free_and_error:
srv_free_paths_and_sizes();
- my_free(internal_innobase_data_file_path,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(internal_innobase_data_file_path);
goto error;
}
@@ -2607,8 +2609,7 @@ innobase_end(
err = 1;
}
srv_free_paths_and_sizes();
- my_free(internal_innobase_data_file_path,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(internal_innobase_data_file_path);
pthread_mutex_destroy(&innobase_share_mutex);
pthread_mutex_destroy(&prepare_commit_mutex);
pthread_mutex_destroy(&commit_threads_m);
@@ -2995,7 +2996,7 @@ innobase_rollback_to_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_rollback_to_savepoint_for_mysql(trx, name,
&mysql_binlog_cache_pos);
@@ -3026,7 +3027,7 @@ innobase_release_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_release_savepoint_for_mysql(trx, name);
@@ -3073,7 +3074,7 @@ innobase_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
char name[64];
- longlong2str((ulint)savepoint,name,36,1);
+ longlong2str((ulint)savepoint,name,36);
error = (int) trx_savepoint_for_mysql(trx, name, (ib_int64_t)0);
@@ -3575,7 +3576,7 @@ innobase_build_index_translation(
func_exit:
if (!ret) {
/* Build translation table failed. */
- my_free(index_mapping, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(index_mapping);
share->idx_trans_tbl.array_size = 0;
share->idx_trans_tbl.index_count = 0;
@@ -3793,7 +3794,7 @@ retry:
if (ib_table && ib_table->is_corrupt) {
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
@@ -3833,7 +3834,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
my_errno = ENOENT;
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
@@ -3849,7 +3850,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
my_errno = ENOENT;
dict_table_decrement_handle_count(ib_table, FALSE);
@@ -4042,7 +4043,7 @@ ha_innobase::close(void)
row_prebuilt_free(prebuilt, FALSE);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
free_share(share);
/* Tell InnoDB server that there might be work for
@@ -5251,7 +5252,7 @@ calc_row_difference(
upd_t* uvect, /*!< in/out: update vector */
uchar* old_row, /*!< in: old row in MySQL format */
uchar* new_row, /*!< in: new row in MySQL format */
- struct st_table* table, /*!< in: table in MySQL data
+ TABLE* table, /*!< in: table in MySQL data
dictionary */
uchar* upd_buff, /*!< in: buffer to use */
ulint buff_len, /*!< in: buffer length */
@@ -6699,7 +6700,7 @@ create_index(
error = convert_error_code_to_mysql(error, flags, NULL);
- my_free(field_lengths, MYF(0));
+ my_free(field_lengths);
DBUG_RETURN(error);
}
@@ -7519,7 +7520,7 @@ innobase_drop_database(
trx = innobase_trx_allocate(thd);
#endif
error = row_drop_database_for_mysql(namebuf, trx);
- my_free(namebuf, MYF(0));
+ my_free(namebuf);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@@ -7597,8 +7598,8 @@ innobase_rename_table(
log_buffer_flush_to_disk();
}
- my_free(norm_to, MYF(0));
- my_free(norm_from, MYF(0));
+ my_free(norm_to);
+ my_free(norm_from);
DBUG_RETURN(error);
}
@@ -7765,7 +7766,7 @@ ha_innobase::records_in_range(
mem_heap_free(heap);
func_exit:
- my_free(key_val_buff2, MYF(0));
+ my_free(key_val_buff2);
prebuilt->trx->op_info = (char*)"";
@@ -8825,7 +8826,7 @@ ha_innobase::free_foreign_key_create_info(
char* str) /*!< in, own: create info string to free */
{
if (str) {
- my_free(str, MYF(0));
+ my_free(str);
}
}
@@ -9053,19 +9054,20 @@ ha_innobase::external_lock(
ulong const tx_isolation = thd_tx_isolation(ha_thd());
if (tx_isolation <= ISO_READ_COMMITTED
&& binlog_format == BINLOG_FORMAT_STMT
-#if MYSQL_VERSION_ID > 50140
&& thd_binlog_filter_ok(thd)
-#endif /* MYSQL_VERSION_ID > 50140 */
+ && thd_sqlcom_can_generate_row_events(thd)
)
{
- char buf[256];
- my_snprintf(buf, sizeof(buf),
- "Transaction level '%s' in"
- " InnoDB is not safe for binlog mode '%s'",
- tx_isolation_names[tx_isolation],
- binlog_format_names[binlog_format]);
- my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
- DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ int skip = 0;
+ /* used by test case */
+ DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = 1;);
+ if (!skip) {
+ my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0),
+ " InnoDB is limited to row-logging when "
+ "transaction isolation level is "
+ "READ COMMITTED or READ UNCOMMITTED.");
+ DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ }
}
}
@@ -9404,7 +9406,7 @@ innodb_show_status(
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
- my_free(str, MYF(0));
+ my_free(str);
DBUG_RETURN(FALSE);
}
@@ -9673,10 +9675,9 @@ static void free_share(INNOBASE_SHARE* share)
thr_lock_delete(&share->lock);
/* Free any memory from index translation table */
- my_free(share->idx_trans_tbl.index_mapping,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(share->idx_trans_tbl.index_mapping);
- my_free(share, MYF(0));
+ my_free(share);
/* TODO: invoke HASH_MIGRATE if innobase_open_tables
shrinks too much */
@@ -11280,14 +11281,8 @@ static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
PLUGIN_VAR_OPCMDARG,
"Speeds up the shutdown process of the InnoDB storage engine. Possible "
- "values are 0, 1 (faster)"
- /*
- NetWare can't close unclosed files, can't automatically kill remaining
- threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
- */
- IF_NETWARE("", " or 2 (fastest - crash-like)")
- ".",
- NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
+ "values are 0, 1 (faster) or 2 (fastest - crash-like).",
+ NULL, NULL, 1, 0, 2, 0);
static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
PLUGIN_VAR_NOCMDARG,
@@ -11449,7 +11444,7 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
- NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
+ NULL, NULL, 128*1024*1024L, 5*1024*1024L, LONGLONG_MAX, 1024*1024L);
static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 50a43aaebed..03358012878 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -296,14 +296,20 @@ 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.
+ @param thd Thread handle
+ @return 1 the query may generate row changes, 0 otherwise.
+*/
+bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd);
}
typedef struct trx_struct trx_t;
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 3a32ed9cf36..daad61ed341 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -21,8 +21,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
Smart ALTER TABLE
*******************************************************/
-#include <mysql_priv.h>
+#include <unireg.h>
#include <mysqld_error.h>
+#include <sql_lex.h> // SQLCOM_CREATE_INDEX
+#include <mysql/innodb_priv.h>
extern "C" {
#include "log0log.h"
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 0f656528315..17c22212ab5 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -23,8 +23,8 @@ InnoDB INFORMATION SCHEMA tables interface to MySQL.
Created July 18, 2007 Vasil Dimov
*******************************************************/
-#include <mysql_priv.h>
#include <mysqld_error.h>
+#include <sql_acl.h> // PROCESS_ACL
#include <m_ctype.h>
#include <hash.h>
diff --git a/storage/xtradb/handler/mysql_addons.cc b/storage/xtradb/handler/mysql_addons.cc
index eae1fe9fbc2..ae6306e5db9 100644
--- a/storage/xtradb/handler/mysql_addons.cc
+++ b/storage/xtradb/handler/mysql_addons.cc
@@ -36,7 +36,7 @@ Created November 07, 2007 Vasil Dimov
#define MYSQL_SERVER
#endif /* MYSQL_SERVER */
-#include <mysql_priv.h>
+#include <sql_priv.h>
#include "mysql_addons.h"
#include "univ.i"
diff --git a/storage/xtradb/include/handler0alter.h b/storage/xtradb/include/handler0alter.h
index 985b76f4f50..7f5af6d2e76 100644
--- a/storage/xtradb/include/handler0alter.h
+++ b/storage/xtradb/include/handler0alter.h
@@ -27,7 +27,7 @@ UNIV_INTERN
void
innobase_rec_to_mysql(
/*==================*/
- TABLE* table, /*!< in/out: MySQL table */
+ struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */
const ulint* offsets); /*!< in: rec_get_offsets(
@@ -39,4 +39,4 @@ UNIV_INTERN
void
innobase_rec_reset(
/*===============*/
- TABLE* table); /*!< in/out: MySQL table */
+ struct TABLE* table); /*!< in/out: MySQL table */
diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h
index 62a5efd11f7..fbeb125ce7b 100644
--- a/storage/xtradb/include/row0merge.h
+++ b/storage/xtradb/include/row0merge.h
@@ -191,7 +191,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table); /*!< in/out: MySQL table, for
+ struct TABLE* table); /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
#endif /* row0merge.h */
diff --git a/storage/xtradb/include/row0types.h b/storage/xtradb/include/row0types.h
index 7920fd75061..1be729206ba 100644
--- a/storage/xtradb/include/row0types.h
+++ b/storage/xtradb/include/row0types.h
@@ -54,6 +54,6 @@ typedef struct purge_node_struct purge_node_t;
typedef struct row_ext_struct row_ext_t;
/* MySQL data types */
-typedef struct st_table TABLE;
+struct TABLE;
#endif
diff --git a/storage/xtradb/os/os0thread.c b/storage/xtradb/os/os0thread.c
index 34818ada804..e41c1163371 100644
--- a/storage/xtradb/os/os0thread.c
+++ b/storage/xtradb/os/os0thread.c
@@ -200,10 +200,6 @@ os_thread_create(
#ifndef UNIV_HPUX10
pthread_attr_destroy(&attr);
#endif
- if (srv_set_thread_priorities) {
-
- my_pthread_setprio(pthread, srv_query_thread_priority);
- }
if (thread_id) {
*thread_id = pthread;
diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
index 37c895fb520..24ab62ec24b 100644
--- a/storage/xtradb/plug.in
+++ b/storage/xtradb/plug.in
@@ -15,7 +15,10 @@
#
MYSQL_STORAGE_ENGINE(xtradb, xtradb, [XtraDB Storage Engine],
- [XtraDB - a drop-in replacement for InnoDB], [max,max-no-ndb])
+ [XtraDB - a drop-in replacement for InnoDB],
+ dnl[max,max-no-ndb]
+ )
+MYSQL_PLUGIN_DISABLED(xtradb)
MYSQL_PLUGIN_DIRECTORY(xtradb, [storage/xtradb])
MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.a])
MYSQL_PLUGIN_DYNAMIC(xtradb, [ha_xtradb.la])
diff --git a/storage/xtradb/row/row0merge.c b/storage/xtradb/row/row0merge.c
index 65102851bdf..1e1d19f28c8 100644
--- a/storage/xtradb/row/row0merge.c
+++ b/storage/xtradb/row/row0merge.c
@@ -408,7 +408,7 @@ row_merge_buf_add(
/** Structure for reporting duplicate records. */
struct row_merge_dup_struct {
const dict_index_t* index; /*!< index being sorted */
- TABLE* table; /*!< MySQL table object */
+ struct TABLE* table; /*!< MySQL table object */
ulint n_dup; /*!< number of duplicates */
};
@@ -1108,7 +1108,7 @@ ulint
row_merge_read_clustered_index(
/*===========================*/
trx_t* trx, /*!< in: transaction */
- TABLE* table, /*!< in/out: MySQL table object,
+ struct TABLE* table, /*!< in/out: MySQL table object,
for reporting erroneous records */
const dict_table_t* old_table,/*!< in: table where rows are
read from */
@@ -1403,7 +1403,7 @@ row_merge_blocks(
ulint* foffs1, /*!< in/out: offset of second
source list in the file */
merge_file_t* of, /*!< in/out: output file */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -1587,7 +1587,7 @@ row_merge(
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table, /*!< in/out: MySQL table, for
+ struct TABLE* table, /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
ulint* num_run,/*!< in/out: Number of runs remain
@@ -1709,7 +1709,7 @@ row_merge_sort(
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -2558,7 +2558,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 0cb0f4dc060..a8732720e10 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -56,7 +56,7 @@ EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc
CHARSET_INFO.txt strmov_overlapp.c
libmystrings_a_LIBADD=
-conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c bcmp.c
+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
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 745594cc6e1..76af3ef2cdf 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -156,7 +156,7 @@ static size_t
my_casefold_mb_varlen(CHARSET_INFO *cs,
char *src, size_t srclen,
char *dst, size_t dstlen __attribute__((unused)),
- uchar *map,
+ const uchar *map,
size_t is_upper)
{
char *srcend= src + srclen, *dst0= dst;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 25ef54e5c02..6c1dcb7481e 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -304,6 +304,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
ulong *nr1, ulong *nr2)
{
register const uchar *sort_order=cs->sort_order;
+ const uchar *end;
/*
Remove end space. We have to do this to be able to compare
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index d1f845cc8fe..fcef2c68967 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -10286,6 +10286,38 @@ struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci=
&my_collation_any_uca_handler
};
+struct charset_info_st my_charset_utf8mb4_croatian_uca_ci=
+{
+ 245,0,0, /* number */
+ MY_CS_UTF8MB4_UCA_FLAGS,/* state */
+ MY_UTF8MB4, /* csname */
+ MY_UTF8MB4 "_croatian_ci",/* name */
+ "", /* comment */
+ croatian, /* tailoring */
+ ctype_utf8, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 1, /* mbminlen */
+ 4, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf8mb4_handler,
+ &my_collation_any_uca_handler
+};
+
#endif /* HAVE_CHARSET_utf8mb4 */
@@ -10952,6 +10984,37 @@ struct charset_info_st my_charset_utf32_sinhala_uca_ci=
&my_collation_utf32_uca_handler
};
+struct charset_info_st my_charset_utf32_croatian_uca_ci=
+{
+ 214,0,0, /* number */
+ MY_CS_UTF32_UCA_FLAGS /* state */,
+ "utf32", /* cs name */
+ "utf32_croatian_ci", /* name */
+ "", /* comment */
+ croatian, /* tailoring */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 4, /* mbminlen */
+ 4, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf32_handler,
+ &my_collation_utf32_uca_handler
+};
#endif /* HAVE_CHARSET_utf32 */
@@ -11619,6 +11682,37 @@ struct charset_info_st my_charset_utf16_sinhala_uca_ci=
&my_collation_utf16_uca_handler
};
+struct charset_info_st my_charset_utf16_croatian_uca_ci=
+{
+ 215,0,0, /* number */
+ MY_CS_UTF16_UCA_FLAGS /* state */,
+ "utf16", /* cs name */
+ "utf16_croatian_ci", /* name */
+ "", /* comment */
+ croatian, /* tailoring */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 2, /* mbminlen */
+ 4, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf16_handler,
+ &my_collation_utf16_uca_handler
+};
#endif /* HAVE_CHARSET_utf16 */
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 66e54914c2f..e9c69c628da 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1095,7 +1095,7 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)),
static inline void
-my_tolower_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tolower_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -1104,7 +1104,7 @@ my_tolower_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
static inline void
-my_toupper_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_toupper_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -1113,7 +1113,7 @@ my_toupper_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
static inline void
-my_tosort_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tosort_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256)
@@ -1727,7 +1727,7 @@ MY_CHARSET_HANDLER my_charset_utf16_handler=
};
-CHARSET_INFO my_charset_utf16_general_ci=
+struct charset_info_st my_charset_utf16_general_ci=
{
54,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
@@ -1760,7 +1760,7 @@ CHARSET_INFO my_charset_utf16_general_ci=
};
-CHARSET_INFO my_charset_utf16_bin=
+struct charset_info_st my_charset_utf16_bin=
{
55,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII,
@@ -1824,7 +1824,7 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)),
static inline void
-my_tolower_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tolower_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -1833,7 +1833,7 @@ my_tolower_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
static inline void
-my_toupper_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_toupper_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -1842,7 +1842,7 @@ my_toupper_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
static inline void
-my_tosort_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tosort_utf32(MY_UNICASE_INFO *const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256)
@@ -2754,7 +2754,7 @@ MY_CHARSET_HANDLER my_charset_utf32_handler=
};
-CHARSET_INFO my_charset_utf32_general_ci=
+struct charset_info_st my_charset_utf32_general_ci=
{
60,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII,
@@ -2787,7 +2787,7 @@ CHARSET_INFO my_charset_utf32_general_ci=
};
-CHARSET_INFO my_charset_utf32_bin=
+struct charset_info_st my_charset_utf32_bin=
{
61,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII,
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 7628d5eb82a..0f6cf990701 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -67172,7 +67172,7 @@ static size_t
my_casefold_ujis(CHARSET_INFO *cs,
char *src, size_t srclen,
char *dst, size_t dstlen __attribute__((unused)),
- uchar *map,
+ const uchar * const map,
size_t is_upper)
{
char *srcend= src + srclen, *dst0= dst;
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 8cc2ebdeb68..4b0265693b6 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1721,7 +1721,7 @@ MY_UNICASE_INFO *const my_unicase_turkish[256]=
static inline void
-my_tosort_unicode(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tosort_unicode(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256)
@@ -1754,7 +1754,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
int scan;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *,
+ int (*mb_wc)(CHARSET_INFO *, my_wc_t *,
const uchar *, const uchar *);
mb_wc= cs->cset->mb_wc;
@@ -1905,14 +1905,13 @@ my_strnxfrm_unicode(CHARSET_INFO *cs,
uchar *dst, size_t dstlen,
const uchar *src, size_t srclen)
{
- my_wc_t wc;
+ my_wc_t UNINIT_VAR(wc);
int res;
uchar *de= dst + dstlen;
uchar *de_beg= de - 1;
const uchar *se = src + srclen;
- MY_UNICASE_INFO **uni_plane= (cs->state & MY_CS_BINSORT) ?
- NULL : cs->caseinfo;
- LINT_INIT(wc);
+ MY_UNICASE_INFO * const*uni_plane= (cs->state & MY_CS_BINSORT) ?
+ NULL : cs->caseinfo;
DBUG_ASSERT(src);
while (dst < de_beg)
@@ -4683,7 +4682,7 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)),
static inline void
-my_tolower_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_tolower_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -4692,7 +4691,7 @@ my_tolower_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
static inline void
-my_toupper_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc)
+my_toupper_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
if (page < 256 && uni_plane[page])
@@ -4707,7 +4706,7 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, char *src, size_t srclen,
my_wc_t wc;
int srcres, dstres;
char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
DBUG_ASSERT(src != dst || cs->caseup_multiply == 1);
while ((src < srcend) &&
@@ -4739,7 +4738,7 @@ my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen,
my_wc_t wc;
int res;
const uchar *e= s + slen;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
/*
Remove end space. We do this to be able to compare
@@ -4775,7 +4774,7 @@ my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
DBUG_ASSERT(cs->caseup_multiply == 1);
while (*src &&
@@ -4800,7 +4799,7 @@ my_casedn_utf8mb4(CHARSET_INFO *cs,
my_wc_t wc;
int srcres, dstres;
char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
DBUG_ASSERT(src != dst || cs->casedn_multiply == 1);
while ((src < srcend) &&
@@ -4823,7 +4822,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
DBUG_ASSERT(cs->casedn_multiply == 1);
while (*src &&
@@ -4865,7 +4864,7 @@ my_strnncoll_utf8mb4(CHARSET_INFO *cs,
my_wc_t s_wc,t_wc;
const uchar *se= s + slen;
const uchar *te= t + tlen;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
LINT_INIT(s_wc);
LINT_INIT(t_wc);
@@ -4932,7 +4931,7 @@ my_strnncollsp_utf8mb4(CHARSET_INFO *cs,
int res;
my_wc_t s_wc, t_wc;
const uchar *se= s + slen, *te= t + tlen;
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
LINT_INIT(s_wc);
LINT_INIT(t_wc);
@@ -5016,7 +5015,7 @@ my_strnncollsp_utf8mb4(CHARSET_INFO *cs,
static int
my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
{
- MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+ MY_UNICASE_INFO * const* uni_plane= cs->caseinfo;
while (s[0] && t[0])
{
my_wc_t s_wc,t_wc;
@@ -5183,7 +5182,7 @@ MY_CHARSET_HANDLER my_charset_utf8mb4_handler=
-CHARSET_INFO my_charset_utf8mb4_general_ci=
+struct charset_info_st my_charset_utf8mb4_general_ci=
{
45,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT, /* state */
@@ -5216,7 +5215,7 @@ CHARSET_INFO my_charset_utf8mb4_general_ci=
};
-CHARSET_INFO my_charset_utf8mb4_bin=
+struct charset_info_st my_charset_utf8mb4_bin=
{
46,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT, /* state */