summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/compile-solaris-amd642
-rw-r--r--VERSION2
-rw-r--r--client/CMakeLists.txt3
-rw-r--r--client/mysql_upgrade.c1
-rw-r--r--client/mysqlimport.c5
-rw-r--r--cmake/cpack_rpm.cmake1
-rw-r--r--cmake/os/Windows.cmake10
-rw-r--r--extra/yassl/README29
-rw-r--r--extra/yassl/include/openssl/ssl.h2
-rw-r--r--extra/yassl/include/yassl_error.hpp3
-rw-r--r--extra/yassl/src/buffer.cpp2
-rw-r--r--extra/yassl/src/handshake.cpp2
-rw-r--r--extra/yassl/src/ssl.cpp29
-rw-r--r--extra/yassl/src/yassl_error.cpp4
-rw-r--r--extra/yassl/src/yassl_imp.cpp15
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp9
-rw-r--r--extra/yassl/taocrypt/src/rsa.cpp4
-rw-r--r--extra/yassl/testsuite/cipher-test.sh1
-rw-r--r--include/decimal.h8
-rw-r--r--include/maria.h2
-rw-r--r--include/my_alarm.h2
-rw-r--r--include/my_base.h8
-rw-r--r--include/my_dbug.h4
-rw-r--r--include/my_global.h2
-rw-r--r--include/my_pthread.h8
-rw-r--r--include/my_sys.h13
-rw-r--r--include/mysql.h4
-rw-r--r--man/aria_chk.13
-rw-r--r--man/aria_dump_log.15
-rw-r--r--man/aria_ftdump.13
-rw-r--r--man/aria_pack.13
-rw-r--r--man/aria_read_log.13
-rw-r--r--man/comp_err.123
-rw-r--r--man/innochecksum.142
-rw-r--r--man/make_win_bin_dist.117
-rw-r--r--man/msql2mysql.117
-rw-r--r--man/my_print_defaults.141
-rw-r--r--man/myisam_ftdump.117
-rw-r--r--man/myisamchk.1185
-rw-r--r--man/myisamlog.117
-rw-r--r--man/myisampack.119
-rw-r--r--man/mysql-stress-test.pl.123
-rw-r--r--man/mysql-test-run.pl.1537
-rw-r--r--man/mysql.1497
-rw-r--r--man/mysql.server.144
-rw-r--r--man/mysql_client_test.125
-rw-r--r--man/mysql_config.139
-rw-r--r--man/mysql_convert_table_format.126
-rw-r--r--man/mysql_find_rows.117
-rw-r--r--man/mysql_fix_extensions.117
-rw-r--r--man/mysql_install_db.1154
-rw-r--r--man/mysql_plugin.137
-rw-r--r--man/mysql_secure_installation.121
-rw-r--r--man/mysql_setpermission.135
-rw-r--r--man/mysql_tzinfo_to_sql.120
-rw-r--r--man/mysql_upgrade.1450
-rw-r--r--man/mysql_waitpid.117
-rw-r--r--man/mysql_zap.117
-rw-r--r--man/mysqlaccess.128
-rw-r--r--man/mysqladmin.1220
-rw-r--r--man/mysqlbinlog.1264
-rw-r--r--man/mysqlbug.125
-rw-r--r--man/mysqlcheck.1320
-rw-r--r--man/mysqld.834
-rw-r--r--man/mysqld_multi.1123
-rw-r--r--man/mysqld_safe.1202
-rw-r--r--man/mysqldump.1596
-rw-r--r--man/mysqldumpslow.126
-rw-r--r--man/mysqlhotcopy.139
-rw-r--r--man/mysqlimport.1223
-rw-r--r--man/mysqlshow.1225
-rw-r--r--man/mysqlslap.1327
-rw-r--r--man/mysqltest.1363
-rw-r--r--man/ndbd.817
-rw-r--r--man/ndbd_redo_log_reader.117
-rw-r--r--man/ndbmtd.817
-rw-r--r--man/perror.119
-rw-r--r--man/replace.117
-rw-r--r--man/resolve_stack_dump.117
-rw-r--r--man/resolveip.117
-rw-r--r--mysql-test/disabled.def3
-rw-r--r--mysql-test/include/restart_mysqld.inc20
-rwxr-xr-xmysql-test/mysql-test-run.pl5
-rw-r--r--mysql-test/r/alter_table.result9
-rw-r--r--mysql-test/r/derived.result27
-rw-r--r--mysql-test/r/dyncol.result15
-rw-r--r--mysql-test/r/empty_server_name-8224.result1
-rw-r--r--mysql-test/r/events_1.result3
-rw-r--r--mysql-test/r/events_restart.result24
-rw-r--r--mysql-test/r/explain_non_select.result41
-rw-r--r--mysql-test/r/func_if.result17
-rw-r--r--mysql-test/r/func_misc.result204
-rw-r--r--mysql-test/r/information_schema2.result24
-rw-r--r--mysql-test/r/init_file_set_password-7656.result8
-rw-r--r--mysql-test/r/loadxml.result27
-rw-r--r--mysql-test/r/lowercase_fs_on.result3
-rw-r--r--mysql-test/r/lowercase_table3.result11
-rw-r--r--mysql-test/r/mdev-504.result2
-rw-r--r--mysql-test/r/mysql_upgrade-6984.result1
-rw-r--r--mysql-test/r/mysqldump.result29
-rw-r--r--mysql-test/r/partition_alter.result53
-rw-r--r--mysql-test/r/partition_error.result2
-rw-r--r--mysql-test/r/partition_innodb.result34
-rw-r--r--mysql-test/r/ps.result21
-rw-r--r--mysql-test/r/ps_change_master.result22
-rw-r--r--mysql-test/r/selectivity_no_engine.result17
-rw-r--r--mysql-test/r/skip_grants.result4
-rw-r--r--mysql-test/r/subselect.result94
-rw-r--r--mysql-test/r/subselect_no_exists_to_in.result94
-rw-r--r--mysql-test/r/subselect_no_mat.result94
-rw-r--r--mysql-test/r/subselect_no_opts.result94
-rw-r--r--mysql-test/r/subselect_no_scache.result94
-rw-r--r--mysql-test/r/subselect_no_semijoin.result94
-rw-r--r--mysql-test/r/subselect_sj2.result33
-rw-r--r--mysql-test/r/subselect_sj2_jcl6.result33
-rw-r--r--mysql-test/r/subselect_sj2_mat.result33
-rw-r--r--mysql-test/r/update.result15
-rw-r--r--mysql-test/r/view.result137
-rw-r--r--mysql-test/std_data/bug16171518_1.dat59
-rw-r--r--mysql-test/std_data/bug16171518_2.dat12
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result72
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result72
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-filewrite.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug68148.result36
-rw-r--r--mysql-test/suite/innodb/r/innodb_monitor.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result2
-rw-r--r--mysql-test/suite/innodb/r/snapshot.result8
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-filewrite.test32
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60229-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60229.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug68148.test41
-rw-r--r--mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test4
-rw-r--r--mysql-test/suite/innodb/t/snapshot.test18
-rw-r--r--mysql-test/suite/innodb/t/xa_recovery.test6
-rw-r--r--mysql-test/suite/jp/t/jp_enum_sjis-master.opt1
-rw-r--r--mysql-test/suite/jp/t/jp_enum_sjis.test4
-rw-r--r--mysql-test/suite/jp/t/jp_enum_ucs2-master.opt1
-rw-r--r--mysql-test/suite/jp/t/jp_enum_ucs2.test4
-rw-r--r--mysql-test/suite/jp/t/jp_enum_ujis-master.opt1
-rw-r--r--mysql-test/suite/jp/t/jp_enum_ujis.test4
-rw-r--r--mysql-test/suite/jp/t/jp_enum_utf8-master.opt1
-rw-r--r--mysql-test/suite/jp/t/jp_enum_utf8.test4
-rw-r--r--mysql-test/suite/parts/r/partition_debug.result16
-rw-r--r--mysql-test/suite/parts/t/partition_debug.test18
-rw-r--r--mysql-test/suite/perfschema/r/misc.result15
-rw-r--r--mysql-test/suite/perfschema/r/query_cache.result4
-rw-r--r--mysql-test/suite/perfschema/t/misc.test20
-rw-r--r--mysql-test/suite/perfschema/t/query_cache.test2
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_load.result7
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_send.result7
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_load.test20
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_send.test9
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result4
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.test8
-rw-r--r--mysql-test/suite/roles/ip-6401.test3
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.result6
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.test13
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev8193.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_to_stmt.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev8193.test56
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_to_stmt.test23
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result9
-rw-r--r--mysql-test/t/alter_table.test13
-rw-r--r--mysql-test/t/derived.test35
-rw-r--r--mysql-test/t/dyncol.test12
-rw-r--r--mysql-test/t/empty_server_name-8224.test4
-rw-r--r--mysql-test/t/events_1.test3
-rw-r--r--mysql-test/t/events_restart.test14
-rw-r--r--mysql-test/t/explain_non_select.test42
-rw-r--r--mysql-test/t/func_if.test14
-rw-r--r--mysql-test/t/func_misc.test207
-rw-r--r--mysql-test/t/information_schema2.test19
-rw-r--r--mysql-test/t/init_file_set_password-7656.test26
-rw-r--r--mysql-test/t/loadxml.test14
-rw-r--r--mysql-test/t/lowercase_fs_on.test38
-rw-r--r--mysql-test/t/lowercase_table3-master.opt1
-rw-r--r--mysql-test/t/lowercase_table3.test37
-rw-r--r--mysql-test/t/mdev-504.test4
-rw-r--r--mysql-test/t/mysql_upgrade-6984.test3
-rw-r--r--mysql-test/t/mysqldump.test36
-rw-r--r--mysql-test/t/partition_alter.test66
-rw-r--r--mysql-test/t/partition_error.test2
-rw-r--r--mysql-test/t/partition_innodb.test42
-rw-r--r--mysql-test/t/ps.test22
-rw-r--r--mysql-test/t/ps_change_master.test45
-rw-r--r--mysql-test/t/selectivity_no_engine.test17
-rw-r--r--mysql-test/t/skip_grants.test2
-rw-r--r--mysql-test/t/subselect.test99
-rw-r--r--mysql-test/t/subselect_sj2.test39
-rw-r--r--mysql-test/t/update.test15
-rw-r--r--mysql-test/t/view.test157
-rw-r--r--mysys/ma_dyncol.c6
-rw-r--r--mysys/mf_keycache.c26
-rw-r--r--mysys/mulalloc.c44
-rw-r--r--scripts/mysql_install_db.sh4
-rw-r--r--scripts/mysql_secure_installation.sh32
-rw-r--r--scripts/mysql_system_tables_fix.sql2
-rw-r--r--sql/events.cc178
-rw-r--r--sql/events.h16
-rw-r--r--sql/field.h17
-rw-r--r--sql/field_conv.cc16
-rw-r--r--sql/filesort.cc1
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/hostname.cc1
-rw-r--r--sql/item.cc21
-rw-r--r--sql/item.h3
-rw-r--r--sql/item_cmpfunc.cc54
-rw-r--r--sql/item_func.cc53
-rw-r--r--sql/item_func.h39
-rw-r--r--sql/item_subselect.cc26
-rw-r--r--sql/item_subselect.h6
-rw-r--r--sql/key.cc1
-rw-r--r--sql/lock.cc1
-rw-r--r--sql/log.cc5
-rw-r--r--sql/log.h1
-rw-r--r--sql/log_event.cc142
-rw-r--r--sql/log_event.h74
-rw-r--r--sql/log_slow.h28
-rw-r--r--sql/mysqld.cc28
-rw-r--r--sql/opt_range.cc63
-rw-r--r--sql/opt_subselect.cc140
-rw-r--r--sql/opt_subselect.h13
-rw-r--r--sql/opt_sum.cc6
-rw-r--r--sql/partition_info.cc51
-rw-r--r--sql/protocol.cc1
-rw-r--r--sql/records.cc5
-rw-r--r--sql/records.h2
-rw-r--r--sql/rpl_injector.cc1
-rw-r--r--sql/rpl_mi.cc1
-rw-r--r--sql/rpl_parallel.cc43
-rw-r--r--sql/rpl_record_old.cc1
-rw-r--r--sql/rpl_rli.cc4
-rw-r--r--sql/slave.cc6
-rw-r--r--sql/sql_acl.cc66
-rw-r--r--sql/sql_admin.h2
-rw-r--r--sql/sql_base.cc27
-rw-r--r--sql/sql_base.h1
-rw-r--r--sql/sql_class.cc16
-rw-r--r--sql/sql_class.h3
-rw-r--r--sql/sql_connect.cc1
-rw-r--r--sql/sql_const.h8
-rw-r--r--sql/sql_delete.cc17
-rw-r--r--sql/sql_digest.h7
-rw-r--r--sql/sql_error.cc2
-rw-r--r--sql/sql_handler.cc38
-rw-r--r--sql/sql_handler.h5
-rw-r--r--sql/sql_insert.cc57
-rw-r--r--sql/sql_lex.cc24
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_load.cc13
-rw-r--r--sql/sql_manager.cc1
-rw-r--r--sql/sql_parse.cc47
-rw-r--r--sql/sql_partition.cc1
-rw-r--r--sql/sql_prepare.cc7
-rw-r--r--sql/sql_profile.cc1
-rw-r--r--sql/sql_reload.cc1
-rw-r--r--sql/sql_repl.cc19
-rw-r--r--sql/sql_select.cc13
-rw-r--r--sql/sql_select.h3
-rw-r--r--sql/sql_show.cc15
-rw-r--r--sql/sql_table.cc11
-rw-r--r--sql/sql_time.cc1
-rw-r--r--sql/sql_trigger.h2
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc33
-rw-r--r--sql/sql_yacc.yy19
-rw-r--r--sql/sys_vars.cc40
-rw-r--r--sql/table.cc8
-rw-r--r--sql/threadpool_unix.cc2
-rw-r--r--sql/unireg.h12
-rw-r--r--storage/archive/archive_test.c2
-rw-r--r--storage/connect/ha_connect.cc32
-rw-r--r--storage/connect/odbconn.cpp6
-rw-r--r--storage/connect/reldef.h3
-rw-r--r--storage/connect/tabdos.cpp3
-rw-r--r--storage/connect/tabfix.cpp12
-rw-r--r--storage/connect/tabjson.cpp12
-rw-r--r--storage/connect/tabmul.cpp2
-rw-r--r--storage/connect/tabodbc.cpp17
-rw-r--r--storage/connect/value.cpp22
-rw-r--r--storage/connect/value.h20
-rw-r--r--storage/federated/ha_federated.h2
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc1
-rw-r--r--storage/innobase/CMakeLists.txt87
-rw-r--r--storage/innobase/btr/btr0cur.cc34
-rw-r--r--storage/innobase/buf/buf0buf.cc59
-rw-r--r--storage/innobase/dict/dict0dict.cc58
-rw-r--r--storage/innobase/handler/ha_innodb.cc38
-rw-r--r--storage/innobase/handler/handler0alter.cc2
-rw-r--r--storage/innobase/include/dict0dict.h28
-rw-r--r--storage/innobase/include/ibuf0ibuf.ic5
-rw-r--r--storage/innobase/include/os0sync.h167
-rw-r--r--storage/innobase/include/srv0mon.h4
-rw-r--r--storage/innobase/include/srv0srv.h21
-rw-r--r--storage/innobase/include/sync0sync.h9
-rw-r--r--storage/innobase/include/sync0sync.ic19
-rw-r--r--storage/innobase/include/univ.i2
-rw-r--r--storage/innobase/lock/lock0lock.cc7
-rw-r--r--storage/innobase/log/log0log.cc8
-rw-r--r--storage/innobase/row/row0ins.cc2
-rw-r--r--storage/innobase/row/row0log.cc4
-rw-r--r--storage/innobase/row/row0merge.cc51
-rw-r--r--storage/innobase/srv/srv0mon.cc34
-rw-r--r--storage/innobase/srv/srv0srv.cc34
-rw-r--r--storage/innobase/srv/srv0start.cc5
-rw-r--r--storage/innobase/trx/trx0sys.cc22
-rw-r--r--storage/maria/ma_blockrec.h2
-rw-r--r--storage/maria/ma_pagecache.c28
-rw-r--r--storage/myisam/myisamdef.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc2
-rw-r--r--storage/perfschema/pfs.cc1
-rw-r--r--storage/perfschema/pfs_timer.cc40
-rw-r--r--storage/tokudb/hatoku_hton.cc20
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result32
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test34
-rw-r--r--storage/xtradb/CMakeLists.txt78
-rw-r--r--storage/xtradb/api/api0api.cc12
-rw-r--r--storage/xtradb/btr/btr0cur.cc8
-rw-r--r--storage/xtradb/buf/buf0buf.cc12
-rw-r--r--storage/xtradb/buf/buf0flu.cc19
-rw-r--r--storage/xtradb/dict/dict0dict.cc65
-rw-r--r--storage/xtradb/dict/dict0stats_bg.cc8
-rw-r--r--storage/xtradb/fil/fil0fil.cc9
-rw-r--r--storage/xtradb/handler/ha_innodb.cc77
-rw-r--r--storage/xtradb/handler/handler0alter.cc166
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc4
-rw-r--r--storage/xtradb/include/dict0dict.h27
-rw-r--r--storage/xtradb/include/dict0dict.ic2
-rw-r--r--storage/xtradb/include/fts0fts.h2
-rw-r--r--storage/xtradb/include/row0purge.h12
-rw-r--r--storage/xtradb/include/srv0mon.h4
-rw-r--r--storage/xtradb/include/srv0srv.h12
-rw-r--r--storage/xtradb/include/univ.i5
-rw-r--r--storage/xtradb/log/log0log.cc3
-rw-r--r--storage/xtradb/os/os0file.cc18
-rw-r--r--storage/xtradb/row/row0import.cc107
-rw-r--r--storage/xtradb/row/row0ins.cc71
-rw-r--r--storage/xtradb/row/row0log.cc4
-rw-r--r--storage/xtradb/row/row0merge.cc51
-rw-r--r--storage/xtradb/row/row0purge.cc79
-rw-r--r--storage/xtradb/row/row0sel.cc2
-rw-r--r--storage/xtradb/srv/srv0mon.cc34
-rw-r--r--storage/xtradb/srv/srv0srv.cc9
-rw-r--r--storage/xtradb/srv/srv0start.cc27
-rw-r--r--strings/conf_to_src.c2
-rw-r--r--strings/ctype.c2
-rw-r--r--support-files/mysql.server.sh13
-rw-r--r--support-files/mysql.spec.sh14
-rw-r--r--win/packaging/ca/CustomAction.cpp2
362 files changed, 9438 insertions, 3163 deletions
diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64
index 2ae8ff333e8..8b032309beb 100755
--- a/BUILD/compile-solaris-amd64
+++ b/BUILD/compile-solaris-amd64
@@ -3,6 +3,6 @@
export LDFLAGS='-m64 -lmtmalloc -R/usr/sfw/lib/64'
export CFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64'
export CXXFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64'
-cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON
+cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON -DWITH_ZLIB=bundled
gmake -j6 VERBOSE=1
diff --git a/VERSION b/VERSION
index c4eb6c7cb58..331af9b05de 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
-MYSQL_VERSION_PATCH=21
+MYSQL_VERSION_PATCH=22
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 1bf466c1e47..e4643ad9358 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,6 +51,7 @@ MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
+SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server)
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 0b312ef5f2f..0dfcd81bdf9 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -870,6 +870,7 @@ static const char *expected_errors[]=
"ERROR 1060", /* Duplicate column name */
"ERROR 1061", /* Duplicate key name */
"ERROR 1054", /* Unknown column */
+ "ERROR 1290", /* RR_OPTION_PREVENTS_STATEMENT */
0
};
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index cf1df1e95d8..2363f1b69df 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,5 +1,6 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +31,6 @@
#include "client_priv.h"
#include "mysql_version.h"
-#include <my_pthread.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
@@ -484,7 +484,6 @@ static void db_disconnect(char *host, MYSQL *mysql)
}
-
static void safe_exit(int error, MYSQL *mysql)
{
if (error && ignore_errors)
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 7f4a91682a8..d0213c7cef5 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -31,6 +31,7 @@ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
+SET(CPACK_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
SET(CPACK_RPM_PACKAGE_URL "http://mariadb.org")
SET(CPACK_RPM_PACKAGE_SUMMARY "MariaDB: a very fast and robust SQL database server")
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index d52e36193ca..4c01bab4c1f 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -50,10 +50,12 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
SET(MSVC TRUE)
ENDIF()
-ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
-ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
+ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
+ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
+# We do not want the windows.h macros min/max
+ADD_DEFINITIONS(-DNOMINMAX)
# Speed up build process excluding unused header files
-ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
+ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
# Adjust compiler and linker flags
IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
diff --git a/extra/yassl/README b/extra/yassl/README
index da399c3d141..bf0e1c9f40f 100644
--- a/extra/yassl/README
+++ b/extra/yassl/README
@@ -12,6 +12,35 @@ before calling SSL_new();
*** end Note ***
+yaSSL Release notes, version 2.3.8 (9/17/2015)
+ This release of yaSSL fixes a high security vulnerability. All users
+ SHOULD update. If using yaSSL for TLS on the server side with private
+ RSA keys allowing ephemeral key exchange you MUST update and regenerate
+ the RSA private keys. This report is detailed in:
+ https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf
+ yaSSL now detects RSA signature faults and returns an error.
+
+yaSSL Patch notes, version 2.3.7e (6/26/2015)
+ This release of yaSSL includes a fix for Date less than comparison.
+ Previously yaSSL would return true on less than comparisons if the Dates
+ were equal. Reported by Oracle. No security problem, but if a cert was
+ generated right now, a server started using it in the same second, and a
+ client tried to verify it in the same second it would report not yet valid.
+
+yaSSL Patch notes, version 2.3.7d (6/22/2015)
+ This release of yaSSL includes a fix for input_buffer set_current with
+ index 0. SSL_peek() at front of waiting data could trigger. Robert
+ Golebiowski of Oracle identified and suggested a fix, thanks!
+
+yaSSL Patch notes, version 2.3.7c (6/12/2015)
+ This release of yaSSL does certificate DATE comparisons to the second
+ instead of to the minute, helpful when using freshly generated certs.
+ Though keep in mind that time sync differences could still show up.
+
+yaSSL Patch notes, version 2.3.7b (3/18/2015)
+ This release of yaSSL fixes a potential crash with corrupted private keys.
+ Also detects bad keys earlier for user.
+
yaSSL Release notes, version 2.3.7 (12/10/2014)
This release of yaSSL fixes the potential to process duplicate handshake
messages by explicitly marking/checking received handshake messages.
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 404ffa29275..bec22427332 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -34,7 +34,7 @@
#include "rsa.h"
-#define YASSL_VERSION "2.3.7"
+#define YASSL_VERSION "2.3.8"
#if defined(__cplusplus)
diff --git a/extra/yassl/include/yassl_error.hpp b/extra/yassl/include/yassl_error.hpp
index beba7b0b5dd..d63244dca90 100644
--- a/extra/yassl/include/yassl_error.hpp
+++ b/extra/yassl/include/yassl_error.hpp
@@ -53,7 +53,8 @@ enum YasslError {
compress_error = 118,
decompress_error = 119,
pms_version_error = 120,
- sanityCipher_error = 121
+ sanityCipher_error = 121,
+ rsaSignFault_error = 122
// !!!! add error message to .cpp !!!!
diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp
index ee5e0cc0793..532da3875a7 100644
--- a/extra/yassl/src/buffer.cpp
+++ b/extra/yassl/src/buffer.cpp
@@ -165,7 +165,7 @@ void input_buffer::set_error()
void input_buffer::set_current(uint i)
{
- if (error_ == 0 && (i == 0 || check(i - 1, size_) == 0))
+ if (error_ == 0 && check(i ? i - 1 : 0, size_) == 0)
current_ = i;
else
error_ = -1;
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index 39bcd9745b4..407e4092ccc 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -1173,6 +1173,8 @@ void sendCertificateVerify(SSL& ssl, BufferOutput buffer)
CertificateVerify verify;
verify.Build(ssl);
+ if (ssl.GetError()) return;
+
RecordLayerHeader rlHeader;
HandShakeHeader hsHeader;
mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer);
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 356b310037e..26a02afcacf 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -37,6 +37,8 @@
#include "file.hpp" // for TaoCrypt Source
#include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack
+#include "rsa.hpp" // for TaoCrypt RSA key decode
+#include "dsa.hpp" // for TaoCrypt DSA key decode
#include <stdio.h>
#include <time.h>
@@ -55,6 +57,8 @@ namespace yaSSL {
int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
{
+ int ret = SSL_SUCCESS;
+
if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
return SSL_BAD_FILETYPE;
@@ -142,8 +146,31 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
}
}
}
+
+ if (type == PrivateKey && ctx->privateKey_) {
+ // see if key is valid early
+ TaoCrypt::Source rsaSource(ctx->privateKey_->get_buffer(),
+ ctx->privateKey_->get_length());
+ TaoCrypt::RSA_PrivateKey rsaKey;
+ rsaKey.Initialize(rsaSource);
+
+ if (rsaSource.GetError().What()) {
+ // rsa failed see if DSA works
+
+ TaoCrypt::Source dsaSource(ctx->privateKey_->get_buffer(),
+ ctx->privateKey_->get_length());
+ TaoCrypt::DSA_PrivateKey dsaKey;
+ dsaKey.Initialize(dsaSource);
+
+ if (rsaSource.GetError().What()) {
+ // neither worked
+ ret = SSL_FAILURE;
+ }
+ }
+ }
+
fclose(input);
- return SSL_SUCCESS;
+ return ret;
}
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index 36e286a73ce..fec6a3394ca 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -148,6 +148,10 @@ void SetErrorString(YasslError error, char* buffer)
strncpy(buffer, "sanity check on cipher text size error", max);
break;
+ case rsaSignFault_error:
+ strncpy(buffer, "rsa signature fault error", max);
+ break;
+
// openssl errors
case SSL_ERROR_WANT_READ :
strncpy(buffer, "the read operation would block", max);
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index 5d5632f3ba4..48d0e01b1fa 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -196,9 +196,16 @@ void DH_Server::build(SSL& ssl)
sha.update(tmp.get_buffer(), tmp.get_size());
sha.get_digest(&hash[MD5_LEN]);
- if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo)
+ if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) {
auth->sign(signature_, hash, sizeof(hash),
ssl.getCrypto().get_random());
+ // check for rsa signautre fault
+ if (!auth->verify(hash, sizeof(hash), signature_,
+ auth->get_signatureLength())) {
+ ssl.SetError(rsaSignFault_error);
+ return;
+ }
+ }
else {
auth->sign(signature_, &hash[MD5_LEN], SHA_LEN,
ssl.getCrypto().get_random());
@@ -2159,6 +2166,12 @@ void CertificateVerify::Build(SSL& ssl)
memcpy(sig.get(), len, VERIFY_HEADER);
rsa.sign(sig.get() + VERIFY_HEADER, hashes_.md5_, sizeof(Hashes),
ssl.getCrypto().get_random());
+ // check for rsa signautre fault
+ if (!rsa.verify(hashes_.md5_, sizeof(Hashes), sig.get() + VERIFY_HEADER,
+ rsa.get_cipherLength())) {
+ ssl.SetError(rsaSignFault_error);
+ return;
+ }
}
else { // DSA
DSS dss(cert.get_privateKey(), cert.get_privateKeyLength(), false);
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index 624148bdac8..d8b133a3f0a 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -84,7 +84,7 @@ void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
namespace { // locals
-// to the minute
+// to the second
bool operator>(tm& a, tm& b)
{
if (a.tm_year > b.tm_year)
@@ -105,13 +105,18 @@ bool operator>(tm& a, tm& b)
a.tm_min > b.tm_min)
return true;
+ if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon &&
+ a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour &&
+ a.tm_min == b.tm_min && a.tm_sec > b.tm_sec)
+ return true;
+
return false;
}
bool operator<(tm& a, tm&b)
{
- return !(a>b);
+ return (b>a);
}
diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp
index 79a8a8f1c4f..73f678e2674 100644
--- a/extra/yassl/taocrypt/src/rsa.cpp
+++ b/extra/yassl/taocrypt/src/rsa.cpp
@@ -140,6 +140,10 @@ word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
void RSA_BlockType1::Pad(const byte* input, word32 inputLen, byte* pkcsBlock,
word32 pkcsBlockLen, RandomNumberGenerator&) const
{
+ // sanity checks
+ if (input == NULL || pkcsBlock == NULL)
+ return;
+
// convert from bit length to byte length
if (pkcsBlockLen % 8 != 0)
{
diff --git a/extra/yassl/testsuite/cipher-test.sh b/extra/yassl/testsuite/cipher-test.sh
index 5ce29459d07..d3e69146097 100644
--- a/extra/yassl/testsuite/cipher-test.sh
+++ b/extra/yassl/testsuite/cipher-test.sh
@@ -4,6 +4,7 @@
#
+no_pid=-1
server_pid=$no_pid
diff --git a/include/decimal.h b/include/decimal.h
index 935d341437d..2adeb824318 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -16,6 +16,10 @@
#ifndef _decimal_h
#define _decimal_h
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
decimal_round_mode;
@@ -112,5 +116,9 @@ void max_decimal(int precision, int frac, decimal_t *to);
#define E_DEC_ERROR 31
#define E_DEC_FATAL_ERROR 30
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/include/maria.h b/include/maria.h
index 16a9beab62a..cdaeadef4de 100644
--- a/include/maria.h
+++ b/include/maria.h
@@ -43,7 +43,7 @@ extern "C" {
#define MARIA_NAME_IEXT ".MAI"
#define MARIA_NAME_DEXT ".MAD"
/* Max extra space to use when sorting keys */
-#define MARIA_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
+#define MARIA_MAX_TEMP_LENGTH (2*1024L*1024L*1024L)
/* Possible values for maria_block_size (must be power of 2) */
#define MARIA_KEY_BLOCK_LENGTH 8192 /* default key block length */
#define MARIA_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
diff --git a/include/my_alarm.h b/include/my_alarm.h
index c3707cba395..73bb6ab76cc 100644
--- a/include/my_alarm.h
+++ b/include/my_alarm.h
@@ -50,7 +50,7 @@ extern ulong my_time_to_wait_for_lock;
#define ALARM_INIT
#define ALARM_END
#define ALARM_TEST (alarm_pos++ >= alarm_end_pos)
-#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE
+#define ALARM_REINIT (alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE)
#endif /* HAVE_ALARM */
#ifdef __cplusplus
diff --git a/include/my_base.h b/include/my_base.h
index cdf8e189031..5c3dd8db9d9 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -536,13 +536,13 @@ typedef ulong key_part_map;
#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
/* Use this when inserting a key in position order */
-#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2
+#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2)
/* Only part of the key is specified while reading */
-#define SEARCH_PART_KEY SEARCH_INSERT*2
+#define SEARCH_PART_KEY (SEARCH_INSERT*2)
/* Used when user key (key 2) contains transaction id's */
-#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2
+#define SEARCH_USER_KEY_HAS_TRANSID (SEARCH_PART_KEY*2)
/* Used when page key (key 1) contains transaction id's */
-#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2
+#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2)
/* bits in opt_flag */
#define QUICK_USED 1
diff --git a/include/my_dbug.h b/include/my_dbug.h
index bcf2015466d..f4c854bc10c 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -58,7 +58,7 @@ extern void _db_end_(void);
extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void);
-extern void _db_flush_();
+extern void _db_flush_(void);
extern void dbug_swap_code_state(void **code_state_store);
extern void dbug_free_code_state(void **code_state_store);
extern const char* _db_get_func_(void);
@@ -123,7 +123,7 @@ extern const char* _db_get_func_(void);
#ifdef __WIN__
#define DBUG_SUICIDE() DBUG_ABORT()
#else
-extern void _db_suicide_();
+extern void _db_suicide_(void);
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif
diff --git a/include/my_global.h b/include/my_global.h
index b3deba3c565..9d77a923710 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -555,7 +555,7 @@ typedef int my_socket; /* File descriptor for sockets */
/* Type for fuctions that handles signals */
#define sig_handler RETSIGTYPE
C_MODE_START
-typedef void (*sig_return)();/* Returns type from signal */
+typedef void (*sig_return)(void); /* Returns type from signal */
C_MODE_END
#if defined(__GNUC__) && !defined(_lint)
typedef char pchar; /* Mixed prototypes can take char */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 7770c28f45f..bb4d0c88ebd 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -701,8 +701,8 @@ extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void);
extern int pthread_dummy(int);
-extern void my_mutex_init();
-extern void my_mutex_end();
+extern void my_mutex_init(void);
+extern void my_mutex_end(void);
/* All thread specific variables are in the following struct */
@@ -745,8 +745,8 @@ struct st_my_thread_var
};
extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
-extern void **my_thread_var_dbug();
-extern safe_mutex_t **my_thread_var_mutex_in_use();
+extern void **my_thread_var_dbug(void);
+extern safe_mutex_t **my_thread_var_mutex_in_use(void);
extern uint my_thread_end_wait_time;
extern my_bool safe_mutex_deadlock_detector;
#define my_thread_var (_my_thread_var())
diff --git a/include/my_sys.h b/include/my_sys.h
index 9913ee8c79b..036084a0ae0 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -168,6 +168,7 @@ extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
/* defines when allocating data */
extern void *my_malloc(size_t Size,myf MyFlags);
extern void *my_multi_malloc(myf MyFlags, ...);
+extern void *my_multi_malloc_large(myf MyFlags, ...);
extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags);
extern void my_free(void *ptr);
extern void *my_memdup(const void *from,size_t length,myf MyFlags);
@@ -641,7 +642,7 @@ extern void my_osmaperr(unsigned long last_error);
#endif
extern void init_glob_errs(void);
-extern const char** get_global_errmsgs();
+extern const char** get_global_errmsgs(void);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
@@ -666,7 +667,7 @@ extern void my_printf_error(uint my_err, const char *format,
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_printv_error(uint error, const char *format, myf MyFlags,
va_list ap);
-extern int my_error_register(const char** (*get_errmsgs) (),
+extern int my_error_register(const char** (*get_errmsgs) (void),
uint first, uint last);
extern const char **my_error_unregister(uint first, uint last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
@@ -884,12 +885,12 @@ extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);
extern my_bool my_gethwaddr(uchar *to);
-extern int my_getncpus();
+extern int my_getncpus(void);
#define HRTIME_RESOLUTION 1000000ULL /* microseconds */
typedef struct {ulonglong val;} my_hrtime_t;
-void my_time_init();
-extern my_hrtime_t my_hrtime();
+void my_time_init(void);
+extern my_hrtime_t my_hrtime(void);
extern ulonglong my_interval_timer(void);
extern ulonglong my_getcputime(void);
@@ -948,7 +949,7 @@ int my_msync(int, void *, size_t, int);
void my_uuid_init(ulong seed1, ulong seed2);
void my_uuid(uchar *guid);
void my_uuid2str(const uchar *guid, char *s);
-void my_uuid_end();
+void my_uuid_end(void);
/* character sets */
extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader);
diff --git a/include/mysql.h b/include/mysql.h
index d9d9739dd1f..f088ad668a1 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -79,8 +79,8 @@ extern unsigned int mariadb_deinitialize_ssl;
extern unsigned int mysql_port;
extern char *mysql_unix_port;
-#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
-#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
+#define CLIENT_NET_READ_TIMEOUT (365*24*3600) /* Timeout on read */
+#define CLIENT_NET_WRITE_TIMEOUT (365*24*3600) /* Timeout on write */
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
diff --git a/man/aria_chk.1 b/man/aria_chk.1
index 4dc5bf8c78f..9b2a19b31af 100644
--- a/man/aria_chk.1
+++ b/man/aria_chk.1
@@ -241,5 +241,4 @@ Read this file after the global files are read.
.SH "SEE ALSO"
\fBmyisamchk(1)\fR
.PP
-For more information, please refer to the MariaDB Knowledge Base,
-which is available online at http://mariadb.com/kb/
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/aria_dump_log.1 b/man/aria_dump_log.1
index 41318d97f7a..16463fc222d 100644
--- a/man/aria_dump_log.1
+++ b/man/aria_dump_log.1
@@ -50,5 +50,6 @@ Only read default options from the given file #.
Read this file after the global files are read.
.PP
.SH "SEE ALSO"
-For more information, please refer to the MariaDB Knowledge Base,
-which is available online at http://mariadb.com/kb/
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
+.SH AUTHOR
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/aria_ftdump.1 b/man/aria_ftdump.1
index 4d6c1373e31..7b5ba5f5211 100644
--- a/man/aria_ftdump.1
+++ b/man/aria_ftdump.1
@@ -25,5 +25,4 @@ Be verbose.
.SH "SEE ALSO"
\fBmyisam_ftdump(1)\fR
.PP
-For more information, please refer to the MariaDB Knowledge Base,
-which is available online at http://mariadb.com/kb/
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/aria_pack.1 b/man/aria_pack.1
index ee47f5ff3bb..2557507b999 100644
--- a/man/aria_pack.1
+++ b/man/aria_pack.1
@@ -72,5 +72,4 @@ Read this file after the global files are read.
.SH "SEE ALSO"
\fBmyisampack(1)\fR
.PP
-For more information, please refer to the MariaDB Knowledge Base,
-which is available online at http://mariadb.com/kb/
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/aria_read_log.1 b/man/aria_read_log.1
index 701104fe047..4570c2ceee9 100644
--- a/man/aria_read_log.1
+++ b/man/aria_read_log.1
@@ -104,5 +104,4 @@ Read this file after the global files are read.
.SH "SEE ALSO"
\fBmyisamlog(1)\fR
.PP
-For more information, please refer to the MariaDB Knowledge Base,
-which is available online at http://mariadb.com/kb/
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/comp_err.1 b/man/comp_err.1
index 817243b84f6..942556bfdda 100644
--- a/man/comp_err.1
+++ b/man/comp_err.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBcomp_err\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBCOMP_ERR\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBCOMP_ERR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -20,7 +13,7 @@
.\" -----------------------------------------------------------------
.\" comp_err
.SH "NAME"
-comp_err \- compile MySQL error message file
+comp_err \- compile MariaDB error message file
.SH "SYNOPSIS"
.HP \w'\fBcomp_err\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBcomp_err [\fR\fB\fIoptions\fR\fR\fB]\fR
@@ -33,11 +26,11 @@ file that is used by
\fBmysqld\fR
to determine the error messages to display for different error codes\&.
\fBcomp_err\fR
-normally is run automatically when MySQL is built\&. It compiles the
+normally is run automatically when MariaDB is built\&. It compiles the
errmsg\&.sys
file from the plaintext file located at
sql/share/errmsg\&.txt
-in MySQL source distributions\&.
+in MariaDB source distributions\&.
.PP
\fBcomp_err\fR
also generates
@@ -254,7 +247,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -263,8 +256,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/innochecksum.1 b/man/innochecksum.1
index 6ad9b6b6d78..4e48b4d69cc 100644
--- a/man/innochecksum.1
+++ b/man/innochecksum.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBinnochecksum\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBINNOCHECKSUM\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -69,7 +62,7 @@ supports the following options\&. For options that refer to page numbers, the nu
.sp -1
.IP \(bu 2.3
.\}
-\fB\-c\fR
+\fB\-c, --count\fR
.sp
Print a count of the number of pages in the file\&.
.RE
@@ -82,7 +75,7 @@ Print a count of the number of pages in the file\&.
.sp -1
.IP \(bu 2.3
.\}
-\fB\-d\fR
+\fB\-d, --debug\fR
.sp
Debug mode; prints checksums for each page\&.
.RE
@@ -95,7 +88,7 @@ Debug mode; prints checksums for each page\&.
.sp -1
.IP \(bu 2.3
.\}
-\fB\-e \fR\fB\fInum\fR\fR
+\fB\-e \fR\fB\fInum\fB, --end-page=#\fR\fR
.sp
End at this page number\&.
.RE
@@ -108,7 +101,7 @@ End at this page number\&.
.sp -1
.IP \(bu 2.3
.\}
-\fB\-p \fR\fB\fInum\fR\fR
+\fB\-p \fR\fB\fInum\fB, --page-num=#\fR\fR
.sp
Check only this page number\&.
.RE
@@ -121,7 +114,7 @@ Check only this page number\&.
.sp -1
.IP \(bu 2.3
.\}
-\fB\-s \fR\fB\fInum\fR\fR
+\fB\-s \fR\fB\fInum\fB, --start-page\fR\fR
.sp
Start at this page number\&.
.RE
@@ -134,14 +127,27 @@ Start at this page number\&.
.sp -1
.IP \(bu 2.3
.\}
-\fB\-v\fR
+\fB\-u, --skip-corrupt\fR\fR
+.sp
+Skip corrupt pages\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-v, --verbose\fR
.sp
Verbose mode; print a progress indicator every five seconds\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -150,8 +156,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/make_win_bin_dist.1 b/man/make_win_bin_dist.1
index 131e4a5f1c1..5d9070e7bd4 100644
--- a/man/make_win_bin_dist.1
+++ b/man/make_win_bin_dist.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmake_win_bin_dist\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMAKE_WIN_BIN_DIST" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMAKE_WIN_BIN_DIST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -169,7 +162,7 @@ directories)\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -178,8 +171,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/msql2mysql.1 b/man/msql2mysql.1
index 61512e312d9..96e4cd3ae5b 100644
--- a/man/msql2mysql.1
+++ b/man/msql2mysql.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmsql2mysql\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMSQL2MYSQL\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -60,7 +53,7 @@ utility to make the function name substitutions\&. See
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -69,8 +62,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/my_print_defaults.1 b/man/my_print_defaults.1
index b44f250f663..2406fa9cb47 100644
--- a/man/my_print_defaults.1
+++ b/man/my_print_defaults.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmy_print_defaults\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMY_PRINT_DEFAULTS" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -87,7 +80,9 @@ Display a help message and exit\&.
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-c \fR\fB\fIfile_name\fR\fR
.sp
-Read only the given option file\&.
+Read only the given option file\&. If no extension is given, default extension(.ini or .cnf) will
+be used\&. \fB\-\-config-file\fR is deprecated, use \fB\-\-defaults\-file\fR instead\&. If \fB\-\-defaults\-file\fR is
+the first option, then read this file only, do not read global or per\-user config files; should be the first option.
.RE
.sp
.RS 4
@@ -126,7 +121,8 @@ string is
\fB\-\-extra\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-e \fR\fB\fIfile_name\fR\fR
.sp
-Read this option file after the global option file but (on Unix) before the user option file\&.
+Read this option file after the global option file but (on Unix) before the user option
+file\&. Should be the first option\&. \fB\-\-extra\-file\fR is deprecated, use \fB\-\-defaults\-extra\-file\fR\&.
.RE
.sp
.RS 4
@@ -153,12 +149,27 @@ In addition to the groups named on the command line, read groups that have the g
.sp -1
.IP \(bu 2.3
.\}
+.\" my_print_defaults: --mysqld option
+.\" mysqld option: my_print_defaults
+\fB\-\-mysqld\fR
+.sp
+Read the same set of groups that the mysqld binary does.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" my_print_defaults: no-defaults option
.\" no-defaults option: my_print_defaults
\fB\-\-no\-defaults\fR,
\fB\-n\fR
.sp
-Return an empty string\&.
+Return an empty string (useful for scripts)\&.
.RE
.sp
.RS 4
@@ -195,7 +206,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -204,8 +215,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1
index f85467aabe0..b2928a17183 100644
--- a/man/myisam_ftdump.1
+++ b/man/myisam_ftdump.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmyisam_ftdump\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -242,7 +235,7 @@ Verbose mode\&. Print more output about what the program does\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -251,8 +244,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/myisamchk.1 b/man/myisamchk.1
index 98ce3805515..df5cb4db604 100644
--- a/man/myisamchk.1
+++ b/man/myisamchk.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmyisamchk\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYISAMCHK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYISAMCHK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -125,7 +118,7 @@ shell> \fBmyisamchk \fR\fB\fI/path/to/database_dir/\fR\fR\fB*\&.MYI\fR
.RE
.\}
.PP
-You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory:
+You can even check all tables in all databases by specifying a wildcard with the path to the MariaDB data directory:
.sp
.if n \{\
.RS 4
@@ -184,7 +177,7 @@ the section called \(lqMYISAMCHK MEMORY USAGE\(rq\&.
.ps -1
.br
.PP
-\fIYou must ensure that no other program is using the tables while you are running \fR\fI\fBmyisamchk\fR\fR\&. The most effective means of doing so is to shut down the MySQL server while running
+\fIYou must ensure that no other program is using the tables while you are running \fR\fI\fBmyisamchk\fR\fR\&. The most effective means of doing so is to shut down the MariaDB server while running
\fBmyisamchk\fR, or to lock all tables that
\fBmyisamchk\fR
is being used on\&.
@@ -218,8 +211,7 @@ However, the easiest way to avoid this problem is to use
CHECK TABLE
instead of
\fBmyisamchk\fR
-to check tables\&. See
-Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq\&.
+to check tables\&.
.sp .5v
.RE
.PP
@@ -227,9 +219,6 @@ Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq\&.
supports the following options, which can be specified on the command line or in the
[myisamchk]
option file group\&.
-\fBmyisamchk\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.SH "MYISAMCHK GENERAL OPTIONS"
.\" options: myisamchk
.\" myisamchk: options
@@ -366,6 +355,66 @@ with external locking disabled, the table can be locked only by another
\fBmyisamchk\fR
command\&.
.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" myisamchk: print argument list option
+.\" print argument list option: myisamchk
+\fB\-\-print\-defaults\fR
+.sp
+Print the program argument list and exit\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" myisamchk: no defaults option
+.\" no defaults option: myisamchk
+\fB\-\-no\-defaults\fR
+.sp
+Don't read default options from any option file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" myisamchk: defaults file option
+.\" defaults file option: myisamchk
+\fB\-\-defaults\-file=#\fR
+.sp
+Only read default options from the given file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" myisamchk: defaults extrafile option
+.\" defaults extra file option: myisamchk
+\fB\-\-defaults\-extra\-file=#\fR
+.sp
+Read this file after the global files are read\&.
+.RE
.PP
You can also set the following variables by using
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
@@ -375,6 +424,7 @@ syntax:
.\" ft_min_word_len myisamchk variable
.\" ft_stopword_file myisamchk variable
.\" key_buffer_size myisamchk variable
+.\" key_cache_block_size myisamchk variable
.\" myisam_block_size myisamchk variable
.\" read_buffer_size myisamchk variable
.\" sort_buffer_size myisamchk variable
@@ -426,6 +476,11 @@ T}:T{
523264
T}
T{
+key_cache_block_size
+T}:T{
+1024
+T}
+T{
myisam_block_size
T}:T{
1024
@@ -696,7 +751,8 @@ finds any errors in the table\&. The repair type is the same as that specified w
\fB\-\-recover\fR
or
\fB\-r\fR
-option\&.
+option\&. States will be updated as with
+\fB\-\-update\-state\fR\&.
.RE
.sp
.RS 4
@@ -816,8 +872,7 @@ file as
.\" character-sets-dir option: myisamchk
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -843,6 +898,24 @@ Correct the checksum information for the table\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" myisamchk: create-missing-keys option
+.\" create-missing-keys option: myisamchk
+\fB\-\-create\-missing\-keys\fR
+.sp
+Create missing keys. This assumes that the data file is correct and that the
+number of rows stored in the index file is correct\&. Enables
+\fB\-\-quick\fR\&.
+
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" myisamchk: data-file-length option
.\" data-file-length option: myisamchk
\fB\-\-data\-file\-length=\fR\fB\fIlen\fR\fR,
@@ -885,7 +958,12 @@ the section called \(lqMYISAMCHK TABLE INFORMATION\(rq\&.
\fB\-f\fR
.sp
Overwrite old intermediate files (files with names like
-\fItbl_name\fR\&.TMD) instead of aborting\&.
+\fItbl_name\fR\&.TMD) instead of aborting\&. Add another
+\fB\-\-force\fR
+to avoid 'myisam_sort_buffer_size is too small' errors\&. In this case
+we will attempt to do the repair with the given
+\fBmyisam_sort_buffer_size\fR
+and dynamically allocate as many management buffers as needed\&.
.RE
.sp
.RS 4
@@ -914,24 +992,6 @@ For
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: no-symlinks option
-.\" no-symlinks option: myisamchk
-\fB\-\-no\-symlinks\fR,
-\fB\-l\fR
-.sp
-Do not follow symbolic links\&. Normally
-\fBmyisamchk\fR
-repairs the table that a symlink points to\&. This option does not exist as of MySQL 4\&.0 because versions from 4\&.0 on do not remove symlinks during repair operations\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
.\" myisamchk: max-record-length option
.\" max-record-length option: myisamchk
\fB\-\-max\-record\-length=\fR\fB\fIlen\fR\fR
@@ -976,7 +1036,7 @@ and
.sp
Achieve a faster repair by modifying only the index file, not the data file\&. You can specify this option twice to force
\fBmyisamchk\fR
-to modify the original data file in case of duplicate keys\&.
+to modify the original data file in case of duplicate keys\&. NOTE: Tables where the data file is corrupted can't be fixed with this option\&.
.RE
.sp
.RS 4
@@ -1043,19 +1103,6 @@ key_buffer_size\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: set-character-set option
-.\" set-character-set option: myisamchk
-\fB\-\-set\-character\-set=\fR\fB\fIname\fR\fR
-.sp
-Change the character set used by the table indexes\&. This option was replaced by
-\fB\-\-set\-collation\fR
-in MySQL 5\&.0\&.3\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
.el \{\
.sp -1
.IP \(bu 2.3
@@ -1251,6 +1298,22 @@ sorts and moves records, it just overwrites record offsets in the index\&. If ke
\fBmyisamchk\fR
must unpack key blocks first, then re\-create indexes and pack the key blocks again\&. (In this case, re\-creating indexes is faster than updating offsets for each index\&.)
.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" myisamchk: stats_method option
+.\" stats_method option: myisamchk
+\fB\-\-stats\-method=name\fR
+.sp
+Specifies how index statistics collection code should treat NULLs\&. Possible values
+of name are "nulls_unequal" (default), "nulls_equal" (emulate MySQL 4 behavior), and "nulls_ignored"\&.
+.RE
.SH "MYISAMCHK TABLE INFORMATION"
.\" table description: myisamchk
.\" tables: information
@@ -1275,7 +1338,7 @@ Runs
\fBmyisamchk\fR
in
\(lqdescribe mode\(rq
-to produce a description of your table\&. If you start the MySQL server with external locking disabled,
+to produce a description of your table\&. If you start the MariaDB server with external locking disabled,
\fBmyisamchk\fR
may report an error for a table that is updated while it runs\&. However, because
\fBmyisamchk\fR
@@ -1623,7 +1686,7 @@ Section\ \&6.6.4, \(lqMyISAM Table Optimization\(rq\&.
.\}
Datafile pointer
.sp
-The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes\&. Most tables manage with 2 bytes, but this cannot be controlled from MySQL yet\&. For fixed tables, this is a row address\&. For dynamic tables, this is a byte address\&.
+The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes\&. Most tables manage with 2 bytes, but this cannot be controlled from MariaDB yet\&. For fixed tables, this is a row address\&. For dynamic tables, this is a byte address\&.
.RE
.sp
.RS 4
@@ -1636,7 +1699,7 @@ The size of the data file pointer, in bytes\&. It is usually 2, 3, 4, or 5 bytes
.\}
Keyfile pointer
.sp
-The size of the index file pointer, in bytes\&. It is usually 1, 2, or 3 bytes\&. Most tables manage with 2 bytes, but this is calculated automatically by MySQL\&. It is always a block address\&.
+The size of the index file pointer, in bytes\&. It is usually 1, 2, or 3 bytes\&. Most tables manage with 2 bytes, but this is calculated automatically by MariaDB\&. It is always a block address\&.
.RE
.sp
.RS 4
@@ -1785,7 +1848,7 @@ Address of the root index block\&.
.\}
Blocksize
.sp
-The size of each index block\&. By default this is 1024, but the value may be changed at compile time when MySQL is built from source\&.
+The size of each index block\&. By default this is 1024, but the value may be changed at compile time when MariaDB is built from source\&.
.RE
.sp
.RS 4
@@ -2137,7 +2200,7 @@ What percentage of the keyblocks are used\&. When a table has just been reorgani
.\}
Packed
.sp
-MySQL tries to pack key values that have a common suffix\&. This can only be used for indexes on
+MariaDB tries to pack key values that have a common suffix\&. This can only be used for indexes on
CHAR
and
VARCHAR
@@ -2193,7 +2256,7 @@ The average row length\&. This is the exact row length for tables with fixed\-le
.\}
Packed
.sp
-MySQL strips spaces from the end of strings\&. The
+MariaDB strips spaces from the end of strings\&. The
Packed
value indicates the percentage of savings achieved by doing this\&.
.RE
@@ -2444,7 +2507,7 @@ instead of
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -2453,8 +2516,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/myisamlog.1 b/man/myisamlog.1
index 1ea424cd949..57728d14e2e 100644
--- a/man/myisamlog.1
+++ b/man/myisamlog.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmyisamlog\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYISAMLOG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYISAMLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -225,7 +218,7 @@ Display version information\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -234,8 +227,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/myisampack.1 b/man/myisampack.1
index 0f5efd0fb8d..37eca1f4a04 100644
--- a/man/myisampack.1
+++ b/man/myisampack.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmyisampack\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYISAMPACK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYISAMPACK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -72,7 +65,7 @@ if the table might be updated by the server during the packing process\&. It is
.sp -1
.IP \(bu 2.3
.\}
-After packing a table, it becomes read only\&. This is generally intended (such as when accessing packed tables on a CD)\&. Allowing writes to a packed table is on our TODO list, but with low priority\&.
+After packing a table, it becomes read only\&. This is generally intended (such as when accessing packed tables on a CD)\&.
.RE
.PP
Invoke
@@ -832,7 +825,7 @@ option to
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -841,8 +834,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql-stress-test.pl.1 b/man/mysql-stress-test.pl.1
index 78ba75847ad..19fe4a1aac6 100644
--- a/man/mysql-stress-test.pl.1
+++ b/man/mysql-stress-test.pl.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql-stress-test.pl\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "03/31/2010" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -28,7 +21,7 @@ mysql-stress-test.pl \- server stress test program
.PP
The
\fBmysql\-stress\-test\&.pl\fR
-Perl script performs stress\-testing of the MySQL server\&. (MySQL 5\&.0 and up only)
+Perl script performs stress\-testing of the MariaDB server\&.
.PP
\fBmysql\-stress\-test\&.pl\fR
requires a version of Perl that has been built with threads support\&.
@@ -250,7 +243,7 @@ The TCP/IP port number to use for connecting to the server\&. The default is 330
\fB\-\-server\-socket=\fR\fB\fIfile_name\fR\fR
.sp
For connections to
-localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. The default if
+localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. The default is
/tmp/mysql\&.sock\&.
.RE
.sp
@@ -266,7 +259,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.\" server-user option: mysql-stress-test.pl
\fB\-\-server\-user=\fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&. The default is
+The MariaDB user name to use when connecting to the server\&. The default is
root\&.
.RE
.sp
@@ -489,7 +482,7 @@ Verbose mode\&. Print more information about what the program does\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 2007, 2010, Oracle and/or its affiliates
+Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -498,8 +491,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1
index 20abc250b15..495c0c50338 100644
--- a/man/mysql-test-run.pl.1
+++ b/man/mysql-test-run.pl.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql-test-run.pl\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "03/31/2010" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -20,7 +13,7 @@
.\" -----------------------------------------------------------------
.\" mysql-test-run.pl
.SH "NAME"
-mysql-test-run.pl \- run MySQL test suite
+mysql-test-run.pl \- run MariaDB test suite
.SH "SYNOPSIS"
.HP \w'\fBmysql\-test\-run\&.pl\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBmysql\-test\-run\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR
@@ -28,7 +21,7 @@ mysql-test-run.pl \- run MySQL test suite
.PP
The
\fBmysql\-test\-run\&.pl\fR
-Perl script is the main application used to run the MySQL test suite\&. It invokes
+Perl script is the main application used to run the MariaDB test suite\&. It invokes
\fBmysqltest\fR
to run individual test cases\&.
.PP
@@ -381,9 +374,54 @@ Display a help message and exit\&.
Allow tests marked as "big" to run\&. Tests can be thus marked by including the line
\fB\-\-source include/big_test\&.inc\fR, and they will only be run if this option is given, or if the environment variable
BIG_TEST
-is set to 1\&.
+is set to 1\&. Repeat this option twice to run only "big" tests\&.
.sp
-This is typically done for tests that take very long to run, or that use very much resources, so that they are not suitable for running as part of a normal test suite run\&.
+This is typically used for tests that take a very long to run, or that use many resources, so that they are not suitable for running as part of a normal test suite run\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: boot-dbx option
+.\" boot-dbx option: mysql-test-run.pl
+\fB\-\-boot\-dbx\fR
+.sp
+Run the mysqld server used for bootstrapping the database through the dbx debugger\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: boot-ddd option
+.\" boot-ddd option: mysql-test-run.pl
+\fB\-\-boot\-ddd\fR
+.sp
+Run the mysqld server used for bootstrapping the database through the ddd debugger\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: boot-gdb option
+.\" boot-gdb option: mysql-test-run.pl
+\fB\-\-boot\-gdb\fR
+.sp
+Run the mysqld server used for bootstrapping the database through the gdb debugger\&.
.RE
.sp
.RS 4
@@ -396,7 +434,7 @@ This is typically done for tests that take very long to run, or that use very mu
.\}
.\" mysql-test-run.pl: build-thread option
.\" build-thread option: mysql-test-run.pl
-\fB\-\-build\-thread=\fR\fB\fInumber\fR\fR
+\fB\-\-[mtr\-]build\-thread=\fR\fB\fInumber\fR\fR
.sp
Specify a number to calculate port numbers from\&. The formula is 10 *
\fIbuild_thread\fR
@@ -410,7 +448,7 @@ auto) can also be set with the
MTR_BUILD_THREAD
environment variable\&.
.sp
-From MySQL 5\&.1\&.45, the more logical
+The more logical
\fB\-\-port\-base\fR
is supported as an alternative\&.
.RE
@@ -471,6 +509,25 @@ The path to the directory where client binaries are located\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: client-dbx option
+.\" client-dbx option: mysql-test-run.pl
+\fB\-\-client\-dbx\fR
+.sp
+Start
+\fBmysqltest\fR
+in the
+\fBdbx\fR
+debugger\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: client-ddd option
.\" client-ddd option: mysql-test-run.pl
\fB\-\-client\-ddd\fR
@@ -560,8 +617,7 @@ is given only once, it has no effect\&. For test runs specific to a given test s
\fB\-\-combination\fR
is to create a
combinations
-file in the suite directory\&. The file should contain a section of options for each test run\&. See
-Section\ \&4.9, \(lqPassing Options from mysql-test-run.pl to mysqld or mysqltest\(rq\&.
+file in the suite directory\&. The file should contain a section of options for each test run\&.
.RE
.sp
.RS 4
@@ -609,10 +665,7 @@ Compress all information sent between the client and the server if both support
.\" cursor-protocol option: mysql-test-run.pl
\fB\-\-cursor\-protocol\fR
.sp
-Pass the
-\fB\-\-cursor\-protocol\fR
-option to
-\fBmysqltest\fR
+Use the cursor protocol between client and server
(implies
\fB\-\-ps\-protocol\fR)\&.
.RE
@@ -625,12 +678,31 @@ option to
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: dbx option
+.\" dbx option: mysql-test-run.pl
+\fB\-\-dbx\fR
+.sp
+Start the
+\fBmysqld(s)\fR
+in the
+\fBdbx\fR
+debugger\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: ddd option
.\" ddd option: mysql-test-run.pl
\fB\-\-ddd\fR
.sp
-Start
-\fBmysqld\fR
+Start the
+\fBmysqld(s)\fR
in the
\fBddd\fR
debugger\&.
@@ -659,6 +731,36 @@ Dump trace output for all clients and servers\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: debug-common option
+.\" debug-common option: mysql-test-run.pl
+\fB\-\-debug\-common\fR
+.sp
+Same as \fB--debug\fR, but sets the 'd' debug flags to "query,info,error,enter,exit"\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: debug-server option
+.\" debug-server option: mysql-test-run.pl
+\fB\-\-debug\-server\fR
+.sp
+Use debug version of server, but without turning on tracing\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: debugger option
.\" debugger option: mysql-test-run.pl
\fB\-\-debugger=\fR\fB\fIdebugger\fR\fR
@@ -691,11 +793,6 @@ to
prefix is used so that
\fBmysqld\fR
does not fail if Debug Sync is not compiled in\&.
-.sp
-For information about using the Debug Sync facility for testing, see
-Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&.
-.sp
-This option was added in MySQL 5\&.1\&.41/5\&.5\&.0/6\&.0\&.6\&.
.RE
.sp
.RS 4
@@ -707,7 +804,7 @@ This option was added in MySQL 5\&.1\&.41/5\&.5\&.0/6\&.0\&.6\&.
.IP \(bu 2.3
.\}
.\" mysql-test-run.pl: defaults-file option
-.\" default-file option: mysql-test-run.pl
+.\" defaults-file option: mysql-test-run.pl
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use the named file as fixed config file template for all tests\&.
@@ -738,11 +835,12 @@ Add setting from the named file to all generated configs\&.
.\}
.\" mysql-test-run.pl: do-test option
.\" do-test option: mysql-test-run.pl
-\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR
+\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR|\fB\fIregex\fR\fR
.sp
Run all test cases having a name that begins with the given
\fIprefix\fR
-value\&. This option provides a convenient way to run a family of similarly named tests\&.
+value, or fulfils the
+\fIregex\fR\&. This option provides a convenient way to run a family of similarly named tests\&.
.sp
The argument for the
\fB\-\-do\-test\fR
@@ -772,6 +870,21 @@ xmainytestz\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: dry-run option
+.\" dry-run option: mysql-test-run.pl
+\fB\-\-dry\-run\fR
+.sp
+Don't run any tests, print the list of tests that were selected for execution\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: embedded-server option
.\" embedded-server option: mysql-test-run.pl
\fB\-\-embedded\-server\fR
@@ -795,7 +908,7 @@ built with the embedded server\&.
.sp
Ignore any
disabled\&.def
-file, and run also tests marked as disbaled\&. Success or failure of those tests will be reported the same way as other tests\&.
+file, and also run tests marked as disabled\&. Success or failure of those tests will be reported the same way as other tests\&.
.RE
.sp
.RS 4
@@ -814,7 +927,7 @@ Specify a file that contains a list of test cases that should be displayed with
[ exp\-fail ]
code rather than
[ fail ]
-if they fail\&. This option was added in MySQL 5\&.1\&.33\&.
+if they fail\&.
.sp
For an example of a file that might be specified via this option, see
mysql\-test/collections/default\&.experimental\&.
@@ -836,10 +949,10 @@ mysql\-test/collections/default\&.experimental\&.
Use an already running server\&. The option/value pair is what is needed by the
\fBmysql\fR
client to connect to the server\&. Each
+\fB\-\-extern\fR option
+can only take one option/value pair as an argument, so you need to repeat
\fB\-\-extern\fR
-can only take one option/value pair as argument, so it you need more you need to repeat
-\fB\-\-extern\fR
-for each of them\&. Example:
+for each pair needed\&. Example:
.sp
.if n \{\
.RS 4
@@ -880,6 +993,21 @@ Do not perform controlled shutdown when servers need to be restarted or at the e
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: force-restart option
+.\" force-restart option: mysql-test-run.pl
+\fB\-\-force\-restart\fR
+.sp
+Always restart servers between tests\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: force option
.\" force option: mysql-test-run.pl
\fB\-\-force\fR
@@ -903,9 +1031,25 @@ causes execution to continue regardless of test case failure\&.
.\" gcov option: mysql-test-run.pl
\fB\-\-gcov\fR
.sp
-Run tests with the
+Collect coverage information after the test\&. The result is a
\fBgcov\fR
-test coverage tool\&.
+file per source and header file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: gcov-src-dir option
+.\" gcov-src-dir option: mysql-test-run.pl
+\fB\-\-gcov\-src\-dir\fR
+.sp
+Colllect coverage only within the given subdirectory\&. For example, if you're only developing the SQL layer,
+it makes sense to use \fB--gcov-src-dir=sql\fR\&.
.RE
.sp
.RS 4
@@ -920,8 +1064,8 @@ test coverage tool\&.
.\" gdb option: mysql-test-run.pl
\fB\-\-gdb\fR
.sp
-Start
-\fBmysqld\fR
+Start the
+\fBmysqld(s)\fR
in the
\fBgdb\fR
debugger\&.
@@ -939,11 +1083,26 @@ debugger\&.
.\" gprof option: mysql-test-run.pl
\fB\-\-gprof\fR
.sp
-Run tests with the
+Collect profiling information using the
\fBgprof\fR
profiling tool\&.
-\fB\-\-gprof\fR
-was added in 5\&.1\&.45\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: manual-dbx option
+.\" manual-dbx option: mysql-test-run.pl
+\fB\-\-manual\-dbx\fR
+.sp
+Use a server that has already been started by the user in the
+\fBdbx\fR
+debugger\&.
.RE
.sp
.RS 4
@@ -1003,6 +1162,23 @@ debugger\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: manual-lldb option
+.\" manual-lldb option: mysql-test-run.pl
+\fB\-\-manual\-lldb\fR
+.sp
+Use a server that has already been started by the user in the
+\fBlldb\fR
+debugger\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: mark-progress option
.\" mark-progress option: mysql-test-run.pl
\fB\-\-mark\-progress\fR
@@ -1025,8 +1201,6 @@ var/log/\fItestname\fR\&.progress\&.
.sp
The maximum number of simultaneous server connections that may be used per test\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. Corresponds to the same option for
\fBmysqltest\fR\&.
-.sp
-This option is available from MySQL 5\&.1\&.45\&.
.RE
.sp
.RS 4
@@ -1073,7 +1247,7 @@ MTR_MAX_SAVE_DATADIR
.\" max-test-fail option: mysql-test-run.pl
\fB\-\-max\-test\-fail=\fR\fB\fIN\fR\fR
.sp
-Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are noe counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable
+Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are not counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable
MTR_MAX_TEST_FAIL
.RE
.sp
@@ -1129,8 +1303,22 @@ option next time\&.
Extra options to pass to
\fBmysqld\fR\&. The value should consist of one or more comma\-separated
\fBmysqld\fR
-options\&. See
-Section\ \&4.9, \(lqPassing Options from mysql-test-run.pl to mysqld or mysqltest\(rq\&.
+options\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: mysqld-env option
+.\" mysqld-env option: mysql-test-run.pl
+\fB\-\-mysqld\-env=\fR\fB\fIVAR=VAL\fR\fR
+.sp
+Specify additional environment settings for "mysqld"\&. Use additional \fB--mysqld-env\fR options to set more than one variable\&.
.RE
.sp
.RS 4
@@ -1233,7 +1421,7 @@ Run tests using
parallel threads\&. By default, 1 thread is used\&. Use
\fB\-\-parallel=auto\fR
for auto\-setting of
-\fIN\fR\&. The auto value was added in MySQL 5\&.1\&.36\&.
+\fIN\fR\&.
.RE
.sp
.RS 4
@@ -1246,7 +1434,7 @@ for auto\-setting of
.\}
.\" mysql-test-run.pl: port-base option
.\" port-base option: mysql-test-run.pl
-\fB\-\-port\-base=\fR\fB\fIP\fR\fR
+\fB\-\-[mtr\-]port\-base=\fR\fB\fIP\fR\fR
.sp
Specify base of port numbers to be used; a block of 10 will be allocated\&.
\fIP\fR
@@ -1254,14 +1442,12 @@ should be divisible by 10; if it is not, it will be rounded down\&. If running w
.sp
If the port number is given as
auto, which is also the default,
-\fBmysql\-test\-run\&.pl\fRwill allocate a number unique to this host\&. The value may also be given with the environment variable
+\fBmysql\-test\-run\&.pl\fR will allocate a number unique to this host\&. The value may also be given with the environment variable
MTR_PORT_BASE\&.
.sp
+If both \fB\-\-build\-thread\fR and \fB\-\-port\-base\fR are used,
\fB\-\-port\-base\fR
-was added in MySQL 5\&.1\&.45 as a more logical alternative to
-\fB\-\-build\-thread\fR\&. If both are used,
-\fB\-\-port\-base\fR
-takes presedence\&.
+takes precedence\&.
.RE
.sp
.RS 4
@@ -1291,10 +1477,7 @@ Do not run any tests, but print details about all tests, in the order they would
.\" ps-protocol option: mysql-test-run.pl
\fB\-\-ps\-protocol\fR
.sp
-Pass the
-\fB\-\-ps\-protocol\fR
-option to
-\fBmysqltest\fR\&.
+Use the binary protocol between client and server\&.
.RE
.sp
.RS 4
@@ -1359,10 +1542,23 @@ number of times\&.
.\" report-features option: mysql-test-run.pl
\fB\-\-report\-features\fR
.sp
-Display the output of
-SHOW ENGINES
-and
-SHOW VARIABLES\&. This can be used to verify that binaries are built with all required features\&.
+First run a "test" that reports MariaDB features, displaying the output of SHOW ENGINES and SHOW VARIABLES\&. This can be
+used to verify that binaries are built with all required features\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: report-times option
+.\" report-times option: mysql-test-run.pl
+\fB\-\-report\-times\fR
+.sp
+Report how much time has been spent on different phases of test execution\&.
.RE
.sp
.RS 4
@@ -1379,7 +1575,8 @@ SHOW VARIABLES\&. This can be used to verify that binaries are built with all re
.sp
If a test fails, it is retried up to a maximum of
\fIN\fR
-runs, but will terminate after 2 failures\&. Default is 3, set to 1 or 0 for no retries\&. This option has no effect unless
+runs (default 1)\&. Retries are also limited by the maximum number of failures before stopping,
+set with the \fB-\-retry\-failure\fR option\&. This option has no effect unless
\fB\-\-force\fR
is also used; without it, test execution will terminate after the first failure\&.
.sp
@@ -1404,7 +1601,8 @@ may fail in total, as each repetition is considered a new test case, which may i
.\" retry-failure option: mysql-test-run.pl
\fB\-\-retry\-failure=\fR\fB\fIN\fR\fR
.sp
-Allow a failed and retried test to fail more than the default 2 times before giving it up\&. Setting it to 0 or 1 effectively turns off retries
+When using the \fB-\-retry\fR option to retry failed tests,
+stop when N failures have occured (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&.
.RE
.sp
.RS 4
@@ -1515,7 +1713,7 @@ with support for SSL connections\&.
.\}
.\" mysql-test-run.pl: skip-test option
.\" skip-test option: mysql-test-run.pl
-\fB\-\-skip\-test=\fR\fB\fIregex\fR\fR
+\fB\-\-skip\-test=\fR\fB\fIregex\fR\fR|\fR\fB\fIregex\fR\fR
.sp
Specify a regular expression to be applied to test case names\&. Cases with names that match the expression are skipped\&. tests to skip\&.
.sp
@@ -1534,6 +1732,21 @@ option for details\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: skip-test-list option
+.\" skip-test-list option: mysql-test-run.pl
+\fB\-\-skip\-test\-list=\fB\fIFILE\fR
+.sp
+Skip the tests listed in FILE\&. Each line in the file is an entry and should be formatted as: <TESTNAME> : <COMMENT>
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
\fB\-\-skip\-*\fR
.sp
\fB\-\-skip\-*\fR
@@ -1572,10 +1785,7 @@ to
.\" sp-protocol option: mysql-test-run.pl
\fB\-\-sp\-protocol\fR
.sp
-Pass the
-\fB\-\-sp\-protocol\fR
-option to
-\fBmysqltest\fR\&.
+Create a stored procedure to execute all queries\&.
.RE
.sp
.RS 4
@@ -1594,7 +1804,7 @@ If
\fBmysql\-test\-run\&.pl\fR
is started with the
\fB\-\-ssl\fR
-option, it sets up a secure conection for all test cases\&. In this case, if
+option, it sets up a secure connection for all test cases\&. In this case, if
\fBmysqld\fR
does not support SSL,
\fBmysql\-test\-run\&.pl\fR
@@ -1610,6 +1820,21 @@ Couldn\'t find support for SSL
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: staging-run option
+.\" staging-run option: mysql-test-run.pl
+\fB\-\-staging\-run\fR
+.sp
+Run a limited number of tests (no slow tests)\&. Used for running staging trees with valgrind\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: start-and-exit option
.\" start-and-exit option: mysql-test-run.pl
\fB\-\-start\fR
@@ -1646,6 +1871,22 @@ will stop once the server has been started, but will terminate if the server die
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: start-and-exit option
+.\" start-and-exit option: mysql-test-run.pl
+\fB\-\-start\-and\-exit\fR
+.sp
+Same
+\fB\-\-start\fR, but mysql-test-run terminates and leaves just the server running\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: start-dirty option
.\" start-dirty option: mysql-test-run.pl
\fB\-\-start\-dirty\fR
@@ -1679,6 +1920,21 @@ sorts the list of names of the test cases to be run, and then begins with
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql-test-run.pl: strace option
+.\" strace option: mysql-test-run.pl
+\fB\-\-strace\fR
+.sp
+Run the "mysqld" executables using strace. Default options are \fB-f -o var/log/'mysqld-name'.strace\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql-test-run.pl: strace-client option
.\" strace-client option: mysql-test-run.pl
\fB\-\-strace\-client\fR
@@ -1686,7 +1942,42 @@ sorts the list of names of the test cases to be run, and then begins with
Create
\fBstrace\fR
output for
-\fBmysqltest\fR\&.
+\fBmysqltest\fR, optionally specifying name and path
+to the trace program to use\&.
+.sp
+Example: \&./mysql\-test\-run\&.pl \-\-strace\-client=ktrace
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: strace-option option
+.\" strace-option option: mysql-test-run.pl
+\fB\-\-strace\-option\fR=\fR\fB\fIARGS\fR\fR
+.sp
+Option to give
+\fBstrace\fR,
+replaces default option(s)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: stress option
+.\" stress option: mysql-test-run.pl
+\fB\-\-stress=\fR\fB\fIARGS\fR\fR
+.sp
+Run stress test, providing options to mysql\-stress\-test\&.pl\&. Options are separated by comma\&.
.RE
.sp
.RS 4
@@ -1699,13 +1990,41 @@ output for
.\}
.\" mysql-test-run.pl: suite option
.\" suite option: mysql-test-run.pl
-\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR
+\fB\-\-suite[s]=\fR\fB\fIsuite_name...\fR\fR
.sp
-Run the named test suite\&. The default name is
-main
-(the regular test suite located in the
-mysql\-test
-directory)\&.
+Comma separated list of suite names to run. The default is: "main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-,handler-,heap-,innodb-,innodb_fts-,
+innodb_zip-,maria-,multi_source-,optimizer_unfixed_bugs-,parts-,percona-,perfschema-,
+plugins-,roles-,rpl-,sys_vars-,unit-,vcol-"\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: stop-file option
+.\" stop-file option: mysql-test-run.pl
+\fB\-\-stop\-file=\fR\fB\fIfile\fR\fR
+.sp
+If this file is detected, mysqltest will not start new tests until the file is removed (also MTR_STOP_FILE environment variable)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: stop-keep-alive option
+.\" stop-keep-alive option: mysql-test-run.pl
+\fB\-\-stop\-keep\-alive=\fR\fB\fIsec\fR\fR
+.sp
+Works with \fB--stop-file\fR, print messages every \fIsec\fR seconds when mysqltest is waiting to remove the file (for buildbot) (also MTR_STOP_KEEP_ALIVE environment variable)\&.
.RE
.sp
.RS 4
@@ -1720,7 +2039,7 @@ directory)\&.
.\" suite-timeout option: mysql-test-run.pl
\fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR
.sp
-Specify the maximum test suite runtime\&.
+Specify the maximum test suite runtime in minutes\&. The default is 360\&.
.RE
.sp
.RS 4
@@ -1735,7 +2054,7 @@ Specify the maximum test suite runtime\&.
.\" testcase-timeout option: mysql-test-run.pl
\fB\-\-testcase\-timeout\fR
.sp
-Specify the maximum test case runtime\&.
+Specify the maximum test case runtime in minutes\&. The default is 15\&.
.RE
.sp
.RS 4
@@ -1750,8 +2069,7 @@ Specify the maximum test case runtime\&.
.\" timediff option: mysql-test-run.pl
\fB\-\-timediff\fR
.sp
-Adds to each test report for a test case, the total time in sconds and milliseconds passed since the preceding test ended\&. This option can only be used together with
-\fB\-\-timestamp\fR, and has no effect without it\&.
+Used with \fB\-\-timestamp\fR, also print time passed since the previous test started\&.
.RE
.sp
.RS 4
@@ -1817,7 +2135,22 @@ will be set to the path for this directory, whether it has the default value or
.\" user option: mysql-test-run.pl
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server (default root)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql-test-run.pl: user-args option
+.\" user-args option: mysql-test-run.pl
+\fB\-\-user\-args\fR
+.sp
+In combination with \fBstart*\fR and no test name, drops arguments to mysqld except those specified with \fB\-\-mysqld\fR (if any)\&.
.RE
.sp
.RS 4
@@ -1830,16 +2163,16 @@ The MySQL user name to use when connecting to the server\&.
.\}
.\" mysql-test-run.pl: valgrind option
.\" valgrind option: mysql-test-run.pl
-\fB\-\-valgrind\fR
+\fB\-\-valgrind[\-all]\fR
.sp
Run
\fBmysqltest\fR
and
\fBmysqld\fR
with
-\fBvalgrind\fR\&. Thiks and the following
+\fBvalgrind\fR\&. This and the following
\fB\-\-valgrind\fR
-options require that the executables have been build with
+options require that the executables have been built with
\fBvalgrind\fR
support\&.
.RE
@@ -1874,9 +2207,11 @@ server with
.\" valgrind-mysqltest option: mysql-test-run.pl
\fB\-\-valgrind\-mysqltest\fR
.sp
-Run
+Run the
\fBmysqltest\fR
-with
+and
+\fBmysql_client_test\fR
+executables with
\fBvalgrind\fR\&.
.RE
.sp
@@ -1892,8 +2227,7 @@ with
.\" valgrind-options option: mysql-test-run.pl
\fB\-\-valgrind\-option=\fR\fB\fIstr\fR\fR
.sp
-Extra options to pass to
-\fBvalgrind\fR\&.
+Option to give \fBvalgrind\fR. Replaces default option(s)\&. Can be specified more then once&.
.RE
.sp
.RS 4
@@ -1908,7 +2242,7 @@ Extra options to pass to
.\" valgrind-path option: mysql-test-run.pl
\fB\-\-valgrind\-path=\fR\fB\fIpath\fR\fR
.sp
-Specify the path name to the
+Path to the
\fBvalgrind\fR
executable\&.
.RE
@@ -1973,10 +2307,7 @@ Write when and why servers are restarted between test cases\&.
.\" view-protocol option: mysql-test-run.pl
\fB\-\-view\-protocol\fR
.sp
-Pass the
-\fB\-\-view\-protocol\fR
-option to
-\fBmysqltest\fR\&.
+Create a view to execute all non updating queries\&.
.RE
.sp
.RS 4
@@ -1991,9 +2322,9 @@ option to
.\" vs-config option: mysql-test-run.pl
\fB\-\-vs\-config=\fR\fB\fIconfig_val\fR\fR
.sp
-Specify the configuration used to build MySQL (for example,
-\fB\-\-vs\-config=debug\fR
-\fB\-\-vs\-config=release\fR)\&. This option is for Windows only\&.
+Visual Studio configuration used to create executables
+(default: MTR_VS_CONFIG environment variable)
+This option is for Windows only\&.
.RE
.sp
.RS 4
@@ -2012,9 +2343,7 @@ If
\fB\-\-start\fR
or
\fB\-\-start\-dirty\fR
-is used, wait for all servers to exit before termination\&. Otherise, it will terminate if one (of several) servers is restarted\&.
-.sp
-This option was added in MySQL 5\&.1\&.36\&.
+is used, wait for all servers to exit before termination\&. Otherwise, it will terminate if one (of several) servers is restarted\&.
.RE
.sp
.RS 4
@@ -2052,7 +2381,7 @@ in their name\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 2007, 2010, Oracle and/or its affiliates
+Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -2061,8 +2390,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql.1 b/man/mysql.1
index b9430ccae6a..48ab6c7cd95 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -25,7 +18,7 @@
.\" SQL scripts
.\" batch SQL files
.SH "NAME"
-mysql \- the MySQL command\-line tool
+mysql \- the MariaDB command\-line tool
.SH "SYNOPSIS"
.HP \w'\fBmysql\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\ 'u
\fBmysql [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR
@@ -34,7 +27,7 @@ mysql \- the MySQL command\-line tool
\fBmysql\fR
is a simple SQL shell (with GNU
readline
-capabilities)\&. It supports interactive and noninteractive use\&. When used interactively, query results are presented in an ASCII\-table format\&. When used noninteractively (for example, as a filter), the result is presented in tab\-separated format\&. The output format can be changed using command options\&.
+capabilities)\&. It supports interactive and non\-interactive use\&. When used interactively, query results are presented in an ASCII\-table format\&. When used non\-interactively (for example, as a filter), the result is presented in tab\-separated format\&. The output format can be changed using command options\&.
.PP
If you have problems due to insufficient memory for large result sets, use the
\fB\-\-quick\fR
@@ -77,13 +70,11 @@ Then type an SQL statement, end it with
\eG
and press Enter\&.
.PP
-As of MySQL 5\&.1\&.10, typing Control\-C causes
+Typing Control\-C causes
\fBmysql\fR
to attempt to kill the current statement\&. If this cannot be done, or Control\-C is typed again before the statement is killed,
\fBmysql\fR
-exits\&. Previously, Control\-C caused
-\fBmysql\fR
-to exit in all cases\&.
+exits\&.
.PP
You can execute SQL statements in a script file (batch file) like this:
.sp
@@ -104,13 +95,10 @@ shell> \fBmysql \fR\fB\fIdb_name\fR\fR\fB < \fR\fB\fIscript\&.sql\fR\fR\fB > \fR
.PP
\fBmysql\fR
supports the following options, which can be specified on the command line or in the
-[mysql]
-and
-[client]
+[mysql], [client], [client-server] or [client-mariadb]
option file groups\&.
\fBmysql\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option files\&.
.sp
.RS 4
.ie n \{\
@@ -137,12 +125,27 @@ Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: abort-source-on-error option
+.\" abort-source-on-error: mysql
+\fB\-\-abort\-source\-on\-error\fR
+.sp
+Abort 'source filename' operations in case of errors\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: auto-rehash option
.\" auto-rehash option: mysql
\fB\-\-auto\-rehash\fR
.sp
Enable automatic rehashing\&. This option is on by default, which enables database, table, and column name completion\&. Use
-\fB\-\-disable\-auto\-rehash\fR
+\fB\-\-disable\-auto\-rehash\fR, \fB\-\-no\-auto\-rehash\fR, or \fB\-\-skip\-auto\-rehash\fR
to disable rehashing\&. That causes
\fBmysql\fR
to start faster, but you must issue the
@@ -162,6 +165,21 @@ completes it\&. Otherwise, you can press Tab again to see the possible names tha
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: auto-vertical-output option
+.\" auto-vertical-output option: mysql
+\fB\-\-auto\-vertical\-output\fR
+.sp
+Automatically switch to vertical output mode if the result is wider than the terminal width\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: batch option
.\" batch option: mysql
\fB\-\-batch\fR,
@@ -184,12 +202,26 @@ option\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: binary-mode option
+.\" binary-mode option: mysql
+\fB\-\-binary\-mode\fR
+.sp
+By default, ASCII '\e0' is disallowed and '\er\en' is translated to '\en'\&. This switch turns off both features, and also turns off parsing of all client commands except \eC and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command)\&. This is necessary when processing output from mysqlbinlog that may contain blobs\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: character-sets-dir option
.\" character-sets-dir option: mysql
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -220,10 +252,7 @@ Write column names in results\&.
\fB\-\-column\-type\-info\fR,
\fB\-m\fR
.sp
-Display result set metadata\&. This option was added in MySQL 5\&.1\&.14\&. (Before that, use
-\fB\-\-debug\-info\fR\&.) The
-\fB\-m\fR
-short option was added in MySQL 5\&.1\&.21\&.
+Display result set metadata\&.
.RE
.sp
.RS 4
@@ -239,7 +268,7 @@ short option was added in MySQL 5\&.1\&.21\&.
\fB\-\-comments\fR,
\fB\-c\fR
.sp
-Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&. This option was added in MySQL 5\&.1\&.23\&.
+Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&.
.RE
.sp
.RS 4
@@ -286,7 +315,7 @@ Set the number of seconds before connection timeout\&. (Default value is 0\&.)
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
-The database to use\&. This is useful primarily in an option file\&.
+The database to use\&.
.RE
.sp
.RS 4
@@ -321,7 +350,7 @@ string is
.\" debug-check option: mysql
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -337,9 +366,22 @@ Print some debugging information when the program exits\&. This option was added
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
-Before MySQL 5\&.1\&.14, this option prints debugging information and memory and CPU usage statistics when the program exits, and also causes display of result set metadata during execution\&. As of MySQL 5\&.1\&.14, use
-\fB\-\-column\-type\-info\fR
-to display result set metadata\&.
+Prints debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: default-auth option
+.\" default-auth option: mysql
+\fB\-\-default\-auth=\fR\fB\fIname\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -362,12 +404,25 @@ A common issue that can occur when the operating system uses
utf8
or another multi\-byte character set is that output from the
\fBmysql\fR
-client is formatted incorrectly, due to the fact that the MySQL client uses the
+client is formatted incorrectly, due to the fact that the MariaDB client uses the
latin1
character set by default\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
+.RE
.sp
-See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq, for more information\&.
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: defaults-extra-file option
+.\" defaults-extra-file option: mysql
+\fB\-\-defaults-extra-file=\fR\fB\fIfilename\fR\fR
+.sp
+Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&.
+Must be given as first option\&.
.RE
.sp
.RS 4
@@ -393,12 +448,11 @@ Set \fB\fIfilename\fR\fR as the file to read default options from, override glob
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-extra-file option
-.\" defaults-extra-file option: mysql
-\fB\-\-defaults-extra-file=\fR\fB\fIfilename\fR\fR
+.\" mysql: defaults-group-suffix option
+.\" defaults-group-suffix option: mysql
+\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR
.sp
-Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&.
-Must be given as first option\&.
+In addition to the groups named on the command line, read groups that have the given suffix\&.
.RE
.sp
.RS 4
@@ -451,9 +505,8 @@ the section called \(lqMYSQL COMMANDS\(rq\&.
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,
\fB\-e \fR\fB\fIstatement\fR\fR
.sp
-Execute the statement and quit\&. The default output format is like that produced with
-\fB\-\-batch\fR\&. See
-Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&.
+Execute the statement and quit\&. Disables \fB\-\-force\fR and history file\&. The default output format is like that produced with
+\fB\-\-batch\fR\&.
.RE
.sp
.RS 4
@@ -469,7 +522,7 @@ Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples
\fB\-\-force\fR,
\fB\-f\fR
.sp
-Continue even if an SQL error occurs\&.
+Continue even if an SQL error occurs\&. Sets \fB\-\-abort\-source\-on-error\fR to 0\&.
.RE
.sp
.RS 4
@@ -485,7 +538,7 @@ Continue even if an SQL error occurs\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -517,10 +570,22 @@ Produce HTML output\&.
\fB\-\-ignore\-spaces\fR,
\fB\-i\fR
.sp
-Ignore spaces after function names\&. The effect of this is described in the discussion for the
-IGNORE_SPACE
-SQL mode (see
-Section\ \&5.1.8, \(lqServer SQL Modes\(rq)\&.
+Ignore spaces after function names\&. Allows one to have spaces (including tab characters and new line characters) between function name and '('\&. The drawback is that this causes built in functions to become reserved words\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: init-command option
+.\" init-command option: mysql
+\fB\-\-init\-command=\fR\fB\fIstr\fR\fR\fR
+.sp
+SQL Command to execute when connecting to the MariaDB server\&. Will automatically be re-executed when reconnecting\&.
.RE
.sp
.RS 4
@@ -577,7 +642,7 @@ has no effect if the server does not also support it\&.
.\" max-allowed-packet option: mysql
\fB\-\-max\-allowed\-packet=\fR\fB\fInum\fR\fR
.sp
-Set the maximum packet length to send to or receive from the server\&. (Default value is 16MB\&.)
+Set the maximum packet length to send to or receive from the server\&. (Default value is 16MB, largest 1GB\&.)
.RE
.sp
.RS 4
@@ -618,7 +683,7 @@ and
both are recognized\&. Use
\fB\-\-skip\-named\-commands\fR
to disable named commands\&. See
-the section called \(lqMYSQL COMMANDS\(rq\&.
+the section called \(lqMYSQL COMMANDS\(rq\&. Disabled by default\&.
.RE
.sp
.RS 4
@@ -695,72 +760,12 @@ Do not read default options from any option file\&. This must be given as the fi
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-named-commands option
-.\" no-named-commands option: mysql
-\fB\-\-no\-named\-commands\fR,
-\fB\-g\fR
-.sp
-Deprecated, use
-\fB\-\-disable\-named\-commands\fR
-instead\&.
-\fB\-\-no\-named\-commands\fR
-is removed in MySQL 5\&.5\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-.\" mysql: no-pager option
-.\" no-pager option: mysql
-\fB\-\-no\-pager\fR
-.sp
-Deprecated form of
-\fB\-\-skip\-pager\fR\&. See the
-\fB\-\-pager\fR
-option\&.
-\fB\-\-no\-pager\fR
-is removed in MySQL 5\&.5\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-.\" mysql: no-tee option
-.\" no-tee option: mysql
-\fB\-\-no\-tee\fR
-.sp
-Deprecated form of
-\fB\-\-skip\-tee\fR\&. See the
-\fB\-\-tee\fR
-option\&.
-\fB\-\-no\-tee\fR
-is removed in MySQL 5\&.5\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
.\" mysql: one-database option
.\" one-database option: mysql
\fB\-\-one\-database\fR,
\fB\-o\fR
.sp
-Ignore statements except those for the default database named on the command line\&. This is useful for skipping updates to other databases in the binary log\&.
+Ignore statements except those those that occur while the default database is the one named on the command line\&. This filtering is limited, and based only on USE statements\&. This is useful for skipping updates to other databases in the binary log\&.
.RE
.sp
.RS 4
@@ -810,8 +815,7 @@ option on the command line,
\fBmysql\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -838,12 +842,27 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: plugin-dir option
+.\" plugin-dir option: mysql
+\fB\-\-plugin\-dir=\fIdir_name\fR
+.sp
+Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: port option
.\" port option: mysql
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
-The TCP/IP port number to use for the connection\&.
+The TCP/IP port number to use for the connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&.
.RE
.sp
.RS 4
@@ -869,12 +888,26 @@ Print the program argument list and exit\&. This must be given as the first argu
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: progress-reports option
+.\" progress-reports option: mysql
+\fB\-\-progress\-reports\fR
+.sp
+Get progress reports for long running commands (such as ALTER TABLE)\&. (Defaults to on; use \fB\-\-skip\-progress\-reports\fR to disable\&.)
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: prompt option
.\" prompt option: mysql
\fB\-\-prompt=\fR\fB\fIformat_str\fR\fR
.sp
-Set the prompt to the specified format\&. The default is
-mysql>\&. The special sequences that the prompt can contain are described in
+Set the prompt to the specified format\&. The special sequences that the prompt can contain are described in
the section called \(lqMYSQL COMMANDS\(rq\&.
.RE
.sp
@@ -890,8 +923,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&.
.\" protocol option: mysql
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -979,8 +1011,8 @@ CHAR(92)
.\" reconnect option: mysql
\fB\-\-reconnect\fR
.sp
-If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. To suppress reconnection behavior, use
-\fB\-\-skip\-reconnect\fR\&.
+If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. Enabled by default, to disable use
+\fB\-\-skip\-reconnect\fR or \fB\-\-disable\-reconnect\fR\&.
.RE
.sp
.RS 4
@@ -1180,12 +1212,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.\}
.\" mysql: SSL options
.\" SSL options: mysql
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL CA option
+.\" SSL CA option: mysql
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL CA Path option
+.\" SSL CA Path option: mysql
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Cert option
+.\" SSL Cert option: mysql
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Cipher option
+.\" SSL Cipher option: mysql
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Key option
+.\" SSL Key option: mysql
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Crl option
+.\" SSL CRL option: mysql
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Crlpath option
+.\" SSL Crlpath option: mysql
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysql
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -1249,7 +1406,7 @@ Flush the buffer after each query\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -1333,36 +1490,7 @@ If the connection cannot be established, wait and retry instead of aborting\&.
\fB\-X\fR
.sp
Produce XML output\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-Prior to MySQL 5\&.1\&.12, there was no differentiation in the output when using this option between columns containing the
-NULL
-value and columns containing the string literal
-\'NULL\'; both were represented as
-.sp .5v
-.RE
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-<field name="\fIcolumn_name\fR">NULL</field>
-.fi
-.if n \{\
-.RE
-.\}
-.sp
-Beginning with MySQL 5\&.1\&.12, the output when
+The output when
\fB\-\-xml\fR
is used with
\fBmysql\fR
@@ -1371,7 +1499,7 @@ matches that of
\fBmysqldump\fR(1)
for details\&.
.sp
-Beginning with MySQL 5\&.1\&.18, the XML output also uses an XML namespace, as shown here:
+The XML output also uses an XML namespace, as shown here:
.sp
.if n \{\
.RS 4
@@ -1398,18 +1526,10 @@ shell> \fBmysql \-\-xml \-uroot \-e "SHOW VARIABLES LIKE \'version%\'"\fR
</row>
</resultset>
.fi
-.if n \{\
-.RE
-.\}
-.sp
-(See
-\m[blue]\fBBug#25946\fR\m[]\&\s-2\u[1]\d\s+2\&.)
.RE
.PP
You can also set the following variables by using
-\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR\&. The
-\fB\-\-set\-variable\fR
-format is deprecated and is removed in MySQL 5\&.5\&.
+\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR\&.
.sp
.RS 4
.ie n \{\
@@ -1504,8 +1624,7 @@ environment variable\&.
.PP
The
\&.mysql_history
-should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&.
+should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&.
.PP
If you do not want to maintain a history file, first remove
\&.mysql_history
@@ -1632,7 +1751,7 @@ If you provide an argument to the
help
command,
\fBmysql\fR
-uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. For more information, see
+uses it as a search string to access server\-side help\&. For more information, see
the section called \(lqMYSQL SERVER-SIDE HELP\(rq\&.
.RE
.sp
@@ -1653,7 +1772,7 @@ Change the default character set and issue a
SET NAMES
statement\&. This enables the character set to remain synchronized on the client and server if
\fBmysql\fR
-is run with auto\-reconnect enabled (which is not recommended), because the specified character set is used for reconnects\&. This command was added in MySQL 5\&.1\&.7\&.
+is run with auto\-reconnect enabled (which is not recommended), because the specified character set is used for reconnects\&.
.RE
.sp
.RS 4
@@ -1705,16 +1824,14 @@ Change the string that
\fBmysql\fR
interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&.
.sp
-The delimiter can be specified as an unquoted or quoted argument\&. Quoting can be done with either single quote (\') or douple quote (") characters\&. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delmiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
+The delimiter can be specified as an unquoted or quoted argument\&. Quoting can be done with either single quote (\') or douple quote (") characters\&. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MariaDB\&. For an unquoted argument, the delmiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
.sp
When the delimiter recognized by
\fBmysql\fR
is set to something other than the default of
\(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
\(lq;\(rq
-as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see
-Section\ \&21.9.12, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
-Section\ \&19.1, \(lqDefining Stored Programs\(rq)\&.
+as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution, and for parsing the body of stored procedures and functions, triggers, and events\&.
.RE
.sp
.RS 4
@@ -2505,7 +2622,7 @@ You can set the
prompt
option in the
[mysql]
-group of any MySQL option file, such as
+group of any MariaDB option file, such as
/etc/my\&.cnf
or the
\&.my\&.cnf
@@ -2524,8 +2641,7 @@ prompt=(\e\eu@\e\eh) [\e\ed]>\e\e_
.sp
In this example, note that the backslashes are doubled\&. If you set the prompt using the
prompt
-option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files\&. (The rules for escape sequences in option files are listed in
-Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.) The overlap may cause you problems if you use single backslashes\&. For example,
+option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files\&. The overlap may cause you problems if you use single backslashes\&. For example,
\es
is interpreted as a space rather than as the current seconds value\&. The following example shows how to define a prompt within an option file to include the current time in
HH:MM:SS>
@@ -2588,10 +2704,9 @@ If you provide an argument to the
help
command,
\fBmysql\fR
-uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. The proper operation of this command requires that the help tables in the
+uses it as a search string to access server\-side help\&. The proper operation of this command requires that the help tables in the
mysql
-database be initialized with help topic information (see
-Section\ \&5.1.9, \(lqServer-Side Help\(rq)\&.
+database be initialized with help topic information.
.PP
If there is no match for the search string, the search fails:
.sp
@@ -2782,17 +2897,14 @@ with the
\fB\-\-verbose\fR
option, which causes each statement to be displayed before the result that it produces\&.
.PP
-As of MySQL 5\&.1\&.23,
\fBmysql\fR
-ignores Unicode byte order mark (BOM) characters at the beginning of input files\&. Previously, it read them and sent them to the server, resulting in a syntax error\&. Presence of a BOM does not cause
+ignores Unicode byte order mark (BOM) characters at the beginning of input files\&. Presence of a BOM does not cause
\fBmysql\fR
to change its default character set\&. To do that, invoke
\fBmysql\fR
with an option such as
\fB\-\-default\-character\-set=utf8\fR\&.
.PP
-For more information about batch mode, see
-Section\ \&3.5, \(lqUsing mysql in Batch Mode\(rq\&.
.SH "MYSQL TIPS"
.PP
This section describes some techniques that can help you use
@@ -2846,7 +2958,7 @@ When you use the
\fB\-\-safe\-updates\fR
option,
\fBmysql\fR
-issues the following statement when it connects to the MySQL server:
+issues the following statement when it connects to the MariaDB server:
.sp
.if n \{\
.RS 4
@@ -2858,9 +2970,6 @@ SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;
.RE
.\}
.PP
-See
-Section\ \&5.1.5, \(lqSession System Variables\(rq\&.
-.PP
The
SET
statement has the following effects:
@@ -2980,12 +3089,10 @@ client with the
\fB\-\-skip\-reconnect\fR
option\&.
.PP
-For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see
-Section\ \&21.9.11, \(lqControlling Automatic Reconnection Behavior\(rq\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -3000,8 +3107,6 @@ Bug#25946
\%http://bugs.mysql.com/bug.php?id=25946
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql.server.1 b/man/mysql.server.1
index dc965921f6f..ba206cb985c 100644
--- a/man/mysql.server.1
+++ b/man/mysql.server.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql.server\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -20,35 +13,33 @@
.\" -----------------------------------------------------------------
.\" mysql.server
.SH "NAME"
-mysql.server \- MySQL server startup script
+mysql.server \- MariaDB server startup script
.SH "SYNOPSIS"
.HP \w'\fBmysql\ {start|stop}\fR\ 'u
\fBmysql {start|stop}\fR
.SH "DESCRIPTION"
.PP
-MySQL distributions on Unix include a script named
-\fBmysql\&.server\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the Mac OS X Startup Item for MySQL\&.
+MariaDB distributions on Unix include a script named
+\fBmysql\&.server\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the Mac OS X Startup Item for MariaDB\&.
.PP
\fBmysql\&.server\fR
can be found in the
support\-files
-directory under your MySQL installation directory or in a MySQL source distribution\&.
+directory under your MariaDB installation directory or in a MariaDB source distribution\&.
.PP
If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), the
\fBmysql\&.server\fR
script will be installed in the
/etc/init\&.d
directory with the name
-mysql\&. You need not install it manually\&. See
-Section\ \&2.6.1, \(lqInstalling MySQL from RPM Packages on Linux\(rq, for more information on the Linux RPM packages\&.
+mysql\&. You need not install it manually\&.
.PP
Some vendors provide RPM packages that install a startup script under a different name such as
\fBmysqld\fR\&.
.PP
-If you install MySQL from a source distribution or using a binary distribution format that does not install
+If you install MariaDB from a source distribution or using a binary distribution format that does not install
\fBmysql\&.server\fR
-automatically, you can install it manually\&. Instructions are provided in
-Section\ \&2.13.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&.
+automatically, you can install it manually\&.
.PP
\fBmysql\&.server\fR
reads options from the
@@ -58,8 +49,7 @@ and
sections of option files\&. For backward compatibility, it also reads
[mysql_server]
sections, although you should rename such sections to
-[mysql\&.server]
-when using MySQL 5\&.1\&.
+[mysql\&.server]&.
.PP
\fBmysql\&.server\fR
supports the following options\&.
@@ -76,7 +66,7 @@ supports the following options\&.
.\" basedir option: mysql.server
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL installation directory\&.
+The path to the MariaDB installation directory\&.
.RE
.sp
.RS 4
@@ -91,7 +81,7 @@ The path to the MySQL installation directory\&.
.\" datadir option: mysql.server
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL data directory\&.
+The path to the MariaDB data directory\&.
.RE
.sp
.RS 4
@@ -106,7 +96,7 @@ The path to the MySQL data directory\&.
.\" pid-file option: mysql.server
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
.sp
-The path name of the file in which the server should write its process ID\&.
+The path name of the file in which the server should write its process ID\&. If not provided, the default, "host_name.pid" is used.
.RE
.sp
.RS 4
@@ -123,7 +113,7 @@ The path name of the file in which the server should write its process ID\&.
.sp
How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time,
\fBmysql\&.server\fR
-exits with an error\&. The default value is 900\&. A value of 0 means not to wait at all for startup\&. Negative values mean to wait forever (no timeout)\&. This option was added in MySQL 5\&.1\&.17\&. Before that, a value of 900 is always used\&.
+exits with an error\&. The default value is 900\&. A value of 0 means not to wait at all for startup\&. Negative values mean to wait forever (no timeout)\&.
.RE
.sp
.RS 4
@@ -176,7 +166,7 @@ The login user name to use for running
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -185,8 +175,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_client_test.1 b/man/mysql_client_test.1
index a366092012c..d28945bbbe7 100644
--- a/man/mysql_client_test.1
+++ b/man/mysql_client_test.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_client_test\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
.\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "03/31/2010" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL_CLIENT_TEST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -33,7 +26,7 @@ mysql_client_test_embedded \- test client API for embedded server
.PP
The
\fBmysql_client_test\fR
-program is used for testing aspects of the MySQL client API that cannot be tested using
+program is used for testing aspects of the MariaDB client API that cannot be tested using
\fBmysqltest\fR
and its test language\&.
\fBmysql_client_test_embedded\fR
@@ -128,7 +121,7 @@ The database to use\&.
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
-Write a debugging log if MySQL is built with debugging support\&. The default
+Write a debugging log if MariaDB is built with debugging support\&. The default
\fIdebug_options\fR
value is
\'d:t:o,/tmp/mysql_client_test\&.trace\'\&.
@@ -165,7 +158,7 @@ library\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -304,7 +297,7 @@ may optionally behave in a different way than if called manually, for example by
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -326,7 +319,7 @@ mysql\-test/var\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 2007, 2010, Oracle and/or its affiliates
+Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -335,8 +328,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_config.1 b/man/mysql_config.1
index 86086e15f45..dd6df086c59 100644
--- a/man/mysql_config.1
+++ b/man/mysql_config.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_config\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -27,7 +20,7 @@ mysql_config \- get compile options for compiling clients
.SH "DESCRIPTION"
.PP
\fBmysql_config\fR
-provides you with useful information for compiling your MySQL client and connecting it to MySQL\&.
+provides you with useful information for compiling your MariaDB client and connecting it to MariaDB\&.
.PP
\fBmysql_config\fR
supports the following options\&.
@@ -63,7 +56,7 @@ for more portable options that contain only include paths\&.
.\" include option: mysql_config
\fB\-\-include\fR
.sp
-Compiler options to find MySQL include files\&.
+Compiler options to find MariaDB include files\&.
.RE
.sp
.RS 4
@@ -81,7 +74,7 @@ Compiler options to find MySQL include files\&.
\fB\-\-libmysqld\-libs\fR,
\fB\-\-embedded\fR
.sp
-Libraries and options required to link with the MySQL embedded server\&.
+Libraries and options required to link with the MariaDB embedded server\&.
.RE
.sp
.RS 4
@@ -96,7 +89,7 @@ Libraries and options required to link with the MySQL embedded server\&.
.\" libs option: mysql_config
\fB\-\-libs\fR
.sp
-Libraries and options required to link with the MySQL client library\&.
+Libraries and options required to link with the MariaDB client library\&.
.RE
.sp
.RS 4
@@ -111,7 +104,7 @@ Libraries and options required to link with the MySQL client library\&.
.\" libs_r option: mysql_config
\fB\-\-libs_r\fR
.sp
-Libraries and options required to link with the thread\-safe MySQL client library\&.
+Libraries and options required to link with the thread\-safe MariaDB client library\&.
.RE
.sp
.RS 4
@@ -126,7 +119,7 @@ Libraries and options required to link with the thread\-safe MySQL client librar
.\" plugindir option: mysql_config
\fB\-\-plugindir\fR
.sp
-The default plugin directory path name, defined when configuring MySQL\&. This option was added in MySQL 5\&.1\&.24\&.
+The default plugin directory path name, defined when configuring MariaDB\&.
.RE
.sp
.RS 4
@@ -141,7 +134,7 @@ The default plugin directory path name, defined when configuring MySQL\&. This o
.\" port option: mysql_config
\fB\-\-port\fR
.sp
-The default TCP/IP port number, defined when configuring MySQL\&.
+The default TCP/IP port number, defined when configuring MariaDB\&.
.RE
.sp
.RS 4
@@ -156,7 +149,7 @@ The default TCP/IP port number, defined when configuring MySQL\&.
.\" socket option: mysql_config
\fB\-\-socket\fR
.sp
-The default Unix socket file, defined when configuring MySQL\&.
+The default Unix socket file, defined when configuring MariaDB\&.
.RE
.sp
.RS 4
@@ -171,7 +164,7 @@ The default Unix socket file, defined when configuring MySQL\&.
.\" variable option: mysql_config
\fB\-\-variable=VAR\fR
.sp
-Path to MySQL include, library and plugin directories\&. \fBVAR\fR is one of
+Path to MariaDB include, library and plugin directories\&. \fBVAR\fR is one of
`pkgincludedir`, `pkglibdir` and `plugindir`, respectively\&.
.RE
.sp
@@ -187,7 +180,7 @@ Path to MySQL include, library and plugin directories\&. \fBVAR\fR is one of
.\" version option: mysql_config
\fB\-\-version\fR
.sp
-Version number for the MySQL distribution\&.
+Version number for the MariaDB distribution\&.
.RE
.PP
If you invoke
@@ -219,7 +212,7 @@ Options:
.PP
You can use
\fBmysql_config\fR
-within a command line to include the value that it displays for a particular option\&. For example, to compile a MySQL client program, use
+within a command line to include the value that it displays for a particular option\&. For example, to compile a MariaDB client program, use
\fBmysql_config\fR
as follows:
.sp
@@ -240,7 +233,7 @@ this way, be sure to invoke it within backtick (\(lq`\(rq) characters\&. That te
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -249,8 +242,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1
index bb4c76aac56..6fc03b59b23 100644
--- a/man/mysql_convert_table_format.1
+++ b/man/mysql_convert_table_format.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_convert_table_format\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_CONVERT_TAB" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -100,7 +93,7 @@ Continue even if errors occur\&.
.\" host option: mysql_convert_table_format
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -115,10 +108,9 @@ Connect to the MySQL server on the given host\&.
.\" password option: mysql_convert_table_format
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
-The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
+The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -181,7 +173,7 @@ if this option is not given\&.
.\" user option: mysql_convert_table_format
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -216,7 +208,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -225,8 +217,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_find_rows.1 b/man/mysql_find_rows.1
index 50c3e38be32..fd3ea25c502 100644
--- a/man/mysql_find_rows.1
+++ b/man/mysql_find_rows.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_find_rows\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_FIND_ROWS\F" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -151,7 +144,7 @@ Start output from this row\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -160,8 +153,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_fix_extensions.1 b/man/mysql_fix_extensions.1
index fa66348d24c..f53d103055c 100644
--- a/man/mysql_fix_extensions.1
+++ b/man/mysql_fix_extensions.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_fix_extensions\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_FIX_EXTENSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -61,7 +54,7 @@ shell> \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -70,8 +63,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1
index ff3b216f6da..fa0c86f6568 100644
--- a/man/mysql_install_db.1
+++ b/man/mysql_install_db.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_install_db\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_INSTALL_DB\" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -20,14 +13,14 @@
.\" -----------------------------------------------------------------
.\" mysql_install_db
.SH "NAME"
-mysql_install_db \- initialize MySQL data directory
+mysql_install_db \- initialize MariaDB data directory
.SH "SYNOPSIS"
.HP \w'\fBmysql_install_db\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR
.SH "DESCRIPTION"
.PP
\fBmysql_install_db\fR
-initializes the MySQL data directory and creates the system tables that it contains, if they do not exist\&.
+initializes the MariaDB data directory and creates the system tables that it contains, if they do not exist\&.
.PP
To invoke
\fBmysql_install_db\fR, use the following syntax:
@@ -42,7 +35,7 @@ shell> \fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR
.RE
.\}
.PP
-Because the MySQL server,
+Because the MariaDB server,
\fBmysqld\fR, needs to access the data directory when it runs later, you should either run
\fBmysql_install_db\fR
from the same account that will be used for running
@@ -81,7 +74,7 @@ with the
and
\fB\-\-skip\-grant\-tables\fR
options (see
-Section\ \&2.3.2, \(lqTypical configure Options\(rq)\&. If MySQL was configured with the
+Section\ \&2.3.2, \(lqTypical configure Options\(rq)\&. If MariaDB was configured with the
\fB\-\-disable\-grant\-options\fR
option,
\fB\-\-bootstrap\fR
@@ -113,7 +106,7 @@ option file groups\&.
.\" basedir option: mysql_install_db
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL installation directory\&.
+The path to the MariaDB installation directory\&.
.RE
.sp
.RS 4
@@ -124,13 +117,27 @@ The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: force option
-.\" force option: mysql_install_db
-\fB\-\-force\fR
+.\" mysql_install_db: builddir option
+.\" builddir option: mysql_install_db
+\fB\-\-builddir=\fIpath\fR
.sp
-Cause
-\fBmysql_install_db\fR
-to run even if DNS does not work\&. In that case, grant table entries that normally use host names will use IP addresses\&.
+If using \fB--srcdir\fR with out-of-directory builds, you will need to set this
+to the location of the build directory where built files reside.\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_install_db: cross-bootstrap option
+.\" cross-bootstrap option: mysql_install_db
+\fB\-\-cross\-bootstrap\fR
+.sp
+For internal use. Used when building the MariaDB system tables on a different host than the target.\&.
.RE
.sp
.RS 4
@@ -148,7 +155,102 @@ to run even if DNS does not work\&. In that case, grant table entries that norma
\fB\-\-datadir=\fR\fB\fIpath\fR\fR,
\fB\-\-ldata=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL data directory\&.
+The path to the MariaDB data directory\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: defaults-extra-file option
+.\" defaults-extra-file option: mysqlcheck
+\fB\-\-defaults\-extra\-file=\fR\fB\fIfilename\fR\fR
+.sp
+Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&.
+Must be given as first option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: defaults-file option
+.\" defaults-file option: mysqlcheck
+\fB\-\-defaults\-file=\fR\fB\fIfilename\fR\fR
+.sp
+Set \fB\fIfilename\fR\fR as the file to read default options from, override global defaults files\&.
+Must be given as first option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_install_db: force option
+.\" force option: mysql_install_db
+\fB\-\-force\fR
+.sp
+Cause
+\fBmysql_install_db\fR
+to run even if DNS does not work\&. In that case, grant table entries that normally use host names will use IP addresses\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: help option
+.\" help option: mysqlcheck
+\fB\-\-help\fR
+.sp
+Display a help message and exit\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: no-defaults option
+.\" no-defaults option: mysqlcheck
+\fB\-\-no\-defaults\fR
+.sp
+Do not read default options from any option file\&. This must be given as the first argument\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: print-defaults option
+.\" print-defaults option: mysqlcheck
+\fB\-\-print\-defaults\fR
+.sp
+Print the program argument list and exit\&.
+This must be given as the first argument\&.
.RE
.sp
.RS 4
@@ -163,7 +265,7 @@ The path to the MySQL data directory\&.
.\" rpm option: mysql_install_db
\fB\-\-rpm\fR
.sp
-For internal use\&. This option is used by RPM files during the MySQL installation process\&.
+For internal use\&. This option is used by RPM files during the MariaDB installation process\&.
.RE
.sp
.RS 4
@@ -195,7 +297,7 @@ Use IP addresses rather than host names when creating grant table entries\&. Thi
.sp
For internal use\&. The directory under which
\fBmysql_install_db\fR
-looks for support files such as the error message file and the file for populating the help tables\&. This option was added in MySQL 5\&.1\&.14\&.
+looks for support files such as the error message file and the file for populating the help tables\&.4\&.
.RE
.sp
.RS 4
@@ -252,7 +354,7 @@ For internal use\&. This option is used for creating Windows distributions\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -261,8 +363,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1
index fe4fd137006..c30cd96362c 100644
--- a/man/mysql_plugin.1
+++ b/man/mysql_plugin.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_plugin\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
-.\" Date: 01/16/2013
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.5
-.\" Language: English
.\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "01/16/2013" "MySQL 5\&.5" "MySQL Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -29,7 +22,7 @@
.\" -----------------------------------------------------------------
.\" mysql_plugin
.SH "NAME"
-mysql_plugin \- configure MySQL server plugins
+mysql_plugin \- configure MariaDB server plugins
.SH "SYNOPSIS"
.HP \w'\fBmysql_plugin\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIplugin\fR\fR\fB\ {ENABLE|DISABLE}\fR\ 'u
\fBmysql_plugin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIplugin\fR\fR\fB {ENABLE|DISABLE}\fR
@@ -37,15 +30,13 @@ mysql_plugin \- configure MySQL server plugins
.PP
The
\fBmysql_plugin\fR
-utility enables MySQL administrators to manage which plugins a MySQL server loads\&. It provides an alternative to manually specifying the
+utility enables MariaDB administrators to manage which plugins a MariaDB server loads\&. It provides an alternative to manually specifying the
\fB\-\-plugin\-load\fR
option at server startup or using the
INSTALL PLUGIN
and
UNINSTALL PLUGIN
statements at runtime\&.
-\fBmysql_plugin\fR
-is available as of MySQL 5\&.5\&.16\&.
.PP
Depending on whether
\fBmysql_plugin\fR
@@ -53,12 +44,11 @@ is invoked to enable or disable plugins, it inserts or deletes rows in the
mysql\&.plugin
table that serves as a plugin registry\&. (To perform this operation,
\fBmysql_plugin\fR
-invokes the MySQL server in bootstrap mode\&. This means that the server must not already be running\&.) For normal server startups, the server loads and enables plugins listed in
+invokes the MariaDB server in bootstrap mode\&. This means that the server must not already be running\&.) For normal server startups, the server loads and enables plugins listed in
mysql\&.plugin
automatically\&. For additional control over plugin activation, use
\fB\-\-\fR\fB\fIplugin_name\fR\fR
-options named for specific plugins, as described in
-Section\ \&5.1.8.1, \(lqInstalling and Uninstalling Plugins\(rq\&.
+options named for specific plugins\&.
.PP
Each invocation of
\fBmysql_plugin\fR
@@ -150,7 +140,7 @@ An error occurs if
\fBmysql_plugin\fR
cannot find the configuration file or plugin library file, or if
\fBmysql_plugin\fR
-cannot start the MySQL server\&.
+cannot start the MariaDB server\&.
.PP
\fBmysql_plugin\fR
supports the following options, which can be specified on the command line or in the
@@ -163,8 +153,7 @@ recognizes the
\fB\-\-basedir\fR,
\fB\-\-datadir\fR, and
\fB\-\-plugin\-dir\fR
-options and ignores others\&. For information about option files, see
-Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
+options and ignores others\&.
.PP
mysql_plugin Options
.sp
@@ -268,7 +257,7 @@ server\&.
Do not read values from the configuration file\&. This option enables an administrator to skip reading defaults from the configuration file\&.
.sp
With
-\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MySQL programs that support
+\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MariaDB programs that support
\fB\-\-no\-defaults\fR\&.
.RE
.sp
@@ -334,7 +323,7 @@ to print the defaults for
if they are found in the configuration file\&. If no value for a variable is found, nothing is shown\&.
.sp
With
-\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MySQL programs that support
+\fBmysql_plugin\fR, this option need not be given first on the command line, unlike most other MariaDB programs that support
\fB\-\-print\-defaults\fR\&.
.RE
.sp
@@ -372,7 +361,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved., 2013-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -381,8 +370,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Oracle Corporation (http://dev.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1
index 6345aa18d9f..20a77bc3f1e 100644
--- a/man/mysql_secure_installation.1
+++ b/man/mysql_secure_installation.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_secure_installation\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_SECURE_INST" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_SECURE_INST" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -20,13 +13,13 @@
.\" -----------------------------------------------------------------
.\" mysql_secure_installation
.SH "NAME"
-mysql_secure_installation \- improve MySQL installation security
+mysql_secure_installation \- improve MariaDB installation security
.SH "SYNOPSIS"
.HP \w'\fBmysql_secure_installation\fR\ 'u
\fBmysql_secure_installation\fR
.SH "DESCRIPTION"
.PP
-This program enables you to improve the security of your MySQL installation in the following ways:
+This program enables you to improve the security of your MariaDB installation in the following ways:
.sp
.RS 4
.ie n \{\
@@ -96,7 +89,7 @@ The script will prompt you to determine which actions to perform\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -105,8 +98,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1
index 303d247cc55..fca322ef2e2 100644
--- a/man/mysql_setpermission.1
+++ b/man/mysql_setpermission.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_setpermission\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_SETPERMISSI" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -27,14 +20,13 @@ mysql_setpermission \- interactively set permissions in grant tables
.SH "DESCRIPTION"
.PP
\fBmysql_setpermission\fR
-is a Perl script that was originally written and contributed by Luuk de Boer\&. It interactively sets permissions in the MySQL grant tables\&.
+is a Perl script that was originally written and contributed by Luuk de Boer\&. It interactively sets permissions in the MariaDB grant tables\&.
\fBmysql_setpermission\fR
is written in Perl and requires that the
DBI
and
DBD::mysql
-Perl modules be installed (see
-Section\ \&2.15, \(lqPerl Installation Notes\(rq)\&.
+Perl modules be installed\&.
.PP
Invoke
\fBmysql_setpermission\fR
@@ -53,9 +45,9 @@ shell> \fBmysql_setpermission [\fR\fB\fIoptions\fR\fR\fB]\fR
\fIoptions\fR
should be either
\fB\-\-help\fR
-to display the help message, or options that indicate how to connect to the MySQL server\&. The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables\&.
+to display the help message, or options that indicate how to connect to the MariaDB server\&. The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables\&.
.PP
-\fBmysql_setpermissions\fR
+\fBmysql_setpermission\fR
also reads options from the
[client]
and
@@ -94,7 +86,7 @@ Display a help message and exit\&.
.\" host option: mysql_setpermission
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -109,10 +101,9 @@ Connect to the MySQL server on the given host\&.
.\" password option: mysql_setpermission
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
-The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
+The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -158,12 +149,12 @@ localhost, the Unix socket file to use\&.
.\" user option: mysql_setpermission
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -172,8 +163,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1
index 5b85d51acd1..1b002a62ea2 100644
--- a/man/mysql_tzinfo_to_sql.1
+++ b/man/mysql_tzinfo_to_sql.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_tzinfo_to_sql\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_TZINFO_TO_S" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -36,8 +29,7 @@ zoneinfo
database (the set of files describing time zones)\&. Examples of such systems are Linux, FreeBSD, Solaris, and Mac OS X\&. One likely location for these files is the
/usr/share/zoneinfo
directory (/usr/share/lib/zoneinfo
-on Solaris)\&. If your system does not have a zoneinfo database, you can use the downloadable package described in
-Section\ \&9.6, \(lqMySQL Server Time Zone Support\(rq\&.
+on Solaris)\&.
.PP
\fBmysql_tzinfo_to_sql\fR
can be invoked several ways:
@@ -113,7 +105,7 @@ After running
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -122,8 +114,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1
index 6349f927e09..3948a670436 100644
--- a/man/mysql_upgrade.1
+++ b/man/mysql_upgrade.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_upgrade\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,27 +15,23 @@
.\" upgrading MySQL
.\" MySQL: upgrading
.SH "NAME"
-mysql_upgrade \- check tables for MySQL upgrade
+mysql_upgrade \- check tables for MariaDB upgrade
.SH "SYNOPSIS"
.HP \w'\fBmysql_upgrade\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBmysql_upgrade [\fR\fB\fIoptions\fR\fR\fB]\fR
.SH "DESCRIPTION"
.PP
\fBmysql_upgrade\fR
-examines all tables in all databases for incompatibilities with the current version of MySQL Server\&.
+examines all tables in all databases for incompatibilities with the current version of the MariaDB Server\&.
\fBmysql_upgrade\fR
also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added\&.
.PP
\fBmysql_upgrade\fR
-should be executed each time you upgrade MySQL\&. It supersedes the older
-\fBmysql_fix_privilege_tables\fR
-script, which should no longer be used\&.
+should be executed each time you upgrade MariaDB\&.
.PP
If a table is found to have a possible incompatibility,
\fBmysql_upgrade\fR
-performs a table check\&. If any problems are found, a table repair is attempted\&. If the table cannot be repaired, see
-Section\ \&2.4.4, \(lqRebuilding or Repairing Tables or Indexes\(rq
-for manual table repair strategies\&.
+performs a table check\&. If any problems are found, a table repair is attempted\&.
.if n \{\
.sp
.\}
@@ -74,14 +63,9 @@ with administrator privileges\&. You can do this by running a Command Prompt as
.ps -1
.br
.PP
-You should always back up your current MySQL installation
+You should always back up your current MariaDB installation
\fIbefore\fR
-performing an upgrade\&. See
-Section\ \&6.2, \(lqDatabase Backup Methods\(rq\&.
-.PP
-Some upgrade incompatibilities may require special handling before you upgrade your MySQL installation and run
-\fBmysql_upgrade\fR\&. See
-Section\ \&2.4.1, \(lqUpgrading MySQL\(rq, for instructions on determining whether any such incompatibilities apply to your installation and how to handle them\&.
+performing an upgrade\&.
.sp .5v
.RE
.PP
@@ -149,8 +133,7 @@ option entails, see the description of the
FOR UPGRADE
option of the
CHECK TABLE
-statement (see
-Section\ \&12.4.2.3, \(lqCHECK TABLE Syntax\(rq)\&.
+statement\&.
.RE
.sp
.RS 4
@@ -168,52 +151,25 @@ that contains SQL statements to upgrade the tables in the
mysql
database\&.
.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-Prior to MySQL 5\&.1\&.31,
-\fBmysql_upgrade\fR
-does not run the second
-\fBmysqlcheck\fR
-command, which is necessary to re\-encode database or table names that contain nonalphanumeric characters\&. (They still appear after the upgrade with the
-#mysql50#
-prefix described in
-Section\ \&8.2.3, \(lqMapping of Identifiers to File Names\(rq\&.) If you have such database or table names, execute the second
-\fBmysqlcheck\fR
-command manually after executing
-\fBmysql_upgrade\fR\&.
-.RE
.PP
-All checked and repaired tables are marked with the current MySQL version number\&. This ensures that next time you run
+All checked and repaired tables are marked with the current MariaDB version number\&. This ensures that next time you run
\fBmysql_upgrade\fR
with the same version of the server, it can tell whether there is any need to check or repair the table again\&.
.\" mysql_upgrade_info file: mysql_upgrade
.\" mysql_upgrade: mysql_upgrade_info file
.PP
\fBmysql_upgrade\fR
-also saves the MySQL version number in a file named
+also saves the MariaDB version number in a file named
mysql_upgrade_info
in the data directory\&. This is used to quickly check whether all tables have been checked for this release so that table\-checking can be skipped\&. To ignore this file and perform the check regardless, use the
\fB\-\-force\fR
option\&.
.PP
-If you install MySQL from RPM packages on Linux, you must install the server and client RPMs\&.
+If you install MariaDB from RPM packages on Linux, you must install the server and client RPMs\&.
\fBmysql_upgrade\fR
is included in the server RPM but requires the client RPM because the latter includes
-\fBmysqlcheck\fR\&. (See
-Section\ \&2.6.1, \(lqInstalling MySQL from RPM Packages on Linux\(rq\&.)
+\fBmysqlcheck\fR\&.
.PP
-In MySQL 5\&.1\&.7,
-\fBmysql_upgrade \fR
-was added as a shell script and worked only for Unix systems\&. As of MySQL 5\&.1\&.10,
-\fBmysql_upgrade\fR
-is an executable binary and is available on all systems\&.
.PP
\fBmysql_upgrade\fR
supports the following options, which can be specified on the command line or in the
@@ -225,8 +181,7 @@ option file groups\&. Other options are passed to
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR
option\&.
\fBmysql_upgrade\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option files\&.
.sp
.RS 4
.ie n \{\
@@ -238,7 +193,8 @@ Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\
.\}
.\" mysql_upgrade: help option
.\" help option: mysql_upgrade
-\fB\-\-help\fR
+\fB\-\-help\fR,
+\fB\-?\fR
.sp
Display a short help message and exit\&.
.RE
@@ -255,7 +211,22 @@ Display a short help message and exit\&.
.\" basedir option: mysql_upgrade
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL installation directory\&. This option is accepted for backward compatibility but ignored\&.
+Old option accepted for backward compatibility but ignored\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: character-sets-dir option
+.\" character-sets-dir option: mysql_upgrade
+\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
+.sp
+Old option accepted for backward compatibility but ignored\&.
.RE
.sp
.RS 4
@@ -270,7 +241,23 @@ The path to the MySQL installation directory\&. This option is accepted for back
.\" datadir option: mysql_upgrade
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
.sp
-The path to the data directory\&. This option is accepted for backward compatibility but ignored\&.
+Old option accepted for backward compatibility but ignored\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: debug option
+.\" debug option: mysql_upgrade
+\fB\-\-debug=\fR\fB\fIpath\fR\fR,
+\fB\-# \fIpath\fR\fR
+.sp
+For debug builds, output debug log\&.
.RE
.sp
.RS 4
@@ -285,7 +272,7 @@ The path to the data directory\&. This option is accepted for backward compatibi
.\" debug-check option: mysql_upgrade
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -301,7 +288,22 @@ Print some debugging information when the program exits\&. This option was added
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: default-character-set option
+.\" default-character-set option: mysql_upgrade
+\fB\-\-default\-character\-set=\fR\fB\fIname\fR\fR
+.sp
+Old option accepted for backward compatibility but ignored\&.
.RE
.sp
.RS 4
@@ -322,7 +324,256 @@ file and force execution of
\fBmysqlcheck\fR
even if
\fBmysql_upgrade\fR
-has already been executed for the current version of MySQL\&.
+has already been executed for the current version of MariaDB\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: host option
+.\" host option: mysql_upgrade
+\fB\-\-host\fR
+.sp
+Connect to MariaDB on the given host\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: password option
+.\" password option: mysql_upgrade
+\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
+\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
+.sp
+The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you
+\fIcannot\fR
+have a space between the option and the password\&. If you omit the
+\fIpassword\fR
+value following the
+\fB\-\-password\fR
+or
+\fB\-p\fR
+option on the command line,
+\fBmysql_upgrade\fR
+prompts for one\&.
+.sp
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: port option
+.\" port option: mysql_upgrade
+\fB\-\-port=\fR\fB\fIport_num\fR\fR,
+\fB\-P \fR\fB\fIport_num\fR\fR
+.sp
+The TCP/IP port number to use for the connection\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: protocol option
+.\" protocol option: mysql_upgrade
+\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
+.sp
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: silent option
+.\" silent option: mysql_upgrade
+\fB\-\-silent\fR
+.sp
+Print less information\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: socket option
+.\" socket option: mysql_upgrade
+\fB\-\-socket=\fR\fB\fIpath\fR\fR,
+\fB\-S \fR\fB\fIpath\fR\fR
+.sp
+For connections to
+localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL options
+.\" SSL options: mysql_upgrade
+\fB\-\-ssl\fR
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL CA option
+.\" SSL CA option: mysql_upgrade
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL CA Path option
+.\" SSL CA Path option: mysql_upgrade
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Cert option
+.\" SSL Cert option: mysql_upgrade
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Cipher option
+.\" SSL Cipher option: mysql_upgrade
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Key option
+.\" SSL Key option: mysql_upgrade
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Crl option
+.\" SSL CRL option: mysql_upgrade
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Crlpath option
+.\" SSL Crlpath option: mysql_upgrade
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysql_upgrade
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -338,7 +589,23 @@ has already been executed for the current version of MySQL\&.
\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR,
\fB\-t \fR\fB\fIpath\fR\fR
.sp
-The path name of the directory to use for creating temporary files\&. This option was added in MySQL 5\&.1\&.25\&.
+The path name of the directory to use for creating temporary files\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: upgrade-system-tables option
+.\" upgrade-system-tables option: mysql_upgrade
+\fB\-\-upgrade\-system\-tables\fR\fR,
+\fB\-s \fR
+.sp
+Only upgrade the system tables in the mysql database\&. Tables in other databases are not checked or touched\&.
.RE
.sp
.RS 4
@@ -354,8 +621,7 @@ The path name of the directory to use for creating temporary files\&. This optio
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&. The default user name is
-root\&.
+The MariaDB user name to use when connecting to the server and not using the current login\&.
.RE
.sp
.RS 4
@@ -370,7 +636,45 @@ root\&.
.\" verbose option: mysql_upgrade
\fB\-\-verbose\fR
.sp
-Verbose mode\&. Print more information about what the program does\&.
+Display more output about the process\&. Using it twice will print connection
+arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE
+commands used during the check phase; using it 4 times (added in MariaDB 10.0.14)
+will also write out all mysqlcheck commands used\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: version option
+.\" version option: mysql_upgrade
+\fB\-\-version\fR,
+\fB\-V\fR
+.sp
+Output version information and exit\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysql_upgrade: version-check option
+.\" version-check option: mysql_upgrade
+\fB\-\-version\-check\fR,
+\fB\-k\fR
+.sp
+Run this program only if its 'server version' matches the version
+of the server to which it's connecting. Note: the 'server version'
+of the program is the version of the MariaDB server with which
+it was built/distributed. Defaults to on; use \fB\-\-skip\-version\-check\fR to disable\&.
.RE
.sp
.RS 4
@@ -389,13 +693,11 @@ Cause binary logging to be enabled while
\fBmysql_upgrade\fR
runs\&. This is the default behavior; to disable binary logging during the upgrade, use the inverse of this option (that is, start the program with
\fB\-\-skip\-write\-binlog\fR)\&.
-.sp
-This option was introduced in MySQL 5\&.1\&.40\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -404,8 +706,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_waitpid.1 b/man/mysql_waitpid.1
index b767fd6ad38..88f41d97f2d 100644
--- a/man/mysql_waitpid.1
+++ b/man/mysql_waitpid.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_waitpid\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -120,7 +113,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -129,8 +122,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysql_zap.1 b/man/mysql_zap.1
index f2a261b47a0..186cfeb77d7 100644
--- a/man/mysql_zap.1
+++ b/man/mysql_zap.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysql_zap\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQL_ZAP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQL_ZAP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -116,7 +109,7 @@ Test mode\&. Display information about each process but do not kill it\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -125,8 +118,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1
index 9833b3f5e6a..c8f9b97edea 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlaccess\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLACCESS\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -27,7 +20,7 @@ mysqlaccess \- client for checking access privileges
.SH "DESCRIPTION"
.PP
\fBmysqlaccess\fR
-is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. Note that
+is a diagnostic tool written by Yves Carlier\&. It checks the access privileges for a host name, user name, and database combination\&. Note that
\fBmysqlaccess\fR
checks access using only the
user,
@@ -197,9 +190,8 @@ Display some examples that show how to use
.\" old_server option: mysqlaccess
\fB\-\-old_server\fR
.sp
-Assume that the server is an old MySQL server (before MySQL 3\&.21) that does not yet know how to handle full
-WHERE
-clauses\&.
+Connect to a very old MySQL server (before MySQL 3\&.21) that does not know how to handle full
+WHERE clauses\&.
.RE
.sp
.RS 4
@@ -287,7 +279,7 @@ Display the release notes\&.
\fB\-\-rhost=\fR\fB\fIhost_name\fR\fR,
\fB\-H \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -396,7 +388,7 @@ The user name to use in the access privileges\&.
Display version information and exit\&.
.RE
.PP
-If your MySQL distribution is installed in some nonstandard location, you must change the location where
+If your MariaDB distribution is installed in some non\-standard location, you must change the location where
\fBmysqlaccess\fR
expects to find the
\fBmysql\fR
@@ -423,7 +415,7 @@ error will occur when you run
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -432,8 +424,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1
index 25b561ffdce..e2b1753ff9f 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqladmin\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,7 +15,7 @@
.\" administration: server
.\" server administration
.SH "NAME"
-mysqladmin \- client for administering a MySQL server
+mysqladmin \- client for administering a MariaB server
.SH "SYNOPSIS"
.HP \w'\fBmysqladmin\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]\ [\fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]]\ \&.\&.\&.\fR\ 'u
\fBmysqladmin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB] [\fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB]] \&.\&.\&.\fR
@@ -74,8 +67,7 @@ debug
.sp
Tell the server to write debug information to the error log\&.
.sp
-Beginning with MySQL 5\&.1\&.12, this includes information about the Event Scheduler\&. See
-Section\ \&19.4.5, \(lqEvent Scheduler Status\(rq\&.
+This also includes information about the Event Scheduler\&.
.RE
.sp
.RS 4
@@ -210,8 +202,7 @@ old\-password \fInew\-password\fR
.sp
This is like the
password
-command but stores the password using the old (pre\-4\&.1) password\-hashing format\&. (See
-Section\ \&5.3.2.3, \(lqPassword Hashing in MySQL\(rq\&.)
+command but stores the password using the old (pre MySQL 4\&.1) password\-hashing format\&.
.RE
.sp
.RS 4
@@ -303,8 +294,7 @@ SHOW PROCESSLIST
statement\&. If the
\fB\-\-verbose\fR
option is given, the output is like that of
-SHOW FULL PROCESSLIST\&. (See
-Section\ \&12.4.5.31, \(lqSHOW PROCESSLIST Syntax\(rq\&.)
+SHOW FULL PROCESSLIST\&.
.RE
.sp
.RS 4
@@ -448,7 +438,7 @@ command result displays the following values:
.\" uptime
Uptime
.sp
-The number of seconds the MySQL server has been running\&.
+The number of seconds the MariaDB server has been running\&.
.RE
.sp
.RS 4
@@ -492,8 +482,7 @@ Slow queries
.sp
The number of queries that have taken more than
long_query_time
-seconds\&. See
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq\&.
+seconds\&.
.RE
.sp
.RS 4
@@ -555,7 +544,7 @@ The number of tables that currently are open\&.
Memory in use
.sp
The amount of memory allocated directly by
-\fBmysqld\fR\&. This value is displayed only when MySQL has been compiled with
+\fBmysqld\fR\&. This value is displayed only when MariaDB has been compiled with
\fB\-\-with\-debug=full\fR\&.
.RE
.sp
@@ -571,7 +560,7 @@ The amount of memory allocated directly by
Maximum memory used
.sp
The maximum amount of memory allocated directly by
-\fBmysqld\fR\&. This value is displayed only when MySQL has been compiled with
+\fBmysqld\fR\&. This value is displayed only when MariaDB has been compiled with
\fB\-\-with\-debug=full\fR\&.
.RE
.PP
@@ -591,9 +580,6 @@ supports the following options, which can be specified on the command line or in
and
[client]
option file groups\&.
-\fBmysqladmin\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.sp
.RS 4
.ie n \{\
@@ -608,7 +594,7 @@ Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\
\fB\-\-help\fR,
\fB\-?\fR
.sp
-Display a help message and exit\&.
+Display help and exit\&.
.RE
.sp
.RS 4
@@ -623,8 +609,7 @@ Display a help message and exit\&.
.\" character-sets-dir option: mysqladmin
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -708,7 +693,7 @@ string is
.\" debug-check option: mysqladmin
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Check memory and open file usage at exit.\&.
.RE
.sp
.RS 4
@@ -723,7 +708,22 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqladmin
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: default-auth option
+.\" default-auth option: mysqladmin
+\fB\-\-default\-auth\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -740,8 +740,7 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Use
\fIcharset_name\fR
-as the default character set\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+as the default character set\&.
.RE
.sp
.RS 4
@@ -806,7 +805,7 @@ command\&. With multiple commands, continue even if an error occurs\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -822,7 +821,7 @@ Connect to the MySQL server on the given host\&.
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
-Suppress the warning beep that is emitted by default for errors such as a failure to connect to the server\&. This option was added in MySQL 5\&.1\&.17\&.
+Suppress the warning beep that is emitted by default for errors such as a failure to connect to the server\&.
.RE
.sp
.RS 4
@@ -865,8 +864,7 @@ option on the command line,
\fBmysqladmin\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&.
.RE
.sp
.RS 4
@@ -898,7 +896,8 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
-The TCP/IP port number to use for the connection\&.
+The TCP/IP port number to use for the connection or 0 for default to,
+in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&.
.RE
.sp
.RS 4
@@ -928,8 +927,7 @@ Print the program argument list and exit\&. This must be given as the first argu
.\" protocol option: mysqladmin
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -1034,12 +1032,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.\}
.\" mysqladmin: SSL options
.\" SSL options: mysqladmin
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA option
+.\" SSL CA option: mysqladmin
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA Path option
+.\" SSL CA Path option: mysqladmin
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cert option
+.\" SSL Cert option: mysqladmin
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cipher option
+.\" SSL Cipher option: mysqladmin
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Key option
+.\" SSL Key option: mysqladmin
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crl option
+.\" SSL CRL option: mysqladmin
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crlpath option
+.\" SSL Crlpath option: mysqladmin
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqladmin
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -1055,7 +1178,7 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -1127,9 +1250,6 @@ value is given, it indicates the number of times to retry\&. The default is one
.PP
You can also set the following variables by using
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
-The
-\fB\-\-set\-variable\fR
-format is deprecated and is removed in MySQL 5\&.5\&. syntax:
.sp
.RS 4
.ie n \{\
@@ -1163,7 +1283,7 @@ The maximum number of seconds to wait for server shutdown\&. The default value i
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -1172,8 +1292,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1
index 5e9bc6c2f43..15c371a9913 100644
--- a/man/mysqlbinlog.1
+++ b/man/mysqlbinlog.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlbinlog\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -32,9 +25,7 @@ that describe modifications to database contents\&. The server writes these file
\fBmysqlbinlog\fR
utility\&. You can also use
\fBmysqlbinlog\fR
-to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in
-Section\ \&5.2.4, \(lqThe Binary Log\(rq, and
-Section\ \&16.2.2, \(lqReplication Relay and Status Files\(rq\&.
+to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&.
.PP
Invoke
\fBmysqlbinlog\fR
@@ -64,8 +55,7 @@ shell> \fBmysqlbinlog binlog\&.0000003\fR
.\}
.PP
The output includes events contained in
-binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. See
-Section\ \&16.1.2, \(lqReplication Formats\(rq, for information about logging modes\&.
+binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&.
.PP
Events are preceded by header comments that provide additional information\&. For example:
.sp
@@ -102,12 +92,11 @@ indicates the result from executing the event\&. Zero means that no error occurr
The output from
\fBmysqlbinlog\fR
can be re\-executed (for example, by using it as input to
-\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section and
-Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq\&.
+\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section\&.
.PP
Normally, you use
\fBmysqlbinlog\fR
-to read binary log files directly and apply them to the local MySQL server\&. It is also possible to read binary logs from a remote server by using the
+to read binary log files directly and apply them to the local MariaDB server\&. It is also possible to read binary logs from a remote server by using the
\fB\-\-read\-from\-remote\-server\fR
option\&. To read remote binary logs, the connection parameter options can be given to indicate how to connect to the server\&. These options are
\fB\-\-host\fR,
@@ -125,9 +114,6 @@ supports the following options, which can be specified on the command line or in
and
[client]
option file groups\&.
-\fBmysqlbinlog\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.sp
.RS 4
.ie n \{\
@@ -211,7 +197,7 @@ displays
BINLOG
statements whenever possible\&. This is the implied value if the option is given as
\fB\-\-base64\-output\fR
-without a value\&.
+without a value\&. Both ALWAYS and not giving a value are deprecated.
.RE
.sp
.RS 4
@@ -255,17 +241,14 @@ NEVER, it does not exit with an error if a row event is found\&.
.RS 4
The
\fB\-\-base64\-output\fR
-option was introduced in MySQL 5\&.1\&.5, to be given as
+can be given as
\fB\-\-base64\-output\fR
or
\fB\-\-skip\-base64\-output\fR
(with the sense of
AUTO
or
-NEVER)\&. The option values described in the preceding list may be used as of MySQL 5\&.1\&.24, with the exception of
-UNSPEC
-and
-DECODE\-ROWS, which are available as of MySQL 5\&.1\&.28\&.
+NEVER)\&.
.sp
For examples that show the effect of
\fB\-\-base64\-output\fR
@@ -274,6 +257,22 @@ and
on row event output, see
the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&.
.RE
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlbinlog: binlog-row-event-max-size option
+.\" binlog-row-event-max-size option: mysqlbinlog
+\fB\-\-binlog\-row\-event\-max\-size\=\fR\fB\fIpath\fR\fR
+.sp
+The directory where character sets are installed\&.
+.RE
.sp
.RS 4
.ie n \{\
@@ -287,8 +286,7 @@ the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&.
.\" character-sets-dir option: mysqlbinlog
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -308,7 +306,7 @@ This option causes
\fBmysqlbinlog\fR
to output entries from the binary log (local log only) that occur while
\fIdb_name\fR
-is been selected as the default database by
+has been selected as the default database by
USE\&.
.sp
The
@@ -452,10 +450,11 @@ USE\&. (In particular, no cross\-database updates should be used\&.)
.br
This option did not work correctly for
\fBmysqlbinlog\fR
-with row\-based logging prior to MySQL 5\&.1\&.37\&. (\m[blue]\fBBug#42941\fR\m[]\&\s-2\u[1]\d\s+2)
+with row\-based logging prior to MySQL 5\&.1\&.37\&.
.sp .5v
.RE
.RE
+.RE
.sp
.RS 4
.ie n \{\
@@ -489,7 +488,7 @@ string is
.\" debug-check option: mysqlbinlog
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -504,7 +503,52 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqlbinlog
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlbinlog: defaults-extra-file option
+.\" defaults-extra-file option: mysqlbinlog
+\fB\-\-defaults\-extra\-file=\fR\fB\fIname\fR
+.sp
+Read this file after the global files are read\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlbinlog: defaults-file option
+.\" defaults-file option: mysqlbinlog
+\fB\-\-defaults\-file=\fR\fB\fIname\fR
+.sp
+Only read default options from the given file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlbinlog: default-auth option
+.\" default-auth option: mysqlbinlog
+\fB\-\-default\-auth=\fR\fB\fIname\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -522,7 +566,7 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Disable binary logging\&. This is useful for avoiding an endless loop if you use the
\fB\-\-to\-last\-log\fR
-option and are sending the output to the same MySQL server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&.
+option and are sending the output to the same MariaDB server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&.
.sp
This option requires that you have the
SUPER
@@ -545,6 +589,21 @@ privilege\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlbinlog: force-if-open option
+.\" force-if-open option: mysqlbinlog
+\fB\-\-force\-if\-open\fR
+.sp
+Force if binlog was not closed properly. Defaults to on; use \fB--skip-force-if-open\fR to disable\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlbinlog: force-read option
.\" force-read option: mysqlbinlog
\fB\-\-force\-read\fR,
@@ -571,7 +630,7 @@ stops if it reads such an event\&.
\fB\-H\fR
.sp
Display a hex dump of the log in comments, as described in
-the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&. This option was added in MySQL 5\&.1\&.2\&.
+the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&.
.RE
.sp
.RS 4
@@ -587,7 +646,7 @@ the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Get the binary log from the MySQL server on the given host\&.
+Get the binary log from the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -616,6 +675,21 @@ in the specified directory\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlbinlog: no-defaults option
+.\" no-defaults option: mysqlbinlog
+\fB\-\-no\-defaults\fR
+.sp
+Don't read default options from any option file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlbinlog: offset option
.\" offset option: mysqlbinlog
\fB\-\-offset=\fR\fB\fIN\fR\fR,
@@ -651,8 +725,8 @@ option on the command line,
\fBmysqlbinlog\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You
+can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -663,12 +737,11 @@ Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: port option
-.\" port option: mysqlbinlog
-\fB\-\-port=\fR\fB\fIport_num\fR\fR,
-\fB\-P \fR\fB\fIport_num\fR\fR
+.\" mysqlbinlog: plugin-dir option
+.\" plugin-dir option: mysqlbinlog
+\fB\-\-plugin\-dir=\fIdir_name\fR
.sp
-The TCP/IP port number to use for connecting to a remote server\&.
+Directory for client-side plugins\&.
.RE
.sp
.RS 4
@@ -679,15 +752,29 @@ The TCP/IP port number to use for connecting to a remote server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: position option
-.\" position option: mysqlbinlog
-\fB\-\-position=\fR\fB\fIN\fR\fR
+.\" mysqlbinlog: print-defaults option
+.\" print-defaults option: mysqlbinlog
+\fB\-\-print\-defaults\fR
.sp
-Deprecated\&. Use
-\fB\-\-start\-position\fR
-instead\&.
-\fB\-\-position\fR
-is removed in MySQL 5\&.5\&.
+Print the program argument list from all option files and exit\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlbinlog: port option
+.\" port option: mysqlbinlog
+\fB\-\-port=\fR\fB\fIport_num\fR\fR,
+\fB\-P \fR\fB\fIport_num\fR\fR
+.sp
+The TCP/IP port number to use for connecting to a remote server,
+or \fB0\fR for default to, in order of preference, \fBmy.cnf\fR,
+\fB$MYSQL_TCP_PORT\fR, \fB/etc/services\fR, \fRbuilt-in default (3306)\fR\&.
.RE
.sp
.RS 4
@@ -702,8 +789,7 @@ is removed in MySQL 5\&.5\&.
.\" protocol option: mysqlbinlog
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -735,7 +821,7 @@ Sets the open_files_limit variable, which is used to reserve file descriptors fo
\fB\-\-read\-from\-remote\-server\fR,
\fB\-R\fR
.sp
-Read the binary log from a MySQL server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are
+Read the binary log from a MariaDB server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are
\fB\-\-host\fR,
\fB\-\-password\fR,
\fB\-\-port\fR,
@@ -770,11 +856,37 @@ Direct output to the given file\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlbinlog: rewrite-db option
+.\" rewrite-db option: mysqlbinlog
+\fB\-\-rewrite\-db=\fR\fB\fIname\fR\fR,
+\fB\-r \fR\fB\fIname\fR\fR
+.sp
+Updates to a database with a different name than the original.
+Example: \fBrewrite-db='from->to'\fR\&. For events that are
+binlogged as statements, rewriting the database constitutes changing a
+statement's default database from \fIdb1\fB to \fIdb2\fR\&. There is no statement
+analysis or rewrite of any kind, that is, if one specifies \fB"db1.tbl"\fR
+in the statement explicitly, that occurrence won't be changed to
+\fB"db2.tbl"\fR\&. Row-based events are rewritten correctly to use the new
+database name\&. Filtering (e.g. with \fB--database=name\fR) happens after
+the database rewrites have been performed\&. If you use this option on the
+command line and \fB">"\fR has a special meaning to your command interpreter,
+quote the value (e.g. \fB--rewrite-db="oldname->newname"\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlbinlog: server-id option
.\" server-id option: mysqlbinlog
\fB\-\-server\-id=\fR\fB\fIid\fR\fR
.sp
-Display only those events created by the server having the given server ID\&. This option is available as of MySQL 5\&.1\&.4\&.
+Display only those events created by the server having the given server ID\&.
.RE
.sp
.RS 4
@@ -791,7 +903,7 @@ Display only those events created by the server having the given server ID\&. Th
.sp
Add a
SET NAMES \fIcharset_name\fR
-statement to the output to specify the character set to be used for processing log files\&. This option was added in MySQL 5\&.1\&.12\&.
+statement to the output to specify the character set to be used for processing log files\&.
.RE
.sp
.RS 4
@@ -807,7 +919,10 @@ statement to the output to specify the character set to be used for processing l
\fB\-\-short\-form\fR,
\fB\-s\fR
.sp
-Display only the statements contained in the log, without any extra information\&.
+Display only the statements contained in the log, no extra info
+and no row-based events\&. This is for testing only, and should
+not be used in production systems. If you want to suppress
+base64-output, consider using \fB--base64-output=never\fR instead\&.
.RE
.sp
.RS 4
@@ -854,14 +969,13 @@ data types\&. For example:
.RS 4
.\}
.nf
-shell> \fBmysqlbinlog \-\-start\-datetime="2005\-12\-25 11:25:56" binlog\&.000003\fR
+shell> \fBmysqlbinlog \-\-start\-datetime="2014\-12\-25 11:25:56" binlog\&.000003\fR
.fi
.if n \{\
.RE
.\}
.sp
-This option is useful for point\-in\-time recovery\&. See
-Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
+This option is useful for point\-in\-time recovery\&.
.RE
.sp
.RS 4
@@ -880,8 +994,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
Start reading the binary log at the first event having a position equal to or greater than
\fIN\fR\&. This option applies to the first log file named on the command line\&.
.sp
-This option is useful for point\-in\-time recovery\&. See
-Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
+This option is useful for point\-in\-time recovery\&.
.RE
.sp
.RS 4
@@ -904,8 +1017,7 @@ option for information about the
\fIdatetime\fR
value\&.
.sp
-This option is useful for point\-in\-time recovery\&. See
-Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
+This option is useful for point\-in\-time recovery\&.
.RE
.sp
.RS 4
@@ -923,8 +1035,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
Stop reading the binary log at the first event having a position equal to or greater than
\fIN\fR\&. This option applies to the last log file named on the command line\&.
.sp
-This option is useful for point\-in\-time recovery\&. See
-Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
+This option is useful for point\-in\-time recovery\&.
.RE
.sp
.RS 4
@@ -940,7 +1051,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
\fB\-\-to\-last\-log\fR,
\fB\-t\fR
.sp
-Do not stop at the end of the requested binary log from a MySQL server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MySQL server, this may lead to an endless loop\&. This option requires
+Do not stop at the end of the requested binary log from a MariaDB server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MariaDB server, this may lead to an endless loop, so this option requires
\fB\-\-read\-from\-remote\-server\fR\&.
.RE
.sp
@@ -957,7 +1068,7 @@ Do not stop at the end of the requested binary log from a MySQL server, but rath
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to a remote server\&.
+The MariaDB username to use when connecting to a remote server\&.
.RE
.sp
.RS 4
@@ -973,7 +1084,7 @@ The MySQL user name to use when connecting to a remote server\&.
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
-Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&. This option was added in MySQL 5\&.1\&.28\&.
+Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&.
.sp
For examples that show the effect of
\fB\-\-base64\-output\fR
@@ -1021,8 +1132,8 @@ You can pipe the output of
\fBmysqlbinlog\fR
into the
\fBmysql\fR
-client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old backup (see
-Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq)\&. For example:
+client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old
+backup\&. For example:
.sp
.if n \{\
.RS 4
@@ -1073,7 +1184,7 @@ option, it displays only those events with an offset in the binary log greater t
option (to be able to say, for example,
\(lqroll forward my databases to how they were today at 10:30 a\&.m\&.\(rq)\&.
.PP
-If you have more than one binary log to execute on the MySQL server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be
+If you have more than one binary log to execute on the MariaDB server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be
\fIunsafe\fR:
.sp
.if n \{\
@@ -1145,8 +1256,7 @@ LOAD DATA LOCAL INFILE
statements (that is, it adds
LOCAL), both the client and the server that you use to process the statements must be configured with the
LOCAL
-capability enabled\&. See
-Section\ \&5.3.5, \(lqSecurity Issues with LOAD DATA LOCAL\(rq\&.
+capability enabled\&.
.if n \{\
.sp
.\}
@@ -1591,7 +1701,7 @@ type codes\&. The
\fB\-\-base64\-output=DECODE\-ROWS\fR
and
\fB\-\-verbose\fR
-options may be used to affect row event output\&. These options are available as of MySQL 5\&.1\&.28\&.
+options may be used to affect row event output\&.
.PP
Suppose that the server is using row\-based binary logging and that you execute the following sequence of statements:
.sp
@@ -1952,7 +2062,7 @@ option can be used to prevent this header from being written\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -1967,8 +2077,6 @@ Bug#42941
\%http://bugs.mysql.com/bug.php?id=42941
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlbug.1 b/man/mysqlbug.1
index 32829a073dc..fc22162ebe9 100644
--- a/man/mysqlbug.1
+++ b/man/mysqlbug.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlbug\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLBUG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLBUG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -26,10 +19,12 @@ mysqlbug \- generate bug report
\fBmysqlbug\fR
.SH "DESCRIPTION"
.PP
-This program enables you to generate a bug report and send it to Oracle Corporation\&. It is a shell script and runs on Unix\&.
+To report MariaDB bugs, see https://mariadb.com/kb/en/mariadb/reporting-bugs/ - the mysqlbug program has now been deprecated by Oracle, and was never useful for MariaDB.
+
+Originally, the program enabled you to generate a bug report and send it to Oracle Corporation\&. It is a shell script and runs on Unix\&.
.PP
-The normal way to report bugs is to visit
-\m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for our bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. If you have no Web access, you can generate a bug report by using the
+The normal way to report MySQL bugs is to visit
+\m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for MySQL's bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. If you have no Web access, you can generate a bug report by using the
\fBmysqlbug\fR
script\&.
.PP
@@ -62,7 +57,7 @@ will send the report by email\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -71,8 +66,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1
index 11e968db18c..c175483347c 100644
--- a/man/mysqlcheck.1
+++ b/man/mysqlcheck.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlcheck\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLCHECK\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -36,12 +29,7 @@ client performs table maintenance: It checks, repairs, optimizes, or analyzes ta
.PP
Each table is locked and therefore unavailable to other sessions while it is being processed, although for check operations, the table is locked with a
READ
-lock only (see
-Section\ \&12.3.5, \(lqLOCK TABLES and UNLOCK TABLES Syntax\(rq, for more information about
-READ
-and
-WRITE
-locks)\&. Table maintenance operations can be time\-consuming, particularly for large tables\&. If you use the
+lock only\&. Table maintenance operations can be time\-consuming, particularly for large tables\&. If you use the
\fB\-\-databases\fR
or
\fB\-\-all\-databases\fR
@@ -71,8 +59,7 @@ CHECK TABLE,
REPAIR TABLE,
ANALYZE TABLE, and
OPTIMIZE TABLE
-in a convenient way for the user\&. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed\&. For details about which storage engines each statement works with, see the descriptions for those statements in
-Section\ \&12.4.2, \(lqTable Maintenance Statements\(rq\&.
+in a convenient way for the user\&. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed\&.
.PP
The
MyISAM
@@ -100,8 +87,7 @@ note : The storage engine for the table doesn\'t support check
.PP
If
\fBmysqlcheck\fR
-is unable to repair a table, see
-Section\ \&2.4.4, \(lqRebuilding or Repairing Tables or Indexes\(rq
+is unable to repair a table, see the MariaDB Knowledge Base
for manual table repair strategies\&. This will be the case, for example, for
InnoDB
tables, which can be checked with
@@ -110,7 +96,7 @@ REPAIR TABLE\&.
.PP
The use of
\fBmysqlcheck\fR
-with partitioned tables is not supported before MySQL 5\&.1\&.27\&.
+with partitioned tables is not supported\&.
.if n \{\
.sp
.\}
@@ -193,9 +179,6 @@ supports the following options, which can be specified on the command line or in
and
[client]
option file groups\&.
-\fBmysqlcheck\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
.sp
.RS 4
.ie n \{\
@@ -290,8 +273,7 @@ If a checked table is corrupted, automatically fix it\&. Any necessary repairs a
.\" character-sets-dir option: mysqlcheck
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -348,8 +330,6 @@ option to check tables for incompatibilities with the current version of the ser
and
\fB\-\-fix\-table\-names\fR
options\&.
-\fB\-\-check\-upgrade\fR
-was added in MySQL 5\&.1\&.7\&.
.RE
.sp
.RS 4
@@ -417,7 +397,7 @@ string is
.\" debug-check option: mysqlcheck
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -432,7 +412,22 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqlcheck
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: default-auth option
+.\" default-auth option: mysqlcheck
+\fB\-\-default\-auth=\fR\fB\fIname\fR\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -449,8 +444,7 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Use
\fIcharset_name\fR
-as the default character set\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+as the default character set\&.
.RE
.sp
.RS 4
@@ -500,7 +494,8 @@ Must be given as first option\&.
.sp
If you are using this option to check tables, it ensures that they are 100% consistent but takes a long time\&.
.sp
-If you are using this option to repair tables, it runs an extended repair that may not only take a long time to execute, but may produce a lot of garbage rows also!
+If you are using this option to repair tables, it will force using the old, slow, repair with keycache method,
+instead of the much faster repair by sorting.
.RE
.sp
.RS 4
@@ -531,7 +526,7 @@ Check only tables that have not been closed properly\&.
.\" fix-db-names option: mysqlcheck
\fB\-\-fix\-db\-names\fR
.sp
-Convert database names to 5\&.1 format\&. Only database names that contain special characters are affected\&. This option was added in MySQL 5\&.1\&.7\&.
+Convert database names to the format used since MySQL 5\&.1\&. Only database names that contain special characters are affected\&.
.RE
.sp
.RS 4
@@ -546,7 +541,23 @@ Convert database names to 5\&.1 format\&. Only database names that contain speci
.\" fix-table-names option: mysqlcheck
\fB\-\-fix\-table\-names\fR
.sp
-Convert table names to 5\&.1 format\&. Only table names that contain special characters are affected\&. This option was added in MySQL 5\&.1\&.7\&. As of MySQL 5\&.1\&.23, this option also applies to views\&.
+Convert table names (including views) to the format used since MySQL 5\&.1\&. Only table names that contain special characters are affected\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: flush option
+.\" flush option: mysqlcheck
+\fB\-\-flush\fR,
+.sp
+Flush each table after check. This is useful if you don't
+want to have the checked tables take up space in the caches after the check\&.
.RE
.sp
.RS 4
@@ -578,7 +589,7 @@ Continue even if an SQL error occurs\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -655,8 +666,7 @@ option on the command line,
\fBmysqlcheck\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -683,12 +693,11 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: port option
-.\" port option: mysqlcheck
-\fB\-\-port=\fR\fB\fIport_num\fR\fR,
-\fB\-P \fR\fB\fIport_num\fR\fR
+.\" mysqlcheck: plugin-dir option
+.\" plugin-dir option: mysqlcheck
+\fB\-\-plugin\-dir=\fR\fB\fIname\fR\fR
.sp
-The TCP/IP port number to use for the connection\&.
+ Directory for client-side plugins\&.
.RE
.sp
.RS 4
@@ -699,12 +708,12 @@ The TCP/IP port number to use for the connection\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: protocol option
-.\" protocol option: mysqlcheck
-\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
+.\" mysqlcheck: port option
+.\" port option: mysqlcheck
+\fB\-\-port=\fR\fB\fIport_num\fR\fR,
+\fB\-P \fR\fB\fIport_num\fR\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The TCP/IP port number to use for the connection\&.
.RE
.sp
.RS 4
@@ -731,6 +740,51 @@ This must be given as the first argument\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlcheck: process-tables option
+.\" process-tables option: mysqlcheck
+\fB\-\-process\-tables\fR
+.sp
+Perform the requested operation on tables. Defaults to on; use \fB--skip-process-tables\fR to disable\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: process-views option
+.\" process-views option: mysqlcheck
+\fB\-\-process\-views=\fB\fIval\fR
+.sp
+Perform the requested operation (only CHECK VIEW or REPAIR VIEW). Possible values are NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlcheck: protocol option
+.\" protocol option: mysqlcheck
+\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
+.sp
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlcheck: quick option
.\" quick option: mysqlcheck
\fB\-\-quick\fR,
@@ -781,6 +835,22 @@ Silent mode\&. Print only error messages\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlcheck: skip-database option
+.\" skip-database option: mysqlcheck
+\fB\-\-skip\-database=\fB\fIdb_name\fR
+\fB\-s\fR
+.sp
+Don't process the database (case-sensitive) specified as argument\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlcheck: socket option
.\" socket option: mysqlcheck
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
@@ -798,14 +868,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: SSL options
-.\" SSL options: mysqlcheck
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
+.\" mysqladmin: SSL options
+.\" SSL options: mysqladmin
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA option
+.\" SSL CA option: mysqladmin
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA Path option
+.\" SSL CA Path option: mysqladmin
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cert option
+.\" SSL Cert option: mysqladmin
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cipher option
+.\" SSL Cipher option: mysqladmin
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Key option
+.\" SSL Key option: mysqladmin
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crl option
+.\" SSL CRL option: mysqladmin
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crlpath option
+.\" SSL Crlpath option: mysqladmin
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqladmin
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -861,7 +1056,7 @@ header is corrupted\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -878,6 +1073,13 @@ The MySQL user name to use when connecting to the server\&.
\fB\-v\fR
.sp
Verbose mode\&. Print information about the various stages of program operation\&.
+Using one \fB--verbose\fR option will give you more information about what mysqlcheck is
+doing\&.
+.sp
+Using two \fB--verbose\fR options will also give you connection information\&.
+.sp
+Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during
+the check phase\&.
.RE
.sp
.RS 4
@@ -920,12 +1122,12 @@ to cause
NO_WRITE_TO_BINLOG
to be added to the statements so that they are not logged\&. Use the
\fB\-\-skip\-write\-binlog\fR
-when these statements should not be sent to replication slaves or run when using the binary logs for recovery from backup\&. This option was added in MySQL 5\&.1\&.18\&.
+when these statements should not be sent to replication slaves or run when using the binary logs for recovery from backup\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -934,8 +1136,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqld.8 b/man/mysqld.8
index d3f5954d5e4..f9632e020ea 100644
--- a/man/mysqld.8
+++ b/man/mysqld.8
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqld\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -18,18 +11,18 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld: MySQL server
-.\" MySQL server: mysqld
+.\" mysqld: MariaDB server
+.\" MariaDB server: mysqld
.SH "NAME"
-mysqld \- the MySQL server
+mysqld \- the MariaDB server
.SH "SYNOPSIS"
.HP \w'\fBmysqld\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBmysqld [\fR\fB\fIoptions\fR\fR\fB]\fR
.SH "DESCRIPTION"
.PP
-\fBmysqld\fR, also known as MySQL Server, is the main program that does most of the work in a MySQL installation\&. MySQL Server manages access to the MySQL data directory that contains databases and tables\&. The data directory is also the default location for other information such as log files and status files\&.
+\fBmysqld\fR, also known as MariaDB Server, is the main program that does most of the work in a MariaDB installation\&. MariaDB Server manages access to the MariaDB data directory that contains databases and tables\&. The data directory is also the default location for other information such as log files and status files\&.
.PP
-When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients\&.
+When MariaDB server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients\&.
.PP
The
\fBmysqld\fR
@@ -45,15 +38,14 @@ shell> \fBmysqld \-\-verbose \-\-help\fR
.RE
.\}
.PP
-MySQL Server also has a set of system variables that affect its operation as it runs\&. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration\&. MySQL Server also has a set of status variables that provide information about its operation\&. You can monitor these status variables to access runtime performance characteristics\&.
+MariaDB Server also has a set of system variables that affect its operation as it runs\&. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration\&. MariaDB Server also has a set of status variables that provide information about its operation\&. You can monitor these status variables to access runtime performance characteristics\&.
.PP
-For a full description of MySQL Server command options, system variables, and status variables, see
-Section\ \&5.1, \(lqThe MySQL Server\(rq\&. For information about installing MySQL and setting up the initial configuration, see
-Chapter\ \&2, Installing and Upgrading MySQL\&.
+For a full description of MariaDB Server command options, system variables, and status variables, see
+the MariaDB Knowledge Base\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -62,8 +54,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1
index 07ffa2fd6b4..3f540944c61 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqld_multi\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -23,7 +16,7 @@
.\" scripts
.\" multi mysqld
.SH "NAME"
-mysqld_multi \- manage multiple MySQL servers
+mysqld_multi \- manage multiple MariaDB servers
.SH "SYNOPSIS"
.HP \w'\fBmysqld_multi\ [\fR\fB\fIoptions\fR\fR\fB]\ {start|stop|report}\ [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB]\ \&.\&.\&.]\fR\ 'u
\fBmysqld_multi [\fR\fB\fIoptions\fR\fR\fB] {start|stop|report} [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB] \&.\&.\&.]\fR
@@ -32,8 +25,7 @@ mysqld_multi \- manage multiple MySQL servers
\fBmysqld_multi\fR
is designed to manage several
\fBmysqld\fR
-processes that listen for connections on different Unix socket files and TCP/IP ports\&. It can start or stop servers, or report their current status\&. The MySQL Instance Manager is an alternative means of managing multiple servers (see
-\fBmysqlmanager\fR(8))\&.
+processes that listen for connections on different Unix socket files and TCP/IP ports\&. It can start or stop servers, or report their current status\&.
.PP
\fBmysqld_multi\fR
searches for groups named
@@ -50,9 +42,7 @@ can be any positive integer\&. This number is referred to in the following discu
to specify which servers you want to start, stop, or obtain a status report for\&. Options listed in these groups are the same that you would use in the
[mysqld]
group used for starting
-\fBmysqld\fR\&. (See, for example,
-Section\ \&2.13.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see
-Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&.
+\fBmysqld\fR\&. However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&.
.PP
To invoke
\fBmysqld_multi\fR, use the following syntax:
@@ -136,7 +126,6 @@ shell> \fBmysqld_multi \-\-example\fR
.RE
.\}
.PP
-As of MySQL 5\&.1\&.18,
\fBmysqld_multi\fR
searches for option files as follows:
.sp
@@ -183,16 +172,6 @@ Otherwise, option files in the standard list of locations are read, including an
option, if one is given\&. (If the option is given multiple times, the last value is used\&.)
.RE
.PP
-Before MySQL 5\&.1\&.18, the preceding options are not recognized\&. Files in the standard locations are read, and any file named by the
-\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR
-option, if one is given\&. A file named by
-\fB\-\-config\-file\fR
-is read only for
-[mysqld\fIN\fR]
-option groups, not the
-[mysqld_multi]
-group\&.
-.PP
Option files read are searched for
[mysqld_multi]
and
@@ -207,7 +186,7 @@ groups can be used for options passed to specific
\fBmysqld\fR
instances\&.
.PP
-As of MySQL 5\&.1\&.35, the
+The
[mysqld]
or
[mysqld_safe]
@@ -220,11 +199,7 @@ option to use a different configuration file for that instance, in which case th
[mysqld]
or
[mysqld_safe]
-groups from that file will be used for that instance\&. Before MySQL 5\&.1\&.35, some versions of
-\fBmysqld_multi\fR
-pass the
-\fB\-\-no\-defaults\fR
-options to instances, so these techniques are inapplicable\&.
+groups from that file will be used for that instance\&.
.PP
\fBmysqld_multi\fR
supports the following options\&.
@@ -252,38 +227,6 @@ Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: config-file option
-.\" config-file option: mysqld_multi
-\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR
-.sp
-As of MySQL 5\&.1\&.18, this option is deprecated\&. If given, it is treated the same way as
-\fB\-\-defaults\-extra\-file\fR, described earlier\&.
-\fB\-\-config\-file\fR
-is removed in MySQL 5\&.5\&.
-.sp
-Before MySQL 5\&.1\&.18, this option specifies the name of an extra option file\&. It affects where
-\fBmysqld_multi\fR
-looks for
-[mysqld\fIN\fR]
-option groups\&. Without this option, all options are read from the usual
-my\&.cnf
-file\&. The option does not affect where
-\fBmysqld_multi\fR
-reads its own options, which are always taken from the
-[mysqld_multi]
-group in the usual
-my\&.cnf
-file\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
.\" mysqld_multi: example option
.\" example option: mysqld_multi
\fB\-\-example\fR
@@ -394,8 +337,8 @@ rather than to the log file\&. By default, output goes to the log file\&.
.\" password option: mysqld_multi
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
-The password of the MySQL account to use when invoking
-\fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
+The password of the MariaDB account to use when invoking
+\fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MariaDB programs\&.
.RE
.sp
.RS 4
@@ -425,11 +368,10 @@ Silent mode; disable warnings\&.
.\" tcp-ip option: mysqld_multi
\fB\-\-tcp\-ip\fR
.sp
-Connect to each MySQL server via the TCP/IP port instead of the Unix socket file\&. (If a socket file is missing, the server might still be running, but accessible only via the TCP/IP port\&.) By default, connections are made using the Unix socket file\&. This option affects
-stop
-and
-report
-operations\&.
+Connect to the MariaDB server(s) via the TCP/IP port instead of the UNIX socket\&. This affects stopping
+and reporting. If a socket file is missing, the server may still be running, but can be accessed only
+via the TCP/IP port\&. By default connecting is done via the UNIX socket\&. This option affects
+stop and report operations\&.
.RE
.sp
.RS 4
@@ -444,7 +386,7 @@ operations\&.
.\" user option: mysqld_multi
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
-The user name of the MySQL account to use when invoking
+The user name of the MariaDB account to use when invoking
\fBmysqladmin\fR\&.
.RE
.sp
@@ -503,8 +445,9 @@ servers with the same data directory\&. Use separate data directories, unless yo
\fIknow\fR
what you are doing\&. Starting multiple servers with the same data directory does
\fInot\fR
-give you extra performance in a threaded system\&. See
-Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&.
+give you extra performance in a threaded system\&.
+.sp .5v
+.RE
.RE
.sp
.RS 4
@@ -515,19 +458,7 @@ Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&.
.sp -1
.IP \(bu 2.3
.\}
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBImportant\fR
-.ps -1
-.br
-Make sure that the data directory for each server is fully accessible to the Unix account that the specific
+\fBImportant\fR: Make sure that the data directory for each server is fully accessible to the Unix account that the specific
\fBmysqld\fR
process is started as\&.
\fIDo not\fR
@@ -535,8 +466,7 @@ use the Unix
\fIroot\fR
account for this, unless you
\fIknow\fR
-what you are doing\&. See
-Section\ \&5.3.6, \(lqHow to Run MySQL as a Normal User\(rq\&.
+what you are doing\&.
.sp .5v
.RE
.RE
@@ -549,7 +479,7 @@ Section\ \&5.3.6, \(lqHow to Run MySQL as a Normal User\(rq\&.
.sp -1
.IP \(bu 2.3
.\}
-Make sure that the MySQL account used for stopping the
+Make sure that the MariaDB account used for stopping the
\fBmysqld\fR
servers (with the
\fBmysqladmin\fR
@@ -572,10 +502,7 @@ mysql> \fBGRANT SHUTDOWN ON *\&.*\fR
.RE
.\}
.sp
-See
-Section\ \&5.4, \(lqThe MySQL Access Privilege System\(rq\&. You have to do this for each
-\fBmysqld\fR
-server\&. Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must allow you to connect as
+Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must allow you to connect as
multi_admin
from the host where you want to run
\fBmysqld_multi\fR\&.
@@ -723,12 +650,10 @@ user = jani
.RE
.\}
.PP
-See
-Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -737,8 +662,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1
index 25848aecb9c..fe89c4e2aad 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqld_safe\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,7 +15,7 @@
.\" tools: mysqld_safe
.\" scripts
.SH "NAME"
-mysqld_safe \- MySQL server startup script
+mysqld_safe \- MariaDB server startup script
.SH "SYNOPSIS"
.HP \w'\fBmysqld_safe\ \fR\fB\fIoptions\fR\fR\ 'u
\fBmysqld_safe \fR\fB\fIoptions\fR\fR
@@ -31,34 +24,10 @@ mysqld_safe \- MySQL server startup script
\fBmysqld_safe\fR
is the recommended way to start a
\fBmysqld\fR
-server on Unix and NetWare\&.
+server on Unix\&.
\fBmysqld_safe\fR
-adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file\&. Descriptions of error logging and NetWare\-specific behaviors are given later in this section\&.
-.if n \{\
+adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file\&. Descriptions of error logging is given later in this section\&.
.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.PP
-In MySQL 5\&.1\&.20 (only), the default error logging behavior with
-\fBmysqld_safe\fR
-is to write errors to
-syslog
-on systems that support the
-\fBlogger\fR
-program\&. This differs from the default behavior of writing an error log file for other versions\&.
-.PP
-\fBIn 5\&.1\&.20, logging to \fR\fBsyslog\fR\fB may fail to operate correctly in some cases; if so, use \fR\fB\fB\-\-skip\-syslog\fR\fR\fB to use the default log file or \fR\fB\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR\fR\fB to specify a log file name explicitly\&.\fR
-.sp .5v
-.RE
-.PP
\fBmysqld_safe\fR
tries to start an executable named
\fBmysqld\fR\&. To override the default behavior and specify explicitly the name of the server you want to run, specify a
@@ -75,8 +44,7 @@ should look for the server\&.
Many of the options to
\fBmysqld_safe\fR
are the same as the options to
-\fBmysqld\fR\&. See
-Section\ \&5.1.2, \(lqServer Command Options\(rq\&.
+\fBmysqld\fR\&.
.PP
Options unknown to
\fBmysqld_safe\fR
@@ -84,8 +52,7 @@ are passed to
\fBmysqld\fR
if they are specified on the command line, but ignored if they are specified in the
[mysqld_safe] or [mariadb_safe]
-groups of an option file\&. See
-Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
+groups of an option file\&.
.PP
\fBmysqld_safe\fR
reads all options from the
@@ -117,11 +84,10 @@ also reads
[safe_mysqld]
sections, although you should rename such sections to
[mysqld_safe]
-in MySQL 5\&.1 installations\&.
+in current installations\&.
.PP
\fBmysqld_safe\fR
-supports the options in the following list\&. It also reads option files and supports the options for processing them described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+supports the options in the following list\&. It also reads option files and supports the options for processing them.
.sp
.RS 4
.ie n \{\
@@ -150,7 +116,7 @@ Display a help message and exit\&.
.\" basedir option: mysqld_safe
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
.sp
-The path to the MySQL installation directory\&.
+The path to the MariaDB installation directory\&.
.RE
.sp
.RS 4
@@ -179,6 +145,21 @@ should be able to create\&. The option value is passed to
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqld_safe: crash-script option
+.\" crash-script option: mysqld_safe
+\fB\-\-crash\-script=\fR\fB\fIfile\fR\fR
+.sp
+Script to call in the event of mysqld crashing\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqld_safe: datadir option
.\" datadir option: mysqld_safe
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
@@ -224,6 +205,21 @@ The name of an option file to be read instead of the usual option files\&. This
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqld_safe: flush-caches option
+.\" flush-caches option: mysqld_safe
+\fB\-\-flush\-caches\fR
+.sp
+Flush and purge buffers/caches before starting the server\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqld_safe: ledir option
.\" ledir option: mysqld_safe
\fB\-\-ledir=\fR\fB\fIpath\fR\fR
@@ -245,8 +241,22 @@ cannot find the server, use this option to indicate the path name to the directo
.\" log-error option: mysqld_safe
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
-Write the error log to the given file\&. See
-Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
+Write the error log to the given file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqld_safe: malloc-lib option
+.\" malloc-lib option: mysqld_safe
+\fB\-\-malloc\-lib=\fR\fB\fIlib\fR\fR
+.sp
+Preload shared library lib if available\&.
.RE
.sp
.RS 4
@@ -263,7 +273,7 @@ Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
.sp
The name of the server program (in the
ledir
-directory) that you want to start\&. This option is needed if you use the MySQL binary distribution but have the data directory outside of the binary distribution\&. If
+directory) that you want to start\&. This option is needed if you use the MariaDB binary distribution but have the data directory outside of the binary distribution\&. If
\fBmysqld_safe\fR
cannot find the server, use the
\fB\-\-ledir\fR
@@ -328,6 +338,21 @@ program to set the server\'s scheduling priority to the given value\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqld_safe: no-auto-restart option
+.\" no-auto-restart option: mysqld_safe
+\fB\-\-no\-auto\-restart\fR
+.sp
+Exit after starting mysqld\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqld_safe: no-defaults option
.\" no-defaults option: mysqld_safe
\fB\-\-no\-defaults\fR
@@ -343,6 +368,36 @@ Do not read any option files\&. This must be the first option on the command lin
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqld_safe: no-watch option
+.\" no-watch option: mysqld_safe
+\fB\-\-no\-auto\-restart\fR
+.sp
+Exit after starting mysqld\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqld_safe: numa-interleave option
+.\" numa-interleave option: mysqld_safe
+\fB\-\-numa\-interleave\fR
+.sp
+Run mysqld with its memory interleaved on all NUMA nodes\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqld_safe: open-files-limit option
.\" open-files-limit option: mysqld_safe
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
@@ -380,6 +435,21 @@ The path name of the process ID file\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqld_safe: plugin-dir option
+.\" plugin-dir option: mysqld_safe
+\fB\-\-plugin\-dir=\fIdir_name\fR
+.sp
+Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqld_safe: port option
.\" port option: mysqld_safe
\fB\-\-port=\fR\fB\fIport_num\fR\fR
@@ -444,7 +514,7 @@ on systems that support the
program\&.
\-\-skip\-syslog
suppresses the use of
-syslog; messages are written to an error log file\&. These options were added in MySQL 5\&.1\&.20\&.
+syslog; messages are written to an error log file\&.
.RE
.sp
.RS 4
@@ -471,7 +541,7 @@ mysqld, respectively\&. To specify a suffix for the tag, use
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the tags to be
mysqld_safe\-\fItag\fR
and
-mysqld\-\fItag\fR\&. This option was added in MySQL 5\&.1\&.21\&.
+mysqld\-\fItag\fR\&.
.RE
.sp
.RS 4
@@ -509,7 +579,7 @@ server as the user having the name
\fIuser_name\fR
or the numeric user ID
\fIuser_id\fR\&. (\(lqUser\(rq
-in this context refers to a system login account, not a MySQL user listed in the grant tables\&.)
+in this context refers to a system login account, not a MariaDB user listed in the grant tables\&.)
.RE
.PP
If you execute
@@ -544,8 +614,7 @@ mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\f
.PP
The
\fBmysqld_safe\fR
-script is written so that it normally can start a server that was installed from either a source or a binary distribution of MySQL, even though these types of distributions typically install the server in slightly different locations\&. (See
-Section\ \&2.1.5, \(lqInstallation Layouts\(rq\&.)
+script is written so that it normally can start a server that was installed from either a source or a binary distribution of MariaDB, even though these types of distributions typically install the server in slightly different locations\&.
\fBmysqld_safe\fR
expects one of the following conditions to be true:
.sp
@@ -571,7 +640,7 @@ and
var
directories\&. This condition should be met if you execute
\fBmysqld_safe\fR
-from your MySQL installation directory (for example,
+from your MariaDB installation directory (for example,
/usr/local/mysql
for a binary distribution)\&.
.RE
@@ -589,14 +658,14 @@ If the server and databases cannot be found relative to the working directory,
attempts to locate them by absolute path names\&. Typical locations are
/usr/local/libexec
and
-/usr/local/var\&. The actual locations are determined from the values configured into the distribution at the time it was built\&. They should be correct if MySQL is installed in the location specified at configuration time\&.
+/usr/local/var\&. The actual locations are determined from the values configured into the distribution at the time it was built\&. They should be correct if MariaDB is installed in the location specified at configuration time\&.
.RE
.PP
Because
\fBmysqld_safe\fR
-tries to find the server and databases relative to its own working directory, you can install a binary distribution of MySQL anywhere, as long as you run
+tries to find the server and databases relative to its own working directory, you can install a binary distribution of MariaDB anywhere, as long as you run
\fBmysqld_safe\fR
-from the MySQL installation directory:
+from the MariaDB installation directory:
.sp
.if n \{\
.RS 4
@@ -611,7 +680,7 @@ shell> \fBbin/mysqld_safe &\fR
.PP
If
\fBmysqld_safe\fR
-fails, even when invoked from the MySQL installation directory, you can specify the
+fails, even when invoked from the MariaDB installation directory, you can specify the
\fB\-\-ledir\fR
and
\fB\-\-datadir\fR
@@ -626,7 +695,7 @@ arranges for error (and notice) messages from itself and from
\fBmysqld\fR
to go to the same destination\&.
.PP
-As of MySQL 5\&.1\&.20, there are several
+There are several
\fBmysqld_safe\fR
options for controlling the destination of these messages:
.sp
@@ -686,9 +755,6 @@ If none of these options is given, the default is
.ps -1
.br
.PP
-In MySQL 5\&.1\&.20
-\fIonly\fR, the default is
-\fB\-\-syslog\fR\&. This differs from logging behavior for other versions of MySQL, for which the default is to write messages to the default error log file\&.
.sp .5v
.RE
.PP
@@ -707,10 +773,6 @@ or the error log file) and
stdout\&. Errors go to the logging destination and
stderr\&.
.PP
-Before MySQL 5\&.1\&.20, error logging is controlled only with the
-\fB\-\-log\-error\fR
-option\&. If it is given, messages go to the named error file\&. Otherwise, messages go to the default error file\&.
-.PP
Normally, you should not edit the
\fBmysqld_safe\fR
script\&. Instead, configure
@@ -723,7 +785,7 @@ option file\&. In rare cases, it might be necessary to edit
\fBmysqld_safe\fR
to get it to start the server properly\&. However, if you do this, your modified version of
\fBmysqld_safe\fR
-might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.
+might be overwritten if you upgrade MariaDB in the future, so you should make a copy of your edited version that you can reinstall\&.
.PP
On NetWare,
\fBmysqld_safe\fR
@@ -761,7 +823,7 @@ tables\&.
.sp -1
.IP " 3." 4.2
.\}
-Provides a screen presence for the MySQL server\&.
+Provides a screen presence for the MariaDB server\&.
.RE
.sp
.RS 4
@@ -808,7 +870,7 @@ file in the data directory\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -817,8 +879,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index fdca51f091a..da2e4fa02c5 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqldump\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLDUMP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -32,7 +25,7 @@ mysqldump \- a database backup program
.PP
The
\fBmysqldump\fR
-client is a backup program originally written by Igor Romanenko\&. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server)\&. The dump typically contains SQL statements to create the table, populate it, or both\&. However,
+client is a backup program originally written by Igor Romanenko\&. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MariaDB server)\&. The dump typically contains SQL statements to create the table, populate it, or both\&. However,
\fBmysqldump\fR
can also be used to generate files in CSV, other delimited text, or XML format\&.
.PP
@@ -68,18 +61,11 @@ option, entire databases are dumped\&.
.PP
\fBmysqldump\fR
does not dump the
-INFORMATION_SCHEMA
-database by default\&. As of MySQL 5\&.1\&.38,
-\fBmysqldump\fR
-dumps
-INFORMATION_SCHEMA
-if you name it explicitly on the command line, although currently you must also use the
+INFORMATION_SCHEMA or performance_schema
+databases by default\&. To dump these,
+name them explicitly on the command line, although you must also use the
\fB\-\-skip\-lock\-tables\fR
-option\&. Before 5\&.1\&.38,
-\fBmysqldump\fR
-silently ignores
-INFORMATION_SCHEMA
-even if you name it explicitly on the command line\&.
+option\&.
.PP
To see a list of the options your version of
\fBmysqldump\fR
@@ -207,22 +193,6 @@ or
option\&. Use
\fB\-\-skip\-opt\fR
instead\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.PP
-\fBmysqldump\fR
-from MySQL 5\&.1\&.21 cannot be used to create dumps from MySQL server 5\&.1\&.20 and older\&. This issue is fixed in MySQL 5\&.1\&.22\&. (\m[blue]\fBBug#30123\fR\m[]\&\s-2\u[1]\d\s+2)
-.sp .5v
.RE
.PP
\fBmysqldump\fR
@@ -232,8 +202,7 @@ and
[client]
option file groups\&.
\fBmysqldump\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option file\&.
.sp
.RS 4
.ie n \{\
@@ -311,8 +280,7 @@ Surround each table dump with
LOCK TABLES
and
UNLOCK TABLES
-statements\&. This results in faster inserts when the dump file is reloaded\&. See
-Section\ \&7.2.21, \(lqSpeed of INSERT Statements\(rq\&.
+statements\&. This results in faster inserts when the dump file is reloaded\&.
.RE
.sp
.RS 4
@@ -351,7 +319,6 @@ NDBCLUSTER
table\&. This information is not otherwise included in the output from
\fBmysqldump\fR\&. This option is currently relevant only to MySQL Cluster tables\&.
.sp
-This option was added in MySQL 5\&.1\&.6\&.
.RE
.sp
.RS 4
@@ -377,12 +344,26 @@ Allow creation of column names that are keywords\&. This works by prefixing each
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: apply-slave-statements option
+.\" apply-slave-statements option: mysqldump
+\fB\-\-apply\-slave\-statements\fR
+.sp
+Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: character-sets-dir option
.\" character-sets-dir option: mysqldump
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -421,24 +402,6 @@ Produce more compact output\&. This option enables the
\fB\-\-skip\-disable\-keys\fR, and
\fB\-\-skip\-set\-charset\fR
options\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-Prior to MySQL 5\&.1\&.21, this option did not create valid SQL if the database dump contained views\&. The recreation of views requires the creation and removal of temporary tables and this option suppressed the removal of those temporary tables\&. As a workaround, use
-\fB\-\-compact\fR
-with the
-\fB\-\-add\-drop\-table\fR
-option and then manually adjust the dump file\&.
-.sp .5v
.RE
.RE
.sp
@@ -467,14 +430,12 @@ db2,
maxdb,
no_key_options,
no_table_options, or
-no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&. See
-Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&.
+no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&.
.sp
This option does not guarantee compatibility with other servers\&. It only enables those SQL mode values that are currently available for making dump output more compatible\&. For example,
\fB\-\-compatible=oracle\fR
does not map data types to Oracle types or use Oracle comment syntax\&.
.sp
-\fIThis option requires a server version of 4\&.1\&.0 or higher\fR\&. With older servers, it does nothing\&.
.RE
.sp
.RS 4
@@ -524,9 +485,9 @@ Compress all information sent between the client and the server if both support
\fB\-\-create\-options\fR,
\fB\-a\fR
.sp
-Include all MySQL\-specific table options in the
+Include all MariaDB\-specific table options in the
CREATE TABLE
-statements\&.
+statements\&. Use \fB\-\-skip-create-options\fR to disable.
.RE
.sp
.RS 4
@@ -583,7 +544,7 @@ string is
.\" debug-check option: mysqldump
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -598,7 +559,22 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqldump
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: default-auth option
+.\" default-auth option: mysqldump
+\fB\-\-default\-auth\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -615,16 +591,11 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Use
\fIcharset_name\fR
-as the default character set\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. If no character set is specified,
+as the default character set\&. If no character set is specified,
\fBmysqldump\fR
uses
-utf8, and earlier versions use
-latin1\&.
+utf8\&.
.sp
-Prior to MySQL 5\&.1\&.38, this option has no effect for output data files produced by using the
-\fB\-\-tab\fR
-option\&. See the description for that option\&.
.RE
.sp
.RS 4
@@ -667,6 +638,21 @@ Must be given as first option\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" my_print_defaults: defaults-group-suffix option
+.\" defaults-group-suffix option: my_print_defaults
+\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR,
+.sp
+Also read groups with a suffix of \fIstr\fR\&. For example, since mysqldump normally reads the [client] and [mysqldump] groups, \-\-defaults\-group\-suffix=x would cause it to also read the groups [mysqldump_x] and [client_x]\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: delayed-insert option
.\" delayed-insert option: mysqldump
\fB\-\-delayed\-insert\fR
@@ -756,7 +742,7 @@ control whether the date is added to the comment\&. The default is
\fB\-\-dump\-date\fR
(include the date in the comment)\&.
\fB\-\-skip\-dump\-date\fR
-suppresses date printing\&. This option was added in MySQL 5\&.1\&.23\&.
+suppresses date printing\&
.RE
.sp
.RS 4
@@ -772,7 +758,7 @@ suppresses date printing\&. This option was added in MySQL 5\&.1\&.23\&.
\fB\-\-events\fR,
\fB\-E\fR
.sp
-Include Event Scheduler events for the dumped databases in the output\&. This option was added in MySQL 5\&.1\&.8\&.
+Include Event Scheduler events for the dumped databases in the output\&.
.RE
.sp
.RS 4
@@ -821,8 +807,7 @@ These options are used with the
option and have the same meaning as the corresponding
FIELDS
clauses for
-LOAD DATA INFILE\&. See
-Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
+LOAD DATA INFILE\&.
.RE
.sp
.RS 4
@@ -837,11 +822,9 @@ Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
.\" first-slave option: mysqldump
\fB\-\-first\-slave\fR
.sp
-Deprecated\&. Use
+Removed in MariaDB 5.5\&. Use
\fB\-\-lock\-all\-tables\fR
instead\&.
-\fB\-\-first\-slave\fR
-is removed in MySQL 5\&.5\&.
.RE
.sp
.RS 4
@@ -857,7 +840,7 @@ is removed in MySQL 5\&.5\&.
\fB\-\-flush\-logs\fR,
\fB\-F\fR
.sp
-Flush the MySQL server log files before starting the dump\&. This option requires the
+Flush the MariaDB server log files before starting the dump\&. This option requires the
RELOAD
privilege\&. If you use this option in combination with the
\fB\-\-all\-databases\fR
@@ -893,7 +876,7 @@ database\&. This option should be used any time the dump contains the
mysql
database and any other database that depends on the data in the
mysql
-database for proper restoration\&. This option was added in MySQL 5\&.1\&.12\&.
+database for proper restoration\&.
.RE
.sp
.RS 4
@@ -930,13 +913,11 @@ prints the error message, but it also writes an SQL comment containing the view
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: host option
-.\" host option: mysqldump
-\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
-\fB\-h \fR\fB\fIhost_name\fR\fR
+.\" mysqldump: gtid option
+.\" gtid option: mysqldump
+\fB\-\-gtid\fR
.sp
-Dump data from the MySQL server on the given host\&. The default host is
-localhost\&.
+Available from MariaDB 10.0.13, and is used together with \fB\-\-master\-data\fR and \fB\-\-dump\-slave\fR to more conveniently set up a new GTID slave\&. It causes those options to output SQL statements that configure the slave to use the global transaction ID to connect to the master instead of old-style filename/offset positions\&. The old-style positions are still included in comments when \fB\-\-gtid\fR is used; likewise the GTID position is included in comments even if \fB\-\-gtid\fR is not used\&.
.RE
.sp
.RS 4
@@ -970,6 +951,23 @@ BIT\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: host option
+.\" host option: mysqldump
+\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
+\fB\-h \fR\fB\fIhost_name\fR\fR
+.sp
+Dump data from the MariaDB server on the given host\&. The default host is
+localhost\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: ignore-table option
.\" ignore-table option: mysqldump
\fB\-\-ignore\-table=\fR\fB\fIdb_name\&.tbl_name\fR\fR
@@ -985,6 +983,22 @@ Do not dump the given table, which must be specified using both the database and
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: include-master-host-port option
+.\" include-master-host-port option: mysqldump
+\fB\-\-include\-master\-host\-port\fR
+.sp
+Add the MASTER_HOST and MASTER_PORT options for the CHANGE MASTER TO statement when using
+the \fB--dump-slave\fR option for a slave dump\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: insert-ignore option
.\" insert-ignore option: mysqldump
\fB\-\-insert\-ignore\fR
@@ -1013,8 +1027,7 @@ This option is used with the
option and has the same meaning as the corresponding
LINES
clause for
-LOAD DATA INFILE\&. See
-Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
+LOAD DATA INFILE\&.
.RE
.sp
.RS 4
@@ -1063,6 +1076,8 @@ because it does not need to lock the tables at all\&.
Because
\fB\-\-lock\-tables\fR
locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases\&. Tables in different databases may be dumped in completely different states\&.
+.sp
+Use \fB--skip-lock-tables\fR to disable\&.
.RE
.sp
.RS 4
@@ -1077,7 +1092,7 @@ locks tables for each database separately, this option does not guarantee that t
.\" log-error option: mysqldump
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
-Log warnings and errors by appending them to the named file\&. The default is to do no logging\&. This option was added in MySQL 5\&.1\&.18\&.
+Log warnings and errors by appending them to the named file\&. The default is to do no logging\&.
.RE
.sp
.RS 4
@@ -1110,8 +1125,7 @@ option automatically turns off
\fB\-\-lock\-tables\fR\&. It also turns on
\fB\-\-lock\-all\-tables\fR, unless
\fB\-\-single\-transaction\fR
-also is specified, in which case, a global read lock is acquired only for a short time at the beginning of the dump (see the description for
-\fB\-\-single\-transaction\fR)\&. In all cases, any action on logs happens at the exact moment of the dump\&.
+also is specified\&. In all cases, any action on logs happens at the exact moment of the dump\&.
.sp
It is also possible to set up a slave by dumping an existing slave of the master\&. To do this, use the following procedure on the existing slave:
.sp
@@ -1410,7 +1424,7 @@ This option is shorthand\&. It is the same as specifying
\fB\-\-extended\-insert\fR
\fB\-\-lock\-tables\fR
\fB\-\-quick\fR
-\fB\-\-set\-charset\fR\&. It should give you a fast dump operation and produce a dump file that can be reloaded into a MySQL server quickly\&.
+\fB\-\-set\-charset\fR\&. It should give you a fast dump operation and produce a dump file that can be reloaded into a MariaDB server quickly\&.
.sp
\fIThe \fR\fI\fB\-\-opt\fR\fR\fI option is enabled by default\&. Use \fR\fI\fB\-\-skip\-opt\fR\fR\fI to disable it\&.\fR
See the discussion at the beginning of this section for information about selectively enabling or disabling a subset of the options affected by
@@ -1461,8 +1475,7 @@ option on the command line,
\fBmysqldump\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -1489,6 +1502,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: plugin-dir option
+.\" plugin-dir option: mysqldump
+\fB\-\-plugin\-dir\fR
+.sp
+Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: port option
.\" port option: mysqldump
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
@@ -1509,8 +1537,7 @@ The TCP/IP port number to use for the connection\&.
.\" protocol option: mysqldump
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -1543,7 +1570,7 @@ to retrieve rows for a table from the server a row at a time rather than retriev
.\" print-defaults option: mysqldump
\fB\-\-print\-defaults\fR
.sp
-Print the program argument list and exit\&. This must begiven as the first argument\&.
+Print the program argument list and exit\&. This must be given as the first argument\&.
.RE
.sp
.RS 4
@@ -1588,7 +1615,7 @@ Write
REPLACE
statements rather than
INSERT
-statements\&. This option was added in MySQL 5\&.1\&.3\&.
+statements\&.
.RE
.sp
.RS 4
@@ -1639,15 +1666,10 @@ statements to re\-create the routines\&. However, these statements do not includ
If you require routines to be re\-created with their original timestamp attributes, do not use
\fB\-\-routines\fR\&. Instead, dump and reload the contents of the
mysql\&.proc
-table directly, using a MySQL account that has appropriate privileges for the
+table directly, using a MariaDB account that has appropriate privileges for the
mysql
database\&.
.sp
-This option was added in MySQL 5\&.1\&.2\&. Before that, stored routines are not dumped\&. Routine
-DEFINER
-values are not dumped until MySQL 5\&.1\&.8\&. This means that before 5\&.1\&.8, when routines are reloaded, they will be created with the definer set to the reloading user\&. If you require routines to be re\-created with their original definer, dump and load the contents of the
-mysql\&.proc
-table directly as described earlier\&.
.RE
.sp
.RS 4
@@ -1718,14 +1740,6 @@ option are mutually exclusive because
LOCK TABLES
causes any pending transactions to be committed implicitly\&.
.sp
-This option is not supported for MySQL Cluster tables; the results cannot be guaranteed to be consistent due to the fact that the
-NDBCLUSTER
-storage engine supports only the
-READ_COMMITTED
-transaction isolation level\&. You should always use
-NDB
-backup and restore instead\&.
-.sp
To dump large tables, you should combine the
\fB\-\-single\-transaction\fR
option with
@@ -1740,11 +1754,45 @@ option with
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: skip-add-drop-table option
+.\" skip-add-drop-table option: mysqldump
+\fB\-\-skip\-add\-drop\-table\fR
+.sp
+Disable the
+\fB\-\-add\-drop\-table\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-add-locks option
+.\" skip-add-locks option: mysqldump
+\fB\-\-skip\-add\-locks\fR
+.sp
+Disable the
+\fB\-\-add\-locks\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: skip-comments option
.\" skip-comments option: mysqldump
\fB\-\-skip\-comments\fR
.sp
-See the description for the
+Disable the
\fB\-\-comments\fR
option\&.
.RE
@@ -1757,11 +1805,62 @@ option\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: skip-compact option
+.\" skip-compact option: mysqldump
+\fB\-\-skip\-compact\fR
+.sp
+Disable the
+\fB\-\-compact\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-disable-keys option
+.\" skip-disable-keys option: mysqldump
+\fB\-\-skip\-disable\-keys\fR
+.sp
+Disable the
+\fB\-\-disable\-keys\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-extended-insert option
+.\" skip-extended-insert option: mysqldump
+\fB\-\-skip\-extended\-insert\fR
+.sp
+Disable the
+\fB\-\-extended\-insert\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: skip-opt option
.\" skip-opt option: mysqldump
\fB\-\-skip\-opt\fR
.sp
-See the description for the
+Disable the
\fB\-\-opt\fR
option\&.
.RE
@@ -1774,6 +1873,91 @@ option\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: skip-quick option
+.\" skip-quick option: mysqldump
+\fB\-\-skip\-quick\fR
+.sp
+Disable the
+\fB\-\-quick\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-quote-names option
+.\" skip-quote-names option: mysqldump
+\fB\-\-skip\-quote\-names\fR
+.sp
+Disable the
+\fB\-\-quote\-names\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-set-charset option
+.\" skip-set-charset option: mysqldump
+\fB\-\-skip\-set\-charset\fR
+.sp
+Disable the
+\fB\-\-set\-charset\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-triggers option
+.\" skip-triggers option: mysqldump
+\fB\-\-skip\-triggers\fR
+.sp
+Disable the
+\fB\-\-triggers\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqldump: skip-tz-utc option
+.\" skip-tz-utc option: mysqldump
+\fB\-\-skip\-tz\-utc\fR
+.sp
+Disable the
+\fB\-\-tz\-utc\fR
+option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: socket option
.\" socket option: mysqldump
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
@@ -1791,14 +1975,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: SSL options
-.\" SSL options: mysqldump
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
+.\" mysqladmin: SSL options
+.\" SSL options: mysqladmin
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA option
+.\" SSL CA option: mysqladmin
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA Path option
+.\" SSL CA Path option: mysqladmin
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cert option
+.\" SSL Cert option: mysqladmin
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cipher option
+.\" SSL Cipher option: mysqladmin
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Key option
+.\" SSL Key option: mysqladmin
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crl option
+.\" SSL CRL option: mysqladmin
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crlpath option
+.\" SSL Crlpath option: mysqladmin
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqladmin
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -1852,11 +2161,9 @@ and
\fB\-\-lines\-terminated\-by\fR
options\&.
.sp
-As of MySQL 5\&.1\&.38, column values are converted to the character set specified by the
+Column values are converted to the character set specified by the
\fB\-\-default\-character\-set\fR
-option\&. Prior to 5\&.1\&.38 or if no such option is present, values are dumped using the
-binary
-character set\&. In effect, there is no character set conversion\&. If a table contains columns in several character sets, the output data file will as well and you may not be able to reload the file correctly\&.
+option\&.
.RE
.sp
.RS 4
@@ -1921,7 +2228,7 @@ columns are dumped and reloaded in the time zones local to the source and destin
also protects against changes due to daylight saving time\&.
\fB\-\-tz\-utc\fR
is enabled by default\&. To disable it, use
-\fB\-\-skip\-tz\-utc\fR\&. This option was added in MySQL 5\&.1\&.2\&.
+\fB\-\-skip\-tz\-utc\fR\&.
.RE
.sp
.RS 4
@@ -1937,7 +2244,7 @@ is enabled by default\&. To disable it, use
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -2050,14 +2357,14 @@ T}:T{
T}
.TE
.sp 1
-Beginning with MySQL 5\&.1\&.12, the output from the
+The output from the
\fBmysql\fR
client when run using the
\fB\-\-xml\fR
option also follows the preceding rules\&. (See
the section called \(lqMYSQL OPTIONS\(rq\&.)
.sp
-Beginning with MySQL 5\&.1\&.18, XML output from
+XML output from
\fBmysqldump\fR
includes the XML namespace, as shown here:
.sp
@@ -2148,7 +2455,7 @@ creates rows up to
net_buffer_length
length\&. If you increase this variable, you should also ensure that the
net_buffer_length
-variable in the MySQL server is at least this large\&.
+variable in the MariaDB server is at least this large\&.
.RE
.PP
A common use of
@@ -2190,7 +2497,7 @@ shell> \fBmysql \-e "source \fR\fB\fI/path\-to\-backup/backup\-file\&.sql\fR\fR\
.\}
.PP
\fBmysqldump\fR
-is also very useful for populating databases by copying data from one MySQL server to another:
+is also very useful for populating databases by copying data from one MariaDB server to another:
.sp
.if n \{\
.RS 4
@@ -2247,12 +2554,11 @@ shell> \fBmysqldump \-\-all\-databases \-\-single\-transaction > all_databases\&
This backup acquires a global read lock on all tables (using
FLUSH TABLES WITH READ LOCK) at the beginning of the dump\&. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released\&. If long updating statements are running when the
FLUSH
-statement is issued, the MySQL server may get stalled until those statements finish\&. After that, the dump becomes lock free and does not disturb reads and writes on the tables\&. If the update statements that the MySQL server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates\&.
+statement is issued, the MariaDB server may get stalled until those statements finish\&. After that, the dump becomes lock free and does not disturb reads and writes on the tables\&. If the update statements that the MariaDB server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates\&.
.PP
For point\-in\-time recovery (also known as
\(lqroll\-forward,\(rq
-when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log (see
-Section\ \&5.2.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
+when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log or at least know the binary log coordinates to which the dump corresponds:
.sp
.if n \{\
.RS 4
@@ -2285,19 +2591,15 @@ options can be used simultaneously, which provides a convenient way to make an o
InnoDB
storage engine\&.
.PP
-For more information on making backups, see
-Section\ \&6.2, \(lqDatabase Backup Methods\(rq, and
-Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&.
.\" mysqldump: views
.\" mysqldump: problems
.\" mysqldump: workarounds
.PP
-If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges\&. See
-Section\ \&D.4, \(lqRestrictions on Views\(rq\&.
+If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -2312,8 +2614,6 @@ Bug#30123
\%http://bugs.mysql.com/bug.php?id=30123
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqldumpslow.1 b/man/mysqldumpslow.1
index d0d48f81747..bd1f5189112 100644
--- a/man/mysqldumpslow.1
+++ b/man/mysqldumpslow.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqldumpslow\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -26,10 +19,9 @@ mysqldumpslow \- Summarize slow query log files
\fBmysqldumpslow [\fR\fBoptions\fR\fB] [\fR\fB\fIlog_file\fR\fR\fB \&.\&.\&.]\fR
.SH "DESCRIPTION"
.PP
-The MySQL slow query log contains information about queries that take a long time to execute (see
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq)\&.
+The MariaDB slow query log contains information about queries that take a long time to execute\&.
\fBmysqldumpslow\fR
-parses MySQL slow query log files and prints a summary of their contents\&.
+parses MariaDB slow query log files and prints a summary of their contents\&.
.PP
Normally,
\fBmysqldumpslow\fR
@@ -132,9 +124,9 @@ Consider only queries that match the (\fBgrep\fR\-style) pattern\&.
.\}
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Host name of MySQL server for
+Host name of MariaDB server for
*\-slow\&.log
-file name\&. The value can contain a wildcare\&. The default is
+file name\&. The value can contain a wildcard\&. The default is
*
(match all)\&.
.RE
@@ -309,7 +301,7 @@ Count: 3 Time=2\&.13s (6s) Lock=0\&.00s (0s) Rows=0\&.0 (0), root[root]@local
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -318,8 +310,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlhotcopy.1 b/man/mysqlhotcopy.1
index 73305ad02f6..ca560d3d643 100644
--- a/man/mysqlhotcopy.1
+++ b/man/mysqlhotcopy.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlhotcopy\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -319,15 +312,29 @@ tables in the backup\&. This makes the backup smaller and faster\&. The indexes
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlhotcopy: old-server option
+.\" old-server option: mysqlhotcopy
+\fB\-\-old\-server\fR
+.sp
+Connect to old MySQL-server (before v5.5) which doesn't have FLUSH TABLES WITH READ LOCK fully implemented.\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlhotcopy: password option
.\" password option: mysqlhotcopy
\fB\-\-password=\fR\fB\fIpassword\fR\fR,
\fB\-p\fR\fB\fIpassword\fR\fR
.sp
-The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&.
+The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MariaDB programs\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -488,7 +495,7 @@ The temporary directory\&. The default is
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.PP
Use
@@ -513,7 +520,7 @@ shell> \fBperldoc mysqlhotcopy\fR
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -522,8 +529,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlimport.1 b/man/mysqlimport.1
index 6cd494a617c..8624e71dc3e 100644
--- a/man/mysqlimport.1
+++ b/man/mysqlimport.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlimport\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLIMPORT\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -38,8 +31,7 @@ SQL statement\&. Most options to
\fBmysqlimport\fR
correspond directly to clauses of
LOAD DATA INFILE
-syntax\&. See
-Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
+syntax\&.
.PP
Invoke
\fBmysqlimport\fR
@@ -64,9 +56,6 @@ patient
all would be imported into a table named
patient\&.
.PP
-For additional information about
-\fBmysqldump\fR, see
-Section\ \&6.4, \(lqUsing mysqldump for Backups\(rq\&.
.PP
\fBmysqldump\fR
supports the following options, which can be specified on the command line or in the
@@ -75,8 +64,7 @@ and
[client]
option file groups\&.
\fBmysqldump\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option files\&.
.sp
.RS 4
.ie n \{\
@@ -106,8 +94,7 @@ Display a help message and exit\&.
.\" character-sets-dir option: mysqlimport
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -174,7 +161,7 @@ string is
.\" debug-check option: mysqlimport
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -189,7 +176,22 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqlimport
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlimport: default-auth option
+.\" default-auth option: mysqlimport
+\fB\-\-default\-auth=\fIplugin_name\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -206,8 +208,7 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Use
\fIcharset_name\fR
-as the default character set\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+as the default character set\&.
.RE
.sp
.RS 4
@@ -280,8 +281,7 @@ Empty the table before importing the text file\&.
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options have the same meaning as the corresponding clauses for
-LOAD DATA INFILE\&. See
-Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
+LOAD DATA INFILE\&.
.RE
.sp
.RS 4
@@ -316,7 +316,7 @@ exits if a table does not exist\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Import data to the MySQL server on the given host\&. The default host is
+Import data to the MariaDB server on the given host\&. The default host is
localhost\&.
.RE
.sp
@@ -369,8 +369,7 @@ lines of the data file\&.
.sp
This option has the same meaning as the corresponding clause for
LOAD DATA INFILE\&. For example, to import Windows files that have lines terminated with carriage return/linefeed pairs, use
-\fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.) See
-Section\ \&12.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
+\fB\-\-lines\-terminated\-by="\er\en"\fR\&. (You might have to double the backslashes, depending on the escaping conventions of your command interpreter\&.)\&.
.RE
.sp
.RS 4
@@ -468,8 +467,7 @@ option on the command line,
\fBmysqlimport\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -496,6 +494,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlimport: plugin-dir option
+.\" plugin-dir option: mysqlimport
+\fB\-\-plugin\-dir=\fR\fB\fIname\fR\fR
+.sp
+ Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlimport: port option
.\" port option: mysqlimport
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
@@ -516,8 +529,7 @@ The TCP/IP port number to use for the connection\&.
.\" protocol option: mysqlimport
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -599,14 +611,139 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: SSL options
-.\" SSL options: mysqlimport
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
+.\" mysqladmin: SSL options
+.\" SSL options: mysqladmin
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA option
+.\" SSL CA option: mysqladmin
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL CA Path option
+.\" SSL CA Path option: mysqladmin
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cert option
+.\" SSL Cert option: mysqladmin
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Cipher option
+.\" SSL Cipher option: mysqladmin
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Key option
+.\" SSL Key option: mysqladmin
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crl option
+.\" SSL CRL option: mysqladmin
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Crlpath option
+.\" SSL Crlpath option: mysqladmin
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqladmin: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqladmin
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -622,7 +759,7 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -639,7 +776,7 @@ The MySQL user name to use when connecting to the server\&.
.sp
Load files in parallel using
\fIN\fR
-threads\&. This option was added in MySQL 5\&.1\&.7\&.
+threads\&.
.RE
.sp
.RS 4
@@ -710,7 +847,7 @@ shell> \fBmysql \-e \'SELECT * FROM imptest\' test\fR
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -719,8 +856,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1
index b8c6fa6a620..3eaa8df7c49 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlshow\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLSHOW\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -38,8 +31,7 @@ client can be used to quickly see which databases exist, their tables, or a tabl
\fBmysqlshow\fR
provides a command\-line interface to several SQL
SHOW
-statements\&. See
-Section\ \&12.4.5, \(lqSHOW Syntax\(rq\&. The same information can be obtained by using those statements directly\&. For example, you can issue them from the
+statements\&. The same information can be obtained by using those statements directly\&. For example, you can issue them from the
\fBmysql\fR
client program\&.
.PP
@@ -118,8 +110,7 @@ and
[client]
option file groups\&.
\fBmysqlshow\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option files described.
.sp
.RS 4
.ie n \{\
@@ -148,10 +139,9 @@ Display a help message and exit\&.
.\" mysqlshow: character-sets-dir option
.\" character-sets-dir option: mysqlshow
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR,
-\fB\-c\fR
+\fB\-c\fR \fIpath\fR\fR
.sp
-The directory where character sets are installed\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+The directory where character sets are installed\&.
.RE
.sp
.RS 4
@@ -218,7 +208,7 @@ string is
.\" debug-check option: mysqlshow
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -233,7 +223,22 @@ Print some debugging information when the program exits\&. This option was added
.\" debug-info option: mysqlshow
\fB\-\-debug\-info\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.14\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: default-auth option
+.\" default-auth option: mysqlshow
+\fB\-\-default\-auth=\fR\fB\fIname\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -250,8 +255,7 @@ Print debugging information and memory and CPU usage statistics when the program
.sp
Use
\fIcharset_name\fR
-as the default character set\&. See
-Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&.
+as the default character set\&.
.RE
.sp
.RS 4
@@ -294,12 +298,27 @@ Must be given as first option\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlshow: defaults-group-suffix option
+.\" defaults-group-suffix option: mysqlshow
+\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR
+.sp
+In addition to the groups named on the command line, read groups that have the given suffix\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlshow: host option
.\" host option: mysqlshow
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -359,8 +378,7 @@ option on the command line,
\fBmysqlshow\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -387,6 +405,21 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqlshow: plugin-dir option
+.\" plugin-dir option: mysqlshow
+\fB\-\-plugin\-dir=\fIdir_name\fR
+.sp
+Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqlshow: port option
.\" port option: mysqlshow
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
@@ -407,8 +440,7 @@ The TCP/IP port number to use for the connection\&.
.\" protocol option: mysqlshow
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -474,12 +506,137 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.\}
.\" mysqlshow: SSL options
.\" SSL options: mysqlshow
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL CA option
+.\" SSL CA option: mysqlshow
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL CA Path option
+.\" SSL CA Path option: mysqlshow
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Cert option
+.\" SSL Cert option: mysqlshow
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Cipher option
+.\" SSL Cipher option: mysqlshow
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Key option
+.\" SSL Key option: mysqlshow
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Crl option
+.\" SSL CRL option: mysqlshow
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Crlpath option
+.\" SSL Crlpath option: mysqlshow
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqlshow
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -511,7 +668,7 @@ Display extra information about each table\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -548,7 +705,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -557,8 +714,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqlslap.1 b/man/mysqlslap.1
index e795be397a2..f2ba65e0f03 100644
--- a/man/mysqlslap.1
+++ b/man/mysqlslap.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqlslap\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBMYSQLSLAP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -28,9 +21,7 @@ mysqlslap \- load emulation client
.SH "DESCRIPTION"
.PP
\fBmysqlslap\fR
-is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage\&. It works as if multiple clients are accessing the server\&.
-\fBmysqlslap\fR
-is available as of MySQL 5\&.1\&.4\&.
+is a diagnostic program designed to emulate client load for a MariaDB server and to report the timing of each stage\&. It works as if multiple clients are accessing the server\&.
.PP
Invoke
\fBmysqlslap\fR
@@ -157,8 +148,7 @@ and
[client]
option file groups\&.
\fBmysqlslap\fR
-also supports the options for processing option files described at
-Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
+also supports the options for processing option files\&.
.sp
.RS 4
.ie n \{\
@@ -206,7 +196,7 @@ Generate SQL statements automatically when they are not supplied in files or via
.sp
Add an
AUTO_INCREMENT
-column to automatically generated tables\&. This option was added in MySQL 5\&.1\&.18\&.
+column to automatically generated tables\&.
.RE
.sp
.RS 4
@@ -221,7 +211,7 @@ column to automatically generated tables\&. This option was added in MySQL 5\&.1
.\" auto-generate-sql-execute-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-execute\-number=\fR\fB\fIN\fR\fR
.sp
-Specify how many queries to generate automatically\&. This option was added in MySQL 5\&.1\&.18\&.
+Specify how many queries to generate automatically\&.
.RE
.sp
.RS 4
@@ -236,7 +226,7 @@ Specify how many queries to generate automatically\&. This option was added in M
.\" auto-generate-sql-guid-primary option: mysqlslap
\fB\-\-auto\-generate\-sql\-guid\-primary\fR
.sp
-Add a GUID\-based primary key to automatically generated tables\&. This option was added in MySQL 5\&.1\&.18\&.
+Add a GUID\-based primary key to automatically generated tables\&.
.RE
.sp
.RS 4
@@ -262,7 +252,7 @@ update
(update primary keys), or
mixed
(half inserts, half scanning selects)\&. The default is
-mixed\&. This option was added in MySQL 5\&.1\&.16\&.
+mixed\&.
.RE
.sp
.RS 4
@@ -277,7 +267,7 @@ mixed\&. This option was added in MySQL 5\&.1\&.16\&.
.\" auto-generate-sql-secondary-indexes option: mysqlslap
\fB\-\-auto\-generate\-sql\-secondary\-indexes=\fR\fB\fIN\fR\fR
.sp
-Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&. This option was added in MySQL 5\&.1\&.18\&.
+Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&.
.RE
.sp
.RS 4
@@ -294,7 +284,7 @@ Specify how many secondary indexes to add to automatically generated tables\&. B
.sp
How many different queries to generate for automatic tests\&. For example, if you run a
key
-test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects\&. The default is 10\&. This option was added in MySQL 5\&.1\&.18\&.
+test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects\&. The default is 10\&.
.RE
.sp
.RS 4
@@ -310,7 +300,7 @@ test that performs 1000 selects, you can use this option with a value of 1000 to
\fB\-\-auto\-generate\-sql\-unique\-write\-number=\fR\fB\fIN\fR\fR
.sp
How many different queries to generate for
-\fB\-\-auto\-generate\-sql\-write\-number\fR\&. The default is 10\&. This option was added in MySQL 5\&.1\&.18\&.
+\fB\-\-auto\-generate\-sql\-write\-number\fR\&. The default is 10\&.
.RE
.sp
.RS 4
@@ -325,7 +315,7 @@ How many different queries to generate for
.\" auto-generate-sql-write-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-write\-number=\fR\fB\fIN\fR\fR
.sp
-How many row inserts to perform on each thread\&. The default is 100\&. This option was added in MySQL 5\&.1\&.16\&.
+How many row inserts to perform on each thread\&. The default is 100\&.
.RE
.sp
.RS 4
@@ -340,7 +330,7 @@ How many row inserts to perform on each thread\&. The default is 100\&. This opt
.\" commit option: mysqlslap
\fB\-\-commit=\fR\fB\fIN\fR\fR
.sp
-How many statements to execute before committing\&. The default is 0 (no commits are done)\&. This option was added in MySQL 5\&.1\&.21\&.
+How many statements to execute before committing\&. The default is 0 (no commits are done)\&.
.RE
.sp
.RS 4
@@ -404,7 +394,7 @@ The file or string containing the statement to use for creating the table\&.
.\" create-schema option: mysqlslap
\fB\-\-create\-schema=\fR\fB\fIvalue\fR\fR
.sp
-The schema in which to run the tests\&. This option was added in MySQL 5\&.1\&.5\&.
+The schema in which to run the tests\&.
.RE
.sp
.RS 4
@@ -419,7 +409,7 @@ The schema in which to run the tests\&. This option was added in MySQL 5\&.1\&.5
.\" csv option: mysqlslap
\fB\-\-csv[=\fR\fB\fIfile_name\fR\fR\fB]\fR
.sp
-Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&. This option was added in MySQL 5\&.1\&.5\&.
+Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&.
.RE
.sp
.RS 4
@@ -454,7 +444,7 @@ string is
.\" debug-check option: mysqlslap
\fB\-\-debug\-check\fR
.sp
-Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print some debugging information when the program exits\&.
.RE
.sp
.RS 4
@@ -470,7 +460,22 @@ Print some debugging information when the program exits\&. This option was added
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
-Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&.
+Print debugging information and memory and CPU usage statistics when the program exits\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlslap: default-auth option
+.\" default-auth option: mysqlslap
+\fB\-\-default\-auth=\fR\fB\fIname\fR
+.sp
+Default authentication client-side plugin to use\&.
.RE
.sp
.RS 4
@@ -535,7 +540,7 @@ The delimiter to use in SQL statements supplied in files or via command options\
.sp
Detach (close and reopen) each connection after each
\fIN\fR
-statements\&. The default is 0 (connections are not detached)\&. This option was added in MySQL 5\&.1\&.21\&.
+statements\&. The default is 0 (connections are not detached)\&.
.RE
.sp
.RS 4
@@ -551,7 +556,9 @@ statements\&. The default is 0 (connections are not detached)\&. This option was
\fB\-\-engine=\fR\fB\fIengine_name\fR\fR,
\fB\-e \fR\fB\fIengine_name\fR\fR
.sp
-The storage engine to use for creating tables\&.
+Comma separated list of storage engines to use for creating the table\&. The test is run for
+each engine\&. You can also specify an option for an engine after a colon, for example
+\fBmemory:max_row=2300\fR\&.
.RE
.sp
.RS 4
@@ -567,7 +574,7 @@ The storage engine to use for creating tables\&.
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -582,7 +589,7 @@ Connect to the MySQL server on the given host\&.
.\" init-command option: mysqlslap
\fB\-\-init\-command=str\fR
.sp
-SQL Command to execute when connecting to MySQL server\&. Will automatically be re\-executed when reconnecting\&.
+SQL Command to execute when connecting to MariaDB server\&. Will automatically be re\-executed when reconnecting\&.
.RE
.sp
.RS 4
@@ -609,21 +616,6 @@ The number of times to run the tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: lock-directory option
-.\" lock-directory option: mysqlslap
-\fB\-\-lock\-directory=\fR\fB\fIpath\fR\fR
-.sp
-The directory to use for storing locks\&. This option was added in MySQL 5\&.1\&.5 and removed in 5\&.1\&.18\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
.\" mysqlslap: no-defaults option
.\" no-defaults option: mysqlslap
\fB\-\-no\-defaults\fR
@@ -644,7 +636,7 @@ first argument\&.
.\" no-drop option: mysqlslap
\fB\-\-no\-drop\fR
.sp
-Do not drop the schema after the test\&.
+Do not drop any schema created during the test after the test is complete\&.
.RE
.sp
.RS 4
@@ -715,8 +707,6 @@ shell> \fBmysqlslap \-\-delimiter=";" \-\-number\-of\-queries=10\fR
.if n \{\
.RE
.\}
-.sp
-This option was added in MySQL 5\&.1\&.5\&.
.RE
.sp
.RS 4
@@ -733,7 +723,7 @@ This option was added in MySQL 5\&.1\&.5\&.
.sp
Do not connect to databases\&.
\fBmysqlslap\fR
-only prints what it would have done\&. This option was added in MySQL 5\&.1\&.5\&.
+only prints what it would have done\&.
.RE
.sp
.RS 4
@@ -761,8 +751,7 @@ option on the command line,
\fBmysqlslap\fR
prompts for one\&.
.sp
-Specifying a password on the command line should be considered insecure\&. See
-Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
+Specifying a password on the command line should be considered insecure\&. You can use an option file to avoid giving the password on the command line\&.
.RE
.sp
.RS 4
@@ -789,27 +778,11 @@ On Windows, connect to the server via a named pipe\&. This option applies only i
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: port option
-.\" port option: mysqlslap
-\fB\-\-port=\fR\fB\fIport_num\fR\fR,
-\fB\-P \fR\fB\fIport_num\fR\fR
-.sp
-The TCP/IP port number to use for the connection\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-.\" mysqlslap: post-query option
-.\" post-query option: mysqlslap
-\fB\-\-post\-query=\fR\fB\fIvalue\fR\fR
+.\" mysqlslap: plugin-dir option
+.\" plugin-dir option: mysqlslap
+\fB\-\-plugin\-dir=\fIdir_name\fR
.sp
-The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.18\&.
+Directory for client-side plugins\&.
.RE
.sp
.RS 4
@@ -820,11 +793,12 @@ The file or string containing the statement to execute after the tests have comp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlslap
-\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
+.\" mysqlslap: port option
+.\" port option: mysqlslap
+\fB\-\-port=\fR\fB\fIport_num\fR\fR,
+\fB\-P \fR\fB\fIport_num\fR\fR
.sp
-On Windows, the shared\-memory name to use, for connections made via shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&.
+The TCP/IP port number to use for the connection\&.
.RE
.sp
.RS 4
@@ -835,12 +809,11 @@ On Windows, the shared\-memory name to use, for connections made via shared memo
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: print-defaults option
-.\" print-defaults option: mysqlslap
-\fB\-\-print\-defaults\fR
+.\" mysqlslap: post-query option
+.\" post-query option: mysqlslap
+\fB\-\-post\-query=\fR\fB\fIvalue\fR\fR
.sp
-Print the program argument list and exit\&.
-This must be given as the first argument\&.
+The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&.
.RE
.sp
.RS 4
@@ -857,7 +830,7 @@ This must be given as the first argument\&.
.sp
The string to execute via
system()
-after the tests have completed\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.21\&.
+after the tests have completed\&. This execution is not counted for timing purposes\&.
.RE
.sp
.RS 4
@@ -872,7 +845,7 @@ after the tests have completed\&. This execution is not counted for timing purpo
.\" pre-query option: mysqlslap
\fB\-\-pre\-query=\fR\fB\fIvalue\fR\fR
.sp
-The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.18\&.
+The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&.
.RE
.sp
.RS 4
@@ -889,7 +862,7 @@ The file or string containing the statement to execute before running the tests\
.sp
The string to execute via
system()
-before running the tests\&. This execution is not counted for timing purposes\&. This option was added in MySQL 5\&.1\&.21\&.
+before running the tests\&. This execution is not counted for timing purposes\&.
.RE
.sp
.RS 4
@@ -900,17 +873,12 @@ before running the tests\&. This execution is not counted for timing purposes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: preserve-schema option
-.\" preserve-schema option: mysqlslap
-\fB\-\-preserve\-schema\fR
+.\" mysqlslap: print-defaults option
+.\" print-defaults option: mysqlslap
+\fB\-\-print\-defaults\fR
.sp
-Preserve the schema from the
-\fBmysqlslap\fR
-run\&. The
-\fB\-\-auto\-generate\-sql\fR
-and
-\fB\-\-create\fR
-options disable this option\&. This option was added in MySQL 5\&.1\&.5 and removed in MySQL 5\&.1\&.23\&.
+Print the program argument list and exit\&.
+This must be given as the first argument\&.
.RE
.sp
.RS 4
@@ -925,8 +893,7 @@ options disable this option\&. This option was added in MySQL 5\&.1\&.5 and remo
.\" protocol option: mysqlslap
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
-The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see
-Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&.
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -955,12 +922,11 @@ statement to use for retrieving data\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: silent option
-.\" silent option: mysqlslap
-\fB\-\-silent\fR,
-\fB\-s\fR
+.\" mysqlslap: shared-memory-base-name option
+.\" shared-memory-base-name option: mysqlslap
+\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
-Silent mode\&. No output\&.
+On Windows, the shared\-memory name to use, for connections made via shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&.
.RE
.sp
.RS 4
@@ -971,15 +937,12 @@ Silent mode\&. No output\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: slave option
-.\" slave option: mysqlslap
-\fB\-\-slave\fR
+.\" mysqlslap: silent option
+.\" silent option: mysqlslap
+\fB\-\-silent\fR,
+\fB\-s\fR
.sp
-Follow master locks for other
-\fBmysqlslap\fR
-clients\&. Use this option if you are trying to synchronize around one master server with
-\fB\-\-lock\-directory\fR
-plus NFS\&. This option was added in MySQL 5\&.1\&.5 and removed in 5\&.1\&.18\&.
+Silent mode\&. No output\&.
.RE
.sp
.RS 4
@@ -1007,14 +970,124 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: SSL options
-.\" SSL options: mysqlslap
-\fB\-\-ssl*\fR
-.sp
-Options that begin with
+.\" mysqlshow: SSL options
+.\" SSL options: mysqlshow
\fB\-\-ssl\fR
-specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL CA option
+.\" SSL CA option: mysqlshow
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL CA Path option
+.\" SSL CA Path option: mysqlshow
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Cert option
+.\" SSL Cert option: mysqlshow
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Cipher option
+.\" SSL Cipher option: mysqlshow
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Key option
+.\" SSL Key option: mysqlshow
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Crl option
+.\" SSL CRL option: mysqlshow
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqlshow: SSL Crlpath option
+.\" SSL Crlpath option: mysqlshow
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
.RE
.sp
.RS 4
@@ -1025,17 +1098,11 @@ Section\ \&5.5.6.3, \(lqSSL Command Options\(rq\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: use-threads option
-.\" use-threads option: mysqlslap
-\fB\-\-use\-threads\fR
+.\" mysqlshow: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqlshow
+\fB\-\-ssl\-verify\-server\-cert\fR
.sp
-On Unix, the default is to use
-fork()
-calls and this option causes
-\fBpthread\fR
-calls to be used instead\&. (On Windows, the default is to use
-pthread
-calls and the option has no effect\&.) This option was added in MySQL 5\&.1\&.6 and removed in 5\&.1\&.18\&.
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
.RE
.sp
.RS 4
@@ -1051,7 +1118,7 @@ calls and the option has no effect\&.) This option was added in MySQL 5\&.1\&.6
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -1088,7 +1155,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -1097,8 +1164,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/mysqltest.1 b/man/mysqltest.1
index c68d851cbfc..80c3852b9a9 100644
--- a/man/mysqltest.1
+++ b/man/mysqltest.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBmysqltest\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 03/31/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL
-.\" Language: English
.\"
-.TH "\FBMYSQLTEST\FR" "1" "03/31/2010" "MySQL" "MySQL Database System"
+.TH "\FBMYSQLTEST\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -33,7 +26,7 @@ mysqltest_embedded \- program to run embedded test cases
.PP
The
\fBmysqltest\fR
-program runs a test case against a MySQL server and optionally compares the output with a result file\&. This program reads input written in a special test language\&. Typically, you invoke
+program runs a test case against a MariaDB server and optionally compares the output with a result file\&. This program reads input written in a special test language\&. Typically, you invoke
\fBmysqltest\fR
via
\fBmysql\-test\-run\&.pl\fR
@@ -55,7 +48,7 @@ Features of
.sp -1
.IP \(bu 2.3
.\}
-Can send SQL statements to MySQL servers for execution
+Can send SQL statements to MariaDB servers for execution
.RE
.sp
.RS 4
@@ -101,7 +94,7 @@ servers and switch between connections
.sp -1
.IP \(bu 2.3
.\}
-Can connect to an embedded server (libmysqld), if MySQL is compiled with support for
+Can connect to an embedded server (libmysqld), if MariaDB is compiled with support for
libmysqld\&. (In this case, the executable is named
\fBmysqltest_embedded\fR
rather than
@@ -206,7 +199,40 @@ Compress all information sent between the client and the server if both support
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: currsor-protocol option
+.\" mysqltest: connect-timeout option
+.\" connect-timeout option: mysqltest
+\fB\-\-connect\-timeout=\fInum\fR
+.sp
+This can be used to set the MYSQL_OPT_CONNECT_TIMEOUT parameter of mysql_options to change the number of seconds before an unsuccessful connection attempt times out\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: continue-on-error option
+.\" continue-on-error option: mysqltest
+\fB\-\-continue\-on\-error\fR
+.sp
+Continue test even if we got an error\&. This is mostly
+useful when testing a storage engine to see what from a
+test file it can execute, or to find all syntax errors in
+a newly created big test file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: cursor-protocol option
.\" cursor-protocol option: mysqltest
\fB\-\-cursor\-protocol\fR
.sp
@@ -242,7 +268,7 @@ The default database to use\&.
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
-Write a debugging log if MySQL is built with debugging support\&. The default
+Write a debugging log if MariaDB is built with debugging support\&. The default
\fIdebug_options\fR
value is
\'d:t:S:i:O,/tmp/mysqltest\&.trace\'\&.
@@ -291,27 +317,7 @@ Print debugging information and memory and CPU usage statistics when the program
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
-Connect to the MySQL server on the given host\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-.\" mysqltest: include option
-.\" include option: mysqltest
-\fB\-\-include=\fR\fB\fIfile_name\fR\fR,
-\fB\-i \fR\fB\fIfile_name\fR\fR
-.sp
-Include the contents of the given file before processing the contents of the test file\&. The included file should have the same format as other
-\fBmysqltest\fR
-test files\&. This option has the same effect as putting a
-\-\-source \fIfile_name\fR
-command as the first line of the test file\&.
+Connect to the MariaDB server on the given host\&.
.RE
.sp
.RS 4
@@ -373,8 +379,6 @@ The maximum number of connection attempts when connecting to server\&.
\fB\-\-max\-connections=\fR\fB\fInum\fR\fR
.sp
The maximum number of simultaneous server connections per client (that is, per test)\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&.
-.sp
-This option is available from MySQL 5\&.1\&.45\&.
.RE
.sp
.RS 4
@@ -400,6 +404,36 @@ Do not read default options from any option files\&. If used, this must be the f
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqltest: non-blocking-api option
+.\" non-blocking-api option: mysqltest
+\fB\-\-non\-blocking\-api\fR
+.sp
+Use the non-blocking client API for communication\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: overlay-dir option
+.\" overlay-dir option: mysqltest
+\fB\-\-overlay\-dir=\fIdir_name\fR
+.sp
+Overlay directory\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqltest: password option
.\" password option: mysqltest
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
@@ -424,12 +458,62 @@ option on the command line, you are prompted for one\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqltest: plugin-dir option
+.\" plugin-dir option: mysqltest
+\fB\-\-plugin\-dir=\fIdir_name\fR
+.sp
+Directory for client-side plugins\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqltest: port option
.\" port option: mysqltest
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
-The TCP/IP port number to use for the connection\&.
+The TCP/IP port number to use for the connection or 0 for default to, in order of preference,
+my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: prologue option
+.\" prologue option: mysqltest
+\fB\-\-prologue=\fR\fB\fIname\fR\fR
+.sp
+Include the contents of the given file before processing the contents of the test file\&. The included file should have the same format as other
+\fBmysqltest\fR
+test files\&. This option has the same effect as putting a
+\-\-source \fIfile_name\fR
+command as the first line of the test file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: protocol option
+.\" protocol option: mysqltest
+\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
+.sp
+The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&.
.RE
.sp
.RS 4
@@ -578,6 +662,21 @@ updates the given file by writing the actual test results to it\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqltest: result-format-version option
+.\" result-format-version option: mysqltest
+\fB\-\-result\-format\-version=\fI#\fR
+.sp
+Version of the result file format to use\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqltest: server-arg option
.\" server-arg option: mysqltest
\fB\-\-server\-arg=\fR\fB\fIvalue\fR\fR,
@@ -629,21 +728,6 @@ Suppress all normal output\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: skip-safemalloc option
-.\" skip-safemalloc option: mysqltest
-\fB\-\-skip\-safemalloc\fR
-.sp
-Do not use memory allocation checking\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
.\" mysqltest: sleep option
.\" sleep option: mysqltest
\fB\-\-sleep=\fR\fB\fInum\fR\fR,
@@ -657,8 +741,7 @@ seconds\&. This option does not affect
real_sleep
commands\&.
.sp
-As of MySQL 5\&.0\&.23, an option value of 0 can be used, which effectively disables
-sleep
+An option value of 0 can be used, which effectively disables sleep
commands in the test case\&.
.RE
.sp
@@ -705,6 +788,164 @@ creates and invokes a stored procedure that executes the statement rather than e
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqltest: SSL options
+.\" SSL options: mysqltest
+\fB\-\-ssl\fR
+.sp
+Enable SSL for connection (automatically enabled with other flags). Disable with
+\fB\-\-skip-ssl\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL CA option
+.\" SSL CA option: mysqltest
+\fB\-\-ssl\-ca=\fIname\fR
+.sp
+CA file in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL CA Path option
+.\" SSL CA Path option: mysqltest
+\fB\-\-ssl\-capath=\fIname\fR
+.sp
+CA directory (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Cert option
+.\" SSL Cert option: mysqltest
+\fB\-\-ssl\-cert=\fIname\fR
+.sp
+X509 cert in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Cipher option
+.\" SSL Cipher option: mysqltest
+\fB\-\-ssl\-cipher=\fIname\fR
+.sp
+SSL cipher to use (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Key option
+.\" SSL Key option: mysqltest
+\fB\-\-ssl\-key=\fIname\fR
+.sp
+X509 key in PEM format (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Crl option
+.\" SSL CRL option: mysqltest
+\fB\-\-ssl\-crl=\fIname\fR
+.sp
+Certificate revocation list (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Crlpath option
+.\" SSL Crlpath option: mysqltest
+\fB\-\-ssl\-crlpath=\fIname\fR
+.sp
+Certificate revocation list path (check OpenSSL docs, implies
+\fB\-\-ssl\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: SSL Verify Server Cert option
+.\" SSL Verify Server Cert option: mysqltest
+\fB\-\-ssl\-verify\-server\-cert\fR
+.sp
+Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+.\" mysqltest: suite-dir option
+.\" suite-dir option: mysqltest
+\fB\-\-suite\-dir=\fIdir_name\fR
+.sp
+Suite directory\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqltest: tail-lines option
.\" tail-lines option: mysqltest
\fB\-\-tail\-lines=\fR\fB\fInn\fR\fR
@@ -741,7 +982,7 @@ Read test input from this file\&. The default is to read from the standard input
\fB\-\-timer\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-m \fR\fB\fIfile_name\fR\fR
.sp
-If given, the number of millisecond spent running the test will be written to this file\&. This is used by
+If given, the number of microseconds spent running the test will be written to this file\&. This is used by
\fBmysql\-test\-run\&.pl\fR
for its reporting\&.
.RE
@@ -775,7 +1016,7 @@ The temporary directory where socket files are created\&.
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
-The MySQL user name to use when connecting to the server\&.
+The MariaDB user name to use when connecting to the server\&.
.RE
.sp
.RS 4
@@ -824,12 +1065,12 @@ Display version information and exit\&.
.sp
Every
SELECT
-statement is wrapped inside a view\&. This option was added in MySQL 5\&.0\&.19\&.
+statement is wrapped inside a view\&.
.RE
.SH "COPYRIGHT"
.br
.PP
-Copyright \(co 2007, 2010, Oracle and/or its affiliates
+Copyright \(co 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -838,8 +1079,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/ndbd.8 b/man/ndbd.8
index c3c28d7491b..c3e2b3ffbad 100644
--- a/man/ndbd.8
+++ b/man/ndbd.8
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBndbd\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBNDBD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBNDBD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -787,7 +780,7 @@ Section\ \&17.1.5, \(lqKnown Limitations of MySQL Cluster\(rq\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -812,8 +805,6 @@ ndbd Error Messages
\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/ndbd_redo_log_reader.1 b/man/ndbd_redo_log_reader.1
index f6a2326cab4..8c194722675 100644
--- a/man/ndbd_redo_log_reader.1
+++ b/man/ndbd_redo_log_reader.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBndbd_redo_log_reader\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBNDBD_REDO_LOG_REA" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBNDBD_REDO_LOG_REA" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -154,7 +147,7 @@ must be run on a cluster data node, since it accesses the data node file system
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -169,8 +162,6 @@ Cluster Data Node FileSystemDir Files
\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/ndbmtd.8 b/man/ndbmtd.8
index baadd4eaee2..704ce7adff0 100644
--- a/man/ndbmtd.8
+++ b/man/ndbmtd.8
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBndbmtd\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBNDBMTD\FR" "8" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBNDBMTD\FR" "8" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -356,7 +349,7 @@ concurrently on different data nodes in the same MySQL Cluster\&. However, such
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -381,8 +374,6 @@ ndbd Error Messages
\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html
.RE
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/perror.1 b/man/perror.1
index a37cec6a518..f6971872b34 100644
--- a/man/perror.1
+++ b/man/perror.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBperror\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBPERROR\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBPERROR\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -29,7 +22,7 @@ perror \- explain error codes
\fBperror [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIerrorcode\fR\fR\fB \&.\&.\&.\fR
.SH "DESCRIPTION"
.PP
-For most system errors, MySQL displays, in addition to an internal text message, the system error code in one of the following styles:
+For most system errors, MariaDB displays, in addition to an internal text message, the system error code in one of the following styles:
.sp
.if n \{\
.RS 4
@@ -181,7 +174,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -190,8 +183,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/replace.1 b/man/replace.1
index 453600fb5a1..993335e6701 100644
--- a/man/replace.1
+++ b/man/replace.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBreplace\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBREPLACE\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBREPLACE\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -160,7 +153,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -169,8 +162,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/resolve_stack_dump.1 b/man/resolve_stack_dump.1
index 956cd12b2da..549107143f4 100644
--- a/man/resolve_stack_dump.1
+++ b/man/resolve_stack_dump.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBresolve_stack_dump\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBRESOLVE_STACK_DUM" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -117,7 +110,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -126,8 +119,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/man/resolveip.1 b/man/resolveip.1
index 1b35e6b4cff..97584afc686 100644
--- a/man/resolveip.1
+++ b/man/resolveip.1
@@ -1,13 +1,6 @@
'\" t
-.\" Title: \fBresolveip\fR
-.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 04/06/2010
-.\" Manual: MySQL Database System
-.\" Source: MySQL 5.1
-.\" Language: English
.\"
-.TH "\FBRESOLVEIP\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
+.TH "\FBRESOLVEIP\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -99,7 +92,7 @@ Display version information and exit\&.
.SH "COPYRIGHT"
.br
.PP
-Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
@@ -108,8 +101,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
.sp
.SH "SEE ALSO"
-For more information, please refer to the MySQL Reference Manual,
-which may already be installed locally and which is also available
-online at http://dev.mysql.com/doc/.
+For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
-Sun Microsystems, Inc. (http://www.mysql.com/).
+MariaDB Foundation (http://www.mariadb.org/).
diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def
index bb0e243326a..5c4b7421b21 100644
--- a/mysql-test/disabled.def
+++ b/mysql-test/disabled.def
@@ -11,9 +11,7 @@
##############################################################################
tablespace : disabled in MariaDB (no TABLESPACE table attribute)
events_time_zone : Test is not predictable as it depends on precise timing.
-lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
-archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
#show_explain : Psergey: random timeout in range-checked-for-each record query.
@@ -21,3 +19,4 @@ ssl_crl_clients_valid : broken upstream
ssl_crl : broken upstream
ssl_crl_clrpath : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
+lowercase_fs_on : lower_case_table_names=0 is not an error until 10.1
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 3d53fada870..71efb141917 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -1,3 +1,9 @@
+# ==== Usage ====
+#
+# [--let $shutdown_timeout= 30]
+# [--let $allow_rpl_inited= 1]
+# --source include/restart_mysqld.inc
+
--source include/not_embedded.inc
if ($rpl_inited)
@@ -8,6 +14,16 @@ if ($rpl_inited)
}
}
+--let $server_shutdown_timeout= 60
+if ($shutdown_timeout)
+{
+ --let $server_shutdown_timeout= $shutdown_timeout
+}
+if ($shutdown_timeout == 0)
+{
+ --let $server_shutdown_timeout= 0
+}
+
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--let $_server_id= `SELECT @@server_id`
@@ -15,8 +31,8 @@ if ($rpl_inited)
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
-# it 60 seconds to die before zapping it
-shutdown_server 60;
+# it 10 seconds to die before zapping it
+shutdown_server $server_shutdown_timeout;
# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $_expect_file_name
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 60d34ae5e8a..4f514044e84 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1088,7 +1088,6 @@ sub print_global_resfile {
resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0);
resfile_global("warnings", $opt_warnings ? 1 : 0);
resfile_global("max-connections", $opt_max_connections);
-# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0);
resfile_global("product", "MySQL");
# Somewhat hacky code to convert numeric version back to dot notation
my $v1= int($mysql_version_id / 10000);
@@ -1250,7 +1249,6 @@ sub command_line_setup {
'stop-file=s' => \$opt_stop_file,
'stop-keep-alive=i' => \$opt_stop_keep_alive,
'max-connections=i' => \$opt_max_connections,
- 'default-myisam!' => \&collect_option,
'report-times' => \$opt_report_times,
'result-file' => \$opt_resfile,
'stress=s' => \$opt_stress,
@@ -6646,9 +6644,6 @@ Misc options
timediff With --timestamp, also print time passed since
*previous* test started
max-connections=N Max number of open connection to server in mysqltest
- default-myisam Set default storage engine to MyISAM for non-innodb
- tests. This is needed after switching default storage
- engine to InnoDB.
report-times Report how much time has been spent on different
phases of test execution.
stress=ARGS Run stress test, providing options to
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 5df0c2e3c96..e572fdb197c 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -2012,3 +2012,12 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `idx` (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+CREATE TABLE t1 (
+`event_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+`market_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+PRIMARY KEY (`event_id`,`market_id`)
+);
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
+Warnings:
+Note 1061 Multiple primary key defined
+DROP TABLE t1;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 7c44466ae92..2b0b1041936 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -567,7 +567,31 @@ insert into t1 (accountId,balance) values
update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where accountId like 'dealer%') AS copied) where accountId = 'OPERATOR';
set optimizer_switch=@save_derived_optimizer_switch_bug;
drop table t1;
-set optimizer_switch=@save_derived_optimizer_switch;
+#
+# MDEV-6219:Server crashes in Bitmap<64u>::merge
+# (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT,
+# derived_merge
+#
+CREATE TABLE t1 (a VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo'),('bar');
+create procedure p1()
+INSERT INTO t1 SELECT * FROM (
+SELECT * FROM t1
+) AS sq
+WHERE sq.a IN ( SELECT 'baz' FROM DUAL );
+call p1();
+call p1();
+drop procedure p1;
+PREPARE stmt FROM "
+ INSERT INTO t1 SELECT * FROM (
+ SELECT * FROM t1
+ ) AS sq
+ WHERE sq.a IN ( SELECT 'baz' FROM DUAL )
+";
+EXECUTE stmt;
+EXECUTE stmt;
+deallocate prepare stmt;
+drop table t1;
#
# MDEV-6892: WHERE does not apply
#
@@ -580,3 +604,4 @@ select x.id, message from (select id from t1) x left join
where coalesce(message,0) <> 0;
id message
drop table t1,t2;
+set optimizer_switch=@save_derived_optimizer_switch;
diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result
index 04ab385bca6..62e3b1c7331 100644
--- a/mysql-test/r/dyncol.result
+++ b/mysql-test/r/dyncol.result
@@ -1805,5 +1805,20 @@ set impressions = column_add(impressions,
);
drop table t1;
#
+# MDEV-8565: COLUMN_CHECK fails on valid data
+#
+SELECT COLUMN_CHECK(COLUMN_CREATE('a',0,'b','1'));
+COLUMN_CHECK(COLUMN_CREATE('a',0,'b','1'))
+1
+SELECT COLUMN_CHECK(COLUMN_CREATE('a',1,'b','1'));
+COLUMN_CHECK(COLUMN_CREATE('a',1,'b','1'))
+1
+SELECT COLUMN_JSON(COLUMN_CREATE('a',0,'b','1'));
+COLUMN_JSON(COLUMN_CREATE('a',0,'b','1'))
+{"a":0,"b":"1"}
+SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'));
+COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'))
+{"a":1,"b":"1"}
+#
# end of 10.0 tests
#
diff --git a/mysql-test/r/empty_server_name-8224.result b/mysql-test/r/empty_server_name-8224.result
index 6423114470d..4bf592c8932 100644
--- a/mysql-test/r/empty_server_name-8224.result
+++ b/mysql-test/r/empty_server_name-8224.result
@@ -1 +1,2 @@
create server '' foreign data wrapper w2 options (host '127.0.0.1');
+drop server '';
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index 5a64cf14ef5..475a190d73d 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -114,7 +114,8 @@ create table t_event3 (a int, b float);
drop event if exists event3;
Warnings:
Note 1305 Event event3 does not exist
-create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
+create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day)
+comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
select count(*) from t_event3;
count(*)
0
diff --git a/mysql-test/r/events_restart.result b/mysql-test/r/events_restart.result
index ba3aa503b63..0caac907f64 100644
--- a/mysql-test/r/events_restart.result
+++ b/mysql-test/r/events_restart.result
@@ -18,7 +18,7 @@ change column body body longtext character set utf8 collate utf8_bin;
use events_test;
select @@event_scheduler;
@@event_scheduler
-DISABLED
+OFF
show events;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
select event_name from information_schema.events;
@@ -40,12 +40,12 @@ ERROR HY000: Cannot proceed because system tables used by Event Scheduler were f
drop event intact_check;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
set global event_scheduler=on;
-ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
+ERROR HY000: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
set global event_scheduler=off;
-ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
+ERROR HY000: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
show variables like 'event_scheduler';
Variable_name Value
-event_scheduler DISABLED
+event_scheduler OFF
Make sure that we still can create and drop databases,
and no warnings are produced.
drop database if exists mysqltest_database_not_exists;
@@ -58,6 +58,22 @@ Error 1545 Failed to open mysql.event
Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
+check that we can now enable events without restart
+set global event_scheduler=original;
+Warnings:
+Note 1408 Event Scheduler: Loaded 3 events
+select @@global.event_scheduler;
+@@global.event_scheduler
+ON
+set global event_scheduler=on;
+select @@global.event_scheduler;
+@@global.event_scheduler
+ON
+show events;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+events_test abc1 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test abc2 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test abc3 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
Now let's restart the server again
use events_test;
select @@event_scheduler;
diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result
index 0eee7ee9b1e..5a6b9f841c2 100644
--- a/mysql-test/r/explain_non_select.result
+++ b/mysql-test/r/explain_non_select.result
@@ -232,3 +232,44 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index
DROP TABLE t1;
DROP VIEW v1;
+#
+# MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT
+#
+CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM;
+INSERT INTO t1 (i) VALUES (100),(200);
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (10),(20);
+EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+INSERT INTO t1 (i) VALUES (300);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1, t2;
+#
+# MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t3 VALUES (5),(6);
+EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+2 UNION t3 ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+drop table t1,t2,t3;
+#
+# MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS
+#
+CREATE TABLE t1 (a INT) ENGINE = MyISAM;
+CREATE TABLE t2 (b INT) ENGINE = MyISAM;
+INSERT INTO t2 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+drop table t1,t2;
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index c7f548ae2bc..61f63cc7253 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -234,3 +234,20 @@ SELECT if(1, NULL, (SELECT min('hello')));
if(1, NULL, (SELECT min('hello')))
NULL
End of 5.2 tests
+#
+# MDEV-8663: IF Statement returns multiple values erroneously
+# (or Assertion `!null_value' failed in Item::send(Protocol*, String*)
+#
+CREATE TABLE `t1` (
+`datas` VARCHAR(25) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 't1'
+INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4');
+SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`;
+First Second Third
+1.5 1 2
+2.0 1 2
+NULL 1 2
+drop table t1;
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 496d92223c6..bab360d677d 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -374,6 +374,207 @@ NULL
Warnings:
Warning 1411 Incorrect timeout value: '-1' for function get_lock
#
+# MDEV-8624 MariaDB hangs on query with many logical condition
+#
+CREATE TABLE `t1` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`submitdate` datetime DEFAULT NULL,
+`lastpage` int(11) DEFAULT NULL,
+`startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+`token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+`datestamp` datetime NOT NULL,
+`startdate` datetime NOT NULL,
+`ipaddr` text COLLATE utf8_unicode_ci,
+`refurl` text COLLATE utf8_unicode_ci,
+`57813X540X1723` text COLLATE utf8_unicode_ci,
+`57813X540X1724` text COLLATE utf8_unicode_ci,
+`57813X540X1725` text COLLATE utf8_unicode_ci,
+`57813X540X1726` double DEFAULT NULL,
+`57813X540X1909` double DEFAULT NULL,
+`57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X541X17281` text COLLATE utf8_unicode_ci,
+`57813X541X17282` text COLLATE utf8_unicode_ci,
+`57813X541X17283` text COLLATE utf8_unicode_ci,
+`57813X541X17284` text COLLATE utf8_unicode_ci,
+`57813X541X17285` text COLLATE utf8_unicode_ci,
+`57813X541X17286` text COLLATE utf8_unicode_ci,
+`57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X542X18141` text COLLATE utf8_unicode_ci,
+`57813X542X18142` text COLLATE utf8_unicode_ci,
+`57813X542X18143` text COLLATE utf8_unicode_ci,
+`57813X542X18144` text COLLATE utf8_unicode_ci,
+`57813X542X18145` text COLLATE utf8_unicode_ci,
+`57813X542X18146` text COLLATE utf8_unicode_ci,
+`57813X542X18147` text COLLATE utf8_unicode_ci,
+`57813X542X18148` text COLLATE utf8_unicode_ci,
+`57813X542X18149` text COLLATE utf8_unicode_ci,
+`57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X543X18461` text COLLATE utf8_unicode_ci,
+`57813X543X18462` text COLLATE utf8_unicode_ci,
+`57813X543X18463` text COLLATE utf8_unicode_ci,
+`57813X543X18464` text COLLATE utf8_unicode_ci,
+`57813X543X18465` text COLLATE utf8_unicode_ci,
+`57813X543X18466` text COLLATE utf8_unicode_ci,
+`57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X544X18721` text COLLATE utf8_unicode_ci,
+`57813X544X18722` text COLLATE utf8_unicode_ci,
+`57813X544X18723` text COLLATE utf8_unicode_ci,
+`57813X544X18724` text COLLATE utf8_unicode_ci,
+`57813X544X18725` text COLLATE utf8_unicode_ci,
+`57813X544X18726` text COLLATE utf8_unicode_ci,
+`57813X544X18727` text COLLATE utf8_unicode_ci,
+`57813X544X18728` text COLLATE utf8_unicode_ci,
+`57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+`57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `lime_survey_57813_idx` (`token`),
+KEY `57813X540X1723` (`57813X540X1723`(100)),
+KEY `57813X540X1724` (`57813X540X1724`(100)),
+KEY `57813X540X1726` (`57813X540X1726`),
+KEY `57813X540X1725` (`57813X540X1725`(100)),
+KEY `57813X546X1902` (`57813X546X1902`),
+KEY `57813X546X1903` (`57813X546X1903`),
+KEY `57813X546X1904` (`57813X546X1904`)
+);
+SELECT
+COUNT(*) as `N`,
+ROUND(
+(
+SUM(
+(
+(
+IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) +
+IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) +
+IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) +
+IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) +
+IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) +
+IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) +
+IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) +
+IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) +
+IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) +
+IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) +
+IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) +
+IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) +
+IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) +
+IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) +
+IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) +
+IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) +
+IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) +
+IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) +
+IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) +
+IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) +
+IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) +
+IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) +
+IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) +
+IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) +
+IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) +
+IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) +
+IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) +
+IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) +
+IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 )
+)
+/
+(
+IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) +
+IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) +
+IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) +
+IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) +
+IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) +
+IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) +
+IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) +
+IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) +
+IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) +
+IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) +
+IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) +
+IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) +
+IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) +
+IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) +
+IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) +
+IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) +
+IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) +
+IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) +
+IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) +
+IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) +
+IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) +
+IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) +
+IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) +
+IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) +
+IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) +
+IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) +
+IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) +
+IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) +
+IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 )
+)
+)
+)
+/ COUNT(*) ), 4) as `AVG`
+FROM `t1`
+WHERE `submitdate` IS NOT NULL
+AND (
+( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR
+( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR
+( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR
+( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR
+( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR
+( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR
+( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR
+( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR
+( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR
+( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR
+( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR
+( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR
+( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR
+( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR
+( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR
+( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR
+( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR
+( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR
+( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR
+( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR
+( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR
+( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR
+( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR
+( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR
+( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR
+( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR
+( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR
+( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR
+( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) )
+AND 57813X540X1723 = 'Test';
+N AVG
+0 NULL
+drop table t1;
+#
+# End of 5.5 tests
+#
+#
# GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test
#
# IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired
@@ -594,9 +795,6 @@ select is_free_lock(repeat('a', 193));
ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
select release_lock(repeat('a', 193));
ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
-#
-# End of 5.5 tests
-#
# --
# -- WL#5787: IPv6-capable INET_ATON and INET_NTOA functions.
diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result
index f82301699a7..7e9bdd7088f 100644
--- a/mysql-test/r/information_schema2.result
+++ b/mysql-test/r/information_schema2.result
@@ -6,15 +6,15 @@ select variable_name from information_schema.session_variables where variable_na
(select variable_name from information_schema.session_variables where variable_name = 'basedir');
variable_name
BASEDIR
-create table t1 (a char);
-insert t1 values ('a'),('t'),('z');
-flush status;
-select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1;
-a exists (select 1 from information_schema.columns where table_schema=concat('tes',a))
-a 0
-t 1
-z 0
-show status like 'created_tmp_tables';
-Variable_name Value
-Created_tmp_tables 43
-drop table t1;
+create table t1 (x int);
+create table t2 (x int);
+create table t3 (x int);
+create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ;
+delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE');
+select * from t4;
+table_name
+t1
+t2
+t3
+t4
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/r/init_file_set_password-7656.result b/mysql-test/r/init_file_set_password-7656.result
new file mode 100644
index 00000000000..e5b3fc75706
--- /dev/null
+++ b/mysql-test/r/init_file_set_password-7656.result
@@ -0,0 +1,8 @@
+create user foo@localhost;
+select user,host,password from mysql.user where user='foo';
+user host password
+foo localhost
+select user,host,password from mysql.user where user='foo';
+user host password
+foo localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+drop user foo@localhost;
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result
index 7742f456252..1128caf9122 100644
--- a/mysql-test/r/loadxml.result
+++ b/mysql-test/r/loadxml.result
@@ -93,3 +93,30 @@ a b
216 !&bb b;
3 !b3
DROP TABLE t1;
+#
+# Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS
+#
+CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4));
+LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1;
+SELECT * FROM t1 ORDER BY col1, col2, col3, col4;
+col1 col2 col3 col4
+0bc def ghi jkl
+1no NULL pqr stu
+2BC DEF GHI JKL
+3NO NULL PQR STU
+4bc def ghi jkl
+5no pqr stu vwx
+6BC DEF NULL JKL
+7NO PQR STU VWX
+8bc def ghi NULL
+9kl NULL mno pqr
+ABC DEF NULL JKL
+MNO NULL STU VWX
+DROP TABLE t1;
+CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER);
+LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1;
+SELECT * FROM t1 ORDER BY col1, col2, col3;
+col1 col2 col3
+ABC DEF NULL
+GHI NULL 123
+DROP TABLE t1;
diff --git a/mysql-test/r/lowercase_fs_on.result b/mysql-test/r/lowercase_fs_on.result
new file mode 100644
index 00000000000..a090f46cfbf
--- /dev/null
+++ b/mysql-test/r/lowercase_fs_on.result
@@ -0,0 +1,3 @@
+#
+# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
+#
diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result
deleted file mode 100644
index 22e80aaeb26..00000000000
--- a/mysql-test/r/lowercase_table3.result
+++ /dev/null
@@ -1,11 +0,0 @@
-call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
-DROP TABLE IF EXISTS t1,T1;
-CREATE TABLE t1 (a INT);
-SELECT * FROM T1;
-a
-FLUSH TABLES;
-DROP TABLE t1;
-CREATE TABLE bug29839 (a INT) ENGINE=INNODB;
-SELECT * FROM BUG29839;
-ERROR 42S02: Table 'test.BUG29839' doesn't exist
-DROP TABLE bug29839;
diff --git a/mysql-test/r/mdev-504.result b/mysql-test/r/mdev-504.result
index e178127cf2a..4d93e77c6e8 100644
--- a/mysql-test/r/mdev-504.result
+++ b/mysql-test/r/mdev-504.result
@@ -1,3 +1,4 @@
+SET GLOBAL net_write_timeout = 900;
CREATE TABLE A (
pk INTEGER AUTO_INCREMENT PRIMARY KEY,
fdate DATE
@@ -19,3 +20,4 @@ DROP TABLE A;
DROP PROCEDURE p_analyze;
DROP FUNCTION rnd3;
SET GLOBAL use_stat_tables = DEFAULT;
+SET GLOBAL net_write_timeout = DEFAULT;
diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result
index 7890b66d494..6aea4806ddb 100644
--- a/mysql-test/r/mysql_upgrade-6984.result
+++ b/mysql-test/r/mysql_upgrade-6984.result
@@ -57,3 +57,4 @@ Phase 6/6: Running 'FLUSH PRIVILEGES'
OK
update mysql.user set password='' where user='root';
flush privileges;
+set global event_scheduler=OFF;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 4b0b3faf629..ee2b23428aa 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -4292,7 +4292,6 @@ Abernathy
aberrant
aberration
drop table words;
-mysqlimport: Error: 1146, Table 'test.words' doesn't exist, when using table: words
drop table t1;
drop table t2;
drop table words2;
@@ -5286,6 +5285,34 @@ drop table t1, t2;
#
# End of 5.1 tests
#
+#
+# Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS
+#
+CREATE DATABASE db_20772273;
+USE db_20772273;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (3), (4);
+SELECT * FROM t1;
+a
+1
+2
+SELECT * FROM t2;
+a
+3
+4
+SELECT * FROM t1;
+a
+1
+2
+SELECT * FROM t2;
+a
+3
+4
+DROP TABLE t1;
+DROP TABLE t2;
+DROP DATABASE db_20772273;
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result
new file mode 100644
index 00000000000..cbd90b5ba7c
--- /dev/null
+++ b/mysql-test/r/partition_alter.result
@@ -0,0 +1,53 @@
+CREATE TABLE `test_data` (
+`hid` bigint(20) unsigned NOT NULL,
+`itid` bigint(20) unsigned NOT NULL,
+`clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+`values` double(16,4) NOT NULL,
+PRIMARY KEY (`hid`,`itid`,`clocktime`)
+) ;
+INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES
+(1, 1, '2015-03-10 06:25:16', 0.0000),
+(1, 1, '2015-03-10 06:26:24', 0.0000),
+(1, 1, '2015-03-10 06:27:32', 0.0000),
+(1, 1, '2015-03-10 06:28:40', 0.0000),
+(1, 1, '2015-03-10 06:29:49', 0.0000),
+(1, 1, '2015-03-10 06:30:57', 0.0000),
+(1, 1, '2015-03-10 06:32:05', 0.0000),
+(1, 1, '2015-03-10 06:33:14', 0.0000),
+(1, 1, '2015-03-10 06:34:22', 0.0000),
+(1, 1, '2015-03-10 06:35:30', 0.0000),
+(1, 1, '2015-03-10 06:36:39', 0.0000),
+(1, 1, '2015-03-10 06:37:47', 0.0000),
+(1, 1, '2015-03-10 06:38:55', 0.0000),
+(1, 1, '2015-03-10 06:40:03', 0.0000),
+(1, 1, '2015-03-10 06:41:09', 0.0000),
+(1, 1, '2015-03-10 06:42:21', 0.0000),
+(1, 1, '2015-03-10 06:43:29', 0.0000),
+(1, 1, '2015-03-10 06:44:37', 0.0000),
+(1, 1, '2015-03-10 06:45:46', 0.0000),
+(1, 1, '2015-03-10 06:47:05', 0.0000),
+(1, 1, '2015-03-10 06:48:21', 0.0000),
+(1, 1, '2015-03-10 06:49:41', 0.0000),
+(1, 1, '2015-03-10 06:50:58', 0.0000),
+(1, 1, '2015-03-10 06:52:08', 0.0000),
+(1, 1, '2015-03-10 06:53:17', 0.0000),
+(1, 1, '2015-03-10 06:54:25', 0.0000),
+(563, 1, '2015-03-17 14:28:28', 0.3125),
+(563, 1, '2015-03-17 14:29:39', 0.2775),
+(563, 1, '2015-03-17 14:30:49', 0.2675);
+CREATE PROCEDURE `create_part_max`()
+alter table `test_data`
+ partition by range(unix_timestamp(clocktime)) (
+partition partMAX values less than MAXVALUE
+);
+call create_part_max();
+call create_part_max();
+drop procedure create_part_max;
+prepare stmt from "alter table `test_data`
+ partition by range(unix_timestamp(clocktime)) (
+ partition partMAX values less than MAXVALUE
+ )";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+drop table test_data;
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 847af86913d..f05b145053d 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -1099,7 +1099,7 @@ partition by key (a)
subpartition by hash (sin(a+b))
(partition x1 (subpartition x11, subpartition x12),
partition x2 (subpartition x21, subpartition x22));
-ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
+ERROR HY000: This partition function is not allowed
select load_file('$MYSQLD_DATADIR/test/t1.par');
load_file('$MYSQLD_DATADIR/test/t1.par')
NULL
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 798e3b9a6bf..f1c3795791a 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -765,3 +765,37 @@ f1 f2 f3 f4 f5 f6
INSERT INTO t3 SELECT * FROM t2 WHERE f3 = 'm' AND f2 ='c';
DROP TABLE t1,t2,t3;
set global default_storage_engine=default;
+#
+# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
+# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
+#
+CREATE TABLE t1
+(a INT,
+b INT,
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY HASH (a) PARTITIONS 3;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+# con1
+ALTER TABLE t1 ADD INDEX idx1 (b);
+# con default
+SELECT b FROM t1 WHERE b = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+SELECT b FROM t1 WHERE b = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+DROP TABLE t1;
+# Same test without partitioning
+CREATE TABLE t1
+(a INT,
+b INT,
+PRIMARY KEY (a))
+ENGINE = InnoDB;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+# con1
+ALTER TABLE t1 ADD INDEX idx1 (b);
+# con default
+SELECT b FROM t1 WHERE b = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+SELECT b FROM t1 WHERE b = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+DROP TABLE t1;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 31fcea528aa..8d073f8da1e 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -4052,3 +4052,24 @@ SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
drop table t1;
# End of 5.3 tests
+#
+# MDEV-8756: MariaDB 10.0.21 crashes during PREPARE
+#
+CREATE TABLE t1 ( id INT(10), value INT(10) );
+CREATE TABLE t2 ( id INT(10) );
+SET @save_sql_mode= @@sql_mode;
+SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY';
+PREPARE stmt FROM 'UPDATE t1 t1 SET value = (SELECT 1 FROM t2 WHERE id = t1.id)';
+execute stmt;
+insert into t1 values (1,10),(2,10),(3,10);
+insert into t2 values (1),(2);
+execute stmt;
+select * from t1;
+id value
+1 1
+2 1
+3 NULL
+deallocate prepare stmt;
+SET SESSION sql_mode = @save_sql_mode;
+DROP TABLE t1,t2;
+# End of 10.0 tests
diff --git a/mysql-test/r/ps_change_master.result b/mysql-test/r/ps_change_master.result
new file mode 100644
index 00000000000..25069a537a5
--- /dev/null
+++ b/mysql-test/r/ps_change_master.result
@@ -0,0 +1,22 @@
+#
+# CHANGE MASTER TO doesn't work with prepared statements
+#
+CHANGE MASTER TO MASTER_HOST='host1', MASTER_USER='user1';
+# Master_Host : host1
+# Master_User : user1
+SET @s := "CHANGE MASTER TO MASTER_HOST='host2'";
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+# Master_Host : host2
+# Master_User : user1
+SET @s := "CHANGE MASTER TO MASTER_USER='user2'";
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+# Master_Host : host2
+# Master_User : user2
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+# End of test
diff --git a/mysql-test/r/selectivity_no_engine.result b/mysql-test/r/selectivity_no_engine.result
index a14832f9c0a..31037e90a84 100644
--- a/mysql-test/r/selectivity_no_engine.result
+++ b/mysql-test/r/selectivity_no_engine.result
@@ -276,6 +276,23 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where ((`test`.`tb`.`a` = `test`.`ta`.`a`) and (`test`.`ta`.`a` < 40) and (`test`.`ta`.`a` < 100))
drop table t0,t1,t2;
+#
+# MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
+#
+set @tmp_mdev8779=@@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=5;
+CREATE TABLE t1 (
+i int(10) unsigned NOT NULL AUTO_INCREMENT,
+n varchar(2048) NOT NULL,
+d tinyint(1) unsigned NOT NULL,
+p int(10) unsigned NOT NULL,
+PRIMARY KEY (i)
+) DEFAULT CHARSET=utf8;
+insert into t1 values (1,'aaa',1,1), (2,'bbb',2,2);
+SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some text';
+i n d p
+set optimizer_use_condition_selectivity= @tmp_mdev8779;
+DROP TABLE t1;
#
# End of the test file
#
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index b178e0ecfa7..75792a15afa 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -59,7 +59,9 @@ DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
set global event_scheduler=1;
-ERROR HY000: The MariaDB server is running with the --event-scheduler=DISABLED or --skip-grant-tables option so it cannot execute this statement
+Warnings:
+Note 1408 Event Scheduler: Loaded 0 events
+set global event_scheduler=0;
select count(*) from information_schema.COLUMN_PRIVILEGES;
count(*)
0
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 5678a455234..f49a9bc4aa0 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -81,7 +81,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3591,7 +3591,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7019,3 +7019,93 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result
index 5434bb920e3..f6434c8fe4c 100644
--- a/mysql-test/r/subselect_no_exists_to_in.result
+++ b/mysql-test/r/subselect_no_exists_to_in.result
@@ -85,7 +85,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7019,6 +7019,96 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
set optimizer_switch=default;
select @@optimizer_switch like '%exists_to_in=off%';
@@optimizer_switch like '%exists_to_in=off%'
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index 3325889e1e0..49ad0ed4037 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -88,7 +88,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3594,7 +3594,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7012,6 +7012,96 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index 01af3ea4b16..2122747d262 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7010,4 +7010,94 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
set @optimizer_switch_for_subselect_test=null;
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index 16ebf7a4199..a1c468ba334 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -87,7 +87,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3597,7 +3597,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7025,6 +7025,96 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index d98f7ad67de..168908aa356 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
ERROR 42S22: Unknown column 'a' in 'field list'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
@@ -3590,7 +3590,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
drop table t1, t2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
+ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery'
CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
ERROR 42S22: Unknown column 'no_such_column' in 'where clause'
SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
@@ -7010,5 +7010,95 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
+#
+# MDEV-7565: Server crash with Signal 6 (part 2)
+#
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+ControlRev
+NULL
+#
+# MDEV-7445:Server crash with Signal 6
+#
+CREATE PROCEDURE procedure2()
+BEGIN
+Select
+(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+) As `ControlRev`
+ From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+END |
+call procedure2();
+ControlRev
+NULL
+call procedure2();
+ControlRev
+NULL
+drop procedure procedure2;
+SELECT
+(SELECT user FROM mysql.user
+WHERE h.host in (SELECT host FROM mysql.user)
+) AS sq
+FROM mysql.host h GROUP BY h.host;
+sq
+#
+# MDEV-7846:Server crashes in Item_subselect::fix
+#_fields or fails with Thread stack overrun
+#
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(4);
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+EXECUTE stmt;
+sq
+NULL
+EXECUTE stmt;
+sq
+NULL
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+#
+# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+# m_lock_type != 2' failed in handler::ha_index_read_map
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+3
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+f2
+3
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+count(*)
+1
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+sq
+NULL
+drop view v2;
+drop table t1,t2;
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result
index 9a5da710a4c..e6259a3979b 100644
--- a/mysql-test/r/subselect_sj2.result
+++ b/mysql-test/r/subselect_sj2.result
@@ -1262,5 +1262,38 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
+#
+#
+#
+CREATE TABLE t1 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+id int(16) NOT NULL AUTO_INCREMENT,
+t3_id int(16) NOT NULL DEFAULT '0',
+t1_id int(16) NOT NULL DEFAULT '0',
+PRIMARY KEY (id),
+KEY t3_idx (t3_id),
+KEY t1_idx (t1_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t3 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t3 VALUES (1);
+INSERT INTO t2 VALUES (1, 1, 1);
+INSERT INTO t2 VALUES (2, 1, 2);
+INSERT INTO t2 VALUES (3, 1, 2);
+INSERT INTO t2 VALUES (4, 1, 1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+SELECT * FROM t1 WHERE t1.id IN (
+SELECT t2.t1_id FROM t3 JOIN t2 ON t3.id = t2.t3_id WHERE t3.id = 1
+);
+id
+1
+2
+drop table t1,t2,t3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result
index c10b550d11a..64f7ab2e6bf 100644
--- a/mysql-test/r/subselect_sj2_jcl6.result
+++ b/mysql-test/r/subselect_sj2_jcl6.result
@@ -1277,6 +1277,39 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
+#
+#
+#
+CREATE TABLE t1 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+id int(16) NOT NULL AUTO_INCREMENT,
+t3_id int(16) NOT NULL DEFAULT '0',
+t1_id int(16) NOT NULL DEFAULT '0',
+PRIMARY KEY (id),
+KEY t3_idx (t3_id),
+KEY t1_idx (t1_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t3 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t3 VALUES (1);
+INSERT INTO t2 VALUES (1, 1, 1);
+INSERT INTO t2 VALUES (2, 1, 2);
+INSERT INTO t2 VALUES (3, 1, 2);
+INSERT INTO t2 VALUES (4, 1, 1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+SELECT * FROM t1 WHERE t1.id IN (
+SELECT t2.t1_id FROM t3 JOIN t2 ON t3.id = t2.t3_id WHERE t3.id = 1
+);
+id
+1
+2
+drop table t1,t2,t3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
#
diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result
index 4e75aee24a2..08a97175487 100644
--- a/mysql-test/r/subselect_sj2_mat.result
+++ b/mysql-test/r/subselect_sj2_mat.result
@@ -1264,6 +1264,39 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
+#
+#
+#
+CREATE TABLE t1 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+id int(16) NOT NULL AUTO_INCREMENT,
+t3_id int(16) NOT NULL DEFAULT '0',
+t1_id int(16) NOT NULL DEFAULT '0',
+PRIMARY KEY (id),
+KEY t3_idx (t3_id),
+KEY t1_idx (t1_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE t3 (
+id int(16) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t3 VALUES (1);
+INSERT INTO t2 VALUES (1, 1, 1);
+INSERT INTO t2 VALUES (2, 1, 2);
+INSERT INTO t2 VALUES (3, 1, 2);
+INSERT INTO t2 VALUES (4, 1, 1);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+SELECT * FROM t1 WHERE t1.id IN (
+SELECT t2.t1_id FROM t3 JOIN t2 ON t3.id = t2.t3_id WHERE t3.id = 1
+);
+id
+1
+2
+drop table t1,t2,t3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 9eaf1a46d89..db7c2380398 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -561,6 +561,21 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP VIEW v1;
DROP FUNCTION f1;
DROP TABLE t1;
+# Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT
+# RESULTS
+CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB;
+INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string');
+UPDATE t1 SET b = a, a = 'inject';
+SELECT a, b FROM t1;
+a b
+inject start trail
+UPDATE t1 SET b = c, c = 'inject';
+SELECT c, b FROM t1;
+c b
+inject even longer string
+DROP TABLE t1;
+#
+# MDEV-3948 Assertion `records_are_comparable(table)' fails in compare_record(const TABLE*) on UPDATE with simple AND condition, index_merge+index_merge_intersection, InnoDB
#
# Verify that UPDATE does the same number of handler_update
# operations, no matter if there is ORDER BY or not.
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 2ddcaf54cc9..f697f63ca76 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4828,6 +4828,41 @@ View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci
DROP VIEW v1, v2, v3, v4, v5;
#
+# BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION,
+# IS REJECTED
+# Without the patch, reports an error.
+CREATE VIEW v1 (fld1, fld2) AS
+SELECT 1 AS a, 2 AS b
+UNION ALL
+SELECT 1 AS a, 1 AS a;
+# The column names are explicitly specified and not duplicates, hence
+# succeeds.
+CREATE VIEW v2 (fld1, fld2) AS
+SELECT 1 AS a, 2 AS a
+UNION ALL
+SELECT 1 AS a, 1 AS a;
+# The column name in the first SELECT are not duplicates, hence succeeds.
+CREATE VIEW v3 AS
+SELECT 1 AS a, 2 AS b
+UNION ALL
+SELECT 1 AS a, 1 AS a;
+# Should report an error, since the explicitly specified column names are
+# duplicates.
+CREATE VIEW v4 (fld1, fld1) AS
+SELECT 1 AS a, 2 AS b
+UNION ALL
+SELECT 1 AS a, 1 AS a;
+ERROR 42S21: Duplicate column name 'fld1'
+# Should report an error, since duplicate column name is specified in the
+# First SELECT.
+CREATE VIEW v4 AS
+SELECT 1 AS a, 2 AS a
+UNION ALL
+SELECT 1 AS a, 1 AS a;
+ERROR 42S21: Duplicate column name 'a'
+# Cleanup
+DROP VIEW v1, v2, v3;
+#
# lp:833600 Wrong result with view + outer join + uncorrelated subquery (non-semijoin)
#
CREATE TABLE t1 ( a int, b int );
@@ -5562,6 +5597,108 @@ count(v3.i)
0
drop table t1, t2;
drop view v3;
+#
+# MDEV-8525: mariadb 10.0.20 crashing when data is read by Kodi
+# media center (http://kodi.tv).
+#
+CREATE TABLE `t1` (
+`idSong` int(11) NOT NULL AUTO_INCREMENT,
+`idAlbum` int(11) DEFAULT NULL,
+`idPath` int(11) DEFAULT NULL,
+`strArtists` text,
+`strGenres` text,
+`strTitle` varchar(512) DEFAULT NULL,
+`iTrack` int(11) DEFAULT NULL,
+`iDuration` int(11) DEFAULT NULL,
+`iYear` int(11) DEFAULT NULL,
+`dwFileNameCRC` text,
+`strFileName` text,
+`strMusicBrainzTrackID` text,
+`iTimesPlayed` int(11) DEFAULT NULL,
+`iStartOffset` int(11) DEFAULT NULL,
+`iEndOffset` int(11) DEFAULT NULL,
+`idThumb` int(11) DEFAULT NULL,
+`lastplayed` varchar(20) DEFAULT NULL,
+`rating` char(1) DEFAULT '0',
+`comment` text,
+`mood` text,
+PRIMARY KEY (`idSong`),
+UNIQUE KEY `idxSong7` (`idAlbum`,`strMusicBrainzTrackID`(36)),
+KEY `idxSong` (`strTitle`(255)),
+KEY `idxSong1` (`iTimesPlayed`),
+KEY `idxSong2` (`lastplayed`),
+KEY `idxSong3` (`idAlbum`),
+KEY `idxSong6` (`idPath`,`strFileName`(255))
+) DEFAULT CHARSET=utf8;
+INSERT INTO `t1` VALUES (1,1,1,'strArtists1','strGenres1','strTitle1',1,100,2000,NULL,'strFileName1','strMusicBrainzTrackID1',0,0,0,NULL,NULL,'0','',''),(2,2,2,'strArtists2','strGenres2','strTitle2',2,200,2001,NULL,'strFileName2','strMusicBrainzTrackID2',0,0,0,NULL,NULL,'0','','');
+CREATE TABLE `t2` (
+`idAlbum` int(11) NOT NULL AUTO_INCREMENT,
+`strAlbum` varchar(256) DEFAULT NULL,
+`strMusicBrainzAlbumID` text,
+`strArtists` text,
+`strGenres` text,
+`iYear` int(11) DEFAULT NULL,
+`idThumb` int(11) DEFAULT NULL,
+`bCompilation` int(11) NOT NULL DEFAULT '0',
+`strMoods` text,
+`strStyles` text,
+`strThemes` text,
+`strReview` text,
+`strImage` text,
+`strLabel` text,
+`strType` text,
+`iRating` int(11) DEFAULT NULL,
+`lastScraped` varchar(20) DEFAULT NULL,
+`dateAdded` varchar(20) DEFAULT NULL,
+`strReleaseType` text,
+PRIMARY KEY (`idAlbum`),
+UNIQUE KEY `idxAlbum_2` (`strMusicBrainzAlbumID`(36)),
+KEY `idxAlbum` (`strAlbum`(255)),
+KEY `idxAlbum_1` (`bCompilation`)
+) DEFAULT CHARSET=utf8;
+INSERT INTO `t2` VALUES (1,'strAlbum1','strMusicBrainzAlbumID1','strArtists1','strGenres1',2000,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'album');
+CREATE TABLE `t3` (
+`idArtist` int(11) DEFAULT NULL,
+`idAlbum` int(11) DEFAULT NULL,
+`strJoinPhrase` text,
+`boolFeatured` int(11) DEFAULT NULL,
+`iOrder` int(11) DEFAULT NULL,
+`strArtist` text,
+UNIQUE KEY `idxAlbumArtist_1` (`idAlbum`,`idArtist`),
+UNIQUE KEY `idxAlbumArtist_2` (`idArtist`,`idAlbum`),
+KEY `idxAlbumArtist_3` (`boolFeatured`)
+) DEFAULT CHARSET=utf8;
+INSERT INTO `t3` VALUES (1,1,'',0,0,'strArtist1');
+CREATE TABLE `t4` (
+`idArtist` int(11) NOT NULL AUTO_INCREMENT,
+`strArtist` varchar(256) DEFAULT NULL,
+`strMusicBrainzArtistID` text,
+`strBorn` text,
+`strFormed` text,
+`strGenres` text,
+`strMoods` text,
+`strStyles` text,
+`strInstruments` text,
+`strBiography` text,
+`strDied` text,
+`strDisbanded` text,
+`strYearsActive` text,
+`strImage` text,
+`strFanart` text,
+`lastScraped` varchar(20) DEFAULT NULL,
+`dateAdded` varchar(20) DEFAULT NULL,
+PRIMARY KEY (`idArtist`),
+UNIQUE KEY `idxArtist1` (`strMusicBrainzArtistID`(36)),
+KEY `idxArtist` (`strArtist`(255))
+) DEFAULT CHARSET=utf8;
+INSERT INTO `t4` VALUES (1,'strArtist1','strMusicBrainzArtistID',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+CREATE VIEW `v1` AS select `t2`.`idAlbum` AS `idAlbum`,`t2`.`strAlbum` AS `strAlbum`,`t2`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,`t2`.`strArtists` AS `strArtists`,`t2`.`strGenres` AS `strGenres`,`t2`.`iYear` AS `iYear`,`t2`.`strMoods` AS `strMoods`,`t2`.`strStyles` AS `strStyles`,`t2`.`strThemes` AS `strThemes`,`t2`.`strReview` AS `strReview`,`t2`.`strLabel` AS `strLabel`,`t2`.`strType` AS `strType`,`t2`.`strImage` AS `strImage`,`t2`.`iRating` AS `iRating`,`t2`.`bCompilation` AS `bCompilation`,(select min(`t1`.`iTimesPlayed`) from `t1` where (`t1`.`idAlbum` = `t2`.`idAlbum`)) AS `iTimesPlayed`,`t2`.`strReleaseType` AS `strReleaseType` from `t2`;
+CREATE VIEW `v2` AS select `t3`.`idAlbum` AS `idAlbum`,`t3`.`idArtist` AS `idArtist`,`t4`.`strArtist` AS `strArtist`,`t4`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,`t3`.`boolFeatured` AS `boolFeatured`,`t3`.`strJoinPhrase` AS `strJoinPhrase`,`t3`.`iOrder` AS `iOrder` from (`t3` join `t4` on((`t3`.`idArtist` = `t4`.`idArtist`)));
+SELECT v1.*,v2.* FROM v1 LEFT JOIN v2 ON v1.idAlbum = v2.idAlbum WHERE v1.idAlbum = 1 ORDER BY v2.iOrder;
+idAlbum strAlbum strMusicBrainzAlbumID strArtists strGenres iYear strMoods strStyles strThemes strReview strLabel strType strImage iRating bCompilation iTimesPlayed strReleaseType idAlbum idArtist strArtist strMusicBrainzArtistID boolFeatured strJoinPhrase iOrder
+1 strAlbum1 strMusicBrainzAlbumID1 strArtists1 strGenres1 2000 NULL NULL NULL NULL NULL NULL NULL NULL 0 0 album 1 1 strArtist1 strMusicBrainzArtistID 0 0
+drop view v1,v2;
+drop table t1,t2,t3,t4;
# -----------------------------------------------------------------
# -- End of 10.0 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/std_data/bug16171518_1.dat b/mysql-test/std_data/bug16171518_1.dat
new file mode 100644
index 00000000000..b65b9359ce1
--- /dev/null
+++ b/mysql-test/std_data/bug16171518_1.dat
@@ -0,0 +1,59 @@
+<test_rows>
+ <row>
+ <col1>0bc</col1>
+ <col2>def</col2>
+ <col3>ghi</col3>
+ <col4>jkl</col4>
+ </row>
+ <row>
+ <col1>1no</col1>
+ <col2/>
+ <col3>pqr</col3>
+ <col4>stu</col4>
+ </row>
+
+ <row>
+ <col1>2BC</col1>
+ <col2>DEF</col2>
+ <col3>GHI</col3>
+ <col4>JKL</col4>
+ </row>
+ <row>
+ <col1>3NO</col1>
+ <col2 />
+ <col3>PQR</col3>
+ <col4>STU</col4>
+ </row>
+
+ <row col1="4bc" col2="def" col3="ghi" col4="jkl"/>
+ <row col1="5no" col2="pqr" col3="stu" col4="vwx" />
+
+ <row>
+ <field name='col1'>6BC</field>
+ <field name='col2'>DEF</field>
+ <field name='col3'></field>
+ <field name='col4'>JKL</field>
+ </row>
+ <row>
+ <field name='col1'>7NO</field>
+ <field name='col2'>PQR</field>
+ <field name='col3'>STU</field>
+ <field name='col4'>VWX</field>
+ </row>
+
+ <row>
+ <col1>8bc</col1>
+ <col2>def</col2>
+ <col3>ghi</col3>
+ <col4 />
+ </row>
+ <row>
+ <col1>9kl</col1>
+ <col2/>
+ <col3>mno</col3>
+ <col4>pqr</col4>
+ </row>
+
+ <row col1="ABC" col2="DEF" col3="" col4="JKL"/>
+ <row col1="MNO" col2="" col3="STU" col4="VWX"/>
+</test_rows>
diff --git a/mysql-test/std_data/bug16171518_2.dat b/mysql-test/std_data/bug16171518_2.dat
new file mode 100644
index 00000000000..8a483337a0f
--- /dev/null
+++ b/mysql-test/std_data/bug16171518_2.dat
@@ -0,0 +1,12 @@
+<test_rows>
+ <row>
+ <col1>ABC</col1>
+ <col2>DEF</col2>
+ <col3 />
+ </row>
+ <row>
+ <col1>GHI</col1>
+ <col2 />
+ <col3>123</col3>
+ </row>
+</test_rows>
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 86c4c68d02b..3dbc422e47a 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -1520,7 +1520,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1537,7 +1537,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
-### @1=-000000543.210000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1554,7 +1554,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
-### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 0c44061c4e9..8d23c58732a 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2398,9 +2398,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2491,9 +2491,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2667,9 +2667,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2760,9 +2760,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2840,9 +2840,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2933,9 +2933,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3013,9 +3013,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3186,9 +3186,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3279,9 +3279,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3452,9 +3452,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3545,9 +3545,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3638,9 +3638,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index e54e33283fd..ce503b7371f 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2398,9 +2398,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2494,9 +2494,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2672,9 +2672,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2767,9 +2767,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2847,9 +2847,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -2942,9 +2942,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3022,9 +3022,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3197,9 +3197,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3292,9 +3292,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3467,9 +3467,9 @@ BEGIN
### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */
### @29=9999-12-31 23:59:59 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=2146522447 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3562,9 +3562,9 @@ BEGIN
### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @29=1000-01-01 00:00:00 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=75601 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
@@ -3657,9 +3657,9 @@ BEGIN
### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */
### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */
-### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
-### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
+### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */
### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @29=2008-08-04 16:18:06 /* DATETIME meta=0 nullable=1 is_null=0 */
### @30=1217855904 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/suite/innodb/r/innodb-alter-filewrite.result b/mysql-test/suite/innodb/r/innodb-alter-filewrite.result
new file mode 100644
index 00000000000..444b09ad440
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-filewrite.result
@@ -0,0 +1,30 @@
+CREATE TABLE `test_wo_keys` (
+`f01` int AUTO_INCREMENT,
+`f02` bigint, `f03` bigint, `f04` enum('a','b'),
+`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
+`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
+`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
+`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
+`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
+`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
+`f34` int unsigned, `f35` int unsigned,
+PRIMARY KEY `f01` (`f01`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+show status like '%merge_buffers%';
+Variable_name Value
+Innodb_os_merge_buffers_written 0
+Innodb_os_merge_buffers_read 0
+Innodb_os_merge_buffers_merged 0
+ALTER TABLE test_wo_keys
+ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
+ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
+ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
+ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
+ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
+ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
+show status like '%merge_buffers%';
+Variable_name Value
+Innodb_os_merge_buffers_written 0
+Innodb_os_merge_buffers_read 0
+Innodb_os_merge_buffers_merged 0
+DROP TABLE test_wo_keys;
diff --git a/mysql-test/suite/innodb/r/innodb_bug68148.result b/mysql-test/suite/innodb/r/innodb_bug68148.result
new file mode 100644
index 00000000000..88247053389
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug68148.result
@@ -0,0 +1,36 @@
+set global innodb_file_per_table=1;
+CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+CREATE TABLE `main` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`ref_id1` int(11) NOT NULL,
+`ref_id2` int(11) NOT NULL,
+PRIMARY KEY (`id`),
+UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`),
+KEY `FK_set_out_analysis_route_id` (`ref_id2`),
+CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) ,
+CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`)
+) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS=0;
+DROP INDEX `idx_1` ON `main`;
+SHOW TABLES;
+Tables_in_test
+main
+ref_table1
+ref_table2
+# restart and see if we can still access the main table
+SET FOREIGN_KEY_CHECKS=0;
+ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`);
+SHOW CREATE TABLE `main`;
+Table Create Table
+main CREATE TABLE `main` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `ref_id1` int(11) NOT NULL,
+ `ref_id2` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `FK_set_out_analysis_route_id` (`ref_id2`),
+ KEY `idx_1` (`ref_id1`),
+ CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`),
+ CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE main, ref_table1, ref_table2;
diff --git a/mysql-test/suite/innodb/r/innodb_monitor.result b/mysql-test/suite/innodb/r/innodb_monitor.result
index f8d24f4e6f5..89ce676e38b 100644
--- a/mysql-test/suite/innodb/r/innodb_monitor.result
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result
@@ -123,6 +123,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -254,6 +257,9 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -292,6 +298,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
index 1cb2cf77050..c2a8ba1f4db 100644
--- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
+++ b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
@@ -5,4 +5,4 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(m
SET GLOBAL innodb_simulate_comp_failures = 25;
SELECT COUNT(*) FROM t1;
COUNT(*)
-10000
+1500
diff --git a/mysql-test/suite/innodb/r/snapshot.result b/mysql-test/suite/innodb/r/snapshot.result
new file mode 100644
index 00000000000..dcb3d242fc2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/snapshot.result
@@ -0,0 +1,8 @@
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+CREATE TABLE IF NOT EXISTS t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=InnoDB;
+UPDATE t1 SET i = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+UPDATE t1 SET pk = 0;
+ERROR HY000: Table definition has changed, please retry transaction
+commit;
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-filewrite.test b/mysql-test/suite/innodb/t/innodb-alter-filewrite.test
new file mode 100644
index 00000000000..d0372056937
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-alter-filewrite.test
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-8696: Adding indexes on empty table is slow with large innodb_sort_buffer_size.
+#
+
+CREATE TABLE `test_wo_keys` (
+`f01` int AUTO_INCREMENT,
+`f02` bigint, `f03` bigint, `f04` enum('a','b'),
+`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
+`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
+`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
+`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
+`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
+`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
+`f34` int unsigned, `f35` int unsigned,
+PRIMARY KEY `f01` (`f01`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+show status like '%merge_buffers%';
+
+ALTER TABLE test_wo_keys
+ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
+ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
+ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
+ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
+ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
+ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
+
+show status like '%merge_buffers%';
+
+DROP TABLE test_wo_keys;
diff --git a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt b/mysql-test/suite/innodb/t/innodb_bug60229-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/suite/innodb/t/innodb_bug60229.test b/mysql-test/suite/innodb/t/innodb_bug60229.test
index 8dcf15157d6..aee0b96a942 100644
--- a/mysql-test/suite/innodb/t/innodb_bug60229.test
+++ b/mysql-test/suite/innodb/t/innodb_bug60229.test
@@ -2,6 +2,10 @@
# Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
# WITH FOREIGN KEY CONSTRAINT.
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
-- source include/have_innodb.inc
CREATE TABLE PERSON (
diff --git a/mysql-test/suite/innodb/t/innodb_bug68148.test b/mysql-test/suite/innodb/t/innodb_bug68148.test
new file mode 100644
index 00000000000..531baa30e48
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug68148.test
@@ -0,0 +1,41 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+
+#
+# Bug #68148: drop index on a foreign key column leads to missing table
+# MDEV-8845: Table disappear after modifying FK
+#
+
+set global innodb_file_per_table=1;
+
+CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+
+CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+
+CREATE TABLE `main` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `ref_id1` int(11) NOT NULL,
+ `ref_id2` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`),
+ KEY `FK_set_out_analysis_route_id` (`ref_id2`),
+ CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) ,
+ CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`)
+) ENGINE=InnoDB;
+
+SET FOREIGN_KEY_CHECKS=0;
+
+DROP INDEX `idx_1` ON `main`;
+SHOW TABLES;
+
+--echo # restart and see if we can still access the main table
+--source include/restart_mysqld.inc
+
+# This is required to access the table
+SET FOREIGN_KEY_CHECKS=0;
+ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`);
+SHOW CREATE TABLE `main`;
+
+DROP TABLE main, ref_table1, ref_table2;
+
+
diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test
index ae9e0a9b984..cf22935fad6 100644
--- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test
+++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test
@@ -1,8 +1,8 @@
--source include/big_test.inc
# test takes too long with valgrind
--source include/not_valgrind.inc
---let $num_inserts = 10000
---let $num_ops = 10000
+--let $num_inserts = 1500
+--let $num_ops = 3500
--source suite/innodb/include/innodb_simulate_comp_failures.inc
# clean exit
--exit
diff --git a/mysql-test/suite/innodb/t/snapshot.test b/mysql-test/suite/innodb/t/snapshot.test
new file mode 100644
index 00000000000..8e3dc76fe54
--- /dev/null
+++ b/mysql-test/suite/innodb/t/snapshot.test
@@ -0,0 +1,18 @@
+
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+
+--connect (con1,localhost,root,,test)
+CREATE TABLE IF NOT EXISTS t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=InnoDB;
+
+--connection default
+--error 1412
+UPDATE t1 SET i = 0;
+--error 1412
+UPDATE t1 SET pk = 0;
+commit;
+
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test
index 837b33cb3c4..2c1034f3c4d 100644
--- a/mysql-test/suite/innodb/t/xa_recovery.test
+++ b/mysql-test/suite/innodb/t/xa_recovery.test
@@ -6,6 +6,12 @@ if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins wher
# Embedded server does not support restarting.
--source include/not_embedded.inc
+# MDEV-8841 - close tables opened by previous tests,
+# so they don't get marked crashed when the server gets crashed
+--disable_query_log
+FLUSH TABLES;
+--enable_query_log
+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connect (con1,localhost,root);
diff --git a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt b/mysql-test/suite/jp/t/jp_enum_sjis-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test
index e1f22f6fe27..1060f83ec06 100644
--- a/mysql-test/suite/jp/t/jp_enum_sjis.test
+++ b/mysql-test/suite/jp/t/jp_enum_sjis.test
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
--source include/have_sjis.inc
--source include/have_innodb.inc
--character_set sjis
diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt b/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test
index a3d7c47705d..321f8952148 100644
--- a/mysql-test/suite/jp/t/jp_enum_ucs2.test
+++ b/mysql-test/suite/jp/t/jp_enum_ucs2.test
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
--source include/have_ucs2.inc
--source include/have_innodb.inc
diff --git a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt b/mysql-test/suite/jp/t/jp_enum_ujis-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test
index 17e41e0691e..10e8ad55a3c 100644
--- a/mysql-test/suite/jp/t/jp_enum_ujis.test
+++ b/mysql-test/suite/jp/t/jp_enum_ujis.test
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
--source include/have_ujis.inc
--source include/have_innodb.inc
diff --git a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt b/mysql-test/suite/jp/t/jp_enum_utf8-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test
index ff5978da69c..f67939bd02b 100644
--- a/mysql-test/suite/jp/t/jp_enum_utf8.test
+++ b/mysql-test/suite/jp/t/jp_enum_utf8.test
@@ -1,3 +1,7 @@
+#Server variable option 'lower_case_table_names' sets '0' as default value
+#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of
+#insensitive filsystem is not allowed.
+-- source include/have_case_sensitive_file_system.inc
--source include/have_utf8.inc
--source include/have_innodb.inc
--disable_warnings
diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result
index 3f0f2def790..109072be49c 100644
--- a/mysql-test/suite/parts/r/partition_debug.result
+++ b/mysql-test/suite/parts/r/partition_debug.result
@@ -1,5 +1,21 @@
DROP TABLE IF EXISTS t1;
#
+# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
+# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
+#
+CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a))
+PARTITION BY HASH (a) PARTITIONS 3;
+INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"),
+(6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine");
+SET SESSION debug_dbug="+d,ha_partition_fail_index_init";
+SELECT * FROM t1 WHERE b = "Seven";
+ERROR HY000: Table has no partition for value 0
+SET SESSION debug_dbug="-d,ha_partition_fail_index_init";
+SELECT * FROM t1 WHERE b = "Seven";
+a b
+7 Seven
+DROP TABLE t1;
+#
# WL#4445: EXCHANGE PARTITION WITH TABLE
# Verify ddl_log in case of crashing.
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
diff --git a/mysql-test/suite/parts/t/partition_debug.test b/mysql-test/suite/parts/t/partition_debug.test
index aa943e5fbe1..11b66e4afd8 100644
--- a/mysql-test/suite/parts/t/partition_debug.test
+++ b/mysql-test/suite/parts/t/partition_debug.test
@@ -12,6 +12,24 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
+# Partitioning test that require debug features
+
+--echo #
+--echo # Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
+--echo # Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
+--echo #
+CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a))
+ PARTITION BY HASH (a) PARTITIONS 3;
+ INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"),
+ (6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine");
+SET SESSION debug_dbug="+d,ha_partition_fail_index_init";
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+SELECT * FROM t1 WHERE b = "Seven";
+SET SESSION debug_dbug="-d,ha_partition_fail_index_init";
+SELECT * FROM t1 WHERE b = "Seven";
+DROP TABLE t1;
+
+
--let $DATADIR= `SELECT @@datadir;`
--echo #
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index a50c4ffa297..433d793909f 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -92,3 +92,18 @@ object_schema object_name index_name count_fetch count_insert count_update count
test t_60905 i 2 0 0 1
test t_60905 NULL 5 5 0 1
DROP TABLE t_60905;
+use test;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+
+select mysql_errno, returned_sqlstate, message_text, errors, warnings
+from performance_schema.events_statements_history where errors > 0;
+mysql_errno returned_sqlstate message_text errors warnings
+1146 42S02 Table 'test.t1' doesn't exist 1 0
+
+select mysql_errno, returned_sqlstate, message_text, errors, warnings from
+performance_schema.events_statements_history_long where errors > 0;
+mysql_errno returned_sqlstate message_text errors warnings
+1146 42S02 Table 'test.t1' doesn't exist 1 0
diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result
index 8786cd055ca..837c2573a72 100644
--- a/mysql-test/suite/perfschema/r/query_cache.result
+++ b/mysql-test/suite/perfschema/r/query_cache.result
@@ -38,7 +38,7 @@ spins
NULL
select * from performance_schema.setup_timers where name='wait';
NAME TIMER_NAME
-wait CYCLE
+wait {CYCLE_OR_NANOSECOND}
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
@@ -53,7 +53,7 @@ spins
NULL
select * from performance_schema.setup_timers where name='wait';
NAME TIMER_NAME
-wait CYCLE
+wait {CYCLE_OR_NANOSECOND}
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index af19e8db51d..00b175ec391 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -169,3 +169,23 @@ SELECT object_schema,
DROP TABLE t_60905;
+
+#
+# Bug#11929832 - EVENTS_STATEMENTS_HISTORY HAS ERRORS=0 WHEN THERE ARE ERRORS
+#
+# Verify that SQL errors are properly counted.
+
+use test;
+truncate performance_schema.events_statements_history;
+truncate performance_schema.events_statements_history_long;
+
+--error ER_NO_SUCH_TABLE
+select * from t1;
+
+--echo
+select mysql_errno, returned_sqlstate, message_text, errors, warnings
+ from performance_schema.events_statements_history where errors > 0;
+
+--echo
+select mysql_errno, returned_sqlstate, message_text, errors, warnings from
+ performance_schema.events_statements_history_long where errors > 0;
diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test
index 60d4a648222..802e574f89b 100644
--- a/mysql-test/suite/perfschema/t/query_cache.test
+++ b/mysql-test/suite/perfschema/t/query_cache.test
@@ -34,6 +34,7 @@ show status like "Qcache_hits";
select spins from performance_schema.events_waits_current order by event_name limit 1;
+--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
select * from performance_schema.setup_timers where name='wait';
show status like "Qcache_queries_in_cache";
@@ -42,6 +43,7 @@ show status like "Qcache_hits";
select spins from performance_schema.events_waits_current order by event_name limit 1;
+--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
select * from performance_schema.setup_timers where name='wait';
show status like "Qcache_queries_in_cache";
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index e5d1296ae53..fa8724c321d 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
@@ -1,10 +1,13 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+variable_value = @feedback_used + 1
+1
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK used 1
FEEDBACK version 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index 304294b417e..c4ad3717a16 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
@@ -1,10 +1,13 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+variable_value = @feedback_used + 1
+1
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK used 3
FEEDBACK version 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test
index b1bcb2a6bbd..f2f8c1f97a7 100644
--- a/mysql-test/suite/plugins/t/feedback_plugin_load.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test
@@ -4,11 +4,27 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe
}
select plugin_status from information_schema.plugins where plugin_name='feedback';
+
+# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'.
+# We cannot record the actual value, because the test can be executed more than once,
+# but we can check that the value indeed increases as expected.
+# There is still a room for some race condition, e.g. if at the very moment
+# between first SELECT to store the value and the next SELECT to check that it increases,
+# the feedback plugin is activated. But the probability of it is close to 0,
+# so lets get back to it if it ever happens.
+
+# Lets say the plugin was used X times before this SELECT
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now when we are happy with 'FEEDBACK used', we can check everything else
+
--replace_result https http
--sorted_result
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
-
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
# Embedded server does not use the table mysqld.user and thus
# does not automatically use latin1_bin on startup. Use it manually.
diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test
index 45b507f8e78..31542c33482 100644
--- a/mysql-test/suite/plugins/t/feedback_plugin_send.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test
@@ -14,6 +14,15 @@ if (!$MTR_FEEDBACK_PLUGIN) {
# is doing some work in other workers.
#
sleep 310;
+
+# The test expects that the plugin will send a report at least 2 times,
+# now (5 min after loading) and on server shutdown which happens below.
+# Since we have already waited for 5 min, let's be generous
+# and make sure the server has enough time to shut down properly.
+# We won't lose anything if the shutdown is fast, but if it's slow, the plugin
+# will still be able to finish the job and write about it in the error log.
+
+--let $shutdown_timeout= 60
source include/restart_mysqld.inc;
replace_result https http;
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index 79c6f412111..d565b888c5f 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -36,6 +36,10 @@ select user, host, is_role from user where user like 'test%';
user host is_role
create role '';
ERROR OP000: Invalid role specification ``.
+create role ' ';
+ERROR OP000: Invalid role specification ``.
+create role 'foo ';
+drop role foo;
create role r1;
drop user r1;
ERROR HY000: Operation DROP USER failed for 'r1'@'%'
diff --git a/mysql-test/suite/roles/create_and_drop_role.test b/mysql-test/suite/roles/create_and_drop_role.test
index 0bf5b744e6b..71d6de7053f 100644
--- a/mysql-test/suite/roles/create_and_drop_role.test
+++ b/mysql-test/suite/roles/create_and_drop_role.test
@@ -53,6 +53,14 @@ connection default;
create role '';
#
+# MDEV-8609 Server crashes in is_invalid_role_name on reloading ACL with a blank role name
+#
+--error ER_INVALID_ROLE
+create role ' ';
+create role 'foo ';
+drop role foo;
+
+#
# MDEV-5523 Server crashes on DROP USER <rolename>
#
create role r1;
diff --git a/mysql-test/suite/roles/ip-6401.test b/mysql-test/suite/roles/ip-6401.test
index 34d8553afa3..b7d4b168b75 100644
--- a/mysql-test/suite/roles/ip-6401.test
+++ b/mysql-test/suite/roles/ip-6401.test
@@ -1,3 +1,6 @@
+#
+# MDEV-6401 SET ROLE returning ERROR 1959 Invalid role specification for valid role
+#
--source include/not_embedded.inc
create role r1;
create user foo@'127.0.0.1';
diff --git a/mysql-test/suite/roles/rebuild_role_grants.result b/mysql-test/suite/roles/rebuild_role_grants.result
index 2817c046ae9..bc68d8ddc9f 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.result
+++ b/mysql-test/suite/roles/rebuild_role_grants.result
@@ -56,3 +56,9 @@ Host User Role Admin_option
localhost root r1 Y
drop role r1;
drop user u2;
+create user foo@localhost;
+grant create user on *.* to foo@localhost;
+create role look, isp, xxx, ppp;
+rename user current_user to nnnn@'%';
+drop role look, isp, xxx, ppp;
+drop user nnnn@'%';
diff --git a/mysql-test/suite/roles/rebuild_role_grants.test b/mysql-test/suite/roles/rebuild_role_grants.test
index 3ec3577317a..84dbdf78fb8 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.test
+++ b/mysql-test/suite/roles/rebuild_role_grants.test
@@ -54,3 +54,16 @@ select * from mysql.roles_mapping;
drop role r1;
drop user u2;
+
+#
+# MDEV-8614 Assertion `status == 0' failed in add_role_user_mapping_action on RENAME USER
+#
+create user foo@localhost;
+grant create user on *.* to foo@localhost;
+--connect (con1, localhost, foo,,)
+create role look, isp, xxx, ppp;
+rename user current_user to nnnn@'%';
+drop role look, isp, xxx, ppp;
+connection default;
+disconnect con1;
+drop user nnnn@'%';
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
index cf488e889b4..be420cb021b 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
@@ -18,6 +18,7 @@ RESET MASTER;
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS';
include/start_slave.inc
INSERT INTO t1 VALUES (4);
+include/save_master_gtid.inc
SET sql_log_bin= 0;
CALL mtr.add_suppression("The binlog on the master is missing the GTID");
SET sql_log_bin= 1;
@@ -25,6 +26,7 @@ include/wait_for_slave_io_error.inc [errno=1236]
STOP SLAVE SQL_THREAD;
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS';
include/start_slave.inc
+include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_mdev8193.result b/mysql-test/suite/rpl/r/rpl_mdev8193.result
new file mode 100644
index 00000000000..ad92d32e7d4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mdev8193.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave_sql.inc
+CALL mtr.add_suppression("Statement is unsafe because it uses a system function that may return a different value on the slave");
+create table t1 (i int);
+insert into t1 values (1),(2);
+insert into t1 values (3),(4);
+insert into t1 select i+20+0*sleep(1) from t1 where i=1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+flush logs;
+insert into t1 values (5),(6);
+insert into t1 values (7),(8);
+insert into t1 values (9),(10);
+insert into t1 values (11),(12);
+insert into t1 values (13),(14);
+insert into t1 values (15),(16);
+set global slave_parallel_threads = 1;
+start slave until master_log_file='MASTER_FILE', master_log_pos=MASTER_POS;
+drop table t1;
+include/stop_slave_io.inc
+set global slave_parallel_threads = DEFAULT;
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index de67f5f0610..81243bbba49 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -1689,6 +1689,24 @@ a b
include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
include/start_slave.inc
+*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+BEGIN;
+INSERT INTO t2 VALUES (200);
+INSERT INTO t1 VALUES (200);
+INSERT INTO t2 VALUES (201);
+ROLLBACK;
+SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+a
+200
+SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+a
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+a
+200
+SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+a
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 1cf70ba7e67..33284ce58c6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -47,7 +47,7 @@ include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
-ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_to_stmt.result b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result
new file mode 100644
index 00000000000..2dfa82b0305
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result
@@ -0,0 +1,28 @@
+include/master-slave.inc
+[connection master]
+use test;
+create table t1 (a int primary key);
+insert into t1 values (1),(2),(3),(4),(5);
+update t1 set a=a*10;
+use test;
+select * from t1;
+a
+10
+20
+30
+40
+50
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; create table t1 (a int primary key)
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query # # COMMIT
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index e5870cec2c9..7eb29085099 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -47,7 +47,7 @@ include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
-ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
index 304816a65d1..7f4d851f95c 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
@@ -34,7 +34,7 @@ eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos';
--connection server_1
INSERT INTO t1 VALUES (4);
---save_master_pos
+--source include/save_master_gtid.inc
--connection server_2
SET sql_log_bin= 0;
@@ -48,7 +48,7 @@ STOP SLAVE SQL_THREAD;
eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos';
--source include/start_slave.inc
---sync_with_master
+--source include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt
new file mode 100644
index 00000000000..e6685732d90
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt
@@ -0,0 +1 @@
+--innodb-flush-log-at-trx-commit=2
diff --git a/mysql-test/suite/rpl/t/rpl_mdev8193.test b/mysql-test/suite/rpl/t/rpl_mdev8193.test
new file mode 100644
index 00000000000..29c26bb3da4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mdev8193.test
@@ -0,0 +1,56 @@
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+
+--connection slave
+
+--source include/stop_slave_sql.inc
+
+--connection master
+
+CALL mtr.add_suppression("Statement is unsafe because it uses a system function that may return a different value on the slave");
+create table t1 (i int);
+insert into t1 values (1),(2);
+insert into t1 values (3),(4);
+# This sleep() helps trigger the failure more reliably.
+insert into t1 select i+20+0*sleep(1) from t1 where i=1;
+flush logs;
+insert into t1 values (5),(6);
+insert into t1 values (7),(8);
+insert into t1 values (9),(10);
+
+--let $master_file = query_get_value(show master status,File,1)
+--let $master_pos = query_get_value(show master status,Position,1)
+
+insert into t1 values (11),(12);
+insert into t1 values (13),(14);
+insert into t1 values (15),(16);
+
+--connection slave
+
+set global slave_parallel_threads = 1;
+--replace_result $master_file MASTER_FILE $master_pos MASTER_POS
+eval start slave until master_log_file='$master_file', master_log_pos=$master_pos;
+
+--let $show_statement = SHOW SLAVE STATUS
+--let $field = Slave_SQL_Running
+--let $condition = = 'No'
+--let $wait_timeout = 10
+
+--source include/wait_show_condition.inc
+
+if (`select COUNT(*) > 11 from t1`)
+{
+ query_vertical show slave status;
+ SELECT * FROM t1;
+ die "Wrong number of rows in the table";
+}
+
+drop table t1;
+--source include/stop_slave_io.inc
+set global slave_parallel_threads = DEFAULT;
+
+--connection master
+drop table t1;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index e70dcfa5bb0..01a46637f07 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -2369,6 +2369,28 @@ SET GLOBAL debug_dbug=@old_dbug;
+--echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+--connection server_1
+# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB
+# in a transaction. The bug was an assertion on the ROLLBACK due to
+# mark_start_commit() being already called.
+--disable_warnings
+BEGIN;
+INSERT INTO t2 VALUES (200);
+INSERT INTO t1 VALUES (200);
+INSERT INTO t2 VALUES (201);
+ROLLBACK;
+--enable_warnings
+SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t1 WHERE a>=200 ORDER BY a;
+SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+
+
# Clean up.
--connection server_2
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt
new file mode 100644
index 00000000000..83ed8522e72
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt
@@ -0,0 +1 @@
+--binlog-format=row
diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt
new file mode 100644
index 00000000000..af3a211967b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt
@@ -0,0 +1 @@
+--binlog-format=statement
diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt.test b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test
new file mode 100644
index 00000000000..5ca583d881f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test
@@ -0,0 +1,23 @@
+#
+# check that master starterd with log-format=ROW replication can replicate to
+# slave started with log-format=STATEMENT
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+use test;
+
+create table t1 (a int primary key);
+insert into t1 values (1),(2),(3),(4),(5);
+update t1 set a=a*10;
+
+sync_slave_with_master;
+use test;
+select * from t1;
+source include/show_binlog_events.inc;
+
+connection master;
+drop table t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
index 8c0af874228..654b6fc51dd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
@@ -123,6 +123,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -254,6 +257,9 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -292,6 +298,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
index 8c0af874228..654b6fc51dd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
@@ -123,6 +123,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -254,6 +257,9 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -292,6 +298,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
index 8c0af874228..654b6fc51dd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
@@ -123,6 +123,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -254,6 +257,9 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -292,6 +298,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
index 8c0af874228..654b6fc51dd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
@@ -123,6 +123,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -254,6 +257,9 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -292,6 +298,9 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
+os_merge_blocks_written disabled
+os_merge_blocks_read disabled
+os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 4dde3ed6971..05d915ec478 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1699,3 +1699,16 @@ alter table t1 add unique index if not exists idx(i);
alter table t1 add unique index if not exists idx(i);
show create table t1;
DROP TABLE t1;
+
+#
+# MDEV-8358 ADD PRIMARY KEY IF NOT EXISTS -> ERROR 1068 (42000): Multiple primary key
+#
+
+CREATE TABLE t1 (
+ `event_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `market_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`event_id`,`market_id`)
+ );
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
+DROP TABLE t1;
+
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index ddce7f55292..d98e7b56905 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -492,7 +492,38 @@ update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where ac
set optimizer_switch=@save_derived_optimizer_switch_bug;
drop table t1;
-set optimizer_switch=@save_derived_optimizer_switch;
+--echo #
+--echo # MDEV-6219:Server crashes in Bitmap<64u>::merge
+--echo # (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT,
+--echo # derived_merge
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo'),('bar');
+
+create procedure p1()
+ INSERT INTO t1 SELECT * FROM (
+ SELECT * FROM t1
+ ) AS sq
+ WHERE sq.a IN ( SELECT 'baz' FROM DUAL );
+
+call p1();
+call p1();
+drop procedure p1;
+
+PREPARE stmt FROM "
+ INSERT INTO t1 SELECT * FROM (
+ SELECT * FROM t1
+ ) AS sq
+ WHERE sq.a IN ( SELECT 'baz' FROM DUAL )
+";
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+deallocate prepare stmt;
+
+drop table t1;
--echo #
--echo # MDEV-6892: WHERE does not apply
@@ -506,3 +537,5 @@ select x.id, message from (select id from t1) x left join
(select id, 1 as message from t2) y on x.id=y.id
where coalesce(message,0) <> 0;
drop table t1,t2;
+
+set optimizer_switch=@save_derived_optimizer_switch;
diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test
index 86dcee8148a..ac55fec3e2b 100644
--- a/mysql-test/t/dyncol.test
+++ b/mysql-test/t/dyncol.test
@@ -872,5 +872,17 @@ set impressions = column_add(impressions,
drop table t1;
--echo #
+--echo # MDEV-8565: COLUMN_CHECK fails on valid data
+--echo #
+
+SELECT COLUMN_CHECK(COLUMN_CREATE('a',0,'b','1'));
+
+SELECT COLUMN_CHECK(COLUMN_CREATE('a',1,'b','1'));
+
+SELECT COLUMN_JSON(COLUMN_CREATE('a',0,'b','1'));
+
+SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'));
+
+--echo #
--echo # end of 10.0 tests
--echo #
diff --git a/mysql-test/t/empty_server_name-8224.test b/mysql-test/t/empty_server_name-8224.test
index 528bce5dac5..b15e9d82eb8 100644
--- a/mysql-test/t/empty_server_name-8224.test
+++ b/mysql-test/t/empty_server_name-8224.test
@@ -7,3 +7,7 @@ create server '' foreign data wrapper w2 options (host '127.0.0.1');
--shutdown_server 10
--source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+drop server '';
diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test
index 89e8f9ca7dc..eecd11da5f6 100644
--- a/mysql-test/t/events_1.test
+++ b/mysql-test/t/events_1.test
@@ -125,7 +125,8 @@ drop event existant;
create table t_event3 (a int, b float);
drop event if exists event3;
-create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
+create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day)
+ comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
let $wait_condition=SELECT count(*)=0 from t_event3;
--source include/wait_condition.inc
select count(*) from t_event3;
diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test
index c6152e5d961..7f01859e059 100644
--- a/mysql-test/t/events_restart.test
+++ b/mysql-test/t/events_restart.test
@@ -71,9 +71,9 @@ drop event intact_check_1;
drop event intact_check_2;
--error ER_EVENTS_DB_ERROR
drop event intact_check;
---error ER_EVENTS_DB_ERROR
+--error ER_STARTUP
set global event_scheduler=on;
---error ER_EVENTS_DB_ERROR
+--error ER_STARTUP
set global event_scheduler=off;
show variables like 'event_scheduler';
--echo Make sure that we still can create and drop databases,
@@ -84,6 +84,16 @@ drop database mysqltest_db1;
--echo Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
+
+--echo check that we can now enable events without restart
+set global event_scheduler=original;
+select @@global.event_scheduler;
+set global event_scheduler=on;
+select @@global.event_scheduler;
+--sorted_result
+--replace_column 6 # 9 # 10 #
+show events;
+
--echo Now let's restart the server again
--source include/restart_mysqld.inc
diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test
index e36fd518b61..d9ff0fb7245 100644
--- a/mysql-test/t/explain_non_select.test
+++ b/mysql-test/t/explain_non_select.test
@@ -208,3 +208,45 @@ INSERT INTO t1 VALUES (1),(2);
EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1;
DROP TABLE t1;
DROP VIEW v1;
+
+--echo #
+--echo # MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT
+--echo #
+CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM;
+INSERT INTO t1 (i) VALUES (100),(200);
+
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (10),(20);
+
+EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2;
+INSERT INTO t1 (i) VALUES (300);
+CHECK TABLE t1;
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT);
+
+# Data is not necessary, tables can be empty as well
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t3 VALUES (5),(6);
+
+EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3;
+drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS
+--echo #
+CREATE TABLE t1 (a INT) ENGINE = MyISAM;
+CREATE TABLE t2 (b INT) ENGINE = MyISAM;
+INSERT INTO t2 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2';
+EXECUTE stmt;
+drop table t1,t2;
+
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 2b89a618aa6..8fdba77db9b 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -206,6 +206,20 @@ SELECT if(1, NULL, (SELECT min('hello')));
--echo End of 5.2 tests
+--echo #
+--echo # MDEV-8663: IF Statement returns multiple values erroneously
+--echo # (or Assertion `!null_value' failed in Item::send(Protocol*, String*)
+--echo #
+CREATE TABLE `t1` (
+`datas` VARCHAR(25) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4');
+
+SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`;
+
+drop table t1;
+
--disable_query_log
# Restore timezone to default
set time_zone= @@global.time_zone;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 916a952fa3a..26e379299fc 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -398,6 +398,209 @@ SELECT GET_LOCK('ul1', NULL);
SELECT GET_LOCK('ul1', -1);
--echo #
+--echo # MDEV-8624 MariaDB hangs on query with many logical condition
+--echo #
+CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `submitdate` datetime DEFAULT NULL,
+ `lastpage` int(11) DEFAULT NULL,
+ `startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `datestamp` datetime NOT NULL,
+ `startdate` datetime NOT NULL,
+ `ipaddr` text COLLATE utf8_unicode_ci,
+ `refurl` text COLLATE utf8_unicode_ci,
+ `57813X540X1723` text COLLATE utf8_unicode_ci,
+ `57813X540X1724` text COLLATE utf8_unicode_ci,
+ `57813X540X1725` text COLLATE utf8_unicode_ci,
+ `57813X540X1726` double DEFAULT NULL,
+ `57813X540X1909` double DEFAULT NULL,
+ `57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X541X17281` text COLLATE utf8_unicode_ci,
+ `57813X541X17282` text COLLATE utf8_unicode_ci,
+ `57813X541X17283` text COLLATE utf8_unicode_ci,
+ `57813X541X17284` text COLLATE utf8_unicode_ci,
+ `57813X541X17285` text COLLATE utf8_unicode_ci,
+ `57813X541X17286` text COLLATE utf8_unicode_ci,
+ `57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X542X18141` text COLLATE utf8_unicode_ci,
+ `57813X542X18142` text COLLATE utf8_unicode_ci,
+ `57813X542X18143` text COLLATE utf8_unicode_ci,
+ `57813X542X18144` text COLLATE utf8_unicode_ci,
+ `57813X542X18145` text COLLATE utf8_unicode_ci,
+ `57813X542X18146` text COLLATE utf8_unicode_ci,
+ `57813X542X18147` text COLLATE utf8_unicode_ci,
+ `57813X542X18148` text COLLATE utf8_unicode_ci,
+ `57813X542X18149` text COLLATE utf8_unicode_ci,
+ `57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X543X18461` text COLLATE utf8_unicode_ci,
+ `57813X543X18462` text COLLATE utf8_unicode_ci,
+ `57813X543X18463` text COLLATE utf8_unicode_ci,
+ `57813X543X18464` text COLLATE utf8_unicode_ci,
+ `57813X543X18465` text COLLATE utf8_unicode_ci,
+ `57813X543X18466` text COLLATE utf8_unicode_ci,
+ `57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X544X18721` text COLLATE utf8_unicode_ci,
+ `57813X544X18722` text COLLATE utf8_unicode_ci,
+ `57813X544X18723` text COLLATE utf8_unicode_ci,
+ `57813X544X18724` text COLLATE utf8_unicode_ci,
+ `57813X544X18725` text COLLATE utf8_unicode_ci,
+ `57813X544X18726` text COLLATE utf8_unicode_ci,
+ `57813X544X18727` text COLLATE utf8_unicode_ci,
+ `57813X544X18728` text COLLATE utf8_unicode_ci,
+ `57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
+ `57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `lime_survey_57813_idx` (`token`),
+ KEY `57813X540X1723` (`57813X540X1723`(100)),
+ KEY `57813X540X1724` (`57813X540X1724`(100)),
+ KEY `57813X540X1726` (`57813X540X1726`),
+ KEY `57813X540X1725` (`57813X540X1725`(100)),
+ KEY `57813X546X1902` (`57813X546X1902`),
+ KEY `57813X546X1903` (`57813X546X1903`),
+ KEY `57813X546X1904` (`57813X546X1904`)
+);
+
+SELECT
+COUNT(*) as `N`,
+ROUND(
+ (
+ SUM(
+ (
+ (
+ IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) +
+ IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) +
+ IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) +
+ IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) +
+ IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) +
+ IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) +
+ IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) +
+ IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) +
+ IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) +
+ IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) +
+ IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) +
+ IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) +
+ IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) +
+ IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) +
+ IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) +
+ IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) +
+ IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) +
+ IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) +
+ IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) +
+ IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) +
+ IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) +
+ IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) +
+ IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) +
+ IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) +
+ IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) +
+ IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) +
+ IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) +
+ IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) +
+ IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 )
+ )
+ /
+ (
+ IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) +
+ IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) +
+ IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) +
+ IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) +
+ IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) +
+ IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) +
+ IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) +
+ IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) +
+ IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) +
+ IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) +
+ IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) +
+ IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) +
+ IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) +
+ IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) +
+ IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) +
+ IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) +
+ IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) +
+ IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) +
+ IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) +
+ IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) +
+ IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) +
+ IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) +
+ IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) +
+ IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) +
+ IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) +
+ IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) +
+ IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) +
+ IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) +
+ IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 )
+ )
+ )
+ )
+ / COUNT(*) ), 4) as `AVG`
+FROM `t1`
+WHERE `submitdate` IS NOT NULL
+AND (
+ ( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR
+ ( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR
+ ( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR
+ ( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR
+ ( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR
+ ( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR
+ ( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR
+ ( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR
+ ( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR
+ ( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR
+ ( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR
+ ( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR
+ ( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR
+ ( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR
+ ( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR
+ ( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR
+ ( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR
+ ( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR
+ ( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR
+ ( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR
+ ( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR
+ ( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR
+ ( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR
+ ( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR
+ ( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR
+ ( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR
+ ( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR
+ ( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR
+ ( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) )
+AND 57813X540X1723 = 'Test';
+
+drop table t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
--echo # GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test
--echo #
@@ -574,10 +777,6 @@ select is_free_lock(repeat('a', 193));
--error ER_TOO_LONG_IDENT
select release_lock(repeat('a', 193));
---echo #
---echo # End of 5.5 tests
---echo #
-
--echo
--echo # --
diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test
index d577cdc1e4d..9810c5a0aae 100644
--- a/mysql-test/t/information_schema2.test
+++ b/mysql-test/t/information_schema2.test
@@ -8,15 +8,12 @@ select variable_name from information_schema.session_variables where variable_na
(select variable_name from information_schema.session_variables where variable_name = 'basedir');
#
-# information_schema tables inside subqueries, they should not be re-populated
-# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s
-# table. if it's re-populated, it'll do that multiple times)
+# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
#
-create table t1 (a char);
-insert t1 values ('a'),('t'),('z');
-flush status;
-select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1;
-# fix the result in ps-protocol
---replace_result 44 43
-show status like 'created_tmp_tables';
-drop table t1;
+create table t1 (x int);
+create table t2 (x int);
+create table t3 (x int);
+create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ;
+delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE');
+select * from t4;
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/t/init_file_set_password-7656.test b/mysql-test/t/init_file_set_password-7656.test
new file mode 100644
index 00000000000..ecee3924355
--- /dev/null
+++ b/mysql-test/t/init_file_set_password-7656.test
@@ -0,0 +1,26 @@
+#
+# MDEV-7656 init_file option does not allow changing passwords
+#
+--source include/not_embedded.inc
+
+create user foo@localhost;
+
+select user,host,password from mysql.user where user='foo';
+
+--write_file $MYSQLTEST_VARDIR/init.file
+grant all on *.* to foo@localhost identified by 'test';
+EOF
+
+--enable_reconnect
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--source include/wait_until_connected_again.inc
+select user,host,password from mysql.user where user='foo';
+
+drop user foo@localhost;
diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test
index 6faf712b6ce..93e6e82189f 100644
--- a/mysql-test/t/loadxml.test
+++ b/mysql-test/t/loadxml.test
@@ -116,3 +116,17 @@ LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1
ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b);
SELECT * FROM t1 ORDER BY a;
DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS
+--echo #
+CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4));
+LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1;
+SELECT * FROM t1 ORDER BY col1, col2, col3, col4;
+DROP TABLE t1;
+
+CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER);
+LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1;
+SELECT * FROM t1 ORDER BY col1, col2, col3;
+DROP TABLE t1;
diff --git a/mysql-test/t/lowercase_fs_on.test b/mysql-test/t/lowercase_fs_on.test
new file mode 100644
index 00000000000..6da3ef32a0b
--- /dev/null
+++ b/mysql-test/t/lowercase_fs_on.test
@@ -0,0 +1,38 @@
+#
+# Specific tests for case-insensitive file systems
+# i.e. lower_case_filesystem=ON
+#
+-- source include/have_case_insensitive_file_system.inc
+# Embedded server does not support restarting.
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
+--echo #
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+
+--error 0,1
+--remove_file $SEARCH_FILE
+
+#Shutdown the server
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+#Start the server with --lower_case_table_names=0 in Windows.
+--enable_reconnect
+--error 1
+--exec $MYSQLD_CMD --lower_case_table_names=0 > $SEARCH_FILE 2>&1
+
+#Search for the error messege in the server error log.
+let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination\. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode\.;
+--source include/search_pattern_in_file.inc
+
+#Restart the server
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+#Cleanup
+--error 0,1
+--remove_file $SEARCH_FILE
diff --git a/mysql-test/t/lowercase_table3-master.opt b/mysql-test/t/lowercase_table3-master.opt
deleted file mode 100644
index 9b27aef9bf8..00000000000
--- a/mysql-test/t/lowercase_table3-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=0
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
deleted file mode 100644
index f7ca8211288..00000000000
--- a/mysql-test/t/lowercase_table3.test
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Test of force of lower-case-table-names=0
-# (User has case insensitive file system and wants to preserve case of
-# table names)
-#
-
---source include/have_innodb.inc
---source include/have_lowercase0.inc
---source include/have_case_insensitive_file_system.inc
---source include/not_windows.inc
-
-call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
-
---disable_warnings
-DROP TABLE IF EXISTS t1,T1;
---enable_warnings
-
-#
-# This is actually an error, but ok as the user has forced this
-# by using --lower-case-table-names=0
-CREATE TABLE t1 (a INT);
-SELECT * FROM T1;
-FLUSH TABLES;
-DROP TABLE t1;
-
-#
-# InnoDB should in this case be case sensitive
-# Note that this is not true on windows as no this OS, InnoDB is always
-# storing things in lower case.
-#
-
-CREATE TABLE bug29839 (a INT) ENGINE=INNODB;
---error ER_NO_SUCH_TABLE
-SELECT * FROM BUG29839;
-DROP TABLE bug29839;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/mdev-504.test b/mysql-test/t/mdev-504.test
index bc38e99067a..fb5c7666d33 100644
--- a/mysql-test/t/mdev-504.test
+++ b/mysql-test/t/mdev-504.test
@@ -1,5 +1,7 @@
--disable_ps_protocol
+SET GLOBAL net_write_timeout = 900;
+
CREATE TABLE A (
pk INTEGER AUTO_INCREMENT PRIMARY KEY,
fdate DATE
@@ -74,4 +76,4 @@ DROP TABLE A;
DROP PROCEDURE p_analyze;
DROP FUNCTION rnd3;
SET GLOBAL use_stat_tables = DEFAULT;
-
+SET GLOBAL net_write_timeout = DEFAULT;
diff --git a/mysql-test/t/mysql_upgrade-6984.test b/mysql-test/t/mysql_upgrade-6984.test
index 6f10d3f33e9..9bbfbeb3f87 100644
--- a/mysql-test/t/mysql_upgrade-6984.test
+++ b/mysql-test/t/mysql_upgrade-6984.test
@@ -19,4 +19,5 @@ connect(con1,localhost,root,foo,,,);
update mysql.user set password='' where user='root';
flush privileges;
-
+# Load event table
+set global event_scheduler=OFF;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 9d6789541c0..677a66ab4c8 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -904,13 +904,8 @@ select * from t1;
create view v1 as
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
-# Disable warnings since LIMIT warning for unsafe statement if
-# binlog_format = STATEMENT. Note: after BUG#45832, the warning should
-# not be issued.
---disable_warnings
create view v2 as
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
---enable_warnings
--exec $MYSQL_DUMP --skip-comments test
@@ -1780,7 +1775,7 @@ drop table words;
--replace_regex /.*mysqlimport(\.exe)*/mysqlimport/
--replace_result mysqldump.exe mysqldump
--error 1
---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1
+--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat
drop table t1;
drop table t2;
@@ -2459,6 +2454,35 @@ drop table t1, t2;
--echo # End of 5.1 tests
--echo #
+--echo #
+--echo # Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS
+--echo #
+
+CREATE DATABASE db_20772273;
+USE db_20772273;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (3), (4);
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273
+--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql
+--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql
+
+# Test mysqlimport with multiple threads
+--exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+#Cleanup
+DROP TABLE t1;
+DROP TABLE t2;
+DROP DATABASE db_20772273;
+
#
# MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server
#
diff --git a/mysql-test/t/partition_alter.test b/mysql-test/t/partition_alter.test
new file mode 100644
index 00000000000..592d8fdaeaa
--- /dev/null
+++ b/mysql-test/t/partition_alter.test
@@ -0,0 +1,66 @@
+--source include/have_partition.inc
+
+CREATE TABLE `test_data` (
+ `hid` bigint(20) unsigned NOT NULL,
+ `itid` bigint(20) unsigned NOT NULL,
+ `clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `values` double(16,4) NOT NULL,
+ PRIMARY KEY (`hid`,`itid`,`clocktime`)
+ ) ;
+
+INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES
+ (1, 1, '2015-03-10 06:25:16', 0.0000),
+ (1, 1, '2015-03-10 06:26:24', 0.0000),
+ (1, 1, '2015-03-10 06:27:32', 0.0000),
+ (1, 1, '2015-03-10 06:28:40', 0.0000),
+ (1, 1, '2015-03-10 06:29:49', 0.0000),
+ (1, 1, '2015-03-10 06:30:57', 0.0000),
+ (1, 1, '2015-03-10 06:32:05', 0.0000),
+ (1, 1, '2015-03-10 06:33:14', 0.0000),
+ (1, 1, '2015-03-10 06:34:22', 0.0000),
+ (1, 1, '2015-03-10 06:35:30', 0.0000),
+ (1, 1, '2015-03-10 06:36:39', 0.0000),
+ (1, 1, '2015-03-10 06:37:47', 0.0000),
+ (1, 1, '2015-03-10 06:38:55', 0.0000),
+ (1, 1, '2015-03-10 06:40:03', 0.0000),
+ (1, 1, '2015-03-10 06:41:09', 0.0000),
+ (1, 1, '2015-03-10 06:42:21', 0.0000),
+ (1, 1, '2015-03-10 06:43:29', 0.0000),
+ (1, 1, '2015-03-10 06:44:37', 0.0000),
+ (1, 1, '2015-03-10 06:45:46', 0.0000),
+ (1, 1, '2015-03-10 06:47:05', 0.0000),
+ (1, 1, '2015-03-10 06:48:21', 0.0000),
+ (1, 1, '2015-03-10 06:49:41', 0.0000),
+ (1, 1, '2015-03-10 06:50:58', 0.0000),
+ (1, 1, '2015-03-10 06:52:08', 0.0000),
+ (1, 1, '2015-03-10 06:53:17', 0.0000),
+ (1, 1, '2015-03-10 06:54:25', 0.0000),
+ (563, 1, '2015-03-17 14:28:28', 0.3125),
+ (563, 1, '2015-03-17 14:29:39', 0.2775),
+ (563, 1, '2015-03-17 14:30:49', 0.2675);
+
+
+CREATE PROCEDURE `create_part_max`()
+ alter table `test_data`
+ partition by range(unix_timestamp(clocktime)) (
+ partition partMAX values less than MAXVALUE
+ );
+
+call create_part_max();
+
+call create_part_max();
+
+drop procedure create_part_max;
+
+prepare stmt from "alter table `test_data`
+ partition by range(unix_timestamp(clocktime)) (
+ partition partMAX values less than MAXVALUE
+ )";
+
+execute stmt;
+execute stmt;
+
+deallocate prepare stmt;
+
+drop table test_data;
+
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 5396b9e3543..858213b1e30 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -1157,7 +1157,7 @@ subpartition by hash (rand(a+b));
#
# Subpartition by hash, wrong subpartition function
#
---error ER_SUBPARTITION_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 2d90764da0d..6845cca10fb 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -856,3 +856,45 @@ INSERT INTO t3 SELECT * FROM t2 WHERE f3 = 'm' AND f2 ='c';
DROP TABLE t1,t2,t3;
set global default_storage_engine=default;
+
+--echo #
+--echo # Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
+--echo # Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
+--echo #
+CREATE TABLE t1
+(a INT,
+ b INT,
+ PRIMARY KEY (a))
+ ENGINE = InnoDB
+ PARTITION BY HASH (a) PARTITIONS 3;
+ START TRANSACTION WITH CONSISTENT SNAPSHOT;
+ --connect (con1, localhost, root,,)
+ --echo # con1
+ ALTER TABLE t1 ADD INDEX idx1 (b);
+ --connection default
+ --echo # con default
+ --error ER_TABLE_DEF_CHANGED
+ SELECT b FROM t1 WHERE b = 0;
+ --error ER_TABLE_DEF_CHANGED
+ SELECT b FROM t1 WHERE b = 0;
+ --disconnect con1
+ DROP TABLE t1;
+
+--echo # Same test without partitioning
+CREATE TABLE t1
+(a INT,
+ b INT,
+ PRIMARY KEY (a))
+ ENGINE = InnoDB;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+--echo # con1
+--connect (con1, localhost, root,,)
+ALTER TABLE t1 ADD INDEX idx1 (b);
+--connection default
+--echo # con default
+--error ER_TABLE_DEF_CHANGED
+SELECT b FROM t1 WHERE b = 0;
+--error ER_TABLE_DEF_CHANGED
+SELECT b FROM t1 WHERE b = 0;
+--disconnect con1
+DROP TABLE t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 0233b2e428b..c45b27281a7 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3633,3 +3633,25 @@ SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
drop table t1;
--echo # End of 5.3 tests
+
+--echo #
+--echo # MDEV-8756: MariaDB 10.0.21 crashes during PREPARE
+--echo #
+
+CREATE TABLE t1 ( id INT(10), value INT(10) );
+CREATE TABLE t2 ( id INT(10) );
+SET @save_sql_mode= @@sql_mode;
+SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY';
+
+PREPARE stmt FROM 'UPDATE t1 t1 SET value = (SELECT 1 FROM t2 WHERE id = t1.id)';
+execute stmt;
+insert into t1 values (1,10),(2,10),(3,10);
+insert into t2 values (1),(2);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+SET SESSION sql_mode = @save_sql_mode;
+DROP TABLE t1,t2;
+
+
+--echo # End of 10.0 tests
diff --git a/mysql-test/t/ps_change_master.test b/mysql-test/t/ps_change_master.test
new file mode 100644
index 00000000000..d756b8cd4fb
--- /dev/null
+++ b/mysql-test/t/ps_change_master.test
@@ -0,0 +1,45 @@
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+--echo #
+--echo # CHANGE MASTER TO doesn't work with prepared statements
+--echo #
+
+CHANGE MASTER TO MASTER_HOST='host1', MASTER_USER='user1';
+
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1);
+
+--echo # Master_Host : $master_host
+--echo # Master_User : $master_user
+
+SET @s := "CHANGE MASTER TO MASTER_HOST='host2'";
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1);
+
+--echo # Master_Host : $master_host
+--echo # Master_User : $master_user
+
+SET @s := "CHANGE MASTER TO MASTER_USER='user2'";
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+# Multiple executions should not hurt.
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
+let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1);
+
+--echo # Master_Host : $master_host
+--echo # Master_User : $master_user
+
+
+# Reset
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+
+--echo # End of test
diff --git a/mysql-test/t/selectivity_no_engine.test b/mysql-test/t/selectivity_no_engine.test
index fc425daff6d..2a31c01ed97 100644
--- a/mysql-test/t/selectivity_no_engine.test
+++ b/mysql-test/t/selectivity_no_engine.test
@@ -210,6 +210,23 @@ explain extended select * from t1 ta, t2 tb where ta.a < 40 and tb.a < 100 and t
drop table t0,t1,t2;
+--echo #
+--echo # MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
+--echo #
+set @tmp_mdev8779=@@optimizer_use_condition_selectivity;
+set optimizer_use_condition_selectivity=5;
+CREATE TABLE t1 (
+ i int(10) unsigned NOT NULL AUTO_INCREMENT,
+ n varchar(2048) NOT NULL,
+ d tinyint(1) unsigned NOT NULL,
+ p int(10) unsigned NOT NULL,
+ PRIMARY KEY (i)
+) DEFAULT CHARSET=utf8;
+insert into t1 values (1,'aaa',1,1), (2,'bbb',2,2);
+SELECT * FROM t1 WHERE t1.d = 0 AND t1.p = '1' AND t1.i != '-1' AND t1.n = 'some text';
+set optimizer_use_condition_selectivity= @tmp_mdev8779;
+DROP TABLE t1;
+
--echo #
--echo # End of the test file
--echo #
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 6f4d23e1e14..77339478fdb 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -112,8 +112,8 @@ DROP FUNCTION f3;
#
# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
#
---error ER_OPTION_PREVENTS_STATEMENT
set global event_scheduler=1;
+set global event_scheduler=0;
#
# Bug#26285 Selecting information_schema crahes server
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index d1c3774947a..d6a7300b03a 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -53,7 +53,7 @@ SELECT 1 IN (SELECT 1);
SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
-- error ER_WRONG_USAGE
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
--- error ER_WRONG_PARAMETERS_TO_PROCEDURE
+-- error ER_PARSE_ERROR
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
-- error ER_BAD_FIELD_ERROR
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
@@ -5890,3 +5890,100 @@ DROP TABLE t1,t2;
create table t1 (c int);
select exists(select 1 from t1 group by `c` in (select `c` from t1));
drop table t1;
+
+--echo #
+--echo # MDEV-7565: Server crash with Signal 6 (part 2)
+--echo #
+Select
+ (Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+ Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+ ) As `ControlRev`
+From
+(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+Group By TestCase.Revenue, TestCase.TemplateID;
+
+--echo #
+--echo # MDEV-7445:Server crash with Signal 6
+--echo #
+
+--delimiter |
+CREATE PROCEDURE procedure2()
+BEGIN
+ Select
+ (Select Sum(`TestCase`.Revenue) From mysql.slow_log E
+ Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+ ) As `ControlRev`
+ From
+ (Select 3 as Revenue, 4 as TemplateID) As `TestCase`
+ Group By TestCase.Revenue, TestCase.TemplateID;
+
+END |
+--delimiter ;
+call procedure2();
+call procedure2();
+
+drop procedure procedure2;
+
+
+SELECT
+ (SELECT user FROM mysql.user
+ WHERE h.host in (SELECT host FROM mysql.user)
+ ) AS sq
+FROM mysql.host h GROUP BY h.host;
+
+
+--echo #
+--echo # MDEV-7846:Server crashes in Item_subselect::fix
+--echo #_fields or fails with Thread stack overrun
+--echo #
+CREATE TABLE t1 (column1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3),(9);
+
+CREATE TABLE t2 (column2 INT) ENGINE=MyISAM;
+
+INSERT INTO t2 VALUES (1),(4);
+
+CREATE TABLE t3 (column3 INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (6),(8);
+
+CREATE TABLE t4 (column4 INT) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (2),(5);
+
+
+PREPARE stmt FROM "
+SELECT (
+ SELECT MAX( table1.column1 ) AS field1
+ FROM t1 AS table1
+ WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 )
+) AS sq
+FROM t3 AS table3, t4 AS table4 GROUP BY sq
+";
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+deallocate prepare stmt;
+drop table t1,t2,t3,t4;
+
+--echo #
+--echo # MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
+--echo # m_lock_type != 2' failed in handler::ha_index_read_map
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (3);
+
+CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
+
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0;
+SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 );
+
+delete from t1;
+SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq;
+
+drop view v2;
+drop table t1,t2;
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test
index 0bf9c6d9d10..6ed36083b33 100644
--- a/mysql-test/t/subselect_sj2.test
+++ b/mysql-test/t/subselect_sj2.test
@@ -1391,5 +1391,44 @@ eval explain $query;
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
+--echo #
+--echo #
+--echo #
+CREATE TABLE t1 (
+ id int(16) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE t2 (
+ id int(16) NOT NULL AUTO_INCREMENT,
+ t3_id int(16) NOT NULL DEFAULT '0',
+ t1_id int(16) NOT NULL DEFAULT '0',
+ PRIMARY KEY (id),
+ KEY t3_idx (t3_id),
+ KEY t1_idx (t1_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE t3 (
+ id int(16) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+INSERT INTO t3 VALUES (1);
+
+INSERT INTO t2 VALUES (1, 1, 1);
+INSERT INTO t2 VALUES (2, 1, 2);
+INSERT INTO t2 VALUES (3, 1, 2);
+INSERT INTO t2 VALUES (4, 1, 1);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+
+SELECT * FROM t1 WHERE t1.id IN (
+ SELECT t2.t1_id FROM t3 JOIN t2 ON t3.id = t2.t3_id WHERE t3.id = 1
+);
+
+drop table t1,t2,t3;
+
--echo # This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 09d32966c50..05f9ce39bec 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -506,6 +506,21 @@ DROP VIEW v1;
DROP FUNCTION f1;
DROP TABLE t1;
+--echo # Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT
+--echo # RESULTS
+
+CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB;
+
+INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string');
+UPDATE t1 SET b = a, a = 'inject';
+SELECT a, b FROM t1;
+UPDATE t1 SET b = c, c = 'inject';
+SELECT c, b FROM t1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-3948 Assertion `records_are_comparable(table)' fails in compare_record(const TABLE*) on UPDATE with simple AND condition, index_merge+index_merge_intersection, InnoDB
--echo #
--echo # Verify that UPDATE does the same number of handler_update
--echo # operations, no matter if there is ORDER BY or not.
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 8c2a8ac8dc2..773df49de6f 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4741,6 +4741,50 @@ SHOW CREATE VIEW v4;
DROP VIEW v1, v2, v3, v4, v5;
+
+--echo #
+--echo # BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION,
+--echo # IS REJECTED
+
+--echo # Without the patch, reports an error.
+CREATE VIEW v1 (fld1, fld2) AS
+ SELECT 1 AS a, 2 AS b
+ UNION ALL
+ SELECT 1 AS a, 1 AS a;
+
+--echo # The column names are explicitly specified and not duplicates, hence
+--echo # succeeds.
+CREATE VIEW v2 (fld1, fld2) AS
+ SELECT 1 AS a, 2 AS a
+ UNION ALL
+ SELECT 1 AS a, 1 AS a;
+
+--echo # The column name in the first SELECT are not duplicates, hence succeeds.
+CREATE VIEW v3 AS
+ SELECT 1 AS a, 2 AS b
+ UNION ALL
+ SELECT 1 AS a, 1 AS a;
+
+--echo # Should report an error, since the explicitly specified column names are
+--echo # duplicates.
+--error ER_DUP_FIELDNAME
+CREATE VIEW v4 (fld1, fld1) AS
+ SELECT 1 AS a, 2 AS b
+ UNION ALL
+ SELECT 1 AS a, 1 AS a;
+
+--echo # Should report an error, since duplicate column name is specified in the
+--echo # First SELECT.
+--error ER_DUP_FIELDNAME
+CREATE VIEW v4 AS
+ SELECT 1 AS a, 2 AS a
+ UNION ALL
+ SELECT 1 AS a, 1 AS a;
+
+--echo # Cleanup
+DROP VIEW v1, v2, v3;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
@@ -5445,6 +5489,119 @@ execute stmt;
drop table t1, t2;
drop view v3;
+--echo #
+--echo # MDEV-8525: mariadb 10.0.20 crashing when data is read by Kodi
+--echo # media center (http://kodi.tv).
+--echo #
+
+CREATE TABLE `t1` (
+ `idSong` int(11) NOT NULL AUTO_INCREMENT,
+ `idAlbum` int(11) DEFAULT NULL,
+ `idPath` int(11) DEFAULT NULL,
+ `strArtists` text,
+ `strGenres` text,
+ `strTitle` varchar(512) DEFAULT NULL,
+ `iTrack` int(11) DEFAULT NULL,
+ `iDuration` int(11) DEFAULT NULL,
+ `iYear` int(11) DEFAULT NULL,
+ `dwFileNameCRC` text,
+ `strFileName` text,
+ `strMusicBrainzTrackID` text,
+ `iTimesPlayed` int(11) DEFAULT NULL,
+ `iStartOffset` int(11) DEFAULT NULL,
+ `iEndOffset` int(11) DEFAULT NULL,
+ `idThumb` int(11) DEFAULT NULL,
+ `lastplayed` varchar(20) DEFAULT NULL,
+ `rating` char(1) DEFAULT '0',
+ `comment` text,
+ `mood` text,
+ PRIMARY KEY (`idSong`),
+ UNIQUE KEY `idxSong7` (`idAlbum`,`strMusicBrainzTrackID`(36)),
+ KEY `idxSong` (`strTitle`(255)),
+ KEY `idxSong1` (`iTimesPlayed`),
+ KEY `idxSong2` (`lastplayed`),
+ KEY `idxSong3` (`idAlbum`),
+ KEY `idxSong6` (`idPath`,`strFileName`(255))
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO `t1` VALUES (1,1,1,'strArtists1','strGenres1','strTitle1',1,100,2000,NULL,'strFileName1','strMusicBrainzTrackID1',0,0,0,NULL,NULL,'0','',''),(2,2,2,'strArtists2','strGenres2','strTitle2',2,200,2001,NULL,'strFileName2','strMusicBrainzTrackID2',0,0,0,NULL,NULL,'0','','');
+
+CREATE TABLE `t2` (
+ `idAlbum` int(11) NOT NULL AUTO_INCREMENT,
+ `strAlbum` varchar(256) DEFAULT NULL,
+ `strMusicBrainzAlbumID` text,
+ `strArtists` text,
+ `strGenres` text,
+ `iYear` int(11) DEFAULT NULL,
+ `idThumb` int(11) DEFAULT NULL,
+ `bCompilation` int(11) NOT NULL DEFAULT '0',
+ `strMoods` text,
+ `strStyles` text,
+ `strThemes` text,
+ `strReview` text,
+ `strImage` text,
+ `strLabel` text,
+ `strType` text,
+ `iRating` int(11) DEFAULT NULL,
+ `lastScraped` varchar(20) DEFAULT NULL,
+ `dateAdded` varchar(20) DEFAULT NULL,
+ `strReleaseType` text,
+ PRIMARY KEY (`idAlbum`),
+ UNIQUE KEY `idxAlbum_2` (`strMusicBrainzAlbumID`(36)),
+ KEY `idxAlbum` (`strAlbum`(255)),
+ KEY `idxAlbum_1` (`bCompilation`)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO `t2` VALUES (1,'strAlbum1','strMusicBrainzAlbumID1','strArtists1','strGenres1',2000,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'album');
+
+CREATE TABLE `t3` (
+ `idArtist` int(11) DEFAULT NULL,
+ `idAlbum` int(11) DEFAULT NULL,
+ `strJoinPhrase` text,
+ `boolFeatured` int(11) DEFAULT NULL,
+ `iOrder` int(11) DEFAULT NULL,
+ `strArtist` text,
+ UNIQUE KEY `idxAlbumArtist_1` (`idAlbum`,`idArtist`),
+ UNIQUE KEY `idxAlbumArtist_2` (`idArtist`,`idAlbum`),
+ KEY `idxAlbumArtist_3` (`boolFeatured`)
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO `t3` VALUES (1,1,'',0,0,'strArtist1');
+
+CREATE TABLE `t4` (
+ `idArtist` int(11) NOT NULL AUTO_INCREMENT,
+ `strArtist` varchar(256) DEFAULT NULL,
+ `strMusicBrainzArtistID` text,
+ `strBorn` text,
+ `strFormed` text,
+ `strGenres` text,
+ `strMoods` text,
+ `strStyles` text,
+ `strInstruments` text,
+ `strBiography` text,
+ `strDied` text,
+ `strDisbanded` text,
+ `strYearsActive` text,
+ `strImage` text,
+ `strFanart` text,
+ `lastScraped` varchar(20) DEFAULT NULL,
+ `dateAdded` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`idArtist`),
+ UNIQUE KEY `idxArtist1` (`strMusicBrainzArtistID`(36)),
+ KEY `idxArtist` (`strArtist`(255))
+) DEFAULT CHARSET=utf8;
+
+INSERT INTO `t4` VALUES (1,'strArtist1','strMusicBrainzArtistID',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+CREATE VIEW `v1` AS select `t2`.`idAlbum` AS `idAlbum`,`t2`.`strAlbum` AS `strAlbum`,`t2`.`strMusicBrainzAlbumID` AS `strMusicBrainzAlbumID`,`t2`.`strArtists` AS `strArtists`,`t2`.`strGenres` AS `strGenres`,`t2`.`iYear` AS `iYear`,`t2`.`strMoods` AS `strMoods`,`t2`.`strStyles` AS `strStyles`,`t2`.`strThemes` AS `strThemes`,`t2`.`strReview` AS `strReview`,`t2`.`strLabel` AS `strLabel`,`t2`.`strType` AS `strType`,`t2`.`strImage` AS `strImage`,`t2`.`iRating` AS `iRating`,`t2`.`bCompilation` AS `bCompilation`,(select min(`t1`.`iTimesPlayed`) from `t1` where (`t1`.`idAlbum` = `t2`.`idAlbum`)) AS `iTimesPlayed`,`t2`.`strReleaseType` AS `strReleaseType` from `t2`;
+
+CREATE VIEW `v2` AS select `t3`.`idAlbum` AS `idAlbum`,`t3`.`idArtist` AS `idArtist`,`t4`.`strArtist` AS `strArtist`,`t4`.`strMusicBrainzArtistID` AS `strMusicBrainzArtistID`,`t3`.`boolFeatured` AS `boolFeatured`,`t3`.`strJoinPhrase` AS `strJoinPhrase`,`t3`.`iOrder` AS `iOrder` from (`t3` join `t4` on((`t3`.`idArtist` = `t4`.`idArtist`)));
+
+SELECT v1.*,v2.* FROM v1 LEFT JOIN v2 ON v1.idAlbum = v2.idAlbum WHERE v1.idAlbum = 1 ORDER BY v2.iOrder;
+
+drop view v1,v2;
+drop table t1,t2,t3,t4;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 10.0 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index a7a048acac1..7e47856ce2d 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -3723,10 +3723,12 @@ mariadb_dyncol_check(DYNAMIC_COLUMN *str)
if (prev_type != DYN_COL_NULL)
{
/* It is not first entry */
- if (prev_data_offset >= data_offset)
+ if (prev_data_offset > data_offset ||
+ ((prev_type != DYN_COL_INT &&
+ prev_type != DYN_COL_UINT) && prev_data_offset == data_offset))
{
DBUG_PRINT("info", ("Field order: %u Previous data offset: %u"
- " >= Current data offset: %u",
+ " >(=) Current data offset: %u",
(uint)i,
(uint)prev_data_offset,
(uint)data_offset));
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 0faba93c0a3..16ac749fa09 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -552,17 +552,21 @@ int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
Allocate memory for blocks, hash_links and hash entries;
For each block 2 hash links are allocated
*/
- if (my_multi_malloc(MYF(MY_ZEROFILL),
- &keycache->block_root, blocks * sizeof(BLOCK_LINK),
- &keycache->hash_root,
- sizeof(HASH_LINK*) * keycache->hash_entries,
- &keycache->hash_link_root,
- hash_links * sizeof(HASH_LINK),
- &keycache->changed_blocks,
- sizeof(BLOCK_LINK*) * changed_blocks_hash_size,
- &keycache->file_blocks,
- sizeof(BLOCK_LINK*) * changed_blocks_hash_size,
- NullS))
+ if (my_multi_malloc_large(MYF(MY_ZEROFILL),
+ &keycache->block_root,
+ (ulonglong) (blocks * sizeof(BLOCK_LINK)),
+ &keycache->hash_root,
+ (ulonglong) (sizeof(HASH_LINK*) *
+ keycache->hash_entries),
+ &keycache->hash_link_root,
+ (ulonglong) (hash_links * sizeof(HASH_LINK)),
+ &keycache->changed_blocks,
+ (ulonglong) (sizeof(BLOCK_LINK*) *
+ changed_blocks_hash_size),
+ &keycache->file_blocks,
+ (ulonglong) (sizeof(BLOCK_LINK*) *
+ changed_blocks_hash_size),
+ NullS))
break;
my_large_free(keycache->block_mem);
keycache->block_mem= 0;
diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c
index 9384ed744ad..fceecdc1dc7 100644
--- a/mysys/mulalloc.c
+++ b/mysys/mulalloc.c
@@ -62,3 +62,47 @@ void* my_multi_malloc(myf myFlags, ...)
va_end(args);
DBUG_RETURN((void*) start);
}
+
+
+/*
+ Same as my_multi_malloc, but each entry can be over 4G
+
+ SYNOPSIS
+ my_multi_malloc()
+ myFlags Flags
+ ptr1, length1 Multiple arguments terminated by null ptr
+ ptr2, length2 ...
+ ...
+ NULL
+*/
+
+void *my_multi_malloc_large(myf myFlags, ...)
+{
+ va_list args;
+ char **ptr,*start,*res;
+ size_t tot_length,length;
+ DBUG_ENTER("my_multi_malloc");
+
+ va_start(args,myFlags);
+ tot_length=0;
+ while ((ptr=va_arg(args, char **)))
+ {
+ length=va_arg(args,ulonglong);
+ tot_length+=ALIGN_SIZE(length);
+ }
+ va_end(args);
+
+ if (!(start=(char *) my_malloc(tot_length, myFlags)))
+ DBUG_RETURN(0); /* purecov: inspected */
+
+ va_start(args,myFlags);
+ res=start;
+ while ((ptr=va_arg(args, char **)))
+ {
+ *ptr=res;
+ length=va_arg(args,ulonglong);
+ res+=ALIGN_SIZE(length);
+ }
+ va_end(args);
+ DBUG_RETURN((void*) start);
+}
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 6cfe75961f3..d08d04914ee 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -202,8 +202,10 @@ cannot_find_file()
fi
echo
- echo "If you compiled from source, you need to run 'make install' to"
+ echo "If you compiled from source, you need to either run 'make install' to"
echo "copy the software into the correct location ready for operation."
+ echo "If you don't want to do a full install, you can use the --srcddir"
+ echo "option to only install the mysql database and privilege tables"
echo
echo "If you are using a binary release, you must either be at the top"
echo "level of the extracted archive, or pass the --basedir option"
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index d91e31cda48..82ea1b60a17 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -24,7 +24,6 @@ rootpass=""
echo_n=
echo_c=
basedir=
-bindir=
defaults_file=
defaults_extra_file=
no_defaults=
@@ -159,8 +158,15 @@ then
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
exit 1
fi
+ mysql_command=`find_in_basedir mysql bin`
+ if test -z "$mysql_command"
+ then
+ cannot_find_file mysql $basedir/bin
+ exit 1
+ fi
else
print_defaults="@bindir@/my_print_defaults"
+ mysql_command="@bindir@/mysql"
fi
if test ! -x "$print_defaults"
@@ -169,29 +175,17 @@ then
exit 1
fi
+if test ! -x "$mysql_command"
+then
+ cannot_find_file "$mysql_command"
+ exit 1
+fi
+
# Now we can get arguments from the group [client] and [client-server]
# in the my.cfg file, then re-run to merge with command line arguments.
parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
-# Configure paths to support files
-if test -n "$basedir"
-then
- bindir="$basedir/bin"
-elif test -f "./bin/mysql"
- then
- bindir="./bin"
-else
- bindir="@bindir@"
-fi
-
-mysql_command=`find_in_basedir mysql $bindir`
-if test -z "$mysql_command"
-then
- cannot_find_file mysql $bindir
- exit 1
-fi
-
set_echo_compat() {
case `echo "testing\c"`,`echo -n testing` in
*c*,-n*) echo_n= echo_c= ;;
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index b81eb4e8e40..33b4306b103 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -597,6 +597,8 @@ ALTER TABLE event ADD body_utf8 longblob DEFAULT NULL
AFTER db_collation;
ALTER TABLE event MODIFY body_utf8 longblob DEFAULT NULL;
+# Enable event scheduler if the event table was not up to date before.
+set global event_scheduler=original;
#
# TRIGGER privilege
diff --git a/sql/events.cc b/sql/events.cc
index 1feb285e3a0..e23dcd21954 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -80,7 +80,8 @@ Event_queue *Events::event_queue;
Event_scheduler *Events::scheduler;
Event_db_repository *Events::db_repository;
ulong Events::opt_event_scheduler= Events::EVENTS_OFF;
-bool Events::check_system_tables_error= FALSE;
+ulong Events::startup_state= Events::EVENTS_OFF;
+ulong Events::inited;
/*
@@ -114,7 +115,7 @@ bool Events::check_if_system_tables_error()
{
DBUG_ENTER("Events::check_if_system_tables_error");
- if (check_system_tables_error)
+ if (!inited)
{
my_error(ER_EVENTS_DB_ERROR, MYF(0));
DBUG_RETURN(TRUE);
@@ -257,10 +258,10 @@ common_1_lev_code:
/**
- Create a new query string for removing executable comments
- for avoiding leak and keeping consistency of the execution
+ Create a new query string for removing executable comments
+ for avoiding leak and keeping consistency of the execution
on master and slave.
-
+
@param[in] thd Thread handler
@param[in] buf Query string
@@ -281,7 +282,7 @@ create_query_string(THD *thd, String *buf)
thd->lex->stmt_definition_end -
thd->lex->stmt_definition_begin))
return 1;
-
+
return 0;
}
@@ -336,8 +337,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
if (parse_data->do_not_create)
DBUG_RETURN(FALSE);
- /*
- Turn off row binlogging of this statement and use statement-based
+ /*
+ Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for CREATE EVENT command.
*/
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
@@ -384,8 +385,10 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
String log_query;
if (create_query_string(thd, &log_query))
{
- sql_print_error("Event Error: An error occurred while creating query "
- "string, before writing it into binary log.");
+ my_message_sql(ER_STARTUP,
+ "Event Error: An error occurred while creating query "
+ "string, before writing it into binary log.",
+ MYF(ME_NOREFRESH));
ret= true;
}
else
@@ -473,8 +476,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
}
}
- /*
- Turn off row binlogging of this statement and use statement-based
+ /*
+ Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for UPDATE EVENT command.
*/
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
@@ -752,6 +755,13 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
int ret;
DBUG_ENTER("Events::fill_schema_events");
+ /*
+ If we didn't start events because of --skip-grant-tables, return an
+ empty set
+ */
+ if (opt_noacl)
+ DBUG_RETURN(0);
+
if (check_if_system_tables_error())
DBUG_RETURN(1);
@@ -780,6 +790,7 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
/**
Initializes the scheduler's structures.
+ @param THD or null (if called by init)
@param opt_noacl_or_bootstrap
TRUE if there is --skip-grant-tables or --bootstrap
option. In that case we disable the event scheduler.
@@ -787,44 +798,56 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
@note This function is not synchronized.
@retval FALSE Perhaps there was an error, and the event scheduler
- is disabled. But the error is not fatal and the
+ is disabled. But the error is not fatal and the
server start up can continue.
@retval TRUE Fatal error. Startup must terminate (call unireg_abort()).
*/
bool
-Events::init(bool opt_noacl_or_bootstrap)
+Events::init(THD *thd, bool opt_noacl_or_bootstrap)
{
-
- THD *thd;
int err_no;
bool res= FALSE;
-
+ bool had_thd= thd != 0;
DBUG_ENTER("Events::init");
+ DBUG_ASSERT(inited == 0);
+
+ /*
+ Was disabled explicitly from the command line
+ */
+ if (opt_event_scheduler == Events::EVENTS_DISABLED ||
+ opt_noacl_or_bootstrap)
+ DBUG_RETURN(FALSE);
+
/* We need a temporary THD during boot */
- if (!(thd= new THD()))
+ if (!thd)
{
- res= TRUE;
- goto end;
+
+ if (!(thd= new THD()))
+ {
+ res= TRUE;
+ goto end;
+ }
+ /*
+ The thread stack does not start from this function but we cannot
+ guess the real value. So better some value that doesn't assert than
+ no value.
+ */
+ thd->thread_stack= (char*) &thd;
+ thd->store_globals();
+ /*
+ Set current time for the thread that handles events.
+ Current time is stored in data member start_time of THD class.
+ Subsequently, this value is used to check whether event was expired
+ when make loading events from storage. Check for event expiration time
+ is done at Event_queue_element::compute_next_execution_time() where
+ event's status set to Event_parse_data::DISABLED and dropped flag set
+ to true if event was expired.
+ */
+ thd->set_time();
}
- /*
- The thread stack does not start from this function but we cannot
- guess the real value. So better some value that doesn't assert than
- no value.
- */
- thd->thread_stack= (char*) &thd;
- thd->store_globals();
- /*
- Set current time for the thread that handles events.
- Current time is stored in data member start_time of THD class.
- Subsequently, this value is used to check whether event was expired
- when make loading events from storage. Check for event expiration time
- is done at Event_queue_element::compute_next_execution_time() where
- event's status set to Event_parse_data::DISABLED and dropped flag set
- to true if event was expired.
- */
- thd->set_time();
+
/*
We will need Event_db_repository anyway, even if the scheduler is
disabled - to perform events DDL.
@@ -844,28 +867,19 @@ Events::init(bool opt_noacl_or_bootstrap)
are most likely not there and we're going to disable the event
scheduler anyway.
*/
- if (opt_noacl_or_bootstrap || Event_db_repository::check_system_tables(thd))
+ if (Event_db_repository::check_system_tables(thd))
{
- if (! opt_noacl_or_bootstrap)
- {
- sql_print_error("Event Scheduler: An error occurred when initializing "
- "system tables. Disabling the Event Scheduler.");
- check_system_tables_error= TRUE;
- }
-
+ delete db_repository;
+ db_repository= 0;
+ my_message(ER_STARTUP,
+ "Event Scheduler: An error occurred when initializing "
+ "system tables. Disabling the Event Scheduler.",
+ MYF(ME_NOREFRESH));
/* Disable the scheduler since the system tables are not up to date */
- opt_event_scheduler= EVENTS_DISABLED;
+ opt_event_scheduler= EVENTS_OFF;
goto end;
}
- /*
- Was disabled explicitly from the command line, or because we're running
- with --skip-grant-tables, or --bootstrap, or because we have no system
- tables.
- */
- if (opt_event_scheduler == Events::EVENTS_DISABLED)
- goto end;
-
DBUG_ASSERT(opt_event_scheduler == Events::EVENTS_ON ||
opt_event_scheduler == Events::EVENTS_OFF);
@@ -880,22 +894,23 @@ Events::init(bool opt_noacl_or_bootstrap)
if (event_queue->init_queue(thd) || load_events_from_db(thd) ||
(opt_event_scheduler == EVENTS_ON && scheduler->start(&err_no)))
{
- sql_print_error("Event Scheduler: Error while loading from disk.");
+ my_message_sql(ER_STARTUP,
+ "Event Scheduler: Error while loading from mysql.event table.",
+ MYF(ME_NOREFRESH));
res= TRUE; /* fatal error: request unireg_abort */
goto end;
}
Event_worker_thread::init(db_repository);
+ inited= 1;
end:
if (res)
+ deinit();
+ if (!had_thd)
{
- delete db_repository;
- delete event_queue;
- delete scheduler;
+ delete thd;
+ set_current_thd(0);
}
- delete thd;
- /* Remember that we don't have a THD */
- set_current_thd(0);
DBUG_RETURN(res);
}
@@ -915,17 +930,14 @@ Events::deinit()
{
DBUG_ENTER("Events::deinit");
- if (opt_event_scheduler != EVENTS_DISABLED)
- {
- delete scheduler;
- scheduler= NULL; /* safety */
- delete event_queue;
- event_queue= NULL; /* safety */
- }
-
+ delete scheduler;
+ scheduler= NULL; /* For restart */
+ delete event_queue;
+ event_queue= NULL; /* For restart */
delete db_repository;
- db_repository= NULL; /* safety */
+ db_repository= NULL; /* For restart */
+ inited= 0;
DBUG_VOID_RETURN;
}
@@ -1028,7 +1040,7 @@ Events::dump_internal_status()
holding LOCK_global_system_variables.
*/
mysql_mutex_lock(&LOCK_global_system_variables);
- if (opt_event_scheduler == EVENTS_DISABLED)
+ if (!inited)
puts("The Event Scheduler is disabled");
else
{
@@ -1042,11 +1054,13 @@ Events::dump_internal_status()
bool Events::start(int *err_no)
{
+ DBUG_ASSERT(inited);
return scheduler->start(err_no);
}
bool Events::stop()
{
+ DBUG_ASSERT(inited);
return scheduler->stop();
}
@@ -1076,7 +1090,6 @@ Events::load_events_from_db(THD *thd)
bool ret= TRUE;
uint count= 0;
ulong saved_master_access;
-
DBUG_ENTER("Events::load_events_from_db");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
@@ -1101,7 +1114,9 @@ Events::load_events_from_db(THD *thd)
if (ret)
{
- sql_print_error("Event Scheduler: Failed to open table mysql.event");
+ my_message_sql(ER_STARTUP,
+ "Event Scheduler: Failed to open table mysql.event",
+ MYF(ME_NOREFRESH));
DBUG_RETURN(TRUE);
}
@@ -1123,9 +1138,11 @@ Events::load_events_from_db(THD *thd)
if (et->load_from_row(thd, table))
{
- sql_print_error("Event Scheduler: "
- "Error while loading events from mysql.event. "
- "The table probably contains bad data or is corrupted");
+ my_message(ER_STARTUP,
+ "Event Scheduler: "
+ "Error while loading events from mysql.event. "
+ "The table probably contains bad data or is corrupted",
+ MYF(ME_NOREFRESH));
delete et;
goto end;
}
@@ -1176,9 +1193,12 @@ Events::load_events_from_db(THD *thd)
}
}
}
- if (global_system_variables.log_warnings)
- sql_print_information("Event Scheduler: Loaded %d event%s",
- count, (count == 1) ? "" : "s");
+ my_printf_error(ER_STARTUP,
+ "Event Scheduler: Loaded %d event%s",
+ MYF(ME_NOREFRESH |
+ (global_system_variables.log_warnings) ?
+ ME_JUST_INFO: 0),
+ count, (count == 1) ? "" : "s");
ret= FALSE;
end:
diff --git a/sql/events.h b/sql/events.h
index 646fd257d52..91a0e6f28eb 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -79,9 +79,11 @@ public:
and the @@global.event_scheduler SQL variable.
See sys_var.cc
*/
- enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
+ enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED,
+ EVENTS_ORIGINAL };
/* Protected using LOCK_global_system_variables only. */
- static ulong opt_event_scheduler;
+ static ulong opt_event_scheduler, startup_state;
+ static ulong inited;
static bool check_if_system_tables_error();
static bool start(int *err_no);
static bool stop();
@@ -91,8 +93,7 @@ public:
static Event_db_repository *
get_db_repository() { return db_repository; }
- static bool
- init(bool opt_noacl);
+ static bool init(THD *thd, bool opt_noacl);
static void
deinit();
@@ -130,6 +131,11 @@ public:
static void
dump_internal_status();
+ static void set_original_state(ulong startup_state_org)
+ {
+ startup_state= startup_state_org;
+ }
+
private:
static bool
@@ -139,8 +145,6 @@ private:
static Event_queue *event_queue;
static Event_scheduler *scheduler;
static Event_db_repository *db_repository;
- /* Set to TRUE if an error at start up */
- static bool check_system_tables_error;
private:
/* Prevent use of these */
diff --git a/sql/field.h b/sql/field.h
index 4e3a9f4c7b1..c64d6bc443c 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,6 +1,6 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
@@ -977,6 +977,16 @@ public:
/* Hash value */
virtual void hash(ulong *nr, ulong *nr2);
+/**
+ Checks whether a string field is part of write_set.
+
+ @return
+ FALSE - If field is not char/varchar/....
+ - If field is char/varchar/.. and is not part of write set.
+ TRUE - If field is char/varchar/.. and is part of write set.
+*/
+ virtual bool is_updatable() const { return FALSE; }
+
/* Check whether the field can be used as a join attribute in hash join */
virtual bool hash_join_is_possible() { return TRUE; }
virtual bool eq_cmp_as_binary() { return TRUE; }
@@ -1174,6 +1184,11 @@ public:
int store_decimal(const my_decimal *d);
uint32 max_data_length() const;
+ bool is_updatable() const
+ {
+ DBUG_ASSERT(table && table->write_set);
+ return bitmap_is_set(table->write_set, field_index);
+ }
bool match_collation_to_optimize_range() const { return true; }
};
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index e31f7c5f005..79d579b6828 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -1,7 +1,6 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2012, Monty Program Ab
-
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -905,15 +904,10 @@ int field_conv_incompatible(Field *to, Field *from)
{ // Be sure the value is stored
Field_blob *blob=(Field_blob*) to;
from->val_str(&blob->value);
- /*
- Copy value if copy_blobs is set, or source is not a string and
- we have a pointer to its internal string conversion buffer.
- */
- if (to->table->copy_blobs ||
- (!blob->value.is_alloced() &&
- from_real_type != MYSQL_TYPE_STRING &&
- from_real_type != MYSQL_TYPE_VARCHAR))
+
+ if (!blob->value.is_alloced() && from->is_updatable())
blob->value.copy();
+
return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
}
if (from_real_type == MYSQL_TYPE_ENUM &&
diff --git a/sql/filesort.cc b/sql/filesort.cc
index a545bb623c0..6ad7bee48c6 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -25,7 +25,6 @@
#include <my_global.h>
#include "sql_priv.h"
#include "filesort.h"
-#include "unireg.h" // REQUIRED by other includes
#ifdef HAVE_STDDEF_H
#include <stddef.h> /* for macro offsetof */
#endif
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 929acda2716..85c19da9dda 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5277,6 +5277,7 @@ err:
{
(void) m_file[j]->ha_index_end();
}
+ destroy_record_priority_queue();
}
DBUG_RETURN(error);
}
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 1879d056623..f08ae247398 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -26,6 +26,7 @@
*/
#include <my_global.h>
#include "sql_priv.h"
+#include "unireg.h" // SPECIAL_NO_HOST_CACHE
#include "hostname.h"
#include "my_global.h"
#ifndef __WIN__
diff --git a/sql/item.cc b/sql/item.cc
index 934846c4815..543ea4f0ffb 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -21,7 +21,6 @@
#endif
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include <mysql.h>
#include <m_ctype.h>
#include "my_dir.h"
@@ -4835,8 +4834,24 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
As this is an outer field it should be added to the list of
non aggregated fields of the outer select.
*/
- marker= select->cur_pos_in_select_list;
- select->join->non_agg_fields.push_back(this);
+ if (select->join)
+ {
+ marker= select->cur_pos_in_select_list;
+ select->join->non_agg_fields.push_back(this);
+ }
+ else
+ {
+ /*
+ join is absent if it is upper SELECT_LEX of non-select
+ command
+ */
+ DBUG_ASSERT(select->master_unit()->outer_select() == NULL &&
+ (thd->lex->sql_command != SQLCOM_SELECT &&
+ thd->lex->sql_command != SQLCOM_UPDATE_MULTI &&
+ thd->lex->sql_command != SQLCOM_DELETE_MULTI &&
+ thd->lex->sql_command != SQLCOM_INSERT_SELECT &&
+ thd->lex->sql_command != SQLCOM_REPLACE_SELECT));
+ }
}
if (*from_field != view_ref_found)
{
diff --git a/sql/item.h b/sql/item.h
index 353c9e0f6bc..5b7c0e815b4 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -25,7 +25,6 @@
#include "sql_priv.h" /* STRING_BUFFER_USUAL_SIZE */
#include "unireg.h"
#include "sql_const.h" /* RAND_TABLE_BIT, MAX_FIELD_NAME */
-#include "unireg.h" // REQUIRED: for other includes
#include "thr_malloc.h" /* sql_calloc */
#include "field.h" /* Derivation */
@@ -3771,6 +3770,8 @@ public:
bool eq(const Item *item, bool binary_cmp) const;
Item *get_tmp_table_item(THD *thd)
{
+ if (const_item())
+ return copy_or_same(thd);
Item *item= Item_ref::get_tmp_table_item(thd);
item->name= name;
return item;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 90eef1ea55c..830a12ea48d 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1466,9 +1466,36 @@ bool Item_in_optimizer::eval_not_null_tables(uchar *opt_arg)
bool Item_in_optimizer::fix_left(THD *thd)
{
DBUG_ENTER("Item_in_optimizer::fix_left");
- if ((!args[0]->fixed && args[0]->fix_fields(thd, args)) ||
- (!cache && !(cache= Item_cache::get_cache(args[0]))))
+ /*
+ Here we will store pointer on place of main storage of left expression.
+ For usual IN (ALL/ANY) it is subquery left_expr.
+ For other cases (MAX/MIN optimization, non-transformed EXISTS (10.0))
+ it is args[0].
+ */
+ Item **ref0= args;
+ if (args[1]->type() == Item::SUBSELECT_ITEM &&
+ ((Item_subselect *)args[1])->is_in_predicate())
+ {
+ /*
+ left_expr->fix_fields() may cause left_expr to be substituted for
+ another item. (e.g. an Item_field may be changed into Item_ref). This
+ transformation is undone at the end of statement execution (e.g. the
+ Item_ref is deleted). However, Item_in_optimizer::args[0] may keep
+ the pointer to the post-transformation item. Because of that, on the
+ next execution we need to copy args[1]->left_expr again.
+ */
+ ref0= &(((Item_in_subselect *)args[1])->left_expr);
+ args[0]= ((Item_in_subselect *)args[1])->left_expr;
+ }
+ if ((!(*ref0)->fixed && (*ref0)->fix_fields(thd, ref0)) ||
+ (!cache && !(cache= Item_cache::get_cache(*ref0))))
DBUG_RETURN(1);
+ /*
+ During fix_field() expression could be substituted.
+ So we copy changes before use
+ */
+ if (args[0] != (*ref0))
+ args[0]= (*ref0);
DBUG_PRINT("info", ("actual fix fields"));
cache->setup(args[0]);
@@ -1531,6 +1558,16 @@ bool Item_in_optimizer::fix_left(THD *thd)
bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
+ Item_subselect *sub= 0;
+ uint col;
+
+ /*
+ MAX/MIN optimization can convert the subquery into
+ expr + Item_singlerow_subselect
+ */
+ if (args[1]->type() == Item::SUBSELECT_ITEM)
+ sub= (Item_subselect *)args[1];
+
if (fix_left(thd))
return TRUE;
if (args[0]->maybe_null)
@@ -1538,12 +1575,11 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
if (!args[1]->fixed && args[1]->fix_fields(thd, args+1))
return TRUE;
-
- Item_in_subselect * sub= (Item_in_subselect *)args[1];
if (!invisible_mode() &&
- args[0]->cols() != sub->engine->cols())
+ ((sub && ((col= args[0]->cols()) != sub->engine->cols())) ||
+ (!sub && (args[1]->cols() != (col= 1)))))
{
- my_error(ER_OPERAND_COLUMNS, MYF(0), args[0]->cols());
+ my_error(ER_OPERAND_COLUMNS, MYF(0), col);
return TRUE;
}
if (args[1]->maybe_null)
@@ -2756,7 +2792,8 @@ Item_func_if::str_op(String *str)
String *res=arg->val_str(str);
if (res)
res->set_charset(collation.collation);
- null_value=arg->null_value;
+ if ((null_value=arg->null_value))
+ res= NULL;
return res;
}
@@ -2767,7 +2804,8 @@ Item_func_if::decimal_op(my_decimal *decimal_value)
DBUG_ASSERT(fixed == 1);
Item *arg= args[0]->val_bool() ? args[1] : args[2];
my_decimal *value= arg->val_decimal(decimal_value);
- null_value= arg->null_value;
+ if ((null_value= arg->null_value))
+ value= NULL;
return value;
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index e38e1e4919a..0e66b71e558 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -885,7 +885,7 @@ String *Item_func_hybrid_result_type::val_str(String *str)
case DECIMAL_RESULT:
{
my_decimal decimal_value, *val;
- if (!(val= decimal_op(&decimal_value)))
+ if (!(val= decimal_op_with_null_check(&decimal_value)))
return 0; // null is set
my_decimal_round(E_DEC_FATAL_ERROR, val, decimals, FALSE, val);
str->set_charset(collation.collation);
@@ -912,24 +912,22 @@ String *Item_func_hybrid_result_type::val_str(String *str)
if (is_temporal_type(field_type()))
{
MYSQL_TIME ltime;
- if (date_op(&ltime,
- field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0) ||
- str->alloc(MAX_DATE_STRING_REP_LENGTH))
- {
- null_value= 1;
+ if (date_op_with_null_check(&ltime) ||
+ (null_value= str->alloc(MAX_DATE_STRING_REP_LENGTH)))
return (String *) 0;
- }
ltime.time_type= mysql_type_to_time_type(field_type());
str->length(my_TIME_to_str(&ltime, const_cast<char*>(str->ptr()), decimals));
str->set_charset(&my_charset_bin);
+ DBUG_ASSERT(!null_value);
return str;
}
- return str_op(&str_value);
+ return str_op_with_null_check(&str_value);
case TIME_RESULT:
case ROW_RESULT:
case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0);
}
+ DBUG_ASSERT(!null_value || (str == NULL));
return str;
}
@@ -942,7 +940,7 @@ double Item_func_hybrid_result_type::val_real()
{
my_decimal decimal_value, *val;
double result;
- if (!(val= decimal_op(&decimal_value)))
+ if (!(val= decimal_op_with_null_check(&decimal_value)))
return 0.0; // null is set
my_decimal2double(E_DEC_FATAL_ERROR, val, &result);
return result;
@@ -959,18 +957,14 @@ double Item_func_hybrid_result_type::val_real()
if (is_temporal_type(field_type()))
{
MYSQL_TIME ltime;
- if (date_op(&ltime,
- field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0 ))
- {
- null_value= 1;
+ if (date_op_with_null_check(&ltime))
return 0;
- }
ltime.time_type= mysql_type_to_time_type(field_type());
return TIME_to_double(&ltime);
}
char *end_not_used;
int err_not_used;
- String *res= str_op(&str_value);
+ String *res= str_op_with_null_check(&str_value);
return (res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(),
&end_not_used, &err_not_used) : 0.0);
}
@@ -990,7 +984,7 @@ longlong Item_func_hybrid_result_type::val_int()
case DECIMAL_RESULT:
{
my_decimal decimal_value, *val;
- if (!(val= decimal_op(&decimal_value)))
+ if (!(val= decimal_op_with_null_check(&decimal_value)))
return 0; // null is set
longlong result;
my_decimal2int(E_DEC_FATAL_ERROR, val, unsigned_flag, &result);
@@ -1005,18 +999,14 @@ longlong Item_func_hybrid_result_type::val_int()
if (is_temporal_type(field_type()))
{
MYSQL_TIME ltime;
- if (date_op(&ltime,
- field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0))
- {
- null_value= 1;
+ if (date_op_with_null_check(&ltime))
return 0;
- }
ltime.time_type= mysql_type_to_time_type(field_type());
return TIME_to_ulonglong(&ltime);
}
int err_not_used;
String *res;
- if (!(res= str_op(&str_value)))
+ if (!(res= str_op_with_null_check(&str_value)))
return 0;
char *end= (char*) res->ptr() + res->length();
@@ -1038,17 +1028,21 @@ my_decimal *Item_func_hybrid_result_type::val_decimal(my_decimal *decimal_value)
DBUG_ASSERT(fixed == 1);
switch (cached_result_type) {
case DECIMAL_RESULT:
- val= decimal_op(decimal_value);
+ val= decimal_op_with_null_check(decimal_value);
break;
case INT_RESULT:
{
longlong result= int_op();
+ if (null_value)
+ return NULL;
int2my_decimal(E_DEC_FATAL_ERROR, result, unsigned_flag, decimal_value);
break;
}
case REAL_RESULT:
{
double result= (double)real_op();
+ if (null_value)
+ return NULL;
double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value);
break;
}
@@ -1057,19 +1051,20 @@ my_decimal *Item_func_hybrid_result_type::val_decimal(my_decimal *decimal_value)
if (is_temporal_type(field_type()))
{
MYSQL_TIME ltime;
- if (date_op(&ltime,
- field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0))
+ if (date_op_with_null_check(&ltime))
{
my_decimal_set_zero(decimal_value);
- null_value= 1;
return 0;
}
ltime.time_type= mysql_type_to_time_type(field_type());
return date2my_decimal(&ltime, decimal_value);
}
String *res;
- if (!(res= str_op(&str_value)))
+ if (!(res= str_op_with_null_check(&str_value)))
+ {
+ null_value= 1;
return NULL;
+ }
str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
res->length(), res->charset(), decimal_value);
@@ -1092,7 +1087,7 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime,
case DECIMAL_RESULT:
{
my_decimal value, *res;
- if (!(res= decimal_op(&value)) ||
+ if (!(res= decimal_op_with_null_check(&value)) ||
decimal_to_datetime_with_warn(res, ltime, fuzzydate,
field_name_or_null()))
goto err;
@@ -1122,7 +1117,7 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime,
return date_op(ltime, fuzzydate);
char buff[40];
String tmp(buff,sizeof(buff), &my_charset_bin),*res;
- if (!(res= str_op(&tmp)) ||
+ if (!(res= str_op_with_null_check(&tmp)) ||
str_to_datetime_with_warn(res->charset(), res->ptr(), res->length(),
ltime, fuzzydate))
goto err;
diff --git a/sql/item_func.h b/sql/item_func.h
index ce1f2fdd676..0b3454fa4b0 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -385,17 +385,17 @@ public:
void no_rows_in_result()
{
- bool_func_call_args info;
- info.original_func_item= this;
- info.bool_function= &Item::no_rows_in_result;
- walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ args[i]->no_rows_in_result();
+ }
}
void restore_to_before_no_rows_in_result()
{
- bool_func_call_args info;
- info.original_func_item= this;
- info.bool_function= &Item::restore_to_before_no_rows_in_result;
- walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ args[i]->no_rows_in_result();
+ }
}
};
@@ -419,6 +419,29 @@ public:
class Item_func_hybrid_result_type: public Item_func
{
+ /*
+ Helper methods to make sure that the result of
+ decimal_op(), str_op() and date_op() is properly synched with null_value.
+ */
+ bool date_op_with_null_check(MYSQL_TIME *ltime)
+ {
+ bool rc= date_op(ltime,
+ field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0);
+ DBUG_ASSERT(!rc ^ null_value);
+ return rc;
+ }
+ String *str_op_with_null_check(String *str)
+ {
+ String *res= str_op(str);
+ DBUG_ASSERT((res != NULL) ^ null_value);
+ return res;
+ }
+ my_decimal *decimal_op_with_null_check(my_decimal *decimal_buffer)
+ {
+ my_decimal *res= decimal_op(decimal_buffer);
+ DBUG_ASSERT((res != NULL) ^ null_value);
+ return res;
+ }
protected:
Item_result cached_result_type;
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index fe2352f3008..ce01fc7a3b8 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1378,7 +1378,7 @@ Item_in_subselect::Item_in_subselect(Item * left_exp,
{
DBUG_ENTER("Item_in_subselect::Item_in_subselect");
DBUG_PRINT("info", ("in_strategy: %u", (uint)in_strategy));
- left_expr= left_exp;
+ left_expr_orig= left_expr= left_exp;
func= &eq_creator;
init(select_lex, new select_exists_subselect(this));
max_columns= UINT_MAX;
@@ -1401,7 +1401,7 @@ Item_allany_subselect::Item_allany_subselect(Item * left_exp,
:Item_in_subselect(), func_creator(fc), all(all_arg)
{
DBUG_ENTER("Item_allany_subselect::Item_allany_subselect");
- left_expr= left_exp;
+ left_expr_orig= left_expr= left_exp;
func= func_creator(all_arg);
init(select_lex, new select_exists_subselect(this));
max_columns= 1;
@@ -3032,15 +3032,13 @@ Item_in_subselect::select_in_like_transformer(JOIN *join)
arena= thd->activate_stmt_arena_if_needed(&backup);
if (!optimizer)
{
- result= (!(optimizer= new Item_in_optimizer(left_expr, this)));
+ result= (!(optimizer= new Item_in_optimizer(left_expr_orig, this)));
if (result)
goto out;
}
thd->lex->current_select= current->return_after_parsing();
result= optimizer->fix_left(thd);
- /* fix_fields can change reference to left_expr, we need reassign it */
- left_expr= optimizer->arguments()[0];
thd->lex->current_select= current;
if (changed)
@@ -3107,11 +3105,13 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
{
uint outer_cols_num;
List<Item> *inner_cols;
+ char const *save_where= thd->where;
DBUG_ENTER("Item_in_subselect::fix_fields");
if (test_strategy(SUBS_SEMI_JOIN))
DBUG_RETURN( !( (*ref)= new Item_int(1)) );
+ thd->where= "IN/ALL/ANY subquery";
/*
Check if the outer and inner IN operands match in those cases when we
will not perform IN=>EXISTS transformation. Currently this is when we
@@ -3142,7 +3142,7 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
if (outer_cols_num != inner_cols->elements)
{
my_error(ER_OPERAND_COLUMNS, MYF(0), outer_cols_num);
- DBUG_RETURN(TRUE);
+ goto err;
}
if (outer_cols_num > 1)
{
@@ -3152,20 +3152,24 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
{
inner_col= inner_col_it++;
if (inner_col->check_cols(left_expr->element_index(i)->cols()))
- DBUG_RETURN(TRUE);
+ goto err;
}
}
}
- if (thd_arg->lex->is_view_context_analysis() &&
- left_expr && !left_expr->fixed &&
+ if (left_expr && !left_expr->fixed &&
left_expr->fix_fields(thd_arg, &left_expr))
- DBUG_RETURN(TRUE);
+ goto err;
else
if (Item_subselect::fix_fields(thd_arg, ref))
- DBUG_RETURN(TRUE);
+ goto err;
fixed= TRUE;
+ thd->where= save_where;
DBUG_RETURN(FALSE);
+
+err:
+ thd->where= save_where;
+ DBUG_RETURN(TRUE);
}
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 92b269d02f1..3c0b7bd6ade 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -482,6 +482,12 @@ protected:
Item **having_item);
public:
Item *left_expr;
+ /*
+ Important for PS/SP: left_expr_orig is the item that left_expr originally
+ pointed at. That item is allocated on the statement arena, while
+ left_expr could later be changed to something on the execution arena.
+ */
+ Item *left_expr_orig;
/* Priority of this predicate in the convert-to-semi-join-nest process. */
int sj_convert_priority;
/*
diff --git a/sql/key.cc b/sql/key.cc
index e3787ea7869..aaaea9391c6 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -18,7 +18,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: by includes later
#include "key.h" // key_rec_cmp
#include "field.h" // Field
diff --git a/sql/lock.cc b/sql/lock.cc
index 7c8368ab0e3..07ea0b1f6dc 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -77,7 +77,6 @@
#include <my_global.h>
#include "sql_priv.h"
#include "debug_sync.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "lock.h"
#include "sql_base.h" // close_tables_for_reopen
#include "sql_parse.h" // is_log_table_write_query
diff --git a/sql/log.cc b/sql/log.cc
index 4868902b524..6432716c1f4 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -7838,14 +7838,13 @@ void
MYSQL_BIN_LOG::binlog_trigger_immediate_group_commit()
{
group_commit_entry *head;
- mysql_mutex_lock(&LOCK_prepare_ordered);
+ mysql_mutex_assert_owner(&LOCK_prepare_ordered);
head= group_commit_queue;
if (head)
{
head->thd->has_waiter= true;
mysql_cond_signal(&COND_prepare_ordered);
}
- mysql_mutex_unlock(&LOCK_prepare_ordered);
}
@@ -7864,9 +7863,11 @@ binlog_report_wait_for(THD *thd1, THD *thd2)
{
if (opt_binlog_commit_wait_count == 0)
return;
+ mysql_mutex_lock(&LOCK_prepare_ordered);
thd2->has_waiter= true;
if (thd2->waiting_on_group_commit)
mysql_bin_log.binlog_trigger_immediate_group_commit();
+ mysql_mutex_unlock(&LOCK_prepare_ordered);
}
diff --git a/sql/log.h b/sql/log.h
index c014e08b172..14389963aad 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -17,7 +17,6 @@
#ifndef LOG_H
#define LOG_H
-#include "unireg.h" // REQUIRED: for other includes
#include "handler.h" /* my_xid */
class Relay_log_info;
diff --git a/sql/log_event.cc b/sql/log_event.cc
index f50bb3d8b81..a1dcce7d7c4 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -308,7 +308,7 @@ public:
~Write_on_release_cache()
{
copy_event_cache_to_file_and_reinit(m_cache, m_file);
- if (m_flags | FLUSH_F)
+ if (m_flags & FLUSH_F)
fflush(m_file);
}
@@ -816,6 +816,15 @@ const char* Log_event::get_type_str(Log_event_type type)
case BINLOG_CHECKPOINT_EVENT: return "Binlog_checkpoint";
case GTID_EVENT: return "Gtid";
case GTID_LIST_EVENT: return "Gtid_list";
+
+ /* The following is only for mysqlbinlog */
+ case IGNORABLE_LOG_EVENT: return "Ignorable log event";
+ case ROWS_QUERY_LOG_EVENT: return "MySQL Rows_query";
+ case GTID_LOG_EVENT: return "MySQL Gtid";
+ case ANONYMOUS_GTID_LOG_EVENT: return "MySQL Anonymous_Gtid";
+ case PREVIOUS_GTIDS_LOG_EVENT: return "MySQL Previous_gtids";
+ case HEARTBEAT_LOG_EVENT: return "Heartbeat";
+
default: return "Unknown"; /* impossible */
}
}
@@ -1419,6 +1428,8 @@ Log_event* Log_event::read_log_event(IO_CACHE* file,
DBUG_ENTER("Log_event::read_log_event");
DBUG_ASSERT(description_event != 0);
char head[LOG_EVENT_MINIMAL_HEADER_LEN];
+ my_off_t position= my_b_tell(file);
+
/*
First we only want to read at most LOG_EVENT_MINIMAL_HEADER_LEN, just to
check the event for sanity and to know its length; no need to really parse
@@ -1430,7 +1441,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file,
LOG_EVENT_MINIMAL_HEADER_LEN);
LOCK_MUTEX;
- DBUG_PRINT("info", ("my_b_tell: %lu", (ulong) my_b_tell(file)));
+ DBUG_PRINT("info", ("my_b_tell: %llu", (ulonglong) position));
if (my_b_read(file, (uchar *) head, header_size))
{
DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \
@@ -1487,8 +1498,9 @@ err:
{
DBUG_ASSERT(error != 0);
sql_print_error("Error in Log_event::read_log_event(): "
- "'%s', data_len: %lu, event_type: %d",
- error,data_len,(uchar)(head[EVENT_TYPE_OFFSET]));
+ "'%s' at offset: %llu data_len: %lu event_type: %d",
+ error, position, data_len,
+ (uchar)(head[EVENT_TYPE_OFFSET]));
my_free(buf);
/*
The SQL slave thread will check if file->error<0 to know
@@ -1521,10 +1533,12 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
DBUG_PRINT("info", ("binlog_version: %d", description_event->binlog_version));
DBUG_DUMP("data", (unsigned char*) buf, event_len);
- /* Check the integrity */
+ /*
+ Check the integrity; This is needed because handle_slave_io() doesn't
+ check if packet is of proper length.
+ */
if (event_len < EVENT_LEN_OFFSET ||
- (uchar)buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT ||
- (uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET))
+ event_len != uint4korr(buf+EVENT_LEN_OFFSET))
{
*error="Sanity check failed"; // Needed to free buffer
DBUG_RETURN(NULL); // general sanity check - will fail on a partial read
@@ -1706,6 +1720,15 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
case DELETE_ROWS_EVENT:
ev = new Delete_rows_log_event(buf, event_len, description_event);
break;
+
+ /* MySQL GTID events are ignored */
+ case GTID_LOG_EVENT:
+ case ANONYMOUS_GTID_LOG_EVENT:
+ case PREVIOUS_GTIDS_LOG_EVENT:
+ ev= new Ignorable_log_event(buf, description_event,
+ get_type_str((Log_event_type) event_type));
+ break;
+
case TABLE_MAP_EVENT:
ev = new Table_map_log_event(buf, event_len, description_event);
break;
@@ -1723,10 +1746,22 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
ev = new Annotate_rows_log_event(buf, event_len, description_event);
break;
default:
- DBUG_PRINT("error",("Unknown event code: %d",
- (int) buf[EVENT_TYPE_OFFSET]));
- ev= NULL;
- break;
+ /*
+ Create an object of Ignorable_log_event for unrecognized sub-class.
+ So that SLAVE SQL THREAD will only update the position and continue.
+ */
+ if (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F)
+ {
+ ev= new Ignorable_log_event(buf, description_event,
+ get_type_str((Log_event_type) event_type));
+ }
+ else
+ {
+ DBUG_PRINT("error",("Unknown event code: %d",
+ (int) buf[EVENT_TYPE_OFFSET]));
+ ev= NULL;
+ break;
+ }
}
}
@@ -2192,20 +2227,13 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
uint precision= meta >> 8;
uint decimals= meta & 0xFF;
uint bin_size= my_decimal_get_binary_size(precision, decimals);
- uint length;
my_decimal dec;
binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) ptr, &dec,
precision, decimals);
- int i, end;
- char buff[512], *pos;
- pos= buff;
- pos+= sprintf(buff, "%s", dec.sign() ? "-" : "");
- end= ROUND_UP(dec.frac) + ROUND_UP(dec.intg)-1;
- for (i=0; i < end; i++)
- pos+= sprintf(pos, "%09d.", dec.buf[i]);
- pos+= sprintf(pos, "%09d", dec.buf[i]);
- length= (uint) (pos - buff);
- my_b_write(file, buff, length);
+ int length= DECIMAL_MAX_STR_LENGTH;
+ char buff[DECIMAL_MAX_STR_LENGTH + 1];
+ decimal2string(&dec, buff, &length, 0, 0, 0);
+ my_b_write(file, (uchar*)buff, length);
my_snprintf(typestr, typestr_length, "DECIMAL(%d,%d)",
precision, decimals);
return bin_size;
@@ -4920,6 +4948,9 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
post_header_len[HEARTBEAT_LOG_EVENT-1]= 0;
post_header_len[IGNORABLE_LOG_EVENT-1]= 0;
post_header_len[ROWS_QUERY_LOG_EVENT-1]= 0;
+ post_header_len[GTID_LOG_EVENT-1]= 0;
+ post_header_len[ANONYMOUS_GTID_LOG_EVENT-1]= 0;
+ post_header_len[PREVIOUS_GTIDS_LOG_EVENT-1]= 0;
post_header_len[WRITE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2;
post_header_len[UPDATE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2;
post_header_len[DELETE_ROWS_EVENT-1]= ROWS_HEADER_LEN_V2;
@@ -12835,6 +12866,52 @@ Incident_log_event::write_data_body(IO_CACHE *file)
}
+Ignorable_log_event::Ignorable_log_event(const char *buf,
+ const Format_description_log_event
+ *descr_event,
+ const char *event_name)
+ :Log_event(buf, descr_event), number((int) (uchar) buf[EVENT_TYPE_OFFSET]),
+ description(event_name)
+{
+ DBUG_ENTER("Ignorable_log_event::Ignorable_log_event");
+ DBUG_VOID_RETURN;
+}
+
+Ignorable_log_event::~Ignorable_log_event()
+{
+}
+
+#ifndef MYSQL_CLIENT
+/* Pack info for its unrecognized ignorable event */
+void Ignorable_log_event::pack_info(THD *thd, Protocol *protocol)
+{
+ char buf[256];
+ size_t bytes;
+ bytes= my_snprintf(buf, sizeof(buf), "# Ignorable event type %d (%s)",
+ number, description);
+ protocol->store(buf, bytes, &my_charset_bin);
+}
+#endif
+
+#ifdef MYSQL_CLIENT
+/* Print for its unrecognized ignorable event */
+void
+Ignorable_log_event::print(FILE *file,
+ PRINT_EVENT_INFO *print_event_info)
+{
+ if (print_event_info->short_form)
+ return;
+
+ print_header(&print_event_info->head_cache, print_event_info, FALSE);
+ my_b_printf(&print_event_info->head_cache, "\tIgnorable\n");
+ my_b_printf(&print_event_info->head_cache,
+ "# Ignorable event type %d (%s)\n", number, description);
+ copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
+ file);
+}
+#endif
+
+
#ifdef MYSQL_CLIENT
/**
The default values for these variables should be values that are
@@ -12916,4 +12993,25 @@ bool rpl_get_position_info(const char **log_file_name, ulonglong *log_pos,
return TRUE;
#endif
}
+
+/**
+ Check if we should write event to the relay log
+
+ This is used to skip events that is only supported by MySQL
+
+ Return:
+ 0 ok
+ 1 Don't write event
+*/
+
+bool event_that_should_be_ignored(const char *buf)
+{
+ uint event_type= (uchar)buf[EVENT_TYPE_OFFSET];
+ if (event_type == GTID_LOG_EVENT ||
+ event_type == ANONYMOUS_GTID_LOG_EVENT ||
+ event_type == PREVIOUS_GTIDS_LOG_EVENT ||
+ (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F))
+ return 1;
+ return 0;
+}
#endif
diff --git a/sql/log_event.h b/sql/log_event.h
index 6a3e6f174bb..8661e6e49e5 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -260,6 +260,7 @@ struct sql_ex_info
#define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
#define INCIDENT_HEADER_LEN 2
#define HEARTBEAT_HEADER_LEN 0
+#define IGNORABLE_HEADER_LEN 0
#define ROWS_HEADER_LEN_V2 10
#define ANNOTATE_ROWS_HEADER_LEN 0
#define BINLOG_CHECKPOINT_HEADER_LEN 4
@@ -295,7 +296,7 @@ struct sql_ex_info
to the slave. It is used to increase the thd(max_allowed) for both the
DUMP thread on the master and the SQL/IO thread on the slave.
*/
-#define MAX_MAX_ALLOWED_PACKET 1024*1024*1024
+#define MAX_MAX_ALLOWED_PACKET (1024*1024*1024)
/*
Event header offsets;
@@ -520,6 +521,17 @@ struct sql_ex_info
#define LOG_EVENT_RELAY_LOG_F 0x40
/**
+ @def LOG_EVENT_IGNORABLE_F
+
+ For an event, 'e', carrying a type code, that a slave,
+ 's', does not recognize, 's' will check 'e' for
+ LOG_EVENT_IGNORABLE_F, and if the flag is set, then 'e'
+ is ignored. Otherwise, 's' acknowledges that it has
+ found an unknown event in the relay log.
+*/
+#define LOG_EVENT_IGNORABLE_F 0x80
+
+/**
@def LOG_EVENT_SKIP_REPLICATION_F
Flag set by application creating the event (with @@skip_replication); the
@@ -697,6 +709,11 @@ enum Log_event_type
UPDATE_ROWS_EVENT = 31,
DELETE_ROWS_EVENT = 32,
+ /* MySQL 5.6 GTID events, ignored by MariaDB */
+ GTID_LOG_EVENT= 33,
+ ANONYMOUS_GTID_LOG_EVENT= 34,
+ PREVIOUS_GTIDS_LOG_EVENT= 35,
+
/*
Add new events here - right above this comment!
Existing events (except ENUM_END_EVENT) should never change their numbers
@@ -4740,6 +4757,60 @@ private:
LEX_STRING m_message;
};
+/**
+ @class Ignorable_log_event
+
+ Base class for ignorable log events. Events deriving from
+ this class can be safely ignored by slaves that cannot
+ recognize them. Newer slaves, will be able to read and
+ handle them. This has been designed to be an open-ended
+ architecture, so adding new derived events shall not harm
+ the old slaves that support ignorable log event mechanism
+ (they will just ignore unrecognized ignorable events).
+
+ @note The only thing that makes an event ignorable is that it has
+ the LOG_EVENT_IGNORABLE_F flag set. It is not strictly necessary
+ that ignorable event types derive from Ignorable_log_event; they may
+ just as well derive from Log_event and pass LOG_EVENT_IGNORABLE_F as
+ argument to the Log_event constructor.
+**/
+
+class Ignorable_log_event : public Log_event {
+public:
+ int number;
+ const char *description;
+
+#ifndef MYSQL_CLIENT
+ Ignorable_log_event(THD *thd_arg)
+ :Log_event(thd_arg, LOG_EVENT_IGNORABLE_F, FALSE),
+ number(0), description("internal")
+ {
+ DBUG_ENTER("Ignorable_log_event::Ignorable_log_event");
+ DBUG_VOID_RETURN;
+ }
+#endif
+
+ Ignorable_log_event(const char *buf,
+ const Format_description_log_event *descr_event,
+ const char *event_name);
+ virtual ~Ignorable_log_event();
+
+#ifndef MYSQL_CLIENT
+ void pack_info(THD *, Protocol*);
+#endif
+
+#ifdef MYSQL_CLIENT
+ virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+#endif
+
+ virtual Log_event_type get_type_code() { return IGNORABLE_LOG_EVENT; }
+
+ virtual bool is_valid() const { return 1; }
+
+ virtual int get_data_size() { return IGNORABLE_HEADER_LEN; }
+};
+
+
static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache,
FILE *file)
{
@@ -4797,6 +4868,7 @@ bool rpl_get_position_info(const char **log_file_name, ulonglong *log_pos,
ulonglong *relay_log_pos);
bool event_checksum_test(uchar *buf, ulong event_len, uint8 alg);
+bool event_that_should_be_ignored(const char *buf);
uint8 get_checksum_alg(const char* buf, ulong len);
extern TYPELIB binlog_checksum_typelib;
diff --git a/sql/log_slow.h b/sql/log_slow.h
index 2ae07da97c3..3ae2060cc27 100644
--- a/sql/log_slow.h
+++ b/sql/log_slow.h
@@ -16,23 +16,23 @@
/* Defining what to log to slow log */
#define LOG_SLOW_VERBOSITY_INIT 0
-#define LOG_SLOW_VERBOSITY_INNODB 1 << 0
-#define LOG_SLOW_VERBOSITY_QUERY_PLAN 1 << 1
-#define LOG_SLOW_VERBOSITY_EXPLAIN 1 << 2
+#define LOG_SLOW_VERBOSITY_INNODB (1 << 0)
+#define LOG_SLOW_VERBOSITY_QUERY_PLAN (1 << 1)
+#define LOG_SLOW_VERBOSITY_EXPLAIN (1 << 2)
#define QPLAN_INIT QPLAN_QC_NO
-#define QPLAN_ADMIN 1 << 0
-#define QPLAN_FILESORT 1 << 1
-#define QPLAN_FILESORT_DISK 1 << 2
-#define QPLAN_FULL_JOIN 1 << 3
-#define QPLAN_FULL_SCAN 1 << 4
-#define QPLAN_QC 1 << 5
-#define QPLAN_QC_NO 1 << 6
-#define QPLAN_TMP_DISK 1 << 7
-#define QPLAN_TMP_TABLE 1 << 8
-#define QPLAN_FILESORT_PRIORITY_QUEUE 1 << 9
+#define QPLAN_ADMIN (1 << 0)
+#define QPLAN_FILESORT (1 << 1)
+#define QPLAN_FILESORT_DISK (1 << 2)
+#define QPLAN_FULL_JOIN (1 << 3)
+#define QPLAN_FULL_SCAN (1 << 4)
+#define QPLAN_QC (1 << 5)
+#define QPLAN_QC_NO (1 << 6)
+#define QPLAN_TMP_DISK (1 << 7)
+#define QPLAN_TMP_TABLE (1 << 8)
+#define QPLAN_FILESORT_PRIORITY_QUEUE (1 << 9)
/* ... */
-#define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */
+#define QPLAN_MAX (((ulong) 1) << 31) /* reserved as placeholder */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index f75f5440279..323b851ac1f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4515,14 +4515,24 @@ static int init_common_variables()
{
if (lower_case_table_names_used)
{
+#if MYSQL_VERSION_ID < 100100
if (global_system_variables.log_warnings)
sql_print_warning("You have forced lower_case_table_names to 0 through "
"a command-line option, even though your file system "
"'%s' is case insensitive. This means that you can "
- "corrupt a MyISAM table by accessing it with "
- "different cases. You should consider changing "
- "lower_case_table_names to 1 or 2",
- mysql_real_data_home);
+ "corrupt your tables if you access them using names "
+ "with different letter case. You should consider "
+ "changing lower_case_table_names to 1 or 2",
+ mysql_real_data_home);
+#else
+ sql_print_error("The server option 'lower_case_table_names' is "
+ "configured to use case sensitive table names but the "
+ "data directory resides on a case-insensitive file system. "
+ "Please use a case sensitive file system for your data "
+ "directory or switch to a case-insensitive table name "
+ "mode.");
+#endif
+ return 1;
}
else
{
@@ -6249,7 +6259,15 @@ int mysqld_main(int argc, char **argv)
execute_ddl_log_recovery();
- if (Events::init(opt_noacl || opt_bootstrap))
+ /*
+ Change EVENTS_ORIGINAL to EVENTS_OFF (the default value) as there is no
+ point in using ORIGINAL during startup
+ */
+ if (Events::opt_event_scheduler == Events::EVENTS_ORIGINAL)
+ Events::opt_event_scheduler= Events::EVENTS_OFF;
+
+ Events::set_original_state(Events::opt_event_scheduler);
+ if (Events::init((THD*) 0, opt_noacl || opt_bootstrap))
unireg_abort(1);
#ifdef WITH_WSREP /* WSREP AFTER SE */
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3597ade2cba..da18a30ac78 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2008, 2014, Monty Program Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -876,8 +876,8 @@ public:
Used to store 'current key tuples', in both range analysis and
partitioning (list) analysis
*/
- uchar min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
- max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+ uchar *min_key;
+ uchar *max_key;
/* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */
uint alloced_sel_args;
@@ -3066,13 +3066,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
DBUG_RETURN(0); // Can't use range
}
key_parts= param.key_parts;
- thd->mem_root= &alloc;
/*
Make an array with description of all key parts of all table keys.
This is used in get_mm_parts function.
*/
key_info= head->key_info;
+ uint max_key_len= 0;
for (idx=0 ; idx < head->s->keys ; idx++, key_info++)
{
KEY_PART_INFO *key_part_info;
@@ -3085,6 +3085,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
param.key[param.keys]=key_parts;
key_part_info= key_info->key_part;
+ uint cur_key_len= 0;
for (uint part= 0 ; part < n_key_parts ;
part++, key_parts++, key_part_info++)
{
@@ -3092,6 +3093,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
key_parts->part= part;
key_parts->length= key_part_info->length;
key_parts->store_length= key_part_info->store_length;
+ cur_key_len += key_part_info->store_length;
key_parts->field= key_part_info->field;
key_parts->null_bit= key_part_info->null_bit;
key_parts->image_type =
@@ -3100,10 +3102,22 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
key_parts->flag= (uint8) key_part_info->key_part_flag;
}
param.real_keynr[param.keys++]=idx;
+ if (cur_key_len > max_key_len)
+ max_key_len= cur_key_len;
}
param.key_parts_end=key_parts;
param.alloced_sel_args= 0;
+ max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */
+ if (!(param.min_key= (uchar*)alloc_root(&alloc,max_key_len)) ||
+ !(param.max_key= (uchar*)alloc_root(&alloc,max_key_len)))
+ {
+ thd->no_errors=0;
+ free_root(&alloc,MYF(0)); // Return memory & allocator
+ DBUG_RETURN(0); // Can't use range
+ }
+
+ thd->mem_root= &alloc;
/* Calculate cost of full index read for the shortest covering index */
if (!head->covering_keys.is_clear_all())
{
@@ -3327,7 +3341,7 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
return TRUE;
param->key_parts= key_part;
-
+ uint max_key_len= 0;
for (field_ptr= table->field; *field_ptr; field_ptr++)
{
if (bitmap_is_set(used_fields, (*field_ptr)->field_index))
@@ -3342,6 +3356,8 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
store_length+= HA_KEY_NULL_LENGTH;
if (field->real_type() == MYSQL_TYPE_VARCHAR)
store_length+= HA_KEY_BLOB_LENGTH;
+ if (max_key_len < store_length)
+ max_key_len= store_length;
key_part->store_length= store_length;
key_part->field= field;
key_part->image_type= Field::itRAW;
@@ -3351,6 +3367,13 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
key_part++;
}
}
+
+ max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */
+ if (!(param->min_key= (uchar*)alloc_root(param->mem_root, max_key_len)) ||
+ !(param->max_key= (uchar*)alloc_root(param->mem_root, max_key_len)))
+ {
+ return true;
+ }
param->keys= keys;
param->key_parts_end= key_part;
@@ -4611,10 +4634,19 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
key_tree->min_flag |
key_tree->max_flag,
&subpart_iter);
- DBUG_ASSERT(res); /* We can't get "no satisfying subpartitions" */
+ if (res == 0)
+ {
+ /*
+ The only case where we can get "no satisfying subpartitions"
+ returned from the above call is when an error has occurred.
+ */
+ DBUG_ASSERT(range_par->thd->is_error());
+ return 0;
+ }
+
if (res == -1)
goto pop_and_go_right; /* all subpartitions satisfy */
-
+
uint32 subpart_id;
bitmap_clear_all(&ppar->subparts_bitmap);
while ((subpart_id= subpart_iter.get_next(&subpart_iter)) !=
@@ -4899,12 +4931,15 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
Field **field= (ppar->part_fields)? part_info->part_field_array :
part_info->subpart_field_array;
bool in_subpart_fields= FALSE;
+ uint max_key_len= 0;
+ uint cur_key_len= 0;
for (uint part= 0; part < total_parts; part++, key_part++)
{
key_part->key= 0;
key_part->part= part;
key_part->length= (uint16)(*field)->key_length();
key_part->store_length= (uint16)get_partition_field_store_length(*field);
+ cur_key_len += key_part->store_length;
DBUG_PRINT("info", ("part %u length %u store_length %u", part,
key_part->length, key_part->store_length));
@@ -4930,10 +4965,22 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
{
field= part_info->subpart_field_array;
in_subpart_fields= TRUE;
+ max_key_len= cur_key_len;
+ cur_key_len= 0;
}
}
range_par->key_parts_end= key_part;
+ if (cur_key_len > max_key_len)
+ max_key_len= cur_key_len;
+
+ max_key_len++; /* Take into account the "+1" in QUICK_RANGE::QUICK_RANGE */
+ if (!(range_par->min_key= (uchar*)alloc_root(alloc,max_key_len)) ||
+ !(range_par->max_key= (uchar*)alloc_root(alloc,max_key_len)))
+ {
+ return true;
+ }
+
DBUG_EXECUTE("info", print_partitioning_index(range_par->key_parts,
range_par->key_parts_end););
return FALSE;
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 0ad90e2ef3d..3d470b6ff5c 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -617,6 +617,18 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
thd->stmt_arena->state != Query_arena::PREPARED)
*/
{
+ SELECT_LEX *current= thd->lex->current_select;
+ thd->lex->current_select= current->return_after_parsing();
+ char const *save_where= thd->where;
+ thd->where= "IN/ALL/ANY subquery";
+
+ bool failure= !in_subs->left_expr->fixed &&
+ in_subs->left_expr->fix_fields(thd, &in_subs->left_expr);
+ thd->lex->current_select= current;
+ thd->where= save_where;
+ if (failure)
+ DBUG_RETURN(-1); /* purecov: deadcode */
+
/*
Check if the left and right expressions have the same # of
columns, i.e. we don't have a case like
@@ -630,18 +642,6 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
my_error(ER_OPERAND_COLUMNS, MYF(0), in_subs->left_expr->cols());
DBUG_RETURN(-1);
}
-
- SELECT_LEX *current= thd->lex->current_select;
- thd->lex->current_select= current->return_after_parsing();
- char const *save_where= thd->where;
- thd->where= "IN/ALL/ANY subquery";
-
- bool failure= !in_subs->left_expr->fixed &&
- in_subs->left_expr->fix_fields(thd, &in_subs->left_expr);
- thd->lex->current_select= current;
- thd->where= save_where;
- if (failure)
- DBUG_RETURN(-1); /* purecov: deadcode */
}
DBUG_PRINT("info", ("Checking if subq can be converted to semi-join"));
@@ -704,6 +704,12 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
if (!optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS) &&
!optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION))
my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0));
+ /*
+ Transform each subquery predicate according to its overloaded
+ transformer.
+ */
+ if (subselect->select_transformer(join))
+ DBUG_RETURN(-1);
/*
If the subquery predicate is IN/=ANY, analyse and set all possible
@@ -755,12 +761,6 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
allany_subs->add_strategy(strategy);
}
- /*
- Transform each subquery predicate according to its overloaded
- transformer.
- */
- if (subselect->select_transformer(join))
- DBUG_RETURN(-1);
}
}
DBUG_RETURN(0);
@@ -1593,8 +1593,19 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
if (subq_pred->left_expr->cols() == 1)
{
nested_join->sj_outer_expr_list.push_back(subq_pred->left_expr);
+ /*
+ Create Item_func_eq. Note that
+ 1. this is done on the statement, not execution, arena
+ 2. if it's a PS then this happens only once - on the first execution.
+ On following re-executions, the item will be fix_field-ed normally.
+ 3. Thus it should be created as if it was fix_field'ed, in particular
+ all pointers to items in the execution arena should be protected
+ with thd->change_item_tree
+ */
Item_func_eq *item_eq=
- new Item_func_eq(subq_pred->left_expr, subq_lex->ref_pointer_array[0]);
+ new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]);
+ if (subq_pred->left_expr_orig != subq_pred->left_expr)
+ thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
item_eq->in_equality_no= 0;
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
}
@@ -4362,6 +4373,74 @@ int init_dups_weedout(JOIN *join, uint first_table, int first_fanout_table, uint
/*
+ @brief
+ Set up semi-join Loose Scan strategy for execution
+
+ @detail
+ Other strategies are done in setup_semijoin_dups_elimination(),
+ however, we need to set up Loose Scan earlier, before make_join_select is
+ called. This is to prevent make_join_select() from switching full index
+ scans into quick selects (which will break Loose Scan access).
+
+ @return
+ 0 OK
+ 1 Error
+*/
+
+int setup_semijoin_loosescan(JOIN *join)
+{
+ uint i;
+ DBUG_ENTER("setup_semijoin_loosescan");
+
+ POSITION *pos= join->best_positions + join->const_tables;
+ for (i= join->const_tables ; i < join->top_join_tab_count; )
+ {
+ JOIN_TAB *tab=join->join_tab + i;
+ switch (pos->sj_strategy) {
+ case SJ_OPT_MATERIALIZE:
+ case SJ_OPT_MATERIALIZE_SCAN:
+ i+= 1; /* join tabs are embedded in the nest */
+ pos += pos->n_sj_tables;
+ break;
+ case SJ_OPT_LOOSE_SCAN:
+ {
+ /* We jump from the last table to the first one */
+ tab->loosescan_match_tab= tab + pos->n_sj_tables - 1;
+
+ /* LooseScan requires records to be produced in order */
+ if (tab->select && tab->select->quick)
+ tab->select->quick->need_sorted_output();
+
+ for (uint j= i; j < i + pos->n_sj_tables; j++)
+ join->join_tab[j].inside_loosescan_range= TRUE;
+
+ /* Calculate key length */
+ uint keylen= 0;
+ uint keyno= pos->loosescan_picker.loosescan_key;
+ for (uint kp=0; kp < pos->loosescan_picker.loosescan_parts; kp++)
+ keylen += tab->table->key_info[keyno].key_part[kp].store_length;
+
+ tab->loosescan_key= keyno;
+ tab->loosescan_key_len= keylen;
+ if (pos->n_sj_tables > 1)
+ tab[pos->n_sj_tables - 1].do_firstmatch= tab;
+ i+= pos->n_sj_tables;
+ pos+= pos->n_sj_tables;
+ break;
+ }
+ default:
+ {
+ i++;
+ pos++;
+ break;
+ }
+ }
+ }
+ DBUG_RETURN(FALSE);
+}
+
+
+/*
Setup the strategies to eliminate semi-join duplicates.
SYNOPSIS
@@ -4469,8 +4548,6 @@ int setup_semijoin_dups_elimination(JOIN *join, ulonglong options,
for (i= join->const_tables ; i < join->top_join_tab_count; )
{
JOIN_TAB *tab=join->join_tab + i;
- //POSITION *pos= join->best_positions + i;
- uint keylen, keyno;
switch (pos->sj_strategy) {
case SJ_OPT_MATERIALIZE:
case SJ_OPT_MATERIALIZE_SCAN:
@@ -4480,26 +4557,7 @@ int setup_semijoin_dups_elimination(JOIN *join, ulonglong options,
break;
case SJ_OPT_LOOSE_SCAN:
{
- /* We jump from the last table to the first one */
- tab->loosescan_match_tab= tab + pos->n_sj_tables - 1;
-
- /* LooseScan requires records to be produced in order */
- if (tab->select && tab->select->quick)
- tab->select->quick->need_sorted_output();
-
- for (uint j= i; j < i + pos->n_sj_tables; j++)
- join->join_tab[j].inside_loosescan_range= TRUE;
-
- /* Calculate key length */
- keylen= 0;
- keyno= pos->loosescan_picker.loosescan_key;
- for (uint kp=0; kp < pos->loosescan_picker.loosescan_parts; kp++)
- keylen += tab->table->key_info[keyno].key_part[kp].store_length;
-
- tab->loosescan_key= keyno;
- tab->loosescan_key_len= keylen;
- if (pos->n_sj_tables > 1)
- tab[pos->n_sj_tables - 1].do_firstmatch= tab;
+ /* Setup already handled by setup_semijoin_loosescan */
i+= pos->n_sj_tables;
pos+= pos->n_sj_tables;
break;
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index 3da94d05521..0fb1a931e36 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -194,8 +194,6 @@ public:
PREV_BITS(key_part_map, max_loose_keypart+1) && // (3)
!key_uses_partial_cols(s->table->s, key))
{
- /* Ok, can use the strategy */
- part1_conds_met= TRUE;
if (s->quick && s->quick->index == key &&
s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE)
{
@@ -204,6 +202,12 @@ public:
}
DBUG_PRINT("info", ("Can use LooseScan scan"));
+ if (found_part & 1)
+ {
+ /* Can use LooseScan on ref access if the first key part is bound */
+ part1_conds_met= TRUE;
+ }
+
/*
Check if this is a special case where there are no usable bound
IN-equalities, i.e. we have
@@ -211,11 +215,13 @@ public:
outer_expr IN (SELECT innertbl.key FROM ...)
and outer_expr cannot be evaluated yet, so it's actually full
- index scan and not a ref access
+ index scan and not a ref access.
+ We can do full index scan if it uses index-only.
*/
if (!(found_part & 1 ) && /* no usable ref access for 1st key part */
s->table->covering_keys.is_set(key))
{
+ part1_conds_met= TRUE;
DBUG_PRINT("info", ("Can use full index scan for LooseScan"));
/* Calculate the cost of complete loose index scan. */
@@ -383,6 +389,7 @@ public:
bool create_sj_weedout_tmp_table(THD *thd);
};
+int setup_semijoin_loosescan(JOIN *join);
int setup_semijoin_dups_elimination(JOIN *join, ulonglong options,
uint no_jbuf_after);
void destroy_sj_tmp_tables(JOIN *join);
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index fc3ce09dd8e..1ff1f4a6449 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -341,7 +341,8 @@ int opt_sum_query(THD *thd,
there are no outer joins.
*/
if (!conds && !((Item_sum_count*) item)->get_arg(0)->maybe_null &&
- !outer_tables && maybe_exact_count)
+ !outer_tables && maybe_exact_count &&
+ ((item->used_tables() & OUTER_REF_TABLE_BIT) == 0))
{
if (!is_exact_count)
{
@@ -369,7 +370,8 @@ int opt_sum_query(THD *thd,
indexes to find the key.
*/
Item *expr=item_sum->get_arg(0);
- if (expr->real_item()->type() == Item::FIELD_ITEM)
+ if (((expr->used_tables() & OUTER_REF_TABLE_BIT) == 0) &&
+ expr->real_item()->type() == Item::FIELD_ITEM)
{
uchar key_buff[MAX_KEY_LENGTH];
TABLE_REF ref;
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 73b88d64224..1607b1937df 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -77,6 +78,41 @@ partition_info *partition_info::get_clone()
part_clone->subpartitions.push_back(subpart_clone);
}
clone->partitions.push_back(part_clone);
+ part_clone->list_val_list.empty();
+ List_iterator<part_elem_value> list_val_it(part->list_val_list);
+ part_elem_value *new_val_arr=
+ (part_elem_value *)sql_alloc(sizeof(part_elem_value) *
+ part->list_val_list.elements);
+ if (!new_val_arr)
+ {
+ mem_alloc_error(sizeof(part_elem_value) * part->list_val_list.elements);
+ DBUG_RETURN(NULL);
+ }
+ p_column_list_val *new_colval_arr=
+ (p_column_list_val*)sql_alloc(sizeof(p_column_list_val) *
+ num_columns *
+ part->list_val_list.elements);
+ if (!new_colval_arr)
+ {
+ mem_alloc_error(sizeof(p_column_list_val) * num_columns *
+ part->list_val_list.elements);
+ DBUG_RETURN(NULL);
+ }
+ part_elem_value *val;
+ while ((val= list_val_it++))
+ {
+ part_elem_value *new_val= new_val_arr++;
+ memcpy(new_val, val, sizeof(part_elem_value));
+ if (!val->null_value)
+ {
+ p_column_list_val *new_colval= new_colval_arr;
+ new_colval_arr+= num_columns;
+ memcpy(new_colval, val->col_val_array,
+ sizeof(p_column_list_val) * num_columns);
+ new_val->col_val_array= new_colval;
+ }
+ part_clone->list_val_list.push_back(new_val);
+ }
}
DBUG_RETURN(clone);
}
@@ -1630,15 +1666,22 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
{
int err= 0;
+ /* Check for partition expression. */
if (!list_of_part_fields)
{
DBUG_ASSERT(part_expr);
err= part_expr->walk(&Item::check_partition_func_processor, 0,
NULL);
- if (!err && is_sub_partitioned() && !list_of_subpart_fields)
- err= subpart_expr->walk(&Item::check_partition_func_processor, 0,
- NULL);
}
+
+ /* Check for sub partition expression. */
+ if (!err && is_sub_partitioned() && !list_of_subpart_fields)
+ {
+ DBUG_ASSERT(subpart_expr);
+ err= subpart_expr->walk(&Item::check_partition_func_processor, 0,
+ NULL);
+ }
+
if (err)
{
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
diff --git a/sql/protocol.cc b/sql/protocol.cc
index b2561f9ca11..eeca35359f6 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -27,7 +27,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "protocol.h"
#include "sql_class.h" // THD
#include <stdarg.h>
diff --git a/sql/records.cc b/sql/records.cc
index bfce2f83967..a37f7a18c11 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -66,10 +66,12 @@ static int rr_index_desc(READ_RECORD *info);
@param reverse Scan in the reverse direction
*/
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
bool print_error, uint idx, bool reverse)
{
int error;
+ DBUG_ENTER("init_read_record_idx");
+
empty_record(table);
bzero((char*) info,sizeof(*info));
info->thd= thd;
@@ -88,6 +90,7 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
/* read_record will be changed to rr_index in rr_index_first */
info->read_record= reverse ? rr_index_last : rr_index_first;
+ DBUG_RETURN(error != 0);
}
diff --git a/sql/records.h b/sql/records.h
index 21477d4a30b..a3f0b5eb084 100644
--- a/sql/records.h
+++ b/sql/records.h
@@ -76,7 +76,7 @@ public:
bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
SQL_SELECT *select, int use_record_cache,
bool print_errors, bool disable_rr_cache);
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
bool print_error, uint idx, bool reverse);
void end_read_record(READ_RECORD *info);
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index 19b193729fd..94b081bf4f4 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -15,7 +15,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED by later includes
#include "rpl_injector.h"
#include "transaction.h"
#include "sql_parse.h" // begin_trans, end_trans, COMMIT
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index f322ca0e8b8..dfb7a1071c4 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -17,7 +17,6 @@
#include <my_global.h> // For HAVE_REPLICATION
#include "sql_priv.h"
#include <my_dir.h>
-#include "unireg.h" // REQUIRED by other includes
#include "rpl_mi.h"
#include "slave.h" // SLAVE_MAX_HEARTBEAT_PERIOD
#include "strfunc.h"
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 600d2ab41aa..cc5da77303c 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -95,7 +95,6 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev)
if (cmp < 0)
{
strcpy(rli->group_master_log_name, qev->future_event_master_log_name);
- rli->notify_group_master_log_name_update();
rli->group_master_log_pos= qev->future_event_master_log_pos;
}
else if (cmp == 0
@@ -317,13 +316,26 @@ convert_kill_to_deadlock_error(rpl_group_info *rgi)
}
-static bool
+/*
+ Check if an event marks the end of an event group. Returns non-zero if so,
+ zero otherwise.
+
+ In addition, returns 1 if the group is committing, 2 if it is rolling back.
+*/
+static int
is_group_ending(Log_event *ev, Log_event_type event_type)
{
- return event_type == XID_EVENT ||
- (event_type == QUERY_EVENT &&
- (((Query_log_event *)ev)->is_commit() ||
- ((Query_log_event *)ev)->is_rollback()));
+ if (event_type == XID_EVENT)
+ return 1;
+ if (event_type == QUERY_EVENT)
+ {
+ Query_log_event *qev = (Query_log_event *)ev;
+ if (qev->is_commit())
+ return 1;
+ if (qev->is_rollback())
+ return 2;
+ }
+ return 0;
}
@@ -574,7 +586,7 @@ do_retry:
err= 1;
goto err;
}
- if (is_group_ending(ev, event_type))
+ if (is_group_ending(ev, event_type) == 1)
rgi->mark_start_commit();
err= rpt_handle_event(qev, rpt);
@@ -713,7 +725,8 @@ handle_rpl_parallel_thread(void *arg)
Log_event_type event_type;
rpl_group_info *rgi= qev->rgi;
rpl_parallel_entry *entry= rgi->parallel_entry;
- bool end_of_group, group_ending;
+ bool end_of_group;
+ int group_ending;
next_qev= qev->next;
if (qev->typ == rpl_parallel_thread::queued_event::QUEUED_POS_UPDATE)
@@ -888,7 +901,18 @@ handle_rpl_parallel_thread(void *arg)
group_rgi= rgi;
group_ending= is_group_ending(qev->ev, event_type);
- if (group_ending && likely(!rgi->worker_error))
+ /*
+ We do not unmark_start_commit() here in case of an explicit ROLLBACK
+ statement. Such events should be very rare, there is no real reason
+ to try to group commit them - on the contrary, it seems best to avoid
+ running them in parallel with following group commits, as with
+ ROLLBACK events we are already deep in dangerous corner cases with
+ mix of transactional and non-transactional tables or the like. And
+ avoiding the mark_start_commit() here allows us to keep an assertion
+ in ha_rollback_trans() that we do not rollback after doing
+ mark_start_commit().
+ */
+ if (group_ending == 1 && likely(!rgi->worker_error))
{
/*
Do an extra check for (deadlock) kill here. This helps prevent a
@@ -2040,6 +2064,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
{
memcpy(rli->future_event_master_log_name,
rev->new_log_ident, rev->ident_len+1);
+ rli->notify_group_master_log_name_update();
}
}
diff --git a/sql/rpl_record_old.cc b/sql/rpl_record_old.cc
index 061fab78dbd..5b876373b9c 100644
--- a/sql/rpl_record_old.cc
+++ b/sql/rpl_record_old.cc
@@ -15,7 +15,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED by other includes
#include "rpl_rli.h"
#include "rpl_record_old.h"
#include "log_event.h" // Log_event_type
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 3207c858b20..8a2a55fcde0 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -996,7 +996,6 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
if (cmp < 0)
{
strcpy(group_master_log_name, rgi->future_event_master_log_name);
- notify_group_master_log_name_update();
group_master_log_pos= log_pos;
}
else if (group_master_log_pos < log_pos)
@@ -1218,7 +1217,8 @@ bool Relay_log_info::is_until_satisfied(THD *thd, Log_event *ev)
if (ev && ev->server_id == (uint32) global_system_variables.server_id &&
!replicate_same_server_id)
DBUG_RETURN(FALSE);
- log_name= group_master_log_name;
+ log_name= (opt_slave_parallel_threads > 0 ?
+ future_event_master_log_name : group_master_log_name);
log_pos= ((!ev)? group_master_log_pos :
(get_flag(IN_TRANSACTION) || !ev->log_pos) ?
group_master_log_pos : ev->log_pos - ev->data_written);
diff --git a/sql/slave.cc b/sql/slave.cc
index 2db78d2532d..e5bd92bf4fb 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -5699,6 +5699,11 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error_msg.append(llbuf, strlen(llbuf));
goto err;
}
+
+ /*
+ Heartbeat events doesn't count in the binlog size, so we don't have to
+ increment mi->master_log_pos
+ */
goto skip_relay_logging;
}
break;
@@ -5928,6 +5933,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
else
if ((s_id == global_system_variables.server_id &&
!mi->rli.replicate_same_server_id) ||
+ event_that_should_be_ignored(buf) ||
/*
the following conjunction deals with IGNORE_SERVER_IDS, if set
If the master is on the ignore list, execution of
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f5652596682..bab4659105c 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2561,9 +2561,11 @@ int check_change_password(THD *thd, const char *host, const char *user,
#ifdef WITH_WSREP
if ((!WSREP(thd) || !thd->wsrep_applier) &&
- !thd->slave_thread && !thd->security_ctx->priv_user[0])
+ !thd->slave_thread && !thd->security_ctx->priv_user[0] &&
+ !in_bootstrap)
#else
- if (!thd->slave_thread && !thd->security_ctx->priv_user[0])
+ if (!thd->slave_thread && !thd->security_ctx->priv_user[0] &&
+ !in_bootstrap)
#endif /* WITH_WSREP */
{
my_message(ER_PASSWORD_ANONYMOUS_USER, ER(ER_PASSWORD_ANONYMOUS_USER),
@@ -6759,16 +6761,18 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
for (tl= tables; number-- ; tl= tl->next_global)
{
- sctx= MY_TEST(tl->security_ctx) ? tl->security_ctx : thd->security_ctx;
+ TABLE_LIST *const t_ref=
+ tl->correspondent_table ? tl->correspondent_table : tl;
+ sctx= t_ref->security_ctx ? t_ref->security_ctx : thd->security_ctx;
const ACL_internal_table_access *access=
- get_cached_table_access(&tl->grant.m_internal,
- tl->get_db_name(),
- tl->get_table_name());
+ get_cached_table_access(&t_ref->grant.m_internal,
+ t_ref->get_db_name(),
+ t_ref->get_table_name());
if (access)
{
- switch(access->check(orig_want_access, &tl->grant.privilege))
+ switch(access->check(orig_want_access, &t_ref->grant.privilege))
{
case ACL_INTERNAL_ACCESS_GRANTED:
/*
@@ -6792,26 +6796,26 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
if (!want_access)
continue; // ok
- if (!(~tl->grant.privilege & want_access) ||
- tl->is_anonymous_derived_table() || tl->schema_table)
+ if (!(~t_ref->grant.privilege & want_access) ||
+ t_ref->is_anonymous_derived_table() || t_ref->schema_table)
{
/*
- It is subquery in the FROM clause. VIEW set tl->derived after
+ It is subquery in the FROM clause. VIEW set t_ref->derived after
table opening, but this function always called before table opening.
*/
- if (!tl->referencing_view)
+ if (!t_ref->referencing_view)
{
/*
If it's a temporary table created for a subquery in the FROM
clause, or an INFORMATION_SCHEMA table, drop the request for
a privilege.
*/
- tl->grant.want_privilege= 0;
+ t_ref->grant.want_privilege= 0;
}
continue;
}
- if (is_temporary_table(tl))
+ if (is_temporary_table(t_ref))
{
/*
If this table list element corresponds to a pre-opened temporary
@@ -6819,8 +6823,8 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
Note that during creation of temporary table we still need to check
if user has CREATE_TMP_ACL.
*/
- tl->grant.privilege|= TMP_TABLE_ACLS;
- tl->grant.want_privilege= 0;
+ t_ref->grant.privilege|= TMP_TABLE_ACLS;
+ t_ref->grant.want_privilege= 0;
continue;
}
@@ -6831,20 +6835,20 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
}
grant_table= table_hash_search(sctx->host, sctx->ip,
- tl->get_db_name(),
+ t_ref->get_db_name(),
sctx->priv_user,
- tl->get_table_name(),
+ t_ref->get_table_name(),
FALSE);
if (sctx->priv_role[0])
- grant_table_role= table_hash_search("", NULL, tl->get_db_name(),
+ grant_table_role= table_hash_search("", NULL, t_ref->get_db_name(),
sctx->priv_role,
- tl->get_table_name(),
+ t_ref->get_table_name(),
TRUE);
if (!grant_table && !grant_table_role)
{
- want_access&= ~tl->grant.privilege;
- goto err;
+ want_access&= ~t_ref->grant.privilege;
+ goto err; // No grants
}
/*
@@ -6854,19 +6858,19 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
if (any_combination_will_do)
continue;
- tl->grant.grant_table_user= grant_table; // Remember for column test
- tl->grant.grant_table_role= grant_table_role;
- tl->grant.version= grant_version;
- tl->grant.privilege|= grant_table ? grant_table->privs : 0;
- tl->grant.privilege|= grant_table_role ? grant_table_role->privs : 0;
- tl->grant.want_privilege= ((want_access & COL_ACLS) & ~tl->grant.privilege);
+ t_ref->grant.grant_table_user= grant_table; // Remember for column test
+ t_ref->grant.grant_table_role= grant_table_role;
+ t_ref->grant.version= grant_version;
+ t_ref->grant.privilege|= grant_table ? grant_table->privs : 0;
+ t_ref->grant.privilege|= grant_table_role ? grant_table_role->privs : 0;
+ t_ref->grant.want_privilege= ((want_access & COL_ACLS) & ~t_ref->grant.privilege);
- if (!(~tl->grant.privilege & want_access))
+ if (!(~t_ref->grant.privilege & want_access))
continue;
if ((want_access&= ~((grant_table ? grant_table->cols : 0) |
(grant_table_role ? grant_table_role->cols : 0) |
- tl->grant.privilege)))
+ t_ref->grant.privilege)))
{
goto err; // impossible
}
@@ -9013,8 +9017,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
So we need to examine the current element once again, but
we don't need to restart the search from the beginning.
*/
- if (idx != elements)
- idx++;
+ idx++;
break;
}
@@ -9046,6 +9049,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
my_hash_update(roles_mappings_hash, (uchar*) role_grant_pair,
(uchar*) old_key, old_key_length);
+ idx++; // see the comment above
break;
}
diff --git a/sql/sql_admin.h b/sql/sql_admin.h
index 77fc41e2ec4..96594fad0cb 100644
--- a/sql/sql_admin.h
+++ b/sql/sql_admin.h
@@ -17,7 +17,7 @@
#define SQL_TABLE_MAINTENANCE_H
/* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
-#define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024
+#define SQL_ADMIN_MSG_TEXT_SIZE (128 * 1024)
bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
LEX_STRING *key_cache_name);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 87e54b5771a..71ef74e1013 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1098,13 +1098,20 @@ bool close_temporary_tables(THD *thd)
DBUG_RETURN(FALSE);
DBUG_ASSERT(!thd->rgi_slave);
+ /*
+ Ensure we don't have open HANDLERs for tables we are about to close.
+ This is necessary when close_temporary_tables() is called as part
+ of execution of BINLOG statement (e.g. for format description event).
+ */
+ mysql_ha_rm_temporary_tables(thd);
if (!mysql_bin_log.is_open())
{
TABLE *tmp_next;
- for (table= thd->temporary_tables; table; table= tmp_next)
+ for (TABLE *t= thd->temporary_tables; t; t= tmp_next)
{
- tmp_next= table->next;
- close_temporary(table, 1, 1);
+ tmp_next= t->next;
+ mysql_lock_remove(thd, thd->lock, t);
+ close_temporary(t, 1, 1);
}
thd->temporary_tables= 0;
DBUG_RETURN(FALSE);
@@ -1200,6 +1207,7 @@ bool close_temporary_tables(THD *thd)
strlen(table->s->table_name.str));
s_query.append(',');
next= table->next;
+ mysql_lock_remove(thd, thd->lock, table);
close_temporary(table, 1, 1);
}
thd->clear_error();
@@ -7424,14 +7432,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
*/
result= FALSE;
- /*
- Save the lists made during natural join matching (because
- the matching done only once but we need the list in case
- of prepared statements).
- */
- table_ref_1->persistent_used_items= table_ref_1->used_items;
- table_ref_2->persistent_used_items= table_ref_2->used_items;
-
err:
if (arena)
thd->restore_active_arena(arena, &backup);
@@ -8478,11 +8478,6 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
}
}
#endif
- /*
- field_iterator.create_item() builds used_items which we
- have to save because changes made once and they are persistent
- */
- tables->persistent_used_items= tables->used_items;
if ((field= field_iterator.field()))
{
diff --git a/sql/sql_base.h b/sql/sql_base.h
index a6d90199860..aa4a041fc10 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -16,7 +16,6 @@
#ifndef SQL_BASE_INCLUDED
#define SQL_BASE_INCLUDED
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_trigger.h" /* trg_event_type */
#include "sql_class.h" /* enum_mark_columns */
#include "mysqld.h" /* key_map */
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 4ce99da7c7d..5f1714558eb 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -30,7 +30,6 @@
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_class.h"
#include "sql_cache.h" // query_cache_abort
#include "sql_base.h" // close_thread_tables
@@ -5432,16 +5431,13 @@ void xid_cache_delete(XID_STATE *xid_state)
BINLOG_FORMAT = STATEMENT and at least one table uses a storage
engine limited to row-logging.
- 6. Error: Cannot execute row injection: binlogging impossible since
- BINLOG_FORMAT = STATEMENT.
-
- 7. Warning: Unsafe statement binlogged in statement format since
+ 6. Warning: Unsafe statement binlogged in statement format since
BINLOG_FORMAT = STATEMENT.
In addition, we can produce the following error (not depending on
the variables of the decision diagram):
- 8. Error: Cannot execute statement: binlogging impossible since more
+ 7. Error: Cannot execute statement: binlogging impossible since more
than one engine is involved and at least one engine is
self-logging.
@@ -5720,10 +5716,10 @@ int THD::decide_logging_format(TABLE_LIST *tables)
if (lex->is_stmt_row_injection())
{
/*
- 6. Error: Cannot execute row injection since
- BINLOG_FORMAT = STATEMENT
+ We have to log the statement as row or give an error.
+ Better to accept what master gives us than stopping replication.
*/
- my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0));
+ set_current_stmt_binlog_format_row();
}
else if ((flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 &&
sqlcom_can_generate_row_events(this))
@@ -5755,7 +5751,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x",
binlog_unsafe_warning_flags));
}
- /* log in statement format! */
+ /* log in statement format (or row if row event)! */
}
/* No statement-only engines and binlog_format != STATEMENT.
I.e., nothing prevents us from row logging if needed. */
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 7b22b2eb0ce..596a2713d19 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -21,9 +21,6 @@
/* Classes in mysql */
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
-#ifdef MYSQL_SERVER
-#include "unireg.h" // REQUIRED: for other includes
-#endif
#include <waiting_threads.h>
#include "sql_const.h"
#include <mysql/plugin_audit.h>
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 7b9769cab89..096f4616300 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -28,7 +28,6 @@
#include "sql_audit.h"
#include "sql_connect.h"
#include "probes_mysql.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" // sql_command_flags,
// execute_init_command,
// do_command
diff --git a/sql/sql_const.h b/sql/sql_const.h
index 2cbc616559d..5c3a6d9a7cf 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -17,12 +17,14 @@
@file
File containing constants that can be used throughout the server.
- @note This file shall not contain any includes of any kinds.
+ @note This file shall not contain or include any declarations of any kinds.
*/
#ifndef SQL_CONST_INCLUDED
#define SQL_CONST_INCLUDED
+#include <mysql_version.h>
+
#define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */
/* extra 4+4 bytes for slave tmp tables */
#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
@@ -142,7 +144,7 @@
*/
#define STACK_MIN_SIZE 16000 // Abort if less stack during eval.
-#define STACK_MIN_SIZE_FOR_OPEN 1024*80
+#define STACK_MIN_SIZE_FOR_OPEN (1024*80)
#define STACK_BUFF_ALLOC 352 ///< For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 ///< Abort read after this many int.
@@ -238,7 +240,7 @@
#define DEFAULT_CONCURRENCY 10
#define DELAYED_LIMIT 100 /**< pause after xxx inserts */
#define DELAYED_QUEUE_SIZE 1000
-#define DELAYED_WAIT_TIMEOUT 5*60 /**< Wait for delayed insert */
+#define DELAYED_WAIT_TIMEOUT (5*60) /**< Wait for delayed insert */
#define MAX_CONNECT_ERRORS 100 ///< errors before disabling host
#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 2a57066c17d..4de7f88d736 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -508,17 +508,18 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(TRUE);
}
+
if (query_plan.index == MAX_KEY || (select && select->quick))
+ error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
+ else
+ error= init_read_record_idx(&info, thd, table, 1, query_plan.index,
+ reverse);
+ if (error)
{
- if (init_read_record(&info, thd, table, select, 1, 1, FALSE))
- {
- delete select;
- free_underlaid_joins(thd, select_lex);
- DBUG_RETURN(TRUE);
- }
+ delete select;
+ free_underlaid_joins(thd, select_lex);
+ DBUG_RETURN(TRUE);
}
- else
- init_read_record_idx(&info, thd, table, 1, query_plan.index, reverse);
init_ftfuncs(thd, select_lex, 1);
THD_STAGE_INFO(thd, stage_updating);
diff --git a/sql/sql_digest.h b/sql/sql_digest.h
index ce159283d4d..eaf74b9542e 100644
--- a/sql/sql_digest.h
+++ b/sql/sql_digest.h
@@ -41,6 +41,9 @@ struct sql_digest_storage
For Example:
SELECT * FROM T1;
&lt;SELECT_TOKEN&gt; &lt;*&gt; &lt;FROM_TOKEN&gt; &lt;ID_TOKEN&gt; &lt;2&gt; &lt;T1&gt;
+
+ @note Only the first @c m_byte_count bytes are initialized,
+ out of @c m_token_array_length.
*/
unsigned char *m_token_array;
/* Length of the token array to be considered for DIGEST_TEXT calculation. */
@@ -63,10 +66,6 @@ struct sql_digest_storage
m_full= false;
m_byte_count= 0;
m_charset_number= 0;
- if (m_token_array_length > 0)
- {
- memset(m_token_array, 0, m_token_array_length);
- }
memset(m_md5, 0, MD5_HASH_SIZE);
}
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 3e18b701031..b2fa8187925 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -510,8 +510,10 @@ Diagnostics_area::set_error_status(uint sql_errno,
void
Diagnostics_area::disable_status()
{
+ DBUG_ENTER("disable_status");
DBUG_ASSERT(! is_set());
m_status= DA_DISABLED;
+ DBUG_VOID_RETURN;
}
Warning_info::Warning_info(ulonglong warn_id_arg,
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 110bca96530..5fc7c20d409 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2001, 2013, Oracle and/or its affiliates.
- Copyright (c) 2011, 2013, Monty Program Ab.
+/* Copyright (c) 2001, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -55,7 +55,6 @@
#include <my_global.h>
#include "sql_priv.h"
#include "sql_handler.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_base.h" // close_thread_tables
#include "lock.h" // mysql_unlock_tables
#include "key.h" // key_copy
@@ -1190,3 +1189,36 @@ void mysql_ha_set_explicit_lock_duration(THD *thd)
DBUG_VOID_RETURN;
}
+
+/**
+ Remove temporary tables from the HANDLER's hash table. The reason
+ for having a separate function, rather than calling
+ mysql_ha_rm_tables() is that it is not always feasible (e.g. in
+ close_temporary_tables) to obtain a TABLE_LIST containing the
+ temporary tables.
+
+ @See close_temporary_tables
+ @param thd Thread identifier.
+*/
+void mysql_ha_rm_temporary_tables(THD *thd)
+{
+ DBUG_ENTER("mysql_ha_rm_temporary_tables");
+
+ TABLE_LIST *tmp_handler_tables= NULL;
+ for (uint i= 0; i < thd->handler_tables_hash.records; i++)
+ {
+ TABLE_LIST *handler_table= reinterpret_cast<TABLE_LIST*>
+ (my_hash_element(&thd->handler_tables_hash, i));
+
+ if (handler_table->table && handler_table->table->s->tmp_table)
+ {
+ handler_table->next_local= tmp_handler_tables;
+ tmp_handler_tables= handler_table;
+ }
+ }
+
+ if (tmp_handler_tables)
+ mysql_ha_rm_tables(thd, tmp_handler_tables);
+
+ DBUG_VOID_RETURN;
+}
diff --git a/sql/sql_handler.h b/sql/sql_handler.h
index 133f553675e..7fe5ae5bba8 100644
--- a/sql/sql_handler.h
+++ b/sql/sql_handler.h
@@ -1,6 +1,8 @@
#ifndef SQL_HANDLER_INCLUDED
#define SQL_HANDLER_INCLUDED
-/* Copyright (C) 2010 Monty Program Ab
+/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
+ Copyright (C) 2010, 2015, MariaDB
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@@ -73,6 +75,7 @@ void mysql_ha_flush_tables(THD *thd, TABLE_LIST *all_tables);
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables);
void mysql_ha_cleanup(THD *thd);
void mysql_ha_set_explicit_lock_duration(THD *thd);
+void mysql_ha_rm_temporary_tables(THD *thd);
SQL_HANDLER *mysql_ha_read_prepare(THD *thd, TABLE_LIST *tables,
enum enum_ha_read_modes mode, char *keyname,
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6af2c0646ba..4e033f21b25 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2014, SkySQL Ab.
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,7 +58,6 @@
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_insert.h"
#include "sql_update.h" // compare_record
#include "sql_base.h" // close_thread_tables
@@ -3899,7 +3898,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
/* Add selected items to field list */
List_iterator_fast<Item> it(*items);
Item *item;
- Field *tmp_field;
DBUG_ENTER("create_table_from_items");
tmp_table.alias= 0;
@@ -3914,24 +3912,49 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
while ((item=it++))
{
- Create_field *cr_field;
- Field *field, *def_field;
+ Field *tmp_table_field;
if (item->type() == Item::FUNC_ITEM)
{
if (item->result_type() != STRING_RESULT)
- field= item->tmp_table_field(&tmp_table);
+ tmp_table_field= item->tmp_table_field(&tmp_table);
else
- field= item->tmp_table_field_from_field_type(&tmp_table, 0);
+ tmp_table_field= item->tmp_table_field_from_field_type(&tmp_table,
+ false);
}
else
- field= create_tmp_field(thd, &tmp_table, item, item->type(),
- (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
- 0);
- if (!field ||
- !(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ?
- ((Item_field *)item)->field :
- (Field*) 0))))
- DBUG_RETURN(0);
+ {
+ Field *from_field, * default_field;
+ tmp_table_field= create_tmp_field(thd, &tmp_table, item, item->type(),
+ (Item ***) NULL, &from_field, &default_field,
+ 0, 0, 0, 0, 0);
+ }
+
+ if (!tmp_table_field)
+ DBUG_RETURN(NULL);
+
+ Field *table_field;
+
+ switch (item->type())
+ {
+ /*
+ We have to take into account both the real table's fields and
+ pseudo-fields used in trigger's body. These fields are used
+ to copy defaults values later inside constructor of
+ the class Create_field.
+ */
+ case Item::FIELD_ITEM:
+ case Item::TRIGGER_FIELD_ITEM:
+ table_field= ((Item_field *) item)->field;
+ break;
+ default:
+ table_field= NULL;
+ }
+
+ Create_field *cr_field= new Create_field(tmp_table_field, table_field);
+
+ if (!cr_field)
+ DBUG_RETURN(NULL);
+
if (item->maybe_null)
cr_field->flags &= ~NOT_NULL_FLAG;
alter_info->create_list.push_back(cr_field);
@@ -4021,7 +4044,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
{
if (!thd->is_error()) // CREATE ... IF NOT EXISTS
my_ok(thd); // succeed, but did nothing
- DBUG_RETURN(0);
+ DBUG_RETURN(NULL);
}
DEBUG_SYNC(thd,"create_table_select_before_lock");
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 26f4eabb1f9..4aad94b8188 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -20,7 +20,6 @@
#define MYSQL_LEX 1
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_class.h" // sql_lex.h: SQLCOM_END
#include "sql_lex.h"
#include "sql_parse.h" // add_to_list
@@ -568,6 +567,16 @@ void lex_end(LEX *lex)
DBUG_ENTER("lex_end");
DBUG_PRINT("enter", ("lex: 0x%lx", (long) lex));
+ lex_end_stage1(lex);
+ lex_end_stage2(lex);
+
+ DBUG_VOID_RETURN;
+}
+
+void lex_end_stage1(LEX *lex)
+{
+ DBUG_ENTER("lex_end_stage1");
+
/* release used plugins */
if (lex->plugins.elements) /* No function call and no mutex if no plugins. */
{
@@ -579,6 +588,19 @@ void lex_end(LEX *lex)
delete lex->sphead;
lex->sphead= NULL;
+ DBUG_VOID_RETURN;
+}
+
+/*
+ MASTER INFO parameters (or state) is normally cleared towards the end
+ of a statement. But in case of PS, the state needs to be preserved during
+ its lifetime and should only be cleared on PS close or deallocation.
+*/
+void lex_end_stage2(LEX *lex)
+{
+ DBUG_ENTER("lex_end_stage2");
+
+ /* Reset LEX_MASTER_INFO */
lex->mi.reset();
DBUG_VOID_RETURN;
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 3d008723f66..413afdb4369 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2947,6 +2947,8 @@ extern void lex_init(void);
extern void lex_free(void);
extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
+extern void lex_end_stage1(LEX *lex);
+extern void lex_end_stage2(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(union YYSTYPE *yylval, THD *thd);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 503cc579dd7..08687b20b00 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2014, SkySQL Ab.
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2028,8 +2028,15 @@ int READ_INFO::read_xml()
break;
case '/': /* close tag */
- level--;
chr= my_tospace(GET);
+ /* Decrease the 'level' only when (i) It's not an */
+ /* (without space) empty tag i.e. <tag/> or, (ii) */
+ /* It is of format <row col="val" .../> */
+ if(chr != '>' || in_tag)
+ {
+ level--;
+ in_tag= false;
+ }
if(chr != '>') /* if this is an empty tag <tag /> */
tag.length(0); /* we should keep tag value */
while(chr != '>' && chr != my_b_EOF)
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index c6c465aa4e2..8cf849b97d0 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -24,7 +24,6 @@
#include <my_global.h>
#include "sql_priv.h"
#include "sql_manager.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_base.h" // flush_tables
static bool volatile manager_thread_in_use;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ca7b236eb04..03367acab08 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2014, SkySQL Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,6 @@
#define MYSQL_LEX 1
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
#include "lock.h" // try_transactional_lock,
// check_transactional_lock,
@@ -677,7 +676,7 @@ static char *fgets_fn(char *buffer, size_t size, fgets_input_t input, int *error
static void handle_bootstrap_impl(THD *thd)
{
MYSQL_FILE *file= bootstrap_file;
- DBUG_ENTER("handle_bootstrap");
+ DBUG_ENTER("handle_bootstrap_impl");
#ifndef EMBEDDED_LIBRARY
pthread_detach_this_thread();
@@ -3887,7 +3886,10 @@ end_with_restore_list:
lex->duplicates,
lex->ignore)))
{
- res= handle_select(thd, lex, sel_result, OPTION_SETUP_TABLES_DONE);
+ if (explain)
+ res= mysql_explain_union(thd, &thd->lex->unit, sel_result);
+ else
+ res= handle_select(thd, lex, sel_result, OPTION_SETUP_TABLES_DONE);
/*
Invalidate the table in the query cache if something changed
after unlocking when changes become visible.
@@ -3903,6 +3905,16 @@ end_with_restore_list:
query_cache_invalidate3(thd, first_table, 1);
first_table->next_local= save_table;
}
+ if (explain)
+ {
+ /*
+ sel_result needs to be cleaned up properly.
+ INSERT... SELECT statement will call either send_eof() or
+ abort_result_set(). EXPLAIN doesn't call either, so we need
+ to cleanup manually.
+ */
+ sel_result->abort_result_set();
+ }
delete sel_result;
}
@@ -6326,9 +6338,12 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
for (; i < number && tables != first_not_own_table && tables;
tables= tables->next_global, i++)
{
+ TABLE_LIST *const table_ref= tables->correspondent_table ?
+ tables->correspondent_table : tables;
+
ulong want_access= requirements;
- if (tables->security_ctx)
- sctx= tables->security_ctx;
+ if (table_ref->security_ctx)
+ sctx= table_ref->security_ctx;
else
sctx= backup_ctx;
@@ -6336,26 +6351,26 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
Register access for view underlying table.
Remove SHOW_VIEW_ACL, because it will be checked during making view
*/
- tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
+ table_ref->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
- if (tables->schema_table_reformed)
+ if (table_ref->schema_table_reformed)
{
- if (check_show_access(thd, tables))
+ if (check_show_access(thd, table_ref))
goto deny;
continue;
}
- DBUG_PRINT("info", ("derived: %d view: %d", tables->derived != 0,
- tables->view != 0));
+ DBUG_PRINT("info", ("derived: %d view: %d", table_ref->derived != 0,
+ table_ref->view != 0));
- if (tables->is_anonymous_derived_table())
+ if (table_ref->is_anonymous_derived_table())
continue;
thd->security_ctx= sctx;
- if (check_access(thd, want_access, tables->get_db_name(),
- &tables->grant.privilege,
- &tables->grant.m_internal,
+ if (check_access(thd, want_access, table_ref->get_db_name(),
+ &table_ref->grant.privilege,
+ &table_ref->grant.m_internal,
0, no_errors))
goto deny;
}
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index f0fde223984..be7824aae9e 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -49,7 +49,6 @@
#define MYSQL_LEX 1
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_partition.h"
#include "key.h" // key_restore
#include "sql_parse.h" // parse_sql
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 27d37d9fb83..4b13139014d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3456,7 +3456,8 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
thd->mdl_context.release_transactional_locks();
}
- lex_end(lex);
+ /* Preserve CHANGE MASTER attributes */
+ lex_end_stage1(lex);
cleanup_stmt();
thd->restore_backup_statement(this, &stmt_backup);
thd->stmt_arena= old_stmt_arena;
@@ -4078,6 +4079,10 @@ void Prepared_statement::deallocate()
{
/* We account deallocate in the same manner as mysqld_stmt_close */
status_var_increment(thd->status_var.com_stmt_close);
+
+ /* It should now be safe to reset CHANGE MASTER parameters */
+ lex_end_stage2(lex);
+
/* Statement map calls delete stmt on erase */
thd->stmt_map.erase(this);
}
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 26d515842ed..6b30dd28a51 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -31,7 +31,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_profile.h"
#include <my_sys.h>
#include "sql_show.h" // schema_table_store_record
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index f064146e7fc..ca99a81b455 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -93,6 +93,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
my_error(ER_UNKNOWN_ERROR, MYF(0));
}
}
+ opt_noacl= 0;
if (tmp_thd)
{
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 6307108f4b2..af02c1ca966 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2869,7 +2869,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
if (init_master_info(mi,master_info_file_tmp,relay_log_info_file_tmp, 0,
thread_mask))
slave_errno=ER_MASTER_INFO;
- else if (server_id_supplied && *mi->host)
+ else if (!server_id_supplied)
+ {
+ slave_errno= ER_BAD_SLAVE; net_report= 0;
+ my_message(slave_errno, "Misconfigured slave: server_id was not set; Fix in config file",
+ MYF(0));
+ }
+ else if (!*mi->host)
+ {
+ slave_errno= ER_BAD_SLAVE; net_report= 0;
+ my_message(slave_errno, "Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO",
+ MYF(0));
+ }
+ else
{
/*
If we will start SQL thread we will care about UNTIL options If
@@ -2963,8 +2975,6 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
relay_log_info_file_tmp,
thread_mask);
}
- else
- slave_errno = ER_BAD_SLAVE;
}
else
{
@@ -3321,7 +3331,8 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
*master_info_added= true;
}
if (global_system_variables.log_warnings > 1)
- sql_print_information("Master: '%.*s' Master_info_file: '%s' "
+ sql_print_information("Master connection name: '%.*s' "
+ "Master_info_file: '%s' "
"Relay_info_file: '%s'",
(int) mi->connection_name.length,
mi->connection_name.str,
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index aa9a3f2da0e..edfd9f5ebd3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1530,6 +1530,9 @@ TODO: make view to decide if it is possible to write to WHERE directly or make S
/* Cache constant expressions in WHERE, HAVING, ON clauses. */
cache_const_exprs();
+ if (setup_semijoin_loosescan(this))
+ DBUG_RETURN(1);
+
if (make_join_select(this, select, conds))
{
zero_result_cause=
@@ -9676,9 +9679,14 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
Check again if we should use an index.
We could have used an column from a previous table in
the index if we are using limit and this is the first table
+
+ (1) - Don't switch the used index if we are using semi-join
+ LooseScan on this table. Using different index will not
+ produce the desired ordering and de-duplication.
*/
if (!tab->table->is_filled_at_execution() &&
+ !tab->loosescan_match_tab && // (1)
((cond && (!tab->keys.is_subset(tab->const_keys) && i > 0)) ||
(!tab->const_keys.is_clear_all() && i == join->const_tables &&
join->unit->select_limit_cnt <
@@ -15592,6 +15600,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case Item::FIELD_ITEM:
case Item::DEFAULT_VALUE_ITEM:
case Item::INSERT_VALUE_ITEM:
+ case Item::TRIGGER_FIELD_ITEM:
{
Item_field *field= (Item_field*) item;
bool orig_modify= modify_item;
@@ -18043,6 +18052,10 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
if (return_tab < join->return_tab)
join->return_tab= return_tab;
+ /* check for errors evaluating the condition */
+ if (join->thd->is_error())
+ DBUG_RETURN(NESTED_LOOP_ERROR);
+
if (join->return_tab < join_tab)
DBUG_RETURN(NESTED_LOOP_OK);
/*
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 61157130f50..bbeb2aa6952 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -717,8 +717,7 @@ public:
struct st_position *pos,
struct st_position *loose_scan_pos);
friend bool get_best_combination(JOIN *join);
- friend int setup_semijoin_dups_elimination(JOIN *join, ulonglong options,
- uint no_jbuf_after);
+ friend int setup_semijoin_loosescan(JOIN *join);
friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join);
};
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index c2ae37248b8..d1a24345443 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -8156,13 +8156,14 @@ bool get_schema_tables_result(JOIN *join,
TABLE_LIST *table_list= tab->table->pos_in_table_list;
if (table_list->schema_table && thd->fill_information_schema_tables())
{
-#if MYSQL_VERSION_ID > 100105
-#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields
- bool is_subselect= (&lex->unit != lex->current_select->master_unit() &&
- lex->current_select->master_unit()->item);
-#else
-#define is_subselect false
-#endif
+ /*
+ I_S tables only need to be re-populated if make_cond_for_info_schema()
+ preserves outer fields
+ */
+ bool is_subselect= &lex->unit != lex->current_select->master_unit() &&
+ lex->current_select->master_unit()->item &&
+ tab->select_cond &&
+ tab->select_cond->used_tables() & OUTER_REF_TABLE_BIT;
/* A value of 0 indicates a dummy implementation */
if (table_list->schema_table->fill_table == 0)
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6449f8f22f0..65d601968ba 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5909,6 +5909,16 @@ drop_create_field:
{
if (!key->create_if_not_exists)
continue;
+
+ /* Check if the table already has a PRIMARY KEY */
+ if (key->type == Key::PRIMARY &&
+ table->s->primary_key != MAX_KEY)
+ {
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
+ ER_DUP_KEYNAME, ER(ER_MULTIPLE_PRI_KEY));
+ goto remove_key_no_warn;
+ }
+
/* If the name of the key is not specified, */
/* let us check the name of the first key part. */
if ((keyname= key->name.str) == NULL)
@@ -5975,6 +5985,7 @@ drop_create_field:
remove_key:
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_DUP_KEYNAME, ER(ER_DUP_KEYNAME), keyname);
+remove_key_no_warn:
key_it.remove();
if (key->type == Key::FOREIGN_KEY)
{
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index ca689d55a2b..f2596401c2e 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -19,7 +19,6 @@
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED by other includes
#include "sql_time.h"
#include "tztime.h" // struct Time_zone
#include "sql_class.h" // THD
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 52892550d35..7dfe8939945 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -17,6 +17,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 <mysqld_error.h>
+
/* Forward declarations */
class Item_trigger_field;
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index a316fbad726..71875433c39 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -286,8 +286,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
{
if (!(tmp_result= union_result= new select_union))
goto err;
- if (describe)
- tmp_result= sel_result;
}
else
tmp_result= sel_result;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 150ef50f81c..e64aebcb78c 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -22,7 +22,6 @@
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_update.h"
#include "sql_cache.h" // query_cache_*
#include "sql_base.h" // close_tables_for_reopen
@@ -459,7 +458,8 @@ int mysql_update(THD *thd,
query_plan.scanned_rows= select? select->records: table->file->stats.records;
if (select && select->quick && select->quick->unique_key_range())
- { // Single row select (always "ordered"): Ok to use with key field UPDATE
+ {
+ /* Single row select (always "ordered"): Ok to use with key field UPDATE */
need_sort= FALSE;
query_plan.index= MAX_KEY;
used_key_is_modified= FALSE;
@@ -468,7 +468,8 @@ int mysql_update(THD *thd,
{
ha_rows scanned_limit= query_plan.scanned_rows;
query_plan.index= get_index_for_order(order, table, select, limit,
- &scanned_limit, &need_sort, &reverse);
+ &scanned_limit, &need_sort,
+ &reverse);
if (!need_sort)
query_plan.scanned_rows= scanned_limit;
@@ -481,12 +482,15 @@ int mysql_update(THD *thd,
else
{
if (need_sort)
- { // Assign table scan index to check below for modified key fields:
+ {
+ /* Assign table scan index to check below for modified key fields: */
query_plan.index= table->file->key_used_on_scan;
}
if (query_plan.index != MAX_KEY)
- { // Check if we are modifying a key that we are used to search with:
- used_key_is_modified= is_key_used(table, query_plan.index, table->write_set);
+ {
+ /* Check if we are modifying a key that we are used to search with: */
+ used_key_is_modified= is_key_used(table, query_plan.index,
+ table->write_set);
}
}
}
@@ -597,19 +601,20 @@ int mysql_update(THD *thd,
B. query_plan.index != MAX_KEY
B.1 quick select is used, start the scan with init_read_record
B.2 quick select is not used, this is full index scan (with LIMIT)
- Full index scan must be started with init_read_record_idx
+ Full index scan must be started with init_read_record_idx
*/
if (query_plan.index == MAX_KEY || (select && select->quick))
+ error= init_read_record(&info, thd, table, select, 0, 1, FALSE);
+ else
+ error= init_read_record_idx(&info, thd, table, 1, query_plan.index,
+ reverse);
+
+ if (error)
{
- if (init_read_record(&info, thd, table, select, 0, 1, FALSE))
- {
- close_cached_file(&tempfile);
- goto err;
- }
+ close_cached_file(&tempfile);
+ goto err;
}
- else
- init_read_record_idx(&info, thd, table, 1, query_plan.index, reverse);
THD_STAGE_INFO(thd, stage_searching_rows_for_update);
ha_rows tmp_limit= limit;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b2e3b0e46c0..13f963e2f4c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -35,7 +35,6 @@
#define Select Lex->current_select
#include <my_global.h>
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" /* comp_*_creator */
#include "sql_table.h" /* primary_key_name */
#include "sql_partition.h" /* mem_alloc_error, partition_info, HASH_PARTITION */
@@ -11513,8 +11512,20 @@ procedure_clause:
if (add_proc_to_list(lex->thd, item))
MYSQL_YYABORT;
Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
+
+ /*
+ PROCEDURE CLAUSE cannot handle subquery as one of its parameter,
+ so set expr_allows_subselect as false to disallow any subqueries
+ further. Reset expr_allows_subselect back to true once the
+ parameters are reduced.
+ */
+ Lex->expr_allows_subselect= false;
}
'(' procedure_list ')'
+ {
+ /* Subqueries are allowed from now.*/
+ Lex->expr_allows_subselect= true;
+ }
;
procedure_list:
@@ -15164,6 +15175,9 @@ current_role:
grant_role:
ident_or_text
{
+ CHARSET_INFO *cs= system_charset_info;
+ /* trim end spaces (as they'll be lost in mysql.user anyway) */
+ $1.length= cs->cset->lengthsp(cs, $1.str, $1.length);
if ($1.length == 0)
{
my_error(ER_INVALID_ROLE, MYF(0), "");
@@ -15178,8 +15192,7 @@ grant_role:
$$->auth= empty_lex_str;
if (check_string_char_length(&$$->user, ER(ER_USERNAME),
- username_char_length,
- system_charset_info, 0))
+ username_char_length, cs, 0))
MYSQL_YYABORT;
}
| current_role
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 16e498c2937..4d2e35bac87 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -836,30 +836,26 @@ static Sys_var_ulong Sys_delayed_queue_size(
VALID_RANGE(1, UINT_MAX), DEFAULT(DELAYED_QUEUE_SIZE), BLOCK_SIZE(1));
#ifdef HAVE_EVENT_SCHEDULER
-static const char *event_scheduler_names[]= { "OFF", "ON", "DISABLED", NullS };
+static const char *event_scheduler_names[]= { "OFF", "ON", "DISABLED",
+ "ORIGINAL", NullS };
static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var)
{
- /* DISABLED is only accepted on the command line */
- if (var->save_result.ulonglong_value == Events::EVENTS_DISABLED)
- return true;
- /*
- If the scheduler was disabled because there are no/bad
- system tables, produce a more meaningful error message
- than ER_OPTION_PREVENTS_STATEMENT
- */
- if (Events::check_if_system_tables_error())
- return true;
if (Events::opt_event_scheduler == Events::EVENTS_DISABLED)
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
"--event-scheduler=DISABLED or --skip-grant-tables");
return true;
}
+ /* DISABLED is only accepted on the command line */
+ if (var->save_result.ulonglong_value == Events::EVENTS_DISABLED)
+ return true;
return false;
}
+
static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type)
{
int err_no= 0;
+ bool ret;
uint opt_event_scheduler_value= Events::opt_event_scheduler;
mysql_mutex_unlock(&LOCK_global_system_variables);
/*
@@ -878,9 +874,25 @@ static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type)
rare and it's difficult to avoid it without opening up possibilities
for deadlocks. See bug#51160.
*/
- bool ret= opt_event_scheduler_value == Events::EVENTS_ON
- ? Events::start(&err_no)
- : Events::stop();
+
+ /* EVENTS_ORIGINAL means we should revert back to the startup state */
+ if (opt_event_scheduler_value == Events::EVENTS_ORIGINAL)
+ {
+ opt_event_scheduler_value= Events::opt_event_scheduler=
+ Events::startup_state;
+ }
+
+ /*
+ If the scheduler was not properly inited (because of wrong system tables),
+ try to init it again. This is needed for mysql_upgrade to work properly if
+ the event tables where upgraded.
+ */
+ if (!Events::inited && (Events::init(thd, 0) || !Events::inited))
+ ret= 1;
+ else
+ ret= opt_event_scheduler_value == Events::EVENTS_ON ?
+ Events::start(&err_no) :
+ Events::stop();
mysql_mutex_lock(&LOCK_global_system_variables);
if (ret)
{
diff --git a/sql/table.cc b/sql/table.cc
index 9cb33e92d89..90cdc7089b9 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -19,7 +19,6 @@
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
-#include "unireg.h" // REQUIRED: for other includes
#include "table.h"
#include "key.h" // find_ref_key
#include "sql_table.h" // build_table_filename,
@@ -5338,6 +5337,12 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
item->maybe_null= TRUE;
/* Save item in case we will need to fall back to materialization. */
view->used_items.push_front(item);
+ /*
+ If we create this reference on persistent memory then it should be
+ present in persistent list
+ */
+ if (thd->mem_root == thd->stmt_arena->mem_root)
+ view->persistent_used_items.push_front(item);
DBUG_RETURN(item);
}
@@ -6915,6 +6920,7 @@ bool TABLE_LIST::handle_derived(LEX *lex, uint phases)
{
SELECT_LEX_UNIT *unit;
DBUG_ENTER("handle_derived");
+ DBUG_PRINT("enter", ("phases: 0x%x", phases));
if ((unit= get_unit()))
{
for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index 68c032fb67b..e720e43498a 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -1634,7 +1634,7 @@ int tp_get_idle_thread_count()
Delay in microseconds, after which "pool blocked" message is printed.
(30 sec == 30 Mio usec)
*/
-#define BLOCK_MSG_DELAY 30*1000000
+#define BLOCK_MSG_DELAY (30*1000000)
#define MAX_THREADS_REACHED_MSG \
"Threadpool could not create additional thread to handle queries, because the \
diff --git a/sql/unireg.h b/sql/unireg.h
index 2d51aa39fd4..b13dd494c74 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -110,36 +110,36 @@
The flag means that we need to process tables only to get necessary data.
Views are not processed.
*/
-#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
+#define OPEN_TABLE_ONLY (OPEN_FRM_FILE_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine
The flag means that we need to process views only to get necessary data.
Tables are not processed.
*/
-#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
+#define OPEN_VIEW_ONLY (OPEN_TABLE_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that we need to open a view using
open_normal_and_derived_tables() function.
*/
-#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2
+#define OPEN_VIEW_FULL (OPEN_VIEW_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that I_S table uses optimization algorithm.
*/
-#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2
+#define OPTIMIZE_I_S_TABLE (OPEN_VIEW_FULL*2)
/**
This flag is used to instruct tdc_open_view() to check metadata version.
*/
-#define CHECK_METADATA_VERSION OPEN_TRIGGER_ONLY*2
+#define CHECK_METADATA_VERSION (OPEN_TRIGGER_ONLY*2)
/*
The flag means that we need to process trigger files only.
*/
-#define OPEN_TRIGGER_ONLY OPTIMIZE_I_S_TABLE*2
+#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2)
#define SC_INFO_LENGTH 4 /* Form format constant */
#define TE_INFO_LENGTH 3
diff --git a/storage/archive/archive_test.c b/storage/archive/archive_test.c
index d01c1e0b22e..bb052b8409c 100644
--- a/storage/archive/archive_test.c
+++ b/storage/archive/archive_test.c
@@ -33,7 +33,7 @@
#define ARCHIVE_ROW_HEADER_SIZE 4
-#define BUFFER_LEN 1024 + ARCHIVE_ROW_HEADER_SIZE
+#define BUFFER_LEN (1024 + ARCHIVE_ROW_HEADER_SIZE)
char test_string[BUFFER_LEN];
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index e1ef6f6af62..3036783e5b7 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -169,7 +169,7 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
- char version[]= "Version 1.03.0007 July 05, 2015";
+ char version[]= "Version 1.03.0007 October 20, 2015";
#if defined(__WIN__)
char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__;
char slash= '\\';
@@ -1134,7 +1134,10 @@ PTOS ha_connect::GetTableOptionStruct(TABLE_SHARE *s)
{
TABLE_SHARE *tsp= (tshp) ? tshp : (s) ? s : table_share;
- return (tsp) ? tsp->option_struct : NULL;
+ return (tsp && (!tsp->db_plugin ||
+ !stricmp(plugin_name(tsp->db_plugin)->str, "connect") ||
+ !stricmp(plugin_name(tsp->db_plugin)->str, "partition")))
+ ? tsp->option_struct : NULL;
} // end of GetTableOptionStruct
/****************************************************************************/
@@ -2471,7 +2474,18 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
!(colp[i]= tdbp->ColDB(g, (PSZ)pField->field->field_name, 0)))
return NULL; // Column does not belong to this table
- if (trace) {
+ // These types are not yet implemented (buggy)
+ switch (pField->field->type()) {
+ case MYSQL_TYPE_TIMESTAMP:
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_YEAR:
+ case MYSQL_TYPE_NEWDATE:
+ return NULL;
+ } // endswitch type
+
+ if (trace) {
htrc("Field index=%d\n", pField->field->field_index);
htrc("Field name=%s\n", pField->field->field_name);
} // endif trace
@@ -2486,12 +2500,10 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
if (!i && (ismul))
return NULL;
- if ((res= pval->val_str(&tmp)) == NULL)
- return NULL; // To be clarified
-
- switch (args[i]->real_type()) {
+ switch (args[i]->real_type()) {
case COND::STRING_ITEM:
- pp->Value= PlugSubAllocStr(g, NULL, res->ptr(), res->length());
+ res= pval->val_str(&tmp);
+ pp->Value= PlugSubAllocStr(g, NULL, res->ptr(), res->length());
pp->Type= (pp->Value) ? TYPE_STRING : TYPE_ERROR;
break;
case COND::INT_ITEM:
@@ -2520,8 +2532,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
return NULL;
} // endswitch type
- if (trace)
- htrc("Value=%.*s\n", res->length(), res->ptr());
+ if (trace)
+ htrc("Value type=%hd\n", pp->Type);
// Append the value to the argument list
if (pprec)
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index 6aaa048de81..1ccdf231970 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -2360,9 +2360,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
} // endif rc
for (n = 0, crp = qrp->Colresp; crp; n++, crp = crp->Next) {
- if (vlen[n] == SQL_NULL_DATA)
+ if (vlen[n] == SQL_NO_TOTAL)
+ ThrowDBX("Unexpected SQL_NO_TOTAL returned from SQLFetch");
+ else if (vlen[n] == SQL_NULL_DATA)
pval[n]->SetNull(true);
- else if (crp->Type == TYPE_STRING && vlen[n] != SQL_NULL_DATA)
+ else if (crp->Type == TYPE_STRING/* && vlen[n] != SQL_NULL_DATA*/)
pval[n]->SetValue_char(pbuf[n], vlen[n]);
else
pval[n]->SetNull(false);
diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h
index 4aa29037dfc..dada5716dbe 100644
--- a/storage/connect/reldef.h
+++ b/storage/connect/reldef.h
@@ -193,7 +193,8 @@ class DllExport COLDEF : public COLCRT { /* Column description block
friend class COLBLK;
friend class DBFFAM;
friend class TDBASE;
- public:
+ friend class TDBDOS;
+public:
COLDEF(void); // Constructor
// Implementation
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index a1e58ab3344..527fe55dd89 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -2018,7 +2018,8 @@ int TDBDOS::EstimatedLength(void)
// result if we set dep to 1
dep = 1 + cdp->GetLong() / 20; // Why 20 ?????
} else for (; cdp; cdp = cdp->GetNext())
- dep = MY_MAX(dep, cdp->GetOffset());
+ if (!(cdp->Flags & (U_VIRTUAL|U_SPECIAL)))
+ dep = MY_MAX(dep, cdp->GetOffset());
return (int)dep;
} // end of Estimated Length
diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp
index acd548c86ab..55c254f41ea 100644
--- a/storage/connect/tabfix.cpp
+++ b/storage/connect/tabfix.cpp
@@ -511,29 +511,29 @@ void BINCOL::ReadColumn(PGLOBAL g)
switch (Fmt) {
case 'X': // Standard not converted values
if (Eds && IsTypeChar(Buf_Type))
- Value->SetValue(*(longlong*)p);
+ Value->SetValueNonAligned<longlong>(p);
else
Value->SetBinValue(p);
break;
case 'S': // Short integer
- Value->SetValue(*(short*)p);
+ Value->SetValueNonAligned<short>(p);
break;
case 'T': // Tiny integer
Value->SetValue(*p);
break;
case 'I': // Integer
- Value->SetValue(*(int*)p);
+ Value->SetValueNonAligned<int>(p);
break;
case 'G': // Large (great) integer
- Value->SetValue(*(longlong*)p);
+ Value->SetValueNonAligned<longlong>(p);
break;
case 'F': // Float
case 'R': // Real
- Value->SetValue((double)*(float*)p);
+ Value->SetValueNonAligned<float>(p);
break;
case 'D': // Double
- Value->SetValue(*(double*)p);
+ Value->SetValueNonAligned<double>(p);
break;
case 'C': // Text
if (Value->SetValue_char(p, Long)) {
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index fafba6228b9..211a58f0344 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -755,7 +755,7 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp)
} else
strcpy(To_Line, s);
- Row->Clear();
+// Row->Clear();
return false;
} else
return true;
@@ -979,7 +979,8 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
if (!stricmp(Name, colp->GetName())) {
Nod = colp->Nod;
Nodes = colp->Nodes;
- goto fin;
+ Xpd = colp->Xpd;
+ goto fin;
} // endif Name
sprintf(g->Message, "Cannot parse updated column %s", Name);
@@ -1347,7 +1348,12 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
/***********************************************************************/
void JSONCOL::WriteColumn(PGLOBAL g)
{
- /*********************************************************************/
+ if (Xpd && Tjp->Pretty < 2) {
+ strcpy(g->Message, "Cannot write expanded column when Pretty is not 2");
+ longjmp(g->jumper[g->jump_level], 666);
+ } // endif Xpd
+
+ /*********************************************************************/
/* Check whether this node must be written. */
/*********************************************************************/
if (Value != To_Val)
diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp
index 3008ca1b8ca..ea287558b44 100644
--- a/storage/connect/tabmul.cpp
+++ b/storage/connect/tabmul.cpp
@@ -123,7 +123,7 @@ PTDB TDBMUL::Duplicate(PGLOBAL g)
bool TDBMUL::InitFileNames(PGLOBAL g)
{
#define PFNZ 4096
-#define FNSZ _MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT
+#define FNSZ (_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT)
char *pfn[PFNZ];
char *filename;
int rc, n = 0;
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 098ed1ac114..31854870ed2 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -321,10 +321,21 @@ PSZ TDBODBC::GetFile(PGLOBAL g)
{
if (Connect) {
char *p1, *p2;
- size_t n;
+ int i;
+ size_t n;
- if ((p1 = strstr(Connect, "DBQ="))) {
- p1 += 4; // Beginning of file name
+ if (!(p1 = strstr(Connect, "DBQ="))) {
+ char *p, *lc = strlwr(PlugDup(g, Connect));
+
+ if ((p = strstr(lc, "database=")))
+ p1 = Connect + (p - lc);
+
+ i = 9;
+ } else
+ i = 4;
+
+ if (p1) {
+ p1 += i; // Beginning of file name
p2 = strchr(p1, ';'); // End of file path/name
// Make the File path/name from the connect string
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index 03ec0eb8e40..884ce976a52 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -103,6 +103,7 @@ ulonglong CharToNumber(char *p, int n, ulonglong maxval,
if (minus) *minus = false;
if (rc) *rc = false;
+ if (n <= 0) return 0LL;
// Eliminate leading blanks or 0
for (p2 = p + n; p < p2 && (*p == ' ' || *p == '0'); p++) ;
@@ -705,7 +706,7 @@ bool TYPVAL<TYPE>::SetValue_char(char *p, int n)
template <>
bool TYPVAL<double>::SetValue_char(char *p, int n)
{
- if (p) {
+ if (p && n > 0) {
char buf[64];
for (; n > 0 && *p == ' '; p++)
@@ -1345,7 +1346,7 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
{
bool rc;
- if (p) {
+ if (p && n > 0) {
rc = n > Len;
if ((n = MY_MIN(n, Len))) {
@@ -1804,7 +1805,7 @@ bool DECVAL::SetValue_char(char *p, int n)
{
bool rc;
- if (p) {
+ if (p && n > 0) {
rc = n > Len;
if ((n = MY_MIN(n, Len))) {
@@ -2095,7 +2096,7 @@ bool BINVAL::SetValue_char(char *p, int n)
{
bool rc;
- if (p) {
+ if (p && n > 0) {
rc = n > Clen;
Len = MY_MIN(n, Clen);
memcpy(Binp, p, Len);
@@ -2672,13 +2673,16 @@ bool DTVAL::SetValue_char(char *p, int n)
int ndv;
int dval[6];
- // Trim trailing blanks
- for (p2 = p + n -1; p < p2 && *p2 == ' '; p2--) ;
+ if (n > 0) {
+ // Trim trailing blanks
+ for (p2 = p + n -1; p < p2 && *p2 == ' '; p2--);
- if ((rc = (n = p2 - p + 1) > Len))
- n = Len;
+ if ((rc = (n = p2 - p + 1) > Len))
+ n = Len;
+
+ memcpy(Sdate, p, n);
+ } // endif n
- memcpy(Sdate, p, n);
Sdate[n] = '\0';
ndv = ExtractDate(Sdate, Pdtp, DefYear, dval);
diff --git a/storage/connect/value.h b/storage/connect/value.h
index 780917c9962..471da851423 100644
--- a/storage/connect/value.h
+++ b/storage/connect/value.h
@@ -116,6 +116,26 @@ class DllExport VALUE : public BLOCK {
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
virtual bool FormatValue(PVAL vp, char *fmt) = 0;
+ /**
+ Set value from a non-aligned in-memory value in the machine byte order.
+ TYPE can be either of:
+ - int, short, longlong
+ - uint, ushort, ulonglong
+ - float, double
+ @param - a pointer to a non-aligned value of type TYPE.
+ */
+ template<typename TYPE>
+ void SetValueNonAligned(const char *p)
+ {
+#if defined(__i386__) || defined(__x86_64__)
+ SetValue(*((TYPE*) p)); // x86 can cast non-aligned memory directly
+#else
+ TYPE tmp; // a slower version for non-x86 platforms
+ memcpy(&tmp, p, sizeof(tmp));
+ SetValue(tmp);
+#endif
+ }
+
protected:
virtual bool SetConstFormat(PGLOBAL, FORMAT&) = 0;
const char *GetXfmt(void);
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index cfda0eadf3e..a23375cbe58 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -34,7 +34,7 @@
*/
#define HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM 10000
-#define FEDERATED_QUERY_BUFFER_SIZE STRING_BUFFER_USUAL_SIZE * 5
+#define FEDERATED_QUERY_BUFFER_SIZE (STRING_BUFFER_USUAL_SIZE * 5)
#define FEDERATED_RECORDS_IN_RANGE 2
#define FEDERATED_MAX_KEY_LENGTH 3500 // Same as innodb
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index 1ff6abc4c77..f9de6e8af3b 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ha_federatedx.h"
#include "m_string.h"
+#include "mysqld_error.h"
#include "sql_servers.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 8d5d626fb28..66c67c14314 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,6 +19,20 @@ INCLUDE(CheckFunctionExists)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCSourceRuns)
+IF(CMAKE_CROSSCOMPILING)
+ # Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS when
+ # cross-compiling. Not as precise, but usually good enough.
+ # This only make sense for atomic tests in this file, this trick doesn't
+ # work in a general case.
+ MACRO(CHECK_C_SOURCE SOURCE VAR)
+ CHECK_C_SOURCE_COMPILES("${SOURCE}" "${VAR}")
+ ENDMACRO()
+ELSE()
+ MACRO(CHECK_C_SOURCE SOURCE VAR)
+ CHECK_C_SOURCE_RUNS("${SOURCE}" "${VAR}")
+ ENDMACRO()
+ENDIF()
+
# OS tests
IF(UNIX)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -29,6 +43,9 @@ IF(UNIX)
ADD_DEFINITIONS(-DLINUX_NATIVE_AIO=1)
LINK_LIBRARIES(aio)
ENDIF()
+ IF(HAVE_LIBNUMA)
+ LINK_LIBRARIES(numa)
+ ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP*")
ADD_DEFINITIONS("-DUNIV_HPUX")
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "AIX")
@@ -57,15 +74,14 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(NOT MSVC)
-# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
-IF(NOT CMAKE_CROSSCOMPILING)
+ # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF()
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"
int main()
{
@@ -96,7 +112,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"
int main()
{
@@ -112,7 +128,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -132,7 +148,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS_64
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -141,7 +157,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_SYNC_SYNCHRONISE
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -151,7 +167,18 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_THREAD_FENCE
)
-ENDIF()
+ CHECK_C_SOURCE(
+ "#include<stdint.h>
+ int main()
+ {
+ unsigned char c;
+
+ __atomic_test_and_set(&c, __ATOMIC_ACQUIRE);
+ __atomic_clear(&c, __ATOMIC_RELEASE);
+ return(0);
+ }"
+ HAVE_IB_GCC_ATOMIC_TEST_AND_SET
+ )
IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1)
@@ -173,28 +200,31 @@ IF(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1)
ENDIF()
- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
-IF(NOT CMAKE_CROSSCOMPILING)
- CHECK_C_SOURCE_RUNS(
- "
- #include <pthread.h>
- #include <string.h>
+IF(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
+ ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_TEST_AND_SET=1)
+ENDIF()
- int main() {
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
+# either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
+CHECK_C_SOURCE(
+"
+#include <pthread.h>
+#include <string.h>
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
+int main() {
+ pthread_t x1;
+ pthread_t x2;
+ pthread_t x3;
- __sync_bool_compare_and_swap(&x1, x2, x3);
+ memset(&x1, 0x0, sizeof(x1));
+ memset(&x2, 0x0, sizeof(x2));
+ memset(&x3, 0x0, sizeof(x3));
+
+ __sync_bool_compare_and_swap(&x1, x2, x3);
+
+ return(0);
+}"
+HAVE_IB_ATOMIC_PTHREAD_T_GCC)
- return(0);
- }"
- HAVE_IB_ATOMIC_PTHREAD_T_GCC)
-ENDIF()
IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
ENDIF()
@@ -225,7 +255,6 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
ADD_DEFINITIONS(-DHAVE_IB_SOLARIS_ATOMICS=1)
ENDIF()
- IF(NOT CMAKE_CROSSCOMPILING)
# either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
CHECK_C_SOURCE_COMPILES(
" #include <pthread.h>
@@ -264,7 +293,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
return(0);
}"
HAVE_IB_MACHINE_BARRIER_SOLARIS)
- ENDIF()
+
IF(HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS)
ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=1)
ENDIF()
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index c8dd4fae0a9..7dfcd79cfdb 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
@@ -2118,6 +2118,7 @@ btr_cur_optimistic_update(
ulint max_size;
ulint new_rec_size;
ulint old_rec_size;
+ ulint max_ins_size = 0;
dtuple_t* new_entry;
roll_ptr_t roll_ptr;
ulint i;
@@ -2246,6 +2247,10 @@ any_extern:
: (old_rec_size
+ page_get_max_insert_size_after_reorganize(page, 1));
+ if (!page_zip) {
+ max_ins_size = page_get_max_insert_size_after_reorganize(page, 1);
+ }
+
if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT)
&& (max_size >= new_rec_size))
|| (page_get_n_recs(page) <= 1))) {
@@ -2305,12 +2310,15 @@ any_extern:
ut_ad(err == DB_SUCCESS);
func_exit:
- if (page_zip
- && !(flags & BTR_KEEP_IBUF_BITMAP)
+ if (!(flags & BTR_KEEP_IBUF_BITMAP)
&& !dict_index_is_clust(index)
&& page_is_leaf(page)) {
- /* Update the free bits in the insert buffer. */
- ibuf_update_free_bits_zip(block, mtr);
+
+ if (page_zip) {
+ ibuf_update_free_bits_zip(block, mtr);
+ } else {
+ ibuf_update_free_bits_low(block, max_ins_size, mtr);
+ }
}
return(err);
@@ -2445,6 +2453,7 @@ btr_cur_pessimistic_update(
ibool was_first;
ulint n_reserved = 0;
ulint n_ext;
+ ulint max_ins_size = 0;
*offsets = NULL;
*big_rec = NULL;
@@ -2623,6 +2632,10 @@ make_external:
}
}
+ if (!page_zip) {
+ max_ins_size = page_get_max_insert_size_after_reorganize(page, 1);
+ }
+
/* Store state of explicit locks on rec on the page infimum record,
before deleting rec. The page infimum acts as a dummy carrier of the
locks, taking care also of lock releases, before we can move the locks
@@ -2668,13 +2681,18 @@ make_external:
rec_offs_make_valid(
page_cursor->rec, index, *offsets);
}
- } else if (page_zip &&
- !dict_index_is_clust(index)
+ } else if (!dict_index_is_clust(index)
&& page_is_leaf(page)) {
+
/* Update the free bits in the insert buffer.
This is the same block which was skipped by
BTR_KEEP_IBUF_BITMAP. */
- ibuf_update_free_bits_zip(block, mtr);
+ if (page_zip) {
+ ibuf_update_free_bits_zip(block, mtr);
+ } else {
+ ibuf_update_free_bits_low(block, max_ins_size,
+ mtr);
+ }
}
err = DB_SUCCESS;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e5800ef30c0..6d8edfca5c0 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -53,6 +53,10 @@ Created 11/5/1995 Heikki Tuuri
#include "page0zip.h"
#include "srv0mon.h"
#include "buf0checksum.h"
+#ifdef HAVE_LIBNUMA
+#include <numa.h>
+#include <numaif.h>
+#endif // HAVE_LIBNUMA
/*
IMPLEMENTATION OF THE BUFFER POOL
@@ -1112,6 +1116,22 @@ buf_chunk_init(
return(NULL);
}
+#ifdef HAVE_LIBNUMA
+ if (srv_numa_interleave) {
+ int st = mbind(chunk->mem, chunk->mem_size,
+ MPOL_INTERLEAVE,
+ numa_all_nodes_ptr->maskp,
+ numa_all_nodes_ptr->size,
+ MPOL_MF_MOVE);
+ if (st != 0) {
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "Failed to set NUMA memory policy of buffer"
+ " pool page frames to MPOL_INTERLEAVE"
+ " (error: %s).", strerror(errno));
+ }
+ }
+#endif // HAVE_LIBNUMA
+
/* Allocate the block descriptors from
the start of the memory block. */
chunk->blocks = (buf_block_t*) chunk->mem;
@@ -1442,6 +1462,21 @@ buf_pool_init(
ut_ad(n_instances <= MAX_BUFFER_POOLS);
ut_ad(n_instances == srv_buf_pool_instances);
+#ifdef HAVE_LIBNUMA
+ if (srv_numa_interleave) {
+ ib_logf(IB_LOG_LEVEL_INFO,
+ "Setting NUMA memory policy to MPOL_INTERLEAVE");
+ if (set_mempolicy(MPOL_INTERLEAVE,
+ numa_all_nodes_ptr->maskp,
+ numa_all_nodes_ptr->size) != 0) {
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "Failed to set NUMA memory policy to"
+ " MPOL_INTERLEAVE (error: %s).",
+ strerror(errno));
+ }
+ }
+#endif // HAVE_LIBNUMA
+
buf_pool_ptr = (buf_pool_t*) mem_zalloc(
n_instances * sizeof *buf_pool_ptr);
@@ -1462,6 +1497,18 @@ buf_pool_init(
btr_search_sys_create(buf_pool_get_curr_size() / sizeof(void*) / 64);
+#ifdef HAVE_LIBNUMA
+ if (srv_numa_interleave) {
+ ib_logf(IB_LOG_LEVEL_INFO,
+ "Setting NUMA memory policy to MPOL_DEFAULT");
+ if (set_mempolicy(MPOL_DEFAULT, NULL, 0) != 0) {
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "Failed to set NUMA memory policy to"
+ " MPOL_DEFAULT (error: %s).", strerror(errno));
+ }
+ }
+#endif // HAVE_LIBNUMA
+
return(DB_SUCCESS);
}
@@ -5252,11 +5299,19 @@ buf_print_io_instance(
pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) {
+ double hit_rate = ((1000 * pool_info->page_read_delta)
+ / pool_info->n_page_get_delta);
+
+ if (hit_rate > 1000) {
+ hit_rate = 1000;
+ }
+
+ hit_rate = 1000 - hit_rate;
+
fprintf(file,
"Buffer pool hit rate %lu / 1000,"
" young-making rate %lu / 1000 not %lu / 1000\n",
- (ulong) (1000 - (1000 * pool_info->page_read_delta
- / pool_info->n_page_get_delta)),
+ (ulong) hit_rate,
(ulong) (1000 * pool_info->young_making_delta
/ pool_info->n_page_get_delta),
(ulong) (1000 * pool_info->not_young_making_delta
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 9f05ddf190b..fdfbb549640 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -212,14 +212,6 @@ dict_index_remove_from_cache_low(
dict_index_t* index, /*!< in, own: index */
ibool lru_evict); /*!< in: TRUE if page being evicted
to make room in the table LRU list */
-/**********************************************************************//**
-Removes a table object from the dictionary cache. */
-static
-void
-dict_table_remove_from_cache_low(
-/*=============================*/
- dict_table_t* table, /*!< in, own: table */
- ibool lru_evict); /*!< in: TRUE if evicting from LRU */
#ifdef UNIV_DEBUG
/**********************************************************************//**
Validate the dictionary table LRU list.
@@ -787,6 +779,45 @@ dict_table_get_all_fts_indexes(
return(ib_vector_size(indexes));
}
+/** Store autoinc value when the table is evicted.
+@param[in] table table evicted */
+UNIV_INTERN
+void
+dict_table_autoinc_store(
+ const dict_table_t* table)
+{
+ ut_ad(mutex_own(&dict_sys->mutex));
+
+ if (table->autoinc != 0) {
+ ut_ad(dict_sys->autoinc_map->find(table->id)
+ == dict_sys->autoinc_map->end());
+
+ dict_sys->autoinc_map->insert(
+ std::pair<table_id_t, ib_uint64_t>(
+ table->id, table->autoinc));
+ }
+}
+
+/** Restore autoinc value when the table is loaded.
+@param[in] table table loaded */
+UNIV_INTERN
+void
+dict_table_autoinc_restore(
+ dict_table_t* table)
+{
+ ut_ad(mutex_own(&dict_sys->mutex));
+
+ autoinc_map_t::iterator it;
+ it = dict_sys->autoinc_map->find(table->id);
+
+ if (it != dict_sys->autoinc_map->end()) {
+ table->autoinc = it->second;
+ ut_ad(table->autoinc != 0);
+
+ dict_sys->autoinc_map->erase(it);
+ }
+}
+
/********************************************************************//**
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized.
@@ -1080,6 +1111,8 @@ dict_init(void)
mutex_create(dict_foreign_err_mutex_key,
&dict_foreign_err_mutex, SYNC_NO_ORDER_CHECK);
}
+
+ dict_sys->autoinc_map = new autoinc_map_t();
}
/**********************************************************************//**
@@ -1327,6 +1360,8 @@ dict_table_add_to_cache(
UT_LIST_ADD_FIRST(table_LRU, dict_sys->table_non_LRU, table);
}
+ dict_table_autoinc_restore(table);
+
ut_ad(dict_lru_validate());
dict_sys->size += mem_heap_get_size(table->heap)
@@ -2016,7 +2051,6 @@ dict_table_change_id_in_cache(
/**********************************************************************//**
Removes a table object from the dictionary cache. */
-static
void
dict_table_remove_from_cache_low(
/*=============================*/
@@ -2078,6 +2112,10 @@ dict_table_remove_from_cache_low(
ut_ad(dict_lru_validate());
+ if (lru_evict) {
+ dict_table_autoinc_store(table);
+ }
+
if (lru_evict && table->drop_aborted) {
/* Do as dict_table_try_drop_aborted() does. */
@@ -6842,6 +6880,8 @@ dict_close(void)
mutex_free(&dict_foreign_err_mutex);
}
+ delete dict_sys->autoinc_map;
+
mem_free(dict_sys);
dict_sys = NULL;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0b483d3745d..3df10f55893 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4,7 +4,7 @@ Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -683,6 +683,12 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_os_log_pending_writes, SHOW_LONG},
{"os_log_written",
(char*) &export_vars.innodb_os_log_written, SHOW_LONGLONG},
+ {"os_merge_buffers_written",
+ (char*) &export_vars.innodb_merge_buffers_written, SHOW_LONGLONG},
+ {"os_merge_buffers_read",
+ (char*) &export_vars.innodb_merge_buffers_read, SHOW_LONGLONG},
+ {"os_merge_buffers_merged",
+ (char*) &export_vars.innodb_merge_buffers_merged, SHOW_LONGLONG},
{"page_size",
(char*) &export_vars.innodb_page_size, SHOW_LONG},
{"pages_created",
@@ -7419,7 +7425,7 @@ ha_innobase::write_row(
DBUG_ENTER("ha_innobase::write_row");
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (prebuilt->trx != trx) {
@@ -8159,7 +8165,7 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx);
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (!trx_is_started(trx)) {
@@ -8310,7 +8316,7 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx);
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
} else if (!trx_is_started(trx)) {
@@ -11102,7 +11108,7 @@ ha_innobase::create(
if (form->s->stored_fields > REC_MAX_N_USER_FIELDS) {
DBUG_RETURN(HA_ERR_TOO_MANY_FIELDS);
- } else if (srv_read_only_mode) {
+ } else if (high_level_read_only) {
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
@@ -11432,7 +11438,7 @@ ha_innobase::discard_or_import_tablespace(
ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
@@ -11526,7 +11532,7 @@ ha_innobase::truncate()
DBUG_ENTER("ha_innobase::truncate");
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
@@ -11877,7 +11883,7 @@ ha_innobase::rename_table(
DBUG_ENTER("ha_innobase::rename_table");
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
ib_senderrf(thd, IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
@@ -15929,6 +15935,12 @@ innodb_internal_table_validate(
}
dict_table_close(user_table, FALSE, TRUE);
+
+ DBUG_EXECUTE_IF("innodb_evict_autoinc_table",
+ mutex_enter(&dict_sys->mutex);
+ dict_table_remove_from_cache_low(user_table, TRUE);
+ mutex_exit(&dict_sys->mutex);
+ );
}
return(ret);
@@ -18282,6 +18294,13 @@ static MYSQL_SYSVAR_BOOL(use_native_aio, srv_use_native_aio,
"Use native AIO if supported on this platform.",
NULL, NULL, TRUE);
+#ifdef HAVE_LIBNUMA
+static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Use NUMA interleave memory policy to allocate InnoDB buffer pool.",
+ NULL, NULL, FALSE);
+#endif // HAVE_LIBNUMA
+
static MYSQL_SYSVAR_BOOL(api_enable_binlog, ib_binlog_enabled,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Enable binlog for applications direct access InnoDB through InnoDB APIs",
@@ -18603,6 +18622,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(version),
MYSQL_SYSVAR(use_sys_malloc),
MYSQL_SYSVAR(use_native_aio),
+#ifdef HAVE_LIBNUMA
+ MYSQL_SYSVAR(numa_interleave),
+#endif // HAVE_LIBNUMA
MYSQL_SYSVAR(change_buffering),
MYSQL_SYSVAR(change_buffer_max_size),
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index e7ff88bb093..be3fb48f4f1 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -244,7 +244,7 @@ ha_innobase::check_if_supported_inplace_alter(
{
DBUG_ENTER("check_if_supported_inplace_alter");
- if (srv_read_only_mode) {
+ if (high_level_read_only) {
ha_alter_info->unsupported_reason =
innobase_get_err_msg(ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index cb49d532972..5266cf7d245 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -312,6 +312,21 @@ dict_table_autoinc_initialize(
dict_table_t* table, /*!< in/out: table */
ib_uint64_t value) /*!< in: next value to assign to a row */
__attribute__((nonnull));
+
+/** Store autoinc value when the table is evicted.
+@param[in] table table evicted */
+UNIV_INTERN
+void
+dict_table_autoinc_store(
+ const dict_table_t* table);
+
+/** Restore autoinc value when the table is loaded.
+@param[in] table table loaded */
+UNIV_INTERN
+void
+dict_table_autoinc_restore(
+ dict_table_t* table);
+
/********************************************************************//**
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized.
@@ -371,6 +386,15 @@ dict_table_remove_from_cache(
dict_table_t* table) /*!< in, own: table */
__attribute__((nonnull));
/**********************************************************************//**
+Removes a table object from the dictionary cache. */
+UNIV_INTERN
+void
+dict_table_remove_from_cache_low(
+/*=============================*/
+ dict_table_t* table, /*!< in, own: table */
+ ibool lru_evict); /*!< in: TRUE if table being evicted
+ to make room in the table LRU list */
+/**********************************************************************//**
Renames a table object.
@return TRUE if success */
UNIV_INTERN
@@ -1572,6 +1596,8 @@ extern dict_sys_t* dict_sys;
/** the data dictionary rw-latch protecting dict_sys */
extern rw_lock_t dict_operation_lock;
+typedef std::map<table_id_t, ib_uint64_t> autoinc_map_t;
+
/* Dictionary system struct */
struct dict_sys_t{
ib_mutex_t mutex; /*!< mutex protecting the data
@@ -1606,6 +1632,8 @@ struct dict_sys_t{
UT_LIST_BASE_NODE_T(dict_table_t)
table_non_LRU; /*!< List of tables that can't be
evicted from the cache */
+ autoinc_map_t* autoinc_map; /*!< Map to store table id and autoinc
+ when table is evicted */
};
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic
index 21747fdceac..a5df9f7b6b4 100644
--- a/storage/innobase/include/ibuf0ibuf.ic
+++ b/storage/innobase/include/ibuf0ibuf.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -128,7 +128,8 @@ ibuf_should_try(
&& ibuf->max_size != 0
&& !dict_index_is_clust(index)
&& index->table->quiesce == QUIESCE_NONE
- && (ignore_sec_unique || !dict_index_is_unique(index)));
+ && (ignore_sec_unique || !dict_index_is_unique(index))
+ && srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE);
}
/******************************************************************//**
diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h
index feb64fb1e41..8e4b4f41aae 100644
--- a/storage/innobase/include/os0sync.h
+++ b/storage/innobase/include/os0sync.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -38,6 +38,26 @@ Created 9/6/1995 Heikki Tuuri
#include "ut0lst.h"
#include "sync0types.h"
+#if defined __i386__ || defined __x86_64__ || defined _M_IX86 \
+ || defined _M_X64 || defined __WIN__
+
+#define IB_STRONG_MEMORY_MODEL
+
+#endif /* __i386__ || __x86_64__ || _M_IX86 || _M_X64 || __WIN__ */
+
+#ifdef HAVE_WINDOWS_ATOMICS
+typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates
+ on LONG variable */
+#elif defined(HAVE_ATOMIC_BUILTINS) && !defined(HAVE_ATOMIC_BUILTINS_BYTE)
+typedef ulint lock_word_t;
+#else
+
+#define IB_LOCK_WORD_IS_BYTE
+
+typedef byte lock_word_t;
+
+#endif /* HAVE_WINDOWS_ATOMICS */
+
#ifdef __WIN__
/** Native event (slow)*/
typedef HANDLE os_native_event_t;
@@ -446,11 +466,61 @@ amount to decrement. */
# define os_atomic_decrement_uint64(ptr, amount) \
os_atomic_decrement(ptr, amount)
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val */
-
-# define os_atomic_test_and_set_ulint(ptr, new_val) \
- __sync_lock_test_and_set(ptr, new_val)
+# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
+
+/** Do an atomic test-and-set.
+@param[in,out] ptr Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+ return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE));
+}
+
+/** Do an atomic clear.
+@param[in,out] ptr Memory location to set to zero */
+inline
+void
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+ __atomic_clear(ptr, __ATOMIC_RELEASE);
+}
+
+# elif defined(IB_STRONG_MEMORY_MODEL)
+
+/** Do an atomic test and set.
+@param[in,out] ptr Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+ return(__sync_lock_test_and_set(ptr, 1));
+}
+
+/** Do an atomic release.
+
+In theory __sync_lock_release should be used to release the lock.
+Unfortunately, it does not work properly alone. The workaround is
+that more conservative __sync_lock_test_and_set is used instead.
+
+Performance regression was observed at some conditions for Intel
+architecture. Disable release barrier on Intel architecture for now.
+@param[in,out] ptr Memory location to write to
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+ return(__sync_lock_test_and_set(ptr, 0));
+}
+
+# else
+
+# error "Unsupported platform"
+
+# endif /* HAVE_IB_GCC_ATOMIC_TEST_AND_SET */
#if defined(__powerpc__) || defined(__aarch64__)
/*
@@ -548,11 +618,51 @@ amount to decrement. */
# define os_atomic_decrement_uint64(ptr, amount) \
os_atomic_increment_uint64(ptr, -(amount))
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val */
-
-# define os_atomic_test_and_set_ulint(ptr, new_val) \
- atomic_swap_ulong(ptr, new_val)
+# ifdef IB_LOCK_WORD_IS_BYTE
+
+/** Do an atomic xchg and set to non-zero.
+@param[in,out] ptr Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+ return(atomic_swap_uchar(ptr, 1));
+}
+
+/** Do an atomic xchg and set to zero.
+@param[in,out] ptr Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+ return(atomic_swap_uchar(ptr, 0));
+}
+
+# else
+
+/** Do an atomic xchg and set to non-zero.
+@param[in,out] ptr Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+ return(atomic_swap_ulong(ptr, 1));
+}
+
+/** Do an atomic xchg and set to zero.
+@param[in,out] ptr Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+ return(atomic_swap_ulong(ptr, 0));
+}
+
+# endif /* IB_LOCK_WORD_IS_BYTE */
# define os_atomic_test_and_set_byte_acquire(ptr, new_val) \
atomic_swap_uchar(ptr, new_val)
@@ -673,18 +783,27 @@ amount to decrement. There is no atomic substract function on Windows */
(ib_int64_t*) ptr, \
-(ib_int64_t) amount) - amount))
-/**********************************************************//**
-Returns the old value of *ptr, atomically sets *ptr to new_val.
-InterlockedExchange() operates on LONG, and the LONG will be
-clobbered */
-
-# define os_atomic_test_and_set_byte_acquire(ptr, new_val) \
- ((byte) InterlockedExchange(ptr, new_val))
-# define os_atomic_test_and_set_byte_release(ptr, new_val) \
- ((byte) InterlockedExchange(ptr, new_val))
-
-# define os_atomic_test_and_set_ulong(ptr, new_val) \
- InterlockedExchange(ptr, new_val)
+/** Do an atomic test and set.
+InterlockedExchange() operates on LONG, and the LONG will be clobbered
+@param[in,out] ptr Memory location to set to non-zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_test_and_set(volatile lock_word_t* ptr)
+{
+ return(InterlockedExchange(ptr, 1));
+}
+
+/** Do an atomic release.
+InterlockedExchange() operates on LONG, and the LONG will be clobbered
+@param[in,out] ptr Memory location to set to zero
+@return the previous value */
+inline
+lock_word_t
+os_atomic_clear(volatile lock_word_t* ptr)
+{
+ return(InterlockedExchange(ptr, 0));
+}
# define os_atomic_lock_release_byte(ptr) \
(void) InterlockedExchange(ptr, 0)
@@ -737,7 +856,7 @@ for synchronization */
} while (0);
/** barrier definitions for memory ordering */
-#if defined __i386__ || defined __x86_64__ || defined _M_IX86 || defined _M_X64 || defined __WIN__
+#ifdef IB_STRONG_MEMORY_MODEL
/* Performance regression was observed at some conditions for Intel
architecture. Disable memory barrier for Intel architecture for now. */
# define os_rmb do { } while(0)
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h
index 2d90f47eefe..d2b65721e1a 100644
--- a/storage/innobase/include/srv0mon.h
+++ b/storage/innobase/include/srv0mon.h
@@ -2,6 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -255,6 +256,9 @@ enum monitor_id_t {
MONITOR_OVLD_OS_LOG_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_WRITES,
+ MONITOR_MERGE_BLOCKS_WRITTEN,
+ MONITOR_MERGE_BLOCKS_READ,
+ MONITOR_MERGE_BLOCKS_MERGED,
/* Transaction related counters */
MONITOR_MODULE_TRX,
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index 13f87262f8b..b9a86e76947 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -1,9 +1,9 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -138,6 +138,15 @@ struct srv_stats_t {
/** Number of system rows inserted */
ulint_ctr_64_t n_system_rows_inserted;
+
+ /** Number of merge buffers written */
+ ulint_ctr_64_t merge_buffers_written;
+
+ /** Number of merge buffers read */
+ ulint_ctr_64_t merge_buffers_read;
+
+ /** Number of merge buffers merged */
+ ulint_ctr_64_t merge_buffers_merged;
};
extern const char* srv_main_thread_op_info;
@@ -200,6 +209,9 @@ extern char* srv_arch_dir;
recovery and open all tables in RO mode instead of RW mode. We don't
sync the max trx id to disk either. */
extern my_bool srv_read_only_mode;
+/** Set if InnoDB operates in read-only mode or innodb-force-recovery
+is greater than SRV_FORCE_NO_TRX_UNDO. */
+extern my_bool high_level_read_only;
/** store to its own file each table created by an user; data
dictionary tables are in the system tablespace 0 */
extern my_bool srv_file_per_table;
@@ -230,6 +242,7 @@ OS (provided we compiled Innobase with it in), otherwise we will
use simulated aio we build below with threads.
Currently we support native aio on windows and linux */
extern my_bool srv_use_native_aio;
+extern my_bool srv_numa_interleave;
#ifdef __WIN__
extern ibool srv_use_native_conditions;
#endif /* __WIN__ */
@@ -875,6 +888,9 @@ struct export_var_t{
ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_id
- purged view's min trx_id */
#endif /* UNIV_DEBUG */
+ ib_int64_t innodb_merge_buffers_written;
+ ib_int64_t innodb_merge_buffers_read;
+ ib_int64_t innodb_merge_buffers_merged;
};
/** Thread slot in the thread table. */
@@ -905,6 +921,7 @@ struct srv_slot_t{
#else /* !UNIV_HOTBACKUP */
# define srv_use_adaptive_hash_indexes FALSE
# define srv_use_native_aio FALSE
+# define srv_numa_interleave FALSE
# define srv_force_recovery 0UL
# define srv_set_io_thread_op_info(t,info) ((void) 0)
# define srv_reset_io_thread_op_info() ((void) 0)
diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
index 7b00e16476b..d6f8d8f5e4c 100644
--- a/storage/innobase/include/sync0sync.h
+++ b/storage/innobase/include/sync0sync.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
@@ -46,13 +46,6 @@ Created 9/5/1995 Heikki Tuuri
extern "C" my_bool timed_mutexes;
#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
-#ifdef HAVE_WINDOWS_ATOMICS
-typedef LONG lock_word_t; /*!< On Windows, InterlockedExchange operates
- on LONG variable */
-#else
-typedef byte lock_word_t;
-#endif
-
#if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK
/* By default, buffer mutexes and rwlocks will be excluded from
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic
index a5887b1fd6f..149c81a3788 100644
--- a/storage/innobase/include/sync0sync.ic
+++ b/storage/innobase/include/sync0sync.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -74,13 +74,13 @@ Performs an atomic test-and-set instruction to the lock_word field of a
mutex.
@return the previous value of lock_word: 0 or 1 */
UNIV_INLINE
-byte
+lock_word_t
ib_mutex_test_and_set(
-/*===============*/
+/*==================*/
ib_mutex_t* mutex) /*!< in: mutex */
{
#if defined(HAVE_ATOMIC_BUILTINS)
- return(os_atomic_test_and_set_byte_acquire(&mutex->lock_word, 1));
+ return(os_atomic_test_and_set(&mutex->lock_word));
#else
ibool ret;
@@ -95,7 +95,7 @@ ib_mutex_test_and_set(
}
return((byte) ret);
-#endif
+#endif /* HAVE_ATOMIC_BUILTINS */
}
/******************************************************************//**
@@ -108,15 +108,12 @@ mutex_reset_lock_word(
ib_mutex_t* mutex) /*!< in: mutex */
{
#if defined(HAVE_ATOMIC_BUILTINS)
- /* In theory __sync_lock_release should be used to release the lock.
- Unfortunately, it does not work properly alone. The workaround is
- that more conservative __sync_lock_test_and_set is used instead. */
- os_atomic_test_and_set_byte_release(&mutex->lock_word, 0);
+ os_atomic_clear(&mutex->lock_word);
#else
mutex->lock_word = 0;
- os_fast_mutex_unlock_full_barrier(&(mutex->os_fast_mutex));
-#endif
+ os_fast_mutex_unlock(&(mutex->os_fast_mutex));
+#endif /* HAVE_ATOMIC_BUILTINS */
}
/******************************************************************//**
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 8976052bf64..3f737089ac3 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -44,7 +44,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 6
-#define INNODB_VERSION_BUGFIX 26
+#define INNODB_VERSION_BUGFIX 27
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 28021a2d31b..f72f7f03018 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -2993,8 +2993,8 @@ lock_rec_inherit_to_gap(
/* If srv_locks_unsafe_for_binlog is TRUE or session is using
READ COMMITTED isolation level, we do not want locks set
by an UPDATE or a DELETE to be inherited as gap type locks. But we
- DO want S-locks set by a consistency constraint to be inherited also
- then. */
+ DO want S-locks/X-locks(taken for replace) set by a consistency
+ constraint to be inherited also then */
for (lock = lock_rec_get_first(block, heap_no);
lock != NULL;
@@ -3004,7 +3004,8 @@ lock_rec_inherit_to_gap(
&& !((srv_locks_unsafe_for_binlog
|| lock->trx->isolation_level
<= TRX_ISO_READ_COMMITTED)
- && lock_get_mode(lock) == LOCK_X)) {
+ && lock_get_mode(lock) ==
+ (lock->trx->duplicates ? LOCK_S : LOCK_X))) {
lock_rec_add_to_queue(
LOCK_REC | LOCK_GAP | lock_get_mode(lock),
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 1850e798ed3..19757c81d5e 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -3413,11 +3413,7 @@ loop:
lsn = log_sys->lsn;
- ut_ad(srv_force_recovery != SRV_FORCE_NO_LOG_REDO
- || lsn == log_sys->last_checkpoint_lsn + LOG_BLOCK_HDR_SIZE);
-
- if ((srv_force_recovery != SRV_FORCE_NO_LOG_REDO
- && lsn != log_sys->last_checkpoint_lsn)
+ if (lsn != log_sys->last_checkpoint_lsn
#ifdef UNIV_LOG_ARCHIVE
|| (srv_log_archive_on
&& lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE)
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 6a5dff50952..edfa39a8932 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2738,6 +2738,8 @@ row_ins_sec_index_entry_low(
goto func_exit;
}
+ DEBUG_SYNC_C("row_ins_sec_index_entry_dup_locks_created");
+
/* We did not find a duplicate and we have now
locked with s-locks the necessary records to
prevent any insertion of a duplicate by another
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 74ebe159677..0bc6f33df97 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -2586,7 +2586,7 @@ all_done:
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- ofs, srv_buf_size);
+ ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */
next_mrec = index->online_log->head.block;
@@ -3417,7 +3417,7 @@ all_done:
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- ofs, srv_buf_size);
+ ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */
next_mrec = index->online_log->head.block;
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 284081d4b0c..75aa423b2ac 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -871,6 +872,8 @@ row_merge_read(
success = os_file_read_no_error_handling(OS_FILE_FROM_FD(fd), buf,
ofs, srv_sort_buf_size);
+ srv_stats.merge_buffers_read.inc();
+
#ifdef POSIX_FADV_DONTNEED
/* Each block is read exactly once. Free up the file cache. */
posix_fadvise(fd, ofs, srv_sort_buf_size, POSIX_FADV_DONTNEED);
@@ -905,6 +908,7 @@ row_merge_write(
DBUG_EXECUTE_IF("row_merge_write_failure", return(FALSE););
ret = os_file_write("(merge)", OS_FILE_FROM_FD(fd), buf, ofs, buf_len);
+ srv_stats.merge_buffers_written.inc();
#ifdef UNIV_DEBUG
if (row_merge_print_block_write) {
@@ -1736,7 +1740,7 @@ write_buffers:
/* We have enough data tuples to form a block.
Sort them and write to disk. */
- if (buf->n_tuples) {
+ if (UNIV_LIKELY(buf->n_tuples)) {
if (dict_index_is_unique(buf->index)) {
row_merge_dup_t dup = {
buf->index, table, col_map, 0};
@@ -1777,13 +1781,17 @@ write_buffers:
dict_index_get_lock(buf->index));
}
- row_merge_buf_write(buf, file, block);
+ /* Do not write empty buffers to temporary file */
+ if (buf->n_tuples) {
+
+ row_merge_buf_write(buf, file, block);
- if (!row_merge_write(file->fd, file->offset++,
- block)) {
- err = DB_TEMP_FILE_WRITE_FAILURE;
- trx->error_key_num = i;
- break;
+ if (!row_merge_write(file->fd, file->offset++,
+ block)) {
+ err = DB_TEMP_FILE_WRITE_FAILURE;
+ trx->error_key_num = i;
+ break;
+ }
}
UNIV_MEM_INVALID(&block[0], srv_sort_buf_size);
@@ -2068,6 +2076,9 @@ done1:
mem_heap_free(heap);
b2 = row_merge_write_eof(&block[2 * srv_sort_buf_size],
b2, of->fd, &of->offset);
+
+ srv_stats.merge_buffers_merged.inc();
+
return(b2 ? DB_SUCCESS : DB_CORRUPTION);
}
@@ -3747,17 +3758,21 @@ wait_again:
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
} else {
- row_merge_dup_t dup = {
- sort_idx, table, col_map, 0};
-
- error = row_merge_sort(
- trx, &dup, &merge_files[i],
- block, &tmpfd);
-
- if (error == DB_SUCCESS) {
- error = row_merge_insert_index_tuples(
- trx->id, sort_idx, old_table,
- merge_files[i].fd, block);
+ /* Sorting and inserting is required only if
+ there really is records */
+ if (UNIV_LIKELY(merge_files[i].n_rec)) {
+ row_merge_dup_t dup = {
+ sort_idx, table, col_map, 0};
+
+ error = row_merge_sort(
+ trx, &dup, &merge_files[i],
+ block, &tmpfd);
+
+ if (error == DB_SUCCESS) {
+ error = row_merge_insert_index_tuples(
+ trx->id, sort_idx, old_table,
+ merge_files[i].fd, block);
+ }
}
}
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index a0dd32c203f..960c889f871 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -2,6 +2,7 @@
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -674,6 +675,24 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_WRITES},
+ {"os_merge_blocks_written", "os",
+ "Number of merge blocks written (innodb_os_merge_blocks_written)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_WRITTEN},
+
+ {"os_merge_blocks_read", "os",
+ "Number of merge blocks read (innodb_os_merge_blocks_read)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_READ},
+
+ {"os_merge_blocks_merged", "os",
+ "Number of merge blocks merged (innodb_os_merge_blocks_merged)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_MERGED},
+
/* ========== Counters for Transaction Module ========== */
{"module_trx", "transaction", "Transaction Manager",
MONITOR_MODULE,
@@ -1626,6 +1645,21 @@ srv_mon_process_existing_counter(
update_min = TRUE;
break;
+ /* innodb_os_merge_blocks_written */
+ case MONITOR_MERGE_BLOCKS_WRITTEN:
+ value = srv_stats.merge_buffers_written;
+ break;
+
+ /* innodb_os_merge_blocks_read */
+ case MONITOR_MERGE_BLOCKS_READ:
+ value = srv_stats.merge_buffers_read;
+ break;
+
+ /* innodb_os_merge_blocks_merged */
+ case MONITOR_MERGE_BLOCKS_MERGED:
+ value = srv_stats.merge_buffers_merged;
+ break;
+
/* innodb_log_waits */
case MONITOR_OVLD_LOG_WAITS:
value = srv_stats.log_waits;
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 2ec4f9d5714..582ad9ea039 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1,9 +1,9 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -131,6 +131,9 @@ UNIV_INTERN ulint srv_file_format = 0;
UNIV_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to
set it to the highest format we support. */
UNIV_INTERN ulint srv_max_file_format_at_startup = UNIV_FORMAT_MAX;
+/** Set if InnoDB operates in read-only mode or innodb-force-recovery
+is greater than SRV_FORCE_NO_TRX_UNDO. */
+UNIV_INTERN my_bool high_level_read_only;
#if UNIV_FORMAT_A
# error "UNIV_FORMAT_A must be 0!"
@@ -149,6 +152,7 @@ OS (provided we compiled Innobase with it in), otherwise we will
use simulated aio we build below with threads.
Currently we support native aio on windows and linux */
UNIV_INTERN my_bool srv_use_native_aio = TRUE;
+UNIV_INTERN my_bool srv_numa_interleave = FALSE;
#ifdef __WIN__
/* Windows native condition variables. We use runtime loading / function
@@ -1563,6 +1567,10 @@ srv_export_innodb_status(void)
}
#endif /* UNIV_DEBUG */
+ export_vars.innodb_merge_buffers_written = srv_stats.merge_buffers_written;
+ export_vars.innodb_merge_buffers_read = srv_stats.merge_buffers_read;
+ export_vars.innodb_merge_buffers_merged = srv_stats.merge_buffers_merged;
+
mutex_exit(&srv_innodb_monitor_mutex);
}
@@ -2676,13 +2684,8 @@ srv_do_purge(
}
n_pages_purged = trx_purge(
- n_use_threads, srv_purge_batch_size, false);
-
- if (!(count++ % TRX_SYS_N_RSEGS)) {
- /* Force a truncate of the history list. */
- n_pages_purged += trx_purge(
- 1, srv_purge_batch_size, true);
- }
+ n_use_threads, srv_purge_batch_size,
+ (++count % TRX_SYS_N_RSEGS) == 0);
*n_total_purged += n_pages_purged;
@@ -2875,8 +2878,17 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
n_pages_purged = trx_purge(1, srv_purge_batch_size, false);
}
- /* Force a truncate of the history list. */
- n_pages_purged = trx_purge(1, srv_purge_batch_size, true);
+ /* This trx_purge is called to remove any undo records (added by
+ background threads) after completion of the above loop. When
+ srv_fast_shutdown != 0, a large batch size can cause significant
+ delay in shutdown ,so reducing the batch size to magic number 20
+ (which was default in 5.5), which we hope will be sufficient to
+ remove all the undo records */
+ const uint temp_batch_size = 20;
+
+ n_pages_purged = trx_purge(1, srv_purge_batch_size <= temp_batch_size
+ ? srv_purge_batch_size : temp_batch_size,
+ true);
ut_a(n_pages_purged == 0 || srv_fast_shutdown != 0);
/* The task queue should always be empty, independent of fast
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 2c85dcbb1f1..e6a12da8354 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1559,9 +1559,8 @@ innobase_start_or_create_for_mysql(void)
size_t dirnamelen;
bool sys_datafiles_created = false;
- if (srv_force_recovery > SRV_FORCE_NO_TRX_UNDO) {
- srv_read_only_mode = true;
- }
+ high_level_read_only = srv_read_only_mode
+ || srv_force_recovery > SRV_FORCE_NO_TRX_UNDO;
if (srv_read_only_mode) {
ib_logf(IB_LOG_LEVEL_INFO, "Started in read only mode");
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index e93d3cae0b6..8ff9180eaf2 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -29,7 +29,10 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0sys.ic"
#endif
-#ifndef UNIV_HOTBACKUP
+#ifdef UNIV_HOTBACKUP
+#include "fsp0types.h"
+
+#else /* !UNIV_HOTBACKUP */
#include "fsp0fsp.h"
#include "mtr0log.h"
#include "mtr0log.h"
@@ -1249,18 +1252,15 @@ trx_sys_read_pertable_file_format_id(
/* get the file format from the page */
ptr = page + 54;
flags = mach_read_from_4(ptr);
- if (flags == 0) {
- /* file format is Antelope */
- *format_id = 0;
- return(TRUE);
- } else if (flags & 1) {
- /* tablespace flags are ok */
- *format_id = (flags / 32) % 128;
- return(TRUE);
- } else {
+
+ if (!fsp_flags_is_valid(flags) {
/* bad tablespace flags */
return(FALSE);
}
+
+ *format_id = FSP_FLAGS_GET_POST_ANTELOPE(flags);
+
+ return(TRUE);
}
diff --git a/storage/maria/ma_blockrec.h b/storage/maria/ma_blockrec.h
index 40ca2591236..1caf09ef1f5 100644
--- a/storage/maria/ma_blockrec.h
+++ b/storage/maria/ma_blockrec.h
@@ -44,7 +44,7 @@
/* Number of extents reserved MARIA_BITMAP_BLOCKS to store head part */
#define ELEMENTS_RESERVED_FOR_MAIN_PART 4
/* This is just used to prealloc a dynamic array */
-#define AVERAGE_BLOB_SIZE 1024L*1024L
+#define AVERAGE_BLOB_SIZE (1024L*1024L)
/* Number of pages to store continuous blob parts */
#define BLOB_SEGMENT_MIN_SIZE 128
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index ac66fdf6c57..b2b39598eab 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -829,17 +829,23 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem,
Allocate memory for blocks, hash_links and hash entries;
For each block 2 hash links are allocated
*/
- if (my_multi_malloc(MYF(MY_ZEROFILL),
- &pagecache->block_root, blocks * sizeof(PAGECACHE_BLOCK_LINK),
- &pagecache->hash_root,
- sizeof(PAGECACHE_HASH_LINK*) * pagecache->hash_entries,
- &pagecache->hash_link_root,
- hash_links * sizeof(PAGECACHE_HASH_LINK),
- &pagecache->changed_blocks,
- sizeof(PAGECACHE_BLOCK_LINK*) * changed_blocks_hash_size,
- &pagecache->file_blocks,
- sizeof(PAGECACHE_BLOCK_LINK*) * changed_blocks_hash_size,
- NullS))
+ if (my_multi_malloc_large(MYF(MY_ZEROFILL),
+ &pagecache->block_root,
+ (ulonglong) (blocks *
+ sizeof(PAGECACHE_BLOCK_LINK)),
+ &pagecache->hash_root,
+ (ulonglong) (sizeof(PAGECACHE_HASH_LINK*) *
+ pagecache->hash_entries),
+ &pagecache->hash_link_root,
+ (ulonglong) (hash_links *
+ sizeof(PAGECACHE_HASH_LINK)),
+ &pagecache->changed_blocks,
+ (ulonglong) (sizeof(PAGECACHE_BLOCK_LINK*) *
+ changed_blocks_hash_size),
+ &pagecache->file_blocks,
+ (ulonglong) (sizeof(PAGECACHE_BLOCK_LINK*) *
+ changed_blocks_hash_size),
+ NullS))
break;
my_large_free(pagecache->block_mem);
pagecache->block_mem= 0;
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 8ca052af4ac..07c4a5b473a 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -307,7 +307,7 @@ struct st_myisam_info
int rtree_recursion_depth;
};
-#define USE_WHOLE_KEY HA_MAX_KEY_BUFF*2 /* Use whole key in _mi_search() */
+#define USE_WHOLE_KEY (HA_MAX_KEY_BUFF*2) /* Use whole key in _mi_search() */
#define F_EXTRA_LCK -1
/* bits in opt_flag */
#define MEMMAP_USED 32
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 01ecd341778..21a5262a2f1 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -205,7 +205,7 @@ maria_declare_plugin(perfschema)
0x0001,
pfs_status_vars,
NULL,
- "5.6.26",
+ "5.6.27",
MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index ea8a04a78ae..58d766f480a 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -4832,6 +4832,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
memcpy(pfs->m_message_text, da->message(), MYSQL_ERRMSG_SIZE);
pfs->m_message_text[MYSQL_ERRMSG_SIZE]= 0;
pfs->m_sql_errno= da->sql_errno();
+ pfs->m_error_count++;
memcpy(pfs->m_sqlstate, da->get_sqlstate(), SQLSTATE_LENGTH);
break;
case Diagnostics_area::DA_DISABLED:
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index 8c3553db2b2..8348f165e5c 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -125,6 +125,42 @@ void init_timers(void)
*/
/*
+ For WAIT, the cycle timer is used by default. However, it is not available
+ on all architectures. Fall back to the nanosecond timer in this case. It is
+ unlikely that neither cycle nor nanosecond are available, but we continue
+ probing less resolution timers anyway for consistency with other events.
+ */
+
+ if (cycle_to_pico != 0)
+ {
+ /* Normal case. */
+ wait_timer= TIMER_NAME_CYCLE;
+ }
+ else if (nanosec_to_pico != 0)
+ {
+ /* Robustness, no known cases. */
+ wait_timer= TIMER_NAME_NANOSEC;
+ }
+ else if (microsec_to_pico != 0)
+ {
+ /* Robustness, no known cases. */
+ wait_timer= TIMER_NAME_MICROSEC;
+ }
+ else if (millisec_to_pico != 0)
+ {
+ /* Robustness, no known cases. */
+ wait_timer= TIMER_NAME_MILLISEC;
+ }
+ else
+ {
+ /*
+ Will never be reached on any architecture, but must provide a default if
+ no other timers are available.
+ */
+ wait_timer= TIMER_NAME_TICK;
+ }
+
+ /*
For STAGE and STATEMENT, a timer with a fixed frequency is better.
The prefered timer is nanosecond, or lower resolutions.
*/
@@ -174,7 +210,7 @@ void init_timers(void)
else if (millisec_to_pico != 0)
{
/* Robustness, no known cases. */
- idle_timer= TIMER_NAME_MILLISEC;
+ wait_timer= TIMER_NAME_MILLISEC;
}
else if (tick_to_pico != 0)
{
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index a804fc80489..f1a2426c0e3 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -356,9 +356,23 @@ static int tokudb_init_func(void *p) {
tokudb_hton = (handlerton *) p;
#if TOKUDB_CHECK_JEMALLOC
- if (tokudb_check_jemalloc && dlsym(RTLD_DEFAULT, "mallctl") == NULL) {
- sql_print_error("%s is not initialized because jemalloc is not loaded", tokudb_hton_name);
- goto error;
+ if (tokudb_check_jemalloc) {
+ typedef int (*mallctl_type)(const char *, void *, size_t *, void *, size_t);
+ mallctl_type mallctl_func;
+ mallctl_func= (mallctl_type)dlsym(RTLD_DEFAULT, "mallctl");
+ if (!mallctl_func) {
+ sql_print_error("%s is not initialized because jemalloc is not loaded", tokudb_hton_name);
+ goto error;
+ }
+ char *ver;
+ size_t len= sizeof(ver);
+ mallctl_func("version", &ver, &len, NULL, 0);
+ /* jemalloc 2.2.5 crashes mysql-test */
+ if (strcmp(ver, "2.3.") < 0) {
+ sql_print_error("%s is not initialized because jemalloc is older than 2.3.0", tokudb_hton_name);
+ goto error;
+ }
+
}
#endif
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result
index 7e92604d0f5..48f66942bc3 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result
@@ -9,7 +9,7 @@ insert into t1 values (4,40,400,4000,40000,400000);
insert into t1 values (5,50,500,5000,50000,500000);
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b NULL NULL NULL; Using index
+1 SIMPLE t1 index NULL b NULL NULL NULL Using index
select * from t1;
a b c d e f
1 10 100 1000 10000 100000
@@ -19,7 +19,7 @@ a b c d e f
5 50 500 5000 50000 500000
explain select * from t1 where b > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index
select * from t1 where b > 0;
a b c d e f
1 10 100 1000 10000 100000
@@ -29,7 +29,7 @@ a b c d e f
5 50 500 5000 50000 500000
explain select * from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select * from t1 where d > 0;
a b c d e f
1 10 100 1000 10000 100000
@@ -39,7 +39,7 @@ a b c d e f
5 50 500 5000 50000 500000
explain select a from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select a from t1 where d > 0;
a
1
@@ -71,7 +71,7 @@ e f
update t1 set a = a+1, b = b+10;
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b NULL NULL NULL; Using index
+1 SIMPLE t1 index NULL b NULL NULL NULL Using index
select * from t1;
a b c d e f
2 20 100 1000 10000 100000
@@ -81,7 +81,7 @@ a b c d e f
6 60 500 5000 50000 500000
explain select * from t1 where b > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index
select * from t1 where b > 0;
a b c d e f
2 20 100 1000 10000 100000
@@ -91,7 +91,7 @@ a b c d e f
6 60 500 5000 50000 500000
explain select * from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select * from t1 where d > 0;
a b c d e f
2 20 100 1000 10000 100000
@@ -101,7 +101,7 @@ a b c d e f
6 60 500 5000 50000 500000
explain select a from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select a from t1 where d > 0;
a
2
@@ -133,28 +133,28 @@ e f
delete from t1 where b > 35;
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b NULL NULL NULL; Using index
+1 SIMPLE t1 index NULL b NULL NULL NULL Using index
select * from t1;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select * from t1 where b > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index b b NULL NULL NULL Using where; Using index
select * from t1 where b > 0;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select * from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select * from t1 where d > 0;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select a from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 index d d NULL NULL NULL Using where; Using index
select a from t1 where d > 0;
a
2
@@ -175,28 +175,28 @@ alter table t1 drop index b, drop index d;
alter table t1 add key b(b) clustering=yes, add index d(d,a) clustering=yes;
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b NULL NULL NULL; Using index
+1 SIMPLE t1 index NULL b NULL NULL NULL Using index
select * from t1;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select * from t1 where b > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 X b b NULL NULL NULL Using where; Using index
select * from t1 where b > 0;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select * from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 X d d NULL NULL NULL Using where; Using index
select * from t1 where d > 0;
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select a from t1 where d > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 NULL d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 NULL d d NULL NULL NULL Using where; Using index
select a from t1 where d > 0;
a
2
diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test
index 2abc9a91ff1..1a72b8e9303 100644
--- a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test
+++ b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_hidden.test
@@ -14,19 +14,19 @@ insert into t1 values (4,40,400,4000,40000,400000);
insert into t1 values (5,50,500,5000,50000,500000);
# ignore key_len and rows columns
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1;
select * from t1;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where b > 0;
select * from t1 where b > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where d > 0;
select * from t1 where d > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select a from t1 where d > 0;
select a from t1 where d > 0;
select e,f from t1 where c > 0;
@@ -34,19 +34,19 @@ select e,f from t1 where b > 0;
select e,f from t1 where d > 0;
update t1 set a = a+1, b = b+10;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1;
select * from t1;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where b > 0;
select * from t1 where b > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where d > 0;
select * from t1 where d > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select a from t1 where d > 0;
select a from t1 where d > 0;
select e,f from t1 where c > 0;
@@ -54,19 +54,19 @@ select e,f from t1 where b > 0;
select e,f from t1 where d > 0;
delete from t1 where b > 35;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1;
select * from t1;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where b > 0;
select * from t1 where b > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1 where d > 0;
select * from t1 where d > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select a from t1 where d > 0;
select a from t1 where d > 0;
select e,f from t1 where c > 0;
@@ -78,25 +78,23 @@ alter table t1 drop index b, drop index d;
alter table t1 add key b(b) clustering=yes, add index d(d,a) clustering=yes;
---replace_column 7 NULL 9 NULL;
+--replace_column 7 NULL 9 NULL
explain select * from t1;
select * from t1;
---replace_column 7 NULL 9 NULL;
+--replace_column 4 X 7 NULL 9 NULL
explain select * from t1 where b > 0;
select * from t1 where b > 0;
---replace_column 7 NULL 9 NULL;
+--replace_column 4 X 7 NULL 9 NULL
explain select * from t1 where d > 0;
select * from t1 where d > 0;
---replace_column 4 NULL 7 NULL 9 NULL;
+--replace_column 4 NULL 7 NULL 9 NULL
explain select a from t1 where d > 0;
select a from t1 where d > 0;
select e,f from t1 where c > 0;
select e,f from t1 where b > 0;
select e,f from t1 where d > 0;
-
-
DROP TABLE t1;
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index dc10892212e..f5ac3a483f3 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -19,6 +19,20 @@ INCLUDE(CheckFunctionExists)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCSourceRuns)
+IF(CMAKE_CROSSCOMPILING)
+ # Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS when
+ # cross-compiling. Not as precise, but usually good enough.
+ # This only make sense for atomic tests in this file, this trick doesn't
+ # work in a general case.
+ MACRO(CHECK_C_SOURCE SOURCE VAR)
+ CHECK_C_SOURCE_COMPILES("${SOURCE}" "${VAR}")
+ ENDMACRO()
+ELSE()
+ MACRO(CHECK_C_SOURCE SOURCE VAR)
+ CHECK_C_SOURCE_RUNS("${SOURCE}" "${VAR}")
+ ENDMACRO()
+ENDIF()
+
# OS tests
IF(UNIX)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -63,15 +77,14 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(NOT MSVC)
-# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
-IF(NOT CMAKE_CROSSCOMPILING)
+ # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF()
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"
int main()
{
@@ -102,7 +115,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"
int main()
{
@@ -118,7 +131,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -138,7 +151,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_BUILTINS_64
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -147,7 +160,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_SYNC_SYNCHRONISE
)
- CHECK_C_SOURCE_RUNS(
+ CHECK_C_SOURCE(
"#include<stdint.h>
int main()
{
@@ -157,7 +170,6 @@ IF(NOT CMAKE_CROSSCOMPILING)
}"
HAVE_IB_GCC_ATOMIC_THREAD_FENCE
)
-ENDIF()
IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1)
@@ -180,28 +192,27 @@ IF(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1)
ENDIF()
- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
-IF(NOT CMAKE_CROSSCOMPILING)
- CHECK_C_SOURCE_RUNS(
- "
- #include <pthread.h>
- #include <string.h>
+# either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
+CHECK_C_SOURCE(
+"
+#include <pthread.h>
+#include <string.h>
- int main() {
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
+int main() {
+ pthread_t x1;
+ pthread_t x2;
+ pthread_t x3;
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
+ memset(&x1, 0x0, sizeof(x1));
+ memset(&x2, 0x0, sizeof(x2));
+ memset(&x3, 0x0, sizeof(x3));
- __sync_bool_compare_and_swap(&x1, x2, x3);
+ __sync_bool_compare_and_swap(&x1, x2, x3);
+
+ return(0);
+}"
+HAVE_IB_ATOMIC_PTHREAD_T_GCC)
- return(0);
- }"
- HAVE_IB_ATOMIC_PTHREAD_T_GCC)
-ENDIF()
IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
ENDIF()
@@ -233,7 +244,6 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
SET(XTRADB_OK 1)
ENDIF()
- IF(NOT CMAKE_CROSSCOMPILING)
# either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
CHECK_C_SOURCE_COMPILES(
" #include <pthread.h>
@@ -272,7 +282,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
return(0);
}"
HAVE_IB_MACHINE_BARRIER_SOLARIS)
- ENDIF()
+
IF(HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS)
ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=1)
ENDIF()
@@ -480,12 +490,12 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
-IF(XTRADB_OK)
- MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
- DEFAULT
- RECOMPILE_FOR_EMBEDDED
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
-ELSE()
+MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
+ DEFAULT
+ RECOMPILE_FOR_EMBEDDED
+ LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
+
+IF(TARGET xtradb AND NOT XTRADB_OK)
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
ENDIF()
diff --git a/storage/xtradb/api/api0api.cc b/storage/xtradb/api/api0api.cc
index 0fe21423232..739ea9f7572 100644
--- a/storage/xtradb/api/api0api.cc
+++ b/storage/xtradb/api/api0api.cc
@@ -245,7 +245,7 @@ ib_open_table_by_id(
dict_mutex_enter_for_mysql();
}
- table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
+ table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL);
if (table != NULL && table->ibd_file_missing) {
table = NULL;
@@ -2116,6 +2116,10 @@ ib_cursor_moveto(
n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index);
+ if (n_fields > dtuple_get_n_fields(tuple->ptr)) {
+ n_fields = dtuple_get_n_fields(tuple->ptr);
+ }
+
dtuple_set_n_fields(search_tuple, n_fields);
dtuple_set_n_fields_cmp(search_tuple, n_fields);
@@ -3753,14 +3757,14 @@ ib_table_truncate(
if (trunc_err == DB_SUCCESS) {
ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
TRX_STATE_NOT_STARTED));
-
- err = ib_trx_release(ib_trx);
- ut_a(err == DB_SUCCESS);
} else {
err = ib_trx_rollback(ib_trx);
ut_a(err == DB_SUCCESS);
}
+ err = ib_trx_release(ib_trx);
+ ut_a(err == DB_SUCCESS);
+
/* Set the memcached_sync_count back. */
if (table != NULL && memcached_sync != 0) {
dict_mutex_enter_for_mysql();
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index 4186c9ab33f..04e5797602c 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -4175,6 +4175,14 @@ btr_estimate_number_of_different_key_vals(
page = btr_cur_get_page(&cursor);
SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;);
+ DBUG_EXECUTE_IF("ib_corrupt_page_while_stats_calc",
+ page = NULL;);
+
+ SRV_CORRUPT_TABLE_CHECK(page,
+ {
+ mtr_commit(&mtr);
+ goto exit_loop;
+ });
rec = page_rec_get_next(page_get_infimum_rec(page));
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 793456cb7c9..895957dbe10 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -5524,11 +5524,19 @@ buf_print_io_instance(
pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) {
+ double hit_rate = ((1000 * pool_info->page_read_delta)
+ / pool_info->n_page_get_delta);
+
+ if (hit_rate > 1000) {
+ hit_rate = 1000;
+ }
+
+ hit_rate = 1000 - hit_rate;
+
fprintf(file,
"Buffer pool hit rate %lu / 1000,"
" young-making rate %lu / 1000 not %lu / 1000\n",
- (ulong) (1000 - (1000 * pool_info->page_read_delta
- / pool_info->n_page_get_delta)),
+ (ulong) hit_rate,
(ulong) (1000 * pool_info->young_making_delta
/ pool_info->n_page_get_delta),
(ulong) (1000 * pool_info->not_young_making_delta
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc
index 278f47fc327..c0686cf844f 100644
--- a/storage/xtradb/buf/buf0flu.cc
+++ b/storage/xtradb/buf/buf0flu.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -931,12 +931,12 @@ buf_flush_write_block_low(
break;
case BUF_BLOCK_ZIP_DIRTY:
frame = bpage->zip.data;
-
mach_write_to_8(frame + FIL_PAGE_LSN,
bpage->newest_modification);
- memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
ut_a(page_zip_verify_checksum(frame, zip_size));
+
+ memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
break;
case BUF_BLOCK_FILE_PAGE:
frame = bpage->zip.data;
@@ -2847,8 +2847,6 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
while (srv_shutdown_state == SRV_SHUTDOWN_NONE
|| srv_shutdown_state == SRV_SHUTDOWN_CLEANUP) {
- ulint n_flushed_lru;
-
srv_current_thread_priority = srv_cleaner_thread_priority;
page_cleaner_sleep_if_needed(next_loop_time);
@@ -2857,16 +2855,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
next_loop_time = ut_time_ms() + lru_sleep_time;
- n_flushed_lru = buf_flush_LRU_tail();
-
- if (n_flushed_lru) {
-
- MONITOR_INC_VALUE_CUMULATIVE(
- MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE,
- MONITOR_FLUSH_BACKGROUND_COUNT,
- MONITOR_FLUSH_BACKGROUND_PAGES,
- n_flushed_lru);
- }
+ buf_flush_LRU_tail();
}
buf_lru_manager_is_active = false;
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index a3601a521d2..c9180d8285c 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -3280,71 +3280,6 @@ dict_table_is_referenced_by_foreign_key(
return(!table->referenced_set.empty());
}
-/*********************************************************************//**
-Check if the index is referenced by a foreign key, if TRUE return foreign
-else return NULL
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_referenced_constraint(
-/*=================================*/
- dict_table_t* table, /*!< in: InnoDB table */
- dict_index_t* index) /*!< in: InnoDB index */
-{
- dict_foreign_t* foreign;
-
- ut_ad(index != NULL);
- ut_ad(table != NULL);
-
- for (dict_foreign_set::iterator it = table->referenced_set.begin();
- it != table->referenced_set.end();
- ++it) {
-
- foreign = *it;
-
- if (foreign->referenced_index == index) {
-
- return(foreign);
- }
- }
-
- return(NULL);
-}
-
-/*********************************************************************//**
-Checks if a index is defined for a foreign key constraint. Index is a part
-of a foreign key constraint if the index is referenced by foreign key
-or index is a foreign key index.
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_foreign_constraint(
-/*==============================*/
- dict_table_t* table, /*!< in: InnoDB table */
- dict_index_t* index) /*!< in: InnoDB index */
-{
- dict_foreign_t* foreign;
-
- ut_ad(index != NULL);
- ut_ad(table != NULL);
-
- for (dict_foreign_set::iterator it = table->foreign_set.begin();
- it != table->foreign_set.end();
- ++it) {
-
- foreign = *it;
-
- if (foreign->foreign_index == index) {
-
- return(foreign);
- }
- }
-
- return(NULL);
-}
-
/**********************************************************************//**
Removes a foreign constraint struct from the dictionary cache. */
UNIV_INTERN
diff --git a/storage/xtradb/dict/dict0stats_bg.cc b/storage/xtradb/dict/dict0stats_bg.cc
index 9e1f75a13a9..a5e0e2cf044 100644
--- a/storage/xtradb/dict/dict0stats_bg.cc
+++ b/storage/xtradb/dict/dict0stats_bg.cc
@@ -352,6 +352,14 @@ DECLARE_THREAD(dict_stats_thread)(
break;
}
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (srv_ibuf_disable_background_merge) {
+ usleep(100000);
+ os_event_reset(dict_stats_event);
+ continue;
+ }
+#endif
+
dict_stats_process_entry_from_recalc_pool();
os_event_reset(dict_stats_event);
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 337716fd027..b05fc603c24 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -5477,9 +5477,10 @@ _fil_io(
space = fil_space_get_by_id(space_id);
- /* If we are deleting a tablespace we don't allow any read
- operations on that. However, we do allow write operations. */
- if (space == 0 || (type == OS_FILE_READ && space->stop_new_ops)) {
+ /* If we are deleting a tablespace we don't allow async read operations
+ on that. However, we do allow write and sync read operations */
+ if (space == 0
+ || (type == OS_FILE_READ && !sync && space->stop_new_ops)) {
mutex_exit(&fil_system->mutex);
ib_logf(IB_LOG_LEVEL_ERROR,
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 161c21efa16..c4cf228aa82 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -4,7 +4,7 @@ Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -862,6 +862,12 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_os_log_pending_writes, SHOW_LONG},
{"os_log_written",
(char*) &export_vars.innodb_os_log_written, SHOW_LONGLONG},
+ {"os_merge_buffers_written",
+ (char*) &export_vars.innodb_merge_buffers_written, SHOW_LONGLONG},
+ {"os_merge_buffers_read",
+ (char*) &export_vars.innodb_merge_buffers_read, SHOW_LONGLONG},
+ {"os_merge_buffers_merged",
+ (char*) &export_vars.innodb_merge_buffers_merged, SHOW_LONGLONG},
{"page_size",
(char*) &export_vars.innodb_page_size, SHOW_LONG},
{"pages_created",
@@ -1211,6 +1217,17 @@ innobase_end(
handlerton* hton, /* in: Innodb handlerton */
ha_panic_function type);
+#if NOT_USED
+/*****************************************************************//**
+Stores the current binlog coordinates in the trx system header. */
+static
+int
+innobase_store_binlog_info(
+/*=======================*/
+ handlerton* hton, /*!< in: InnoDB handlerton */
+ THD* thd); /*!< in: MySQL thread handle */
+#endif
+
/*****************************************************************//**
Creates an InnoDB transaction struct for the thd if it does not yet have one.
Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -3327,6 +3344,9 @@ innobase_init(
innobase_hton->start_consistent_snapshot =
innobase_start_trx_and_assign_read_view;
+ /*innobase_hton->store_binlog_info =
+ innobase_store_binlog_info;*/
+
innobase_hton->flush_logs = innobase_flush_logs;
innobase_hton->show_status = innobase_show_status;
innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS |
@@ -4064,6 +4084,38 @@ innobase_commit_low(
#endif /* WITH_WSREP */
}
+#if NOT_USED
+/*****************************************************************//**
+Stores the current binlog coordinates in the trx system header. */
+static
+int
+innobase_store_binlog_info(
+/*=======================*/
+ handlerton* hton, /*!< in: InnoDB handlerton */
+ THD* thd) /*!< in: MySQL thread handle */
+
+{
+ const char* file_name;
+ unsigned long long pos;
+ mtr_t mtr;
+
+ DBUG_ENTER("innobase_store_binlog_info");
+
+ thd_binlog_pos(thd, &file_name, &pos);
+
+ mtr_start(&mtr);
+
+ trx_sys_update_mysql_binlog_offset(file_name, pos,
+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
+
+ mtr_commit(&mtr);
+
+ innobase_flush_logs(hton);
+
+ DBUG_RETURN(0);
+}
+#endif
+
/*****************************************************************//**
Creates an InnoDB transaction struct for the thd if it does not yet have one.
Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -10714,7 +10766,8 @@ create_table_def(
/* MySQL does the name length check. But we do additional check
on the name length here */
- if (strlen(table_name) > MAX_FULL_NAME_LEN) {
+ const size_t table_name_len = strlen(table_name);
+ if (table_name_len > MAX_FULL_NAME_LEN) {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
@@ -10723,6 +10776,15 @@ create_table_def(
DBUG_RETURN(ER_TABLE_NAME);
}
+ if (table_name[table_name_len - 1] == '/') {
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_TABLE_NAME,
+ "InnoDB: Table name is empty");
+
+ DBUG_RETURN(ER_WRONG_TABLE_NAME);
+ }
+
n_cols = form->s->fields;
s_cols = form->s->stored_fields;
@@ -12037,6 +12099,10 @@ ha_innobase::discard_or_import_tablespace(
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
+ if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) {
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+ }
+
dict_table = prebuilt->table;
if (dict_table->space == TRX_SYS_SPACE) {
@@ -13733,8 +13799,8 @@ ha_innobase::check(
my_error(ER_QUERY_INTERRUPTED, MYF(0));
}
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
- return(HA_ADMIN_CORRUPT);
+ if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted)) {
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
}
DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
@@ -16249,6 +16315,9 @@ innodb_log_archive_update(
void* var_ptr,
const void* save)
{
+ if (srv_read_only_mode)
+ return;
+
my_bool in_val = *static_cast<const my_bool*>(save);
if (in_val) {
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 138f717ea27..8134ec9b59d 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -29,6 +29,7 @@ Smart ALTER TABLE
#include <innodb_priv.h>
#include <sql_alter.h>
#include <sql_class.h>
+#include <sql_table.h>
#include "dict0crea.h"
#include "dict0dict.h"
@@ -533,12 +534,9 @@ ha_innobase::check_if_supported_inplace_alter(
} else if (((ha_alter_info->handler_flags
& Alter_inplace_info::ADD_PK_INDEX)
|| innobase_need_rebuild(ha_alter_info))
- && (innobase_fulltext_exist(altered_table)
- || (prebuilt->table->flags2
- & DICT_TF2_FTS_HAS_DOC_ID))) {
+ && (innobase_fulltext_exist(altered_table))) {
/* Refuse to rebuild the table online, if
- fulltext indexes are to survive the rebuild,
- or if the table contains a hidden FTS_DOC_ID column. */
+ fulltext indexes are to survive the rebuild. */
online = false;
/* If the table already contains fulltext indexes,
refuse to rebuild the table natively altogether. */
@@ -896,10 +894,8 @@ innobase_get_foreign_key_info(
char* tbl_namep = NULL;
ulint db_name_len = 0;
ulint tbl_name_len = 0;
-#ifdef __WIN__
char db_name[MAX_DATABASE_NAME_LEN];
char tbl_name[MAX_TABLE_NAME_LEN];
-#endif
fk_key = static_cast<Foreign_key*>(key);
@@ -952,24 +948,29 @@ innobase_get_foreign_key_info(
add_fk[num_fk] = dict_mem_foreign_create();
#ifndef __WIN__
- tbl_namep = fk_key->ref_table.str;
- tbl_name_len = fk_key->ref_table.length;
- db_namep = fk_key->ref_db.str;
- db_name_len = fk_key->ref_db.length;
+ if(fk_key->ref_db.str) {
+ tablename_to_filename(fk_key->ref_db.str, db_name,
+ MAX_DATABASE_NAME_LEN);
+ db_namep = db_name;
+ db_name_len = strlen(db_name);
+ }
+ if (fk_key->ref_table.str) {
+ tablename_to_filename(fk_key->ref_table.str, tbl_name,
+ MAX_TABLE_NAME_LEN);
+ tbl_namep = tbl_name;
+ tbl_name_len = strlen(tbl_name);
+ }
#else
ut_ad(fk_key->ref_table.str);
-
- memcpy(tbl_name, fk_key->ref_table.str,
- fk_key->ref_table.length);
- tbl_name[fk_key->ref_table.length] = 0;
+ tablename_to_filename(fk_key->ref_table.str, tbl_name,
+ MAX_TABLE_NAME_LEN);
innobase_casedn_str(tbl_name);
tbl_name_len = strlen(tbl_name);
tbl_namep = &tbl_name[0];
if (fk_key->ref_db.str != NULL) {
- memcpy(db_name, fk_key->ref_db.str,
- fk_key->ref_db.length);
- db_name[fk_key->ref_db.length] = 0;
+ tablename_to_filename(fk_key->ref_db.str, db_name,
+ MAX_DATABASE_NAME_LEN);
innobase_casedn_str(db_name);
db_name_len = strlen(db_name);
db_namep = &db_name[0];
@@ -3320,58 +3321,74 @@ innobase_check_foreign_key_index(
ulint n_drop_fk) /*!< in: Number of foreign keys
to drop */
{
- dict_foreign_t* foreign;
+ ut_ad(index != NULL);
+ ut_ad(indexed_table != NULL);
- /* Check if the index is referenced. */
- foreign = dict_table_get_referenced_constraint(indexed_table, index);
-
- ut_ad(!foreign || indexed_table
- == foreign->referenced_table);
-
- if (foreign
- && !dict_foreign_find_index(
- indexed_table, col_names,
- foreign->referenced_col_names,
- foreign->n_fields, index,
- /*check_charsets=*/TRUE,
- /*check_null=*/FALSE, NULL, NULL, NULL)
- && !innobase_find_equiv_index(
- foreign->referenced_col_names,
- foreign->n_fields,
- ha_alter_info->key_info_buffer,
- ha_alter_info->index_add_buffer,
- ha_alter_info->index_add_count)
- ) {
- trx->error_info = index;
- return(true);
+ const dict_foreign_set* fks = &indexed_table->referenced_set;
+
+ /* Check for all FK references from other tables to the index. */
+ for (dict_foreign_set::const_iterator it = fks->begin();
+ it != fks->end(); ++it) {
+
+ dict_foreign_t* foreign = *it;
+ if (foreign->referenced_index != index) {
+ continue;
+ }
+ ut_ad(indexed_table == foreign->referenced_table);
+
+ if (NULL == dict_foreign_find_index(
+ indexed_table, col_names,
+ foreign->referenced_col_names,
+ foreign->n_fields, index,
+ /*check_charsets=*/TRUE,
+ /*check_null=*/FALSE,
+ 0,0,0)
+ && NULL == innobase_find_equiv_index(
+ foreign->referenced_col_names,
+ foreign->n_fields,
+ ha_alter_info->key_info_buffer,
+ ha_alter_info->index_add_buffer,
+ ha_alter_info->index_add_count)) {
+
+ /* Index cannot be dropped. */
+ trx->error_info = index;
+ return(true);
+ }
}
- /* Check if this index references some
- other table */
- foreign = dict_table_get_foreign_constraint(
- indexed_table, index);
-
- ut_ad(!foreign || indexed_table
- == foreign->foreign_table);
-
- if (foreign
- && !innobase_dropping_foreign(
- foreign, drop_fk, n_drop_fk)
- && !dict_foreign_find_index(
- indexed_table, col_names,
- foreign->foreign_col_names,
- foreign->n_fields, index,
- /*check_charsets=*/TRUE,
- /*check_null=*/FALSE, NULL,NULL, NULL)
- && !innobase_find_equiv_index(
- foreign->foreign_col_names,
- foreign->n_fields,
- ha_alter_info->key_info_buffer,
- ha_alter_info->index_add_buffer,
- ha_alter_info->index_add_count)
- ) {
- trx->error_info = index;
- return(true);
+ fks = &indexed_table->foreign_set;
+
+ /* Check for all FK references in current table using the index. */
+ for (dict_foreign_set::const_iterator it = fks->begin();
+ it != fks->end(); ++it) {
+
+ dict_foreign_t* foreign = *it;
+ if (foreign->foreign_index != index) {
+ continue;
+ }
+
+ ut_ad(indexed_table == foreign->foreign_table);
+
+ if (!innobase_dropping_foreign(
+ foreign, drop_fk, n_drop_fk)
+ && NULL == dict_foreign_find_index(
+ indexed_table, col_names,
+ foreign->foreign_col_names,
+ foreign->n_fields, index,
+ /*check_charsets=*/TRUE,
+ /*check_null=*/FALSE,
+ 0, 0, 0)
+ && NULL == innobase_find_equiv_index(
+ foreign->foreign_col_names,
+ foreign->n_fields,
+ ha_alter_info->key_info_buffer,
+ ha_alter_info->index_add_buffer,
+ ha_alter_info->index_add_count)) {
+
+ /* Index cannot be dropped. */
+ trx->error_info = index;
+ return(true);
+ }
}
return(false);
@@ -3594,6 +3611,19 @@ check_if_ok_to_rename:
if (index->type & DICT_FTS) {
DBUG_ASSERT(index->type == DICT_FTS
|| (index->type & DICT_CORRUPT));
+
+ /* We need to drop any corrupted fts indexes
+ before we add a new fts index. */
+ if (add_fts_idx && index->type & DICT_CORRUPT) {
+ ib_errf(user_thd, IB_LOG_LEVEL_ERROR,
+ ER_INNODB_INDEX_CORRUPT,
+ "Fulltext index '%s' is corrupt. "
+ "you should drop this index first.",
+ index->name);
+
+ goto err_exit_no_heap;
+ }
+
continue;
}
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index 972208c51bd..19521d362ed 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -2734,7 +2734,9 @@ ibuf_merge_space(
&pages[0], &spaces[0], &versions[0], n_pages,
&mtr);
- ++sum_sizes;
+ if (*n_pages > 0) {
+ ++sum_sizes;
+ }
}
ibuf_mtr_commit(&mtr);
diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h
index ce70e936e6e..5643892bffc 100644
--- a/storage/xtradb/include/dict0dict.h
+++ b/storage/xtradb/include/dict0dict.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
This program is free software; you can redistribute it and/or modify it under
@@ -433,18 +433,6 @@ dict_foreign_add_to_cache(
/*!< in: error to be ignored */
__attribute__((nonnull(1), warn_unused_result));
/*********************************************************************//**
-Check if the index is referenced by a foreign key, if TRUE return the
-matching instance NULL otherwise.
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_referenced_constraint(
-/*=================================*/
- dict_table_t* table, /*!< in: InnoDB table */
- dict_index_t* index) /*!< in: InnoDB index */
- __attribute__((nonnull, warn_unused_result));
-/*********************************************************************//**
Checks if a table is referenced by foreign keys.
@return TRUE if table is referenced by a foreign key */
UNIV_INTERN
@@ -479,19 +467,6 @@ dict_str_starts_with_keyword(
const char* keyword) /*!< in: keyword to look for */
__attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
-Checks if a index is defined for a foreign key constraint. Index is a part
-of a foreign key constraint if the index is referenced by foreign key
-or index is a foreign key index
-@return pointer to foreign key struct if index is defined for foreign
-key, otherwise NULL */
-UNIV_INTERN
-dict_foreign_t*
-dict_table_get_foreign_constraint(
-/*==============================*/
- dict_table_t* table, /*!< in: InnoDB table */
- dict_index_t* index) /*!< in: InnoDB index */
- __attribute__((nonnull, warn_unused_result));
-/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
should be called after the indexes for a table have been created.
diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic
index 6bfd7f6cdae..753f10aba86 100644
--- a/storage/xtradb/include/dict0dict.ic
+++ b/storage/xtradb/include/dict0dict.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h
index a2996ecacc8..d54ed281d9a 100644
--- a/storage/xtradb/include/fts0fts.h
+++ b/storage/xtradb/include/fts0fts.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/xtradb/include/row0purge.h b/storage/xtradb/include/row0purge.h
index 93dcf9cf49b..888289a6c79 100644
--- a/storage/xtradb/include/row0purge.h
+++ b/storage/xtradb/include/row0purge.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -119,6 +119,16 @@ struct purge_node_t{
clustered index record */
ibool done; /* Debug flag */
+#ifdef UNIV_DEBUG
+ /***********************************************************//**
+ Validate the persisent cursor. The purge node has two references
+ to the clustered index record - one via the ref member, and the
+ other via the persistent cursor. These two references must match
+ each other if the found_clust flag is set.
+ @return true if the persistent cursor is consistent with
+ the ref member.*/
+ bool validate_pcur();
+#endif
};
#ifndef UNIV_NONINL
diff --git a/storage/xtradb/include/srv0mon.h b/storage/xtradb/include/srv0mon.h
index 2d90f47eefe..d2b65721e1a 100644
--- a/storage/xtradb/include/srv0mon.h
+++ b/storage/xtradb/include/srv0mon.h
@@ -2,6 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -255,6 +256,9 @@ enum monitor_id_t {
MONITOR_OVLD_OS_LOG_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_WRITES,
+ MONITOR_MERGE_BLOCKS_WRITTEN,
+ MONITOR_MERGE_BLOCKS_READ,
+ MONITOR_MERGE_BLOCKS_MERGED,
/* Transaction related counters */
MONITOR_MODULE_TRX,
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index 5e4582cac69..31cda7d3238 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -145,6 +145,13 @@ struct srv_stats_t {
/** Number of lock waits that have been up to max time (i.e.) lock
wait timeout */
ulint_ctr_1_t n_lock_max_wait_time;
+
+ /** Number of merge buffers written */
+ ulint_ctr_64_t merge_buffers_written;
+ /** Number of merge buffers read */
+ ulint_ctr_64_t merge_buffers_read;
+ /** Number of merge buffers merged */
+ ulint_ctr_64_t merge_buffers_merged;
};
extern const char* srv_main_thread_op_info;
@@ -1092,6 +1099,9 @@ struct export_var_t{
ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_id
- purged view's min trx_id */
#endif /* UNIV_DEBUG */
+ ib_int64_t innodb_merge_buffers_written;
+ ib_int64_t innodb_merge_buffers_read;
+ ib_int64_t innodb_merge_buffers_merged;
};
/** Thread slot in the thread table. */
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 1db6bd85edd..1c52bd0925b 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -44,10 +44,10 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 6
-#define INNODB_VERSION_BUGFIX 25
+#define INNODB_VERSION_BUGFIX 26
#ifndef PERCONA_INNODB_VERSION
-#define PERCONA_INNODB_VERSION 73.1
+#define PERCONA_INNODB_VERSION 74.0
#endif
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
@@ -611,6 +611,7 @@ Windows, so define a typedef for it and a macro to use at the end of such
functions. */
#ifdef __WIN__
+#define usleep(a) Sleep((a)/1000)
typedef ulint os_thread_ret_t;
#define OS_THREAD_DUMMY_RETURN return(0)
#else
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index 1ff00dbcb8c..73551fd72f2 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -3343,6 +3343,7 @@ ulint
log_archive_noarchivelog(void)
/*==========================*/
{
+ ut_ad(!srv_read_only_mode);
loop:
mutex_enter(&(log_sys->mutex));
@@ -3375,6 +3376,8 @@ ulint
log_archive_archivelog(void)
/*========================*/
{
+ ut_ad(!srv_read_only_mode);
+
mutex_enter(&(log_sys->mutex));
if (log_sys->archiving_state == LOG_ARCH_OFF) {
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index 855c500a1bb..d5bd6b429ea 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -1496,6 +1496,7 @@ os_file_create_simple_no_error_handling_func(
*success = (file != INVALID_HANDLE_VALUE);
#else /* __WIN__ */
int create_flag;
+ const char* mode_str = NULL;
ut_a(name);
if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW)
@@ -1506,6 +1507,8 @@ os_file_create_simple_no_error_handling_func(
if (create_mode == OS_FILE_OPEN) {
+ mode_str = "OPEN";
+
if (access_type == OS_FILE_READ_ONLY) {
create_flag = O_RDONLY;
@@ -1524,10 +1527,14 @@ os_file_create_simple_no_error_handling_func(
} else if (srv_read_only_mode) {
+ mode_str = "OPEN";
+
create_flag = O_RDONLY;
} else if (create_mode == OS_FILE_CREATE) {
+ mode_str = "CREATE";
+
create_flag = O_RDWR | O_CREAT | O_EXCL;
} else {
@@ -1542,6 +1549,17 @@ os_file_create_simple_no_error_handling_func(
*success = file == -1 ? FALSE : TRUE;
+ /* This function is always called for data files, we should disable
+ OS caching (O_DIRECT) here as we do in os_file_create_func(), so
+ we open the same file in the same mode, see man page of open(2). */
+ if (!srv_read_only_mode
+ && *success
+ && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
+ || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
+
+ os_file_set_nocache(file, name, mode_str);
+ }
+
#ifdef USE_FILE_LOCK
if (!srv_read_only_mode
&& *success
diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc
index c513320afc1..fc1a72b5695 100644
--- a/storage/xtradb/row/row0import.cc
+++ b/storage/xtradb/row/row0import.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -139,14 +139,6 @@ struct row_import {
ulint find_col(const char* name) const UNIV_NOTHROW;
/**
- Find the index field entry in in the cfg indexes fields.
- @name - of the index to look for
- @return instance if found else 0. */
- const dict_field_t* find_field(
- const row_index_t* cfg_index,
- const char* name) const UNIV_NOTHROW;
-
- /**
Get the number of rows for which purge failed during the convert phase.
@param name - index name
@return number of rows for which purge failed. */
@@ -1141,30 +1133,6 @@ row_import::find_col(
}
/**
-Find the index field entry in in the cfg indexes fields.
-@name - of the index to look for
-@return instance if found else 0. */
-const dict_field_t*
-row_import::find_field(
- const row_index_t* cfg_index,
- const char* name) const UNIV_NOTHROW
-{
- const dict_field_t* field = cfg_index->m_fields;
-
- for (ulint i = 0; i < cfg_index->m_n_fields; ++i, ++field) {
- const char* field_name;
-
- field_name = reinterpret_cast<const char*>(field->name);
-
- if (strcmp(field_name, name) == 0) {
- return(field);
- }
- }
-
- return(0);
-}
-
-/**
Check if the index schema that was read from the .cfg file matches the
in memory index definition.
@return DB_SUCCESS or error code. */
@@ -1187,51 +1155,60 @@ row_import::match_index_columns(
return(DB_ERROR);
}
- cfg_index->m_srv_index = index;
+ if (cfg_index->m_n_fields != index->n_fields) {
- const dict_field_t* field = index->fields;
+ ib_errf(thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Index field count %lu doesn't match"
+ " tablespace metadata file value %lu",
+ (ulong) index->n_fields,
+ (ulong) cfg_index->m_n_fields);
- for (ulint i = 0; i < index->n_fields; ++i, ++field) {
+ return(DB_ERROR);
+ }
- const dict_field_t* cfg_field;
+ cfg_index->m_srv_index = index;
- cfg_field = find_field(cfg_index, field->name);
+ const dict_field_t* field = index->fields;
+ const dict_field_t* cfg_field = cfg_index->m_fields;
- if (cfg_field == 0) {
+ for (ulint i = 0; i < index->n_fields; ++i, ++field, ++cfg_field) {
+
+ if (strcmp(field->name, cfg_field->name) != 0) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_TABLE_SCHEMA_MISMATCH,
- "Index %s field %s not found in tablespace "
- "meta-data file.",
- index->name, field->name);
+ "Index field name %s doesn't match"
+ " tablespace metadata field name %s"
+ " for field position %lu",
+ field->name, cfg_field->name, (ulong) i);
err = DB_ERROR;
- } else {
+ }
- if (cfg_field->prefix_len != field->prefix_len) {
- ib_errf(thd, IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Index %s field %s prefix len %lu "
- "doesn't match meta-data file value "
- "%lu",
- index->name, field->name,
- (ulong) field->prefix_len,
- (ulong) cfg_field->prefix_len);
+ if (cfg_field->prefix_len != field->prefix_len) {
+ ib_errf(thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Index %s field %s prefix len %lu"
+ " doesn't match metadata file value"
+ " %lu",
+ index->name, field->name,
+ (ulong) field->prefix_len,
+ (ulong) cfg_field->prefix_len);
- err = DB_ERROR;
- }
+ err = DB_ERROR;
+ }
- if (cfg_field->fixed_len != field->fixed_len) {
- ib_errf(thd, IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Index %s field %s fixed len %lu "
- "doesn't match meta-data file value "
- "%lu",
- index->name, field->name,
- (ulong) field->fixed_len,
- (ulong) cfg_field->fixed_len);
+ if (cfg_field->fixed_len != field->fixed_len) {
+ ib_errf(thd, IB_LOG_LEVEL_ERROR,
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Index %s field %s fixed len %lu"
+ " doesn't match metadata file value"
+ " %lu",
+ index->name, field->name,
+ (ulong) field->fixed_len,
+ (ulong) cfg_field->fixed_len);
- err = DB_ERROR;
- }
+ err = DB_ERROR;
}
}
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index b1291404176..934a91edc5c 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2354,24 +2354,34 @@ row_ins_clust_index_entry_low(
big_rec_t* big_rec = NULL;
mtr_t mtr;
mem_heap_t* offsets_heap = NULL;
+ ulint search_mode;
ut_ad(dict_index_is_clust(index));
ut_ad(!dict_index_is_unique(index)
|| n_uniq == dict_index_get_n_unique(index));
ut_ad(!n_uniq || n_uniq == dict_index_get_n_unique(index));
+ /* If running with fake_changes mode on then switch from modify to
+ search so that code takes only s-latch and not x-latch.
+ For dry-run (fake-changes) s-latch is acceptable. Taking x-latch will
+ make it more restrictive and will block real changes/workflow. */
+ if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
+ search_mode = (mode & BTR_MODIFY_TREE)
+ ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF;
+ } else {
+ search_mode = mode;
+ }
+
mtr_start_trx(&mtr, thr_get_trx(thr));
if (mode == BTR_MODIFY_LEAF && dict_index_is_online_ddl(index)) {
- if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
- mode = BTR_SEARCH_LEAF | BTR_ALREADY_S_LATCHED;
- } else {
- mode = BTR_MODIFY_LEAF | BTR_ALREADY_S_LATCHED;
- }
+
+ /* We really don't need to OR mode but will leave it for
+ code consistency. */
+ mode |= BTR_ALREADY_S_LATCHED;
+ search_mode |= BTR_ALREADY_S_LATCHED;
+
mtr_s_lock(dict_index_get_lock(index), &mtr);
- } else if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
- mode = (mode & BTR_MODIFY_TREE)
- ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF;
}
cursor.thr = thr;
@@ -2380,7 +2390,7 @@ row_ins_clust_index_entry_low(
the function will return in both low_match and up_match of the
cursor sensible values */
- btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, mode,
+ btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, search_mode,
&cursor, 0, __FILE__, __LINE__, &mtr);
#ifdef UNIV_DEBUG
@@ -2652,7 +2662,7 @@ row_ins_sec_index_entry_low(
que_thr_t* thr) /*!< in: query thread */
{
btr_cur_t cursor;
- ulint search_mode = mode | BTR_INSERT;
+ ulint search_mode;
dberr_t err = DB_SUCCESS;
ulint n_unique;
mtr_t mtr;
@@ -2666,6 +2676,18 @@ row_ins_sec_index_entry_low(
ut_ad(thr_get_trx(thr)->id);
mtr_start_trx(&mtr, trx);
+ /* If running with fake_changes mode on then avoid using insert buffer
+ and also switch from modify to search so that code takes only s-latch
+ and not x-latch. For dry-run (fake-changes) s-latch is acceptable.
+ Taking x-latch will make it more restrictive and will block real
+ changes/workflow. */
+ if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
+ search_mode = (mode & BTR_MODIFY_TREE)
+ ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF;
+ } else {
+ search_mode = mode | BTR_INSERT;
+ }
+
/* Ensure that we acquire index->lock when inserting into an
index with index->online_status == ONLINE_INDEX_COMPLETE, but
could still be subject to rollback_inplace_alter_table().
@@ -2673,11 +2695,24 @@ row_ins_sec_index_entry_low(
The memory object cannot be freed as long as we have an open
reference to the table, or index->table->n_ref_count > 0. */
const bool check = *index->name == TEMP_INDEX_PREFIX;
+
if (check) {
+
DEBUG_SYNC_C("row_ins_sec_index_enter");
- if (mode == BTR_MODIFY_LEAF) {
+
+ /* mode = MODIFY_LEAF is synonymous to search_mode = SEARCH_LEAF
+ search_mode = SEARCH_TREE suggest operation in fake_change mode
+ so continue to s-latch in this mode too. */
+
+ if (mode == BTR_MODIFY_LEAF || search_mode == BTR_SEARCH_TREE) {
+
+ ut_ad((search_mode == BTR_SEARCH_TREE
+ && thr_get_trx(thr)->fake_changes)
+ || mode == BTR_MODIFY_LEAF);
+
search_mode |= BTR_ALREADY_S_LATCHED;
mtr_s_lock(dict_index_get_lock(index), &mtr);
+
} else {
mtr_x_lock(dict_index_get_lock(index), &mtr);
}
@@ -2688,14 +2723,13 @@ row_ins_sec_index_entry_low(
}
}
- /* Note that we use PAGE_CUR_LE as the search mode, because then
- the function will return in both low_match and up_match of the
- cursor sensible values */
-
if (!thr_get_trx(thr)->check_unique_secondary) {
search_mode |= BTR_IGNORE_SEC_UNIQUE;
}
+ /* Note that we use PAGE_CUR_LE as the search mode, because then
+ the function will return in both low_match and up_match of the
+ cursor sensible values */
btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
search_mode,
&cursor, 0, __FILE__, __LINE__, &mtr);
@@ -2775,10 +2809,7 @@ row_ins_sec_index_entry_low(
btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_LE,
- UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)
- ? BTR_SEARCH_LEAF
- : (btr_latch_mode)
- (search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)),
+ search_mode & ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE),
&cursor, 0, __FILE__, __LINE__, &mtr);
}
diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc
index 4a50be3d098..84992ed08cc 100644
--- a/storage/xtradb/row/row0log.cc
+++ b/storage/xtradb/row/row0log.cc
@@ -2584,7 +2584,7 @@ all_done:
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- ofs, srv_buf_size);
+ ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */
next_mrec = index->online_log->head.block;
@@ -3412,7 +3412,7 @@ all_done:
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- ofs, srv_buf_size);
+ ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */
next_mrec = index->online_log->head.block;
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 0a5eb4374f1..3447d15ed1c 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -873,6 +874,8 @@ row_merge_read(
success = os_file_read_no_error_handling(OS_FILE_FROM_FD(fd), buf,
ofs, srv_sort_buf_size);
+ srv_stats.merge_buffers_read.inc();
+
#ifdef POSIX_FADV_DONTNEED
/* Each block is read exactly once. Free up the file cache. */
posix_fadvise(fd, ofs, srv_sort_buf_size, POSIX_FADV_DONTNEED);
@@ -907,6 +910,7 @@ row_merge_write(
DBUG_EXECUTE_IF("row_merge_write_failure", return(FALSE););
ret = os_file_write("(merge)", OS_FILE_FROM_FD(fd), buf, ofs, buf_len);
+ srv_stats.merge_buffers_written.inc();
#ifdef UNIV_DEBUG
if (row_merge_print_block_write) {
@@ -1744,7 +1748,7 @@ write_buffers:
/* We have enough data tuples to form a block.
Sort them and write to disk. */
- if (buf->n_tuples) {
+ if (UNIV_LIKELY(buf->n_tuples)) {
if (dict_index_is_unique(buf->index)) {
row_merge_dup_t dup = {
buf->index, table, col_map, 0};
@@ -1785,13 +1789,17 @@ write_buffers:
dict_index_get_lock(buf->index));
}
- row_merge_buf_write(buf, file, block);
+ /* Do not write empty buffers to temporary file */
+ if (buf->n_tuples) {
+
+ row_merge_buf_write(buf, file, block);
- if (!row_merge_write(file->fd, file->offset++,
- block)) {
- err = DB_TEMP_FILE_WRITE_FAILURE;
- trx->error_key_num = i;
- break;
+ if (!row_merge_write(file->fd, file->offset++,
+ block)) {
+ err = DB_TEMP_FILE_WRITE_FAILURE;
+ trx->error_key_num = i;
+ break;
+ }
}
UNIV_MEM_INVALID(&block[0], srv_sort_buf_size);
@@ -2076,6 +2084,9 @@ done1:
mem_heap_free(heap);
b2 = row_merge_write_eof(&block[2 * srv_sort_buf_size],
b2, of->fd, &of->offset);
+
+ srv_stats.merge_buffers_merged.inc();
+
return(b2 ? DB_SUCCESS : DB_CORRUPTION);
}
@@ -3755,17 +3766,21 @@ wait_again:
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
} else {
- row_merge_dup_t dup = {
- sort_idx, table, col_map, 0};
-
- error = row_merge_sort(
- trx, &dup, &merge_files[i],
- block, &tmpfd);
-
- if (error == DB_SUCCESS) {
- error = row_merge_insert_index_tuples(
- trx->id, sort_idx, old_table,
- merge_files[i].fd, block);
+ /* Sorting and inserting is required only if
+ there really is records */
+ if (UNIV_LIKELY(merge_files[i].n_rec)) {
+ row_merge_dup_t dup = {
+ sort_idx, table, col_map, 0};
+
+ error = row_merge_sort(
+ trx, &dup, &merge_files[i],
+ block, &tmpfd);
+
+ if (error == DB_SUCCESS) {
+ error = row_merge_insert_index_tuples(
+ trx->id, sort_idx, old_table,
+ merge_files[i].fd, block);
+ }
}
}
diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc
index 8212a7b43e0..b26ba971a95 100644
--- a/storage/xtradb/row/row0purge.cc
+++ b/storage/xtradb/row/row0purge.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -84,7 +84,7 @@ row_purge_node_create(
/***********************************************************//**
Repositions the pcur in the purge node on the clustered index record,
-if found.
+if found. If the record is not found, close pcur.
@return TRUE if the record was found */
static
ibool
@@ -95,11 +95,10 @@ row_purge_reposition_pcur(
mtr_t* mtr) /*!< in: mtr */
{
if (node->found_clust) {
- ibool found;
+ ut_ad(node->validate_pcur());
- found = btr_pcur_restore_position(mode, &node->pcur, mtr);
+ node->found_clust = btr_pcur_restore_position(mode, &node->pcur, mtr);
- return(found);
} else {
node->found_clust = row_search_on_row_ref(
&node->pcur, mode, node->table, node->ref, mtr);
@@ -109,6 +108,11 @@ row_purge_reposition_pcur(
}
}
+ /* Close the current cursor if we fail to position it correctly. */
+ if (!node->found_clust) {
+ btr_pcur_close(&node->pcur);
+ }
+
return(node->found_clust);
}
@@ -182,7 +186,12 @@ func_exit:
mem_heap_free(heap);
}
- btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+ /* Persistent cursor is closed if reposition fails. */
+ if (node->found_clust) {
+ btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+ } else {
+ mtr_commit(&mtr);
+ }
return(success);
}
@@ -251,7 +260,12 @@ row_purge_poss_sec(
btr_pcur_get_rec(&node->pcur),
&mtr, index, entry);
- btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+ /* Persistent cursor is closed if reposition fails. */
+ if (node->found_clust) {
+ btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
+ } else {
+ mtr_commit(&mtr);
+ }
return(can_delete);
}
@@ -831,6 +845,8 @@ row_purge_record_func(
dict_index_t* clust_index;
bool purged = true;
+ ut_ad(!node->found_clust);
+
clust_index = dict_table_get_first_index(node->table);
node->index = dict_table_get_next_index(clust_index);
@@ -986,3 +1002,52 @@ row_purge_step(
return(thr);
}
+
+#ifdef UNIV_DEBUG
+/***********************************************************//**
+Validate the persisent cursor. The purge node has two references
+to the clustered index record - one via the ref member, and the
+other via the persistent cursor. These two references must match
+each other if the found_clust flag is set.
+@return true if the stored copy of persistent cursor is consistent
+with the ref member.*/
+bool
+purge_node_t::validate_pcur()
+{
+ if (!found_clust) {
+ return(true);
+ }
+
+ if (index == NULL) {
+ return(true);
+ }
+
+ if (index->type == DICT_FTS) {
+ return(true);
+ }
+
+ if (pcur.old_stored != BTR_PCUR_OLD_STORED) {
+ return(true);
+ }
+
+ dict_index_t* clust_index = pcur.btr_cur.index;
+
+ ulint* offsets = rec_get_offsets(
+ pcur.old_rec, clust_index, NULL, pcur.old_n_fields, &heap);
+
+ /* Here we are comparing the purge ref record and the stored initial
+ part in persistent cursor. Both cases we store n_uniq fields of the
+ cluster index and so it is fine to do the comparison. We note this
+ dependency here as pcur and ref belong to different modules. */
+ int st = cmp_dtuple_rec(ref, pcur.old_rec, offsets);
+
+ if (st != 0) {
+ fprintf(stderr, "Purge node pcur validation failed\n");
+ dtuple_print(stderr, ref);
+ rec_print(stderr, pcur.old_rec, clust_index);
+ return(false);
+ }
+
+ return(true);
+}
+#endif /* UNIV_DEBUG */
diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc
index 6c7796e3ee6..457e8361331 100644
--- a/storage/xtradb/row/row0sel.cc
+++ b/storage/xtradb/row/row0sel.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc
index a0dd32c203f..960c889f871 100644
--- a/storage/xtradb/srv/srv0mon.cc
+++ b/storage/xtradb/srv/srv0mon.cc
@@ -2,6 +2,7 @@
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2014, 2015, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -674,6 +675,24 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_WRITES},
+ {"os_merge_blocks_written", "os",
+ "Number of merge blocks written (innodb_os_merge_blocks_written)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_WRITTEN},
+
+ {"os_merge_blocks_read", "os",
+ "Number of merge blocks read (innodb_os_merge_blocks_read)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_READ},
+
+ {"os_merge_blocks_merged", "os",
+ "Number of merge blocks merged (innodb_os_merge_blocks_merged)",
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DEFAULT_ON),
+ MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_MERGED},
+
/* ========== Counters for Transaction Module ========== */
{"module_trx", "transaction", "Transaction Manager",
MONITOR_MODULE,
@@ -1626,6 +1645,21 @@ srv_mon_process_existing_counter(
update_min = TRUE;
break;
+ /* innodb_os_merge_blocks_written */
+ case MONITOR_MERGE_BLOCKS_WRITTEN:
+ value = srv_stats.merge_buffers_written;
+ break;
+
+ /* innodb_os_merge_blocks_read */
+ case MONITOR_MERGE_BLOCKS_READ:
+ value = srv_stats.merge_buffers_read;
+ break;
+
+ /* innodb_os_merge_blocks_merged */
+ case MONITOR_MERGE_BLOCKS_MERGED:
+ value = srv_stats.merge_buffers_merged;
+ break;
+
/* innodb_log_waits */
case MONITOR_OVLD_LOG_WAITS:
value = srv_stats.log_waits;
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index e9e1059031b..769942ce245 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
+Copyright (c) 2013, 2015, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1949,6 +1949,10 @@ srv_export_innodb_status(void)
}
#endif /* UNIV_DEBUG */
+ export_vars.innodb_merge_buffers_written = srv_stats.merge_buffers_written;
+ export_vars.innodb_merge_buffers_read = srv_stats.merge_buffers_read;
+ export_vars.innodb_merge_buffers_merged = srv_stats.merge_buffers_merged;
+
mutex_exit(&srv_innodb_monitor_mutex);
}
@@ -2244,8 +2248,7 @@ rescan_idle:
mutex_enter(&trx_sys->mutex);
trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
while (trx) {
- if (!trx_state_eq(trx, TRX_STATE_NOT_STARTED)
- && trx_state_eq(trx, TRX_STATE_ACTIVE)
+ if (trx->state == TRX_STATE_ACTIVE
&& trx->mysql_thd
&& innobase_thd_is_idle(trx->mysql_thd)) {
ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd);
diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc
index d1386a3c43a..de51ff18ef3 100644
--- a/storage/xtradb/srv/srv0start.cc
+++ b/storage/xtradb/srv/srv0start.cc
@@ -2710,24 +2710,25 @@ files_checked:
}
#ifdef UNIV_LOG_ARCHIVE
- /* Archiving is always off under MySQL */
- if (!srv_log_archive_on) {
- ut_a(DB_SUCCESS == log_archive_noarchivelog());
- } else {
- bool start_archive;
+ if (!srv_read_only_mode) {
+ if (!srv_log_archive_on) {
+ ut_a(DB_SUCCESS == log_archive_noarchivelog());
+ } else {
+ bool start_archive;
- mutex_enter(&(log_sys->mutex));
+ mutex_enter(&(log_sys->mutex));
- start_archive = FALSE;
+ start_archive = false;
- if (log_sys->archiving_state == LOG_ARCH_OFF) {
- start_archive = TRUE;
- }
+ if (log_sys->archiving_state == LOG_ARCH_OFF) {
+ start_archive = true;
+ }
- mutex_exit(&(log_sys->mutex));
+ mutex_exit(&(log_sys->mutex));
- if (start_archive) {
- ut_a(DB_SUCCESS == log_archive_archivelog());
+ if (start_archive) {
+ ut_a(DB_SUCCESS == log_archive_archivelog());
+ }
}
}
#endif /* UNIV_LOG_ARCHIVE */
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 8d25ac8e7ed..28d2fd1515e 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -23,7 +23,7 @@
#define ROW_LEN 16
#define ROW16_LEN 8
-#define MAX_BUF 64*1024
+#define MAX_BUF (64*1024)
static struct charset_info_st all_charsets[512];
diff --git a/strings/ctype.c b/strings/ctype.c
index 048fbe3d368..d8a1dd7502b 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -264,7 +264,7 @@ static const struct my_cs_file_section_st
}
#define MY_CS_CSDESCR_SIZE 64
-#define MY_CS_TAILORING_SIZE 32*1024
+#define MY_CS_TAILORING_SIZE (32*1024)
#define MY_CS_UCA_VERSION_SIZE 64
#define MY_CS_CONTEXT_SIZE 64
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 76a0622589e..c9398b6c020 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -123,12 +123,6 @@ mode=$1 # start or stop
[ $# -ge 1 ] && shift
-
-other_args="$*" # uncommon, but needed when called from an RPM upgrade action
- # Expected: "--skip-networking --skip-grant-tables"
- # They are not checked here, intentionally, as it is the resposibility
- # of the "spec" file author to give correct arguments only.
-
case `echo "testing\c"`,`echo -n testing` in
*c*,-n*) echo_n= echo_c= ;;
*c*,*) echo_n=-n echo_c= ;;
@@ -220,6 +214,7 @@ else
fi
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
+parse_server_arguments "$@"
# wait for the pid file to disappear
wait_for_gone () {
@@ -324,7 +319,7 @@ case "$mode" in
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" >/dev/null 2>&1 &
wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE
@@ -372,8 +367,8 @@ case "$mode" in
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
- if $0 stop $other_args; then
- if ! $0 start $other_args; then
+ if $0 stop "$@"; then
+ if ! $0 start "$@"; then
log_failure_msg "Failed to restart server."
exit 1
fi
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index ce8e56d4976..ed3b697c0f9 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -677,7 +677,7 @@ install -m 644 "%{malloc_lib_source}" \
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
fi
if [ -z "$mysql_datadir" ]
@@ -782,7 +782,7 @@ esac
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
-if [ -f $STATUS_FILE ]; then
+if [ -f "$STATUS_FILE" ]; then
echo "Some previous upgrade was not finished:"
ls -ld $STATUS_FILE
echo "Please check its status, then do"
@@ -853,7 +853,7 @@ fi
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
@@ -866,8 +866,8 @@ STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
# ----------------------------------------------------------------------
# Create data directory if needed, check whether upgrade or install
# ----------------------------------------------------------------------
-if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
-if [ -f $STATUS_FILE ] ; then
+if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi
+if [ -f "$STATUS_FILE" ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
SERVER_TO_START=''
@@ -1045,7 +1045,7 @@ fi
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
then
- mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
fi
if [ -z "$mysql_datadir" ]
then
@@ -1056,7 +1056,7 @@ NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
-if [ -f $STATUS_FILE ] ; then
+if [ -f "$STATUS_FILE" ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
# This should never happen, but let's be prepared
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index 17bfca1debb..3cb8520b65d 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -17,6 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define UNICODE
#endif
+#undef NOMINMAX
+
#include <winsock2.h>
#include <windows.h>
#include <winreg.h>