You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1710 lines
71 KiB

WL#4738 streamline/simplify @@variable creation process Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
16 years ago
defaults-group-suffix in print_defaults Also clarify which --{no-,}default* options, must be first. Sample output: $ client/mysql --help client/mysql Ver 15.1 Distrib 5.5.59-MariaDB, for Linux (x86_64) using readline 5.1 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Usage: client/mysql [OPTIONS] [database] Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf The following groups are read: mysql client client-server client-mariadb The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file. The following specify which files/groups are read (specified before other options): --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --defaults-group-suffix=# Additionally read default groups with # appended as a suffix. tests running from build directory: TEST: print defaults ignored as not first $ sql/mysqld --no-defaults --print-defaults --lc-messages-dir=${PWD}/sql/share TEST: no startup occurs as --print-defaults specified $ sql/mysqld --print-defaults --lc-messages-dir=${PWD}/sql/share sql/mysqld would have been started with the following arguments: --lc-messages-dir=/home/dan/repos/build-mariadb-5.5/sql/share TEST: default args can't be anywhere $ client/mysql --user=bob --defaults-file=/etc/my.cnf client/mysql: unknown variable 'defaults-file=/etc/my.cnf' $ client/mysql --user=bob --defaults-group-suffix=.group client/mysql: unknown variable 'defaults-group-suffix=.group' /etc/my.cnf: [client-server.group] socket=/var/lib/mysql-multi/group/mysqld.sock user=bob /etc/my.other.cnf: socket=/var/lib/mysql-other/mysqld.sock TEST: defaults file read and suffix also applied $ client/mysql --defaults-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2) TEST: defaults extra file $ client/mysql --defaults-extra-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2)
8 years ago
defaults-group-suffix in print_defaults Also clarify which --{no-,}default* options, must be first. Sample output: $ client/mysql --help client/mysql Ver 15.1 Distrib 5.5.59-MariaDB, for Linux (x86_64) using readline 5.1 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Usage: client/mysql [OPTIONS] [database] Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf The following groups are read: mysql client client-server client-mariadb The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file. The following specify which files/groups are read (specified before other options): --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --defaults-group-suffix=# Additionally read default groups with # appended as a suffix. tests running from build directory: TEST: print defaults ignored as not first $ sql/mysqld --no-defaults --print-defaults --lc-messages-dir=${PWD}/sql/share TEST: no startup occurs as --print-defaults specified $ sql/mysqld --print-defaults --lc-messages-dir=${PWD}/sql/share sql/mysqld would have been started with the following arguments: --lc-messages-dir=/home/dan/repos/build-mariadb-5.5/sql/share TEST: default args can't be anywhere $ client/mysql --user=bob --defaults-file=/etc/my.cnf client/mysql: unknown variable 'defaults-file=/etc/my.cnf' $ client/mysql --user=bob --defaults-group-suffix=.group client/mysql: unknown variable 'defaults-group-suffix=.group' /etc/my.cnf: [client-server.group] socket=/var/lib/mysql-multi/group/mysqld.sock user=bob /etc/my.other.cnf: socket=/var/lib/mysql-other/mysqld.sock TEST: defaults file read and suffix also applied $ client/mysql --defaults-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2) TEST: defaults extra file $ client/mysql --defaults-extra-file=/etc/my.other.cnf --defaults-group-suffix=.group ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2)
8 years ago
WL#4738 streamline/simplify @@variable creation process Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
16 years ago
14 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
16 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
[MDEV-10570] Add Flashback support ==== Description ==== Flashback can rollback the instances/databases/tables to an old snapshot. It's implement on Server-Level by full image format binary logs (--binlog-row-image=FULL), so it supports all engines. Currently, it’s a feature inside mysqlbinlog tool (with --flashback arguments). Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine. ==== New Arguments to mysqlbinlog ==== --flashback (-B) It will let mysqlbinlog to work on FLASHBACK mode. ==== New Arguments to mysqld ==== --flashback Setup the server to use flashback. This enables binary log in row mode and will enable extra logging for DDL's needed by flashback feature ==== Example ==== I have a table "t" in database "test", we can compare the output with "--flashback" and without. #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" > /tmp/1.sql #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" -B > /tmp/2.sql Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime). And if you know the exact postion, "--start-postion" is also works, mysqlbinlog will output the flashback logs that can flashback to "--start-postion" position. ==== Implement ==== 1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation. 2. Just do following things: 2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT. For example: INSERT INTO t VALUES (...) ---> DELETE FROM t WHERE ... DELETE FROM t ... ---> INSERT INTO t VALUES (...) 2.2 For Update_Event, swapping the SET part and WHERE part. For example: UPDATE t SET cols1 = vals1 WHERE cols2 = vals2 ---> UPDATE t SET cols2 = vals2 WHERE cols1 = vals1 2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row. For example: DELETE FROM t WHERE id=1; DELETE FROM t WHERE id=2; ...; DELETE FROM t WHERE id=n; ---> DELETE FROM t WHERE id=n; ...; DELETE FROM t WHERE id=2; DELETE FROM t WHERE id=1; 2.4 Output those events from the last one to the first one which mis-operation happened. For example:
9 years ago
13 years ago
Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable. - Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria. - Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write mysql-test/r/features.result: Added test of Feature_delay_key_write mysql-test/r/key_cache.result: Updated tests as the number of blocks has changed mysql-test/r/mysqld--help.result: Updated result mysql-test/suite/maria/maria3.result: Updated result mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result: Test new variable mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test: Test new variable mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test: Test new variable mysql-test/t/features.test: Added test of Feature_delay_key_write mysql-test/t/key_cache.test: Updated tests as the number of blocks has changed mysys/mf_keycache.c: Made CHANGED_BLOCKS_HASH dynamic sql/handler.cc: Updated call to init_key_cache() sql/mysqld.cc: Added "Feature_delay_key_write" Added support for key-cache-file-hash-size sql/mysqld.h: Added support for key-cache-file-hash-size sql/sql_class.h: Added feature_files_opened_with_delayed_keys sql/sys_vars.cc: Added key_cache_file_hash_size storage/maria/ha_maria.cc: Added pagecache_file_hash_size Added counting of files with delay_key_write storage/maria/ma_checkpoint.c: Fixed compiler warning storage/maria/ma_pagecache.c: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_pagecache.h: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_rt_test.c: Updated parameters for init_pagecache() storage/maria/ma_test1.c: Updated parameters for init_pagecache() storage/maria/ma_test2.c: Updated parameters for init_pagecache() storage/maria/ma_test3.c: Updated parameters for init_pagecache() storage/maria/maria_chk.c: Updated parameters for init_pagecache() storage/maria/maria_ftdump.c: Updated parameters for init_pagecache() storage/maria/maria_pack.c: Updated parameters for init_pagecache() storage/maria/maria_read_log.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_consist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist2.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_single.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_first_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_max_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multithread-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_noflush-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_nologs-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_pagecache-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_purge-t.c: Updated parameters for init_pagecache() storage/myisam/ha_myisam.cc: Added counting of files with delay_key_write storage/myisam/mi_check.c: Updated call to init_key_cache() storage/myisam/mi_test1.c: Updated call to init_key_cache() storage/myisam/mi_test2.c: Updated call to init_key_cache() storage/myisam/mi_test3.c: Updated call to init_key_cache() storage/myisam/mi_test_all.sh: Fixed broken test storage/myisam/myisam_ftdump.c: Updated call to init_key_cache() storage/myisam/myisamchk.c: Updated call to init_key_cache() storage/myisam/myisamlog.c: Updated call to init_key_cache()
12 years ago
16 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
14 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
Implementation of Multi-source replication (MDEV:253) Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
13 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
Implementation of Multi-source replication (MDEV:253) Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
13 years ago
Implementation of Multi-source replication (MDEV:253) Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
13 years ago
MDEV 4427: query timeouts Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired. - Added timer functions based on pthread_cond_timedwait - Added kill_handlerton() to signal storage engines about kill/timeout - Added support for GRANT ... MAX_STATEMENT_TIME=# - Copy max_statement_time to current user, if stored in mysql.user - Added status variable max_statement_time_exceeded - Added KILL_TIMEOUT - Removed digest hash from performance schema tests as they change all the time. - Updated test results that changed because of the new user variables or new fields in mysql.user This functionallity is inspired by work done by Davi Arnaut at twitter. Test case is copied from Davi's work. Documentation can be found at https://kb.askmonty.org/en/how-to-limittimeout-queries/ mysql-test/r/mysqld--help.result: Updated for new help message mysql-test/suite/perfschema/r/all_instances.result: Added new mutex mysql-test/suite/sys_vars/r/max_statement_time_basic.result: Added testing of max_statement_time mysql-test/suite/sys_vars/t/max_statement_time_basic.test: Added testing of max_statement_time mysql-test/t/max_statement_time.test: Added testing of max_statement_time mysys/CMakeLists.txt: Added thr_timer mysys/my_init.c: mysys/mysys_priv.h: Added new mutex and condition variables Added new mutex and condition variables mysys/thr_timer.c: Added timer functions based on pthread_cond_timedwait() This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime() sql/lex.h: Added MAX_STATEMENT_TIME sql/log_event.cc: Safety fix (timeout should be threated as an interrupted query) sql/mysqld.cc: Added support for timers Added status variable max_statement_time_exceeded sql/share/errmsg-utf8.txt: Added ER_QUERY_TIMEOUT sql/signal_handler.cc: Added support for KILL_TIMEOUT sql/sql_acl.cc: Added support for GRANT ... MAX_STATEMENT_TIME=# Copy max_statement_time to current user sql/sql_class.cc: Added timer functionality to THD. Added thd_kill_timeout() sql/sql_class.h: Added timer functionality to THD. Added KILL_TIMEOUT Added max_statement_time variable in similar manner as long_query_time was done. sql/sql_connect.cc: Added handling of max_statement_time_exceeded sql/sql_parse.cc: Added starting and stopping timers for queries. sql/sql_show.cc: Added max_statement_time_exceeded for user/connects status in MariaDB 10.0 sql/sql_yacc.yy: Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0 sql/structs.h: Added max_statement_time user resource sql/sys_vars.cc: Added max_statement_time variables mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test Removed test as we require all fields in mysql.user table. scripts/mysql_system_tables.sql scripts/mysql_system_tables_data.sql scripts/mysql_system_tables_fix.sql Updated mysql.user with new max_statement_time field
11 years ago
Fix for bug#12695572 - "IMPROVE MDL PERFORMANCE IN PRE-VISTA BY CACHING OR REDUCING CREATEEVENT CALLS". 5.5 versions of MySQL server performed worse than 5.1 versions under single-connection workload in autocommit mode on Windows XP. Part of this slowdown can be attributed to overhead associated with constant creation/destruction of MDL_lock objects in the MDL subsystem. The problem is that creation/destruction of these objects causes creation and destruction of associated synchronization primitives, which are expensive on Windows XP. This patch tries to alleviate this problem by introducing a cache of unused MDL_object_lock objects. Instead of destroying such objects we put them into the cache and then reuse with a new key when creation of a new object is requested. To limit the size of this cache, a new --metadata-locks-cache-size start-up parameter was introduced. mysql-test/r/mysqld--help-notwin.result: Updated test after adding --metadata-locks-cache-size parameter. mysql-test/r/mysqld--help-win.result: Updated test after adding --metadata-locks-cache-size parameter. mysql-test/suite/sys_vars/r/metadata_locks_cache_size_basic.result: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic-master.opt: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic.test: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. sql/mdl.cc: Introduced caching of unused MDL_object_lock objects, in order to avoid costs associated with constant creation and destruction of such objects in single-connection workloads run in autocommit mode. Such costs can be pretty high on systems where creation and destruction of synchronization primitives require a system call (e.g. Windows XP). To implement this cache,a list of unused MDL_object_lock instances was added to MDL_map object. Instead of being destroyed MDL_object_lock instances are put into this list and re-used later when creation of a new instance is required. Also added MDL_lock::m_version counter to allow threads having outstanding references to an MDL_object_lock instance to notice that it has been moved to the unused objects list. Added a global variable for a start-up parameter that limits the size of the unused objects list. Note that we don't cache MDL_scoped_lock objects since they are supposed to be created only during execution of DDL statements and therefore should not affect performance much. sql/mdl.h: Added a global variable for start-up parameter that limits the size of the unused MDL_object_lock objects list and constant for its default value. sql/sql_plist.h: Added I_P_List<>::pop_front() function. sql/sys_vars.cc: Introduced --metadata-locks-cache-size start-up parameter for specifying size of the cache of unused MDL_object_lock objects.
14 years ago
MDEV-12387 Push conditions into materialized subqueries The logic and the implementation scheme are similar with the MDEV-9197 Pushdown conditions into non-mergeable views/derived tables How the push down is made on the example: select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 group by x); --> select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 where x>3 group by x having max(y)>10); The implementation scheme: 1. Search for the condition cond that depends only on the fields from the left part of the IN subquery (left_part) 2. Find fields F_group in the select of the right part of the IN subquery (right_part) that are used in the GROUP BY 3. Extract from the cond condition cond_where that depends only on the fields from the left_part that stay at the same places in the left_part (have the same indexes) as the F_group fields in the projection of the right_part 4. Transform cond_where so it can be pushed into the WHERE clause of the right_part and delete cond_where from the cond 5. Transform cond so it can be pushed into the HAVING clause of the right_part The optimization is made in the Item_in_subselect::pushdown_cond_for_in_subquery() and is controlled by the variable condition_pushdown_for_subquery. New test file in_subq_cond_pushdown.test is created. There are also some changes made for setup_jtbm_semi_joins(). Now it is decomposed into the 2 procedures: setup_degenerate_jtbm_semi_joins() that is called before optimize_cond() for cond and setup_jtbm_semi_joins() that is called after optimize_cond(). New setup_jtbm_semi_joins() is made in the way so that the result of its work is the same as if it was called before optimize_cond(). The code that is common for pushdown into materialized derived and into materialized IN subqueries is factored out into pushdown_cond_for_derived(), Item_in_subselect::pushdown_cond_for_in_subquery() and st_select_lex::pushdown_cond_into_where_clause().
8 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
14 years ago
Replication changes for CREATE OR REPLACE TABLE - CREATE TABLE is by default executed on the slave as CREATE OR REPLACE - DROP TABLE is by default executed on the slave as DROP TABLE IF NOT EXISTS This means that a slave will by default continue even if we try to create a table that existed on the slave (the table will be deleted and re-created) or if we try to drop a table that didn't exist on the slave. This should be safe as instead of having the slave stop because of an inconsistency between master and slave, it will fix the inconsistency. Those that would prefer to get a stopped slave instead for the above cases can set slave_ddl_exec_mode to STRICT. - Ensure that a CREATE OR REPLACE TABLE which dropped a table is replicated - DROP TABLE that generated an error on master is handled as an identical DROP TABLE on the slave (IF NOT EXISTS is not added in this case) - Added slave_ddl_exec_mode variable to decide how DDL's are replicated New logic for handling BEGIN GTID ... COMMIT from the binary log: - When we find a BEGIN GTID, we start a transaction and set OPTION_GTID_BEGIN - When we find COMMIT, we reset OPTION_GTID_BEGIN and execute the normal COMMIT code. - While OPTION_GTID_BEGIN is set: - We don't generate implict commits before or after statements - All tables are regarded as transactional tables in the binary log (to ensure things are executed exactly as on the master) - We reset OPTION_GTID_BEGIN also on rollback This will help ensuring that we don't get any sporadic commits (and thus new GTID's) on the slave and will help keep the GTID's between master and slave in sync. mysql-test/extra/rpl_tests/rpl_log.test: Added testing of mode slave_ddl_exec_mode=STRICT mysql-test/r/mysqld--help.result: New help messages mysql-test/suite/rpl/r/create_or_replace_mix.result: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/r/create_or_replace_row.result: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/r/create_or_replace_statement.result: Testing replication of create or replace mysql-test/suite/rpl/r/rpl_gtid_startpos.result: Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave. mysql-test/suite/rpl/r/rpl_row_log.result: Updated result mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Updated result mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated result mysql-test/suite/rpl/r/rpl_stm_log.result: Updated result mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated result mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result: Updated result mysql-test/suite/rpl/t/create_or_replace.inc: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_mix.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_mix.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_row.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_row.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_statement.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_statement.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/rpl_gtid_startpos.test: Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave. mysql-test/suite/rpl/t/rpl_stm_log.test: Removed some lines mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result: Testing of slave_ddl_exec_mode mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test: Testing of slave_ddl_exec_mode sql/handler.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. This is to ensure that statments are not commited too early if non transactional tables are used. sql/log.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. Also treat 'direct' log events as transactional (to get them logged as they where on the master) sql/log_event.cc: Ensure that the new error from DROP TABLE when trying to drop a view is treated same as the old one. Store error code that slave expects in THD. Set OPTION_GTID_BEGIN if we find a BEGIN. Reset OPTION_GTID_BEGIN if we find a COMMIT. sql/mysqld.cc: Added slave_ddl_exec_mode_options sql/mysqld.h: Added slave_ddl_exec_mode_options sql/rpl_gtid.cc: Reset OPTION_GTID_BEGIN if we record a gtid (safety) sql/sql_class.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. sql/sql_class.h: Added to THD: log_current_statement and slave_expected_error sql/sql_insert.cc: Ensure that CREATE OR REPLACE is logged if table was deleted. Don't do implicit commit for CREATE if we are under OPTION_GTID_BEGIN sql/sql_parse.cc: Change CREATE TABLE -> CREATE OR REPLACE TABLE for slaves Change DROP TABLE -> DROP TABLE IF EXISTS for slaves CREATE TABLE doesn't force implicit commit in case of OPTION_GTID_BEGIN Don't do commits before or after any statement if OPTION_GTID_BEGIN was set. sql/sql_priv.h: Added OPTION_GTID_BEGIN sql/sql_show.cc: Enhanced store_create_info() to also be able to handle CREATE OR REPLACE sql/sql_show.h: Updated prototype sql/sql_table.cc: Ensure that CREATE OR REPLACE is logged if table was deleted. sql/sys_vars.cc: Added slave_ddl_exec_mode sql/transaction.cc: Added warning if we got a GTID under OPTION_GTID_BEGIN
12 years ago
MDEV-5657: Parallel replication. Clean up and improve the parallel implementation code, mainly related to scheduling of work to threads and handling of stop and errors. Fix a lot of bugs in various corner cases that could lead to crashes or corruption. Fix that a single replication domain could easily grab all worker threads and stall all other domains; now a configuration variable --slave-domain-parallel-threads allows to limit the number of workers. Allow next event group to start as soon as previous group begins the commit phase (as opposed to when it ends it); this allows multiple event groups on the slave to participate in group commit, even when no other opportunities for parallelism are available. Various fixes: - Fix some races in the rpl.rpl_parallel test case. - Fix an old incorrect assertion in Log_event iocache read. - Fix repeated malloc/free of wait_for_commit and rpl_group_info objects. - Simplify wait_for_commit wakeup logic. - Fix one case in queue_for_group_commit() where killing one thread would fail to correctly signal the error to the next, causing loss of the transaction after slave restart. - Fix leaking of pthreads (and their allocated stack) due to missing PTHREAD_CREATE_DETACHED attribute. - Fix how one batch of group-committed transactions wait for the previous batch before starting to execute themselves. The old code had a very complex scheduling where the first transaction was handled differently, with subtle bugs in corner cases. Now each event group is always scheduled for a new worker (in a round-robin fashion amongst available workers). Keep a count of how many transactions have started to commit, and wait for that counter to reach the appropriate value. - Fix slave stop to wait for all workers to actually complete processing; before, the wait was for update of last_committed_sub_id, which happens a bit earlier, and could leave worker threads potentially accessing bits of the replication state that is no longer valid after slave stop. - Fix a couple of places where the test suite would kill a thread waiting inside enter_cond() in connection with debug_sync; debug_sync + kill can crash in rare cases due to a race with mysys_var_current_mutex in this case. - Fix some corner cases where we had enter_cond() but no exit_cond(). - Fix that we could get failure in wait_for_prior_commit() but forget to flag the error with my_error(). - Fix slave stop (both for normal stop and stop due to error). Now, at stop we pick a specific safe point (in terms of event groups executed) and make sure that all event groups before that point are executed to completion, and that no event group after start executing; this ensures a safe place to restart replication, even for non-transactional stuff/DDL. In error stop, make sure that all prior event groups are allowed to execute to completion, and that any later event groups that have started are rolled back, if possible. The old code could leave eg. T1 and T3 committed but T2 not, or it could even leave half a transaction not rolled back in some random worker, which would cause big problems when that worker was later reused after slave restart. - Fix the accounting of amount of events queued for one worker. Before, the amount was reduced immediately as soon as the events were dequeued (which happens all at once); this allowed twice the amount of events to be queued in memory for each single worker, which is not what users would expect. - Fix that an error set during execution of one event was sometimes not cleared before executing the next, causing problems with the error reporting. - Fix incorrect handling of thd->killed in worker threads.
12 years ago
Implementation of Multi-source replication (MDEV:253) Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
13 years ago
16 years ago
Fixed bug#11753187 (formerly known as bug 44585): SP_CACHE BEHAVES AS MEMORY LEAK. Background: - There are caches for stored functions and stored procedures (SP-cache); - There is no similar cache for events; - Triggers are cached together with TABLE objects; - Those SP-caches are per-session (i.e. specific to each session); - A stored routine is represented by a sp_head-instance internally; - SP-cache basically contains sp_head-objects of stored routines, which have been executed in a session; - sp_head-object is added into the SP-cache before the corresponding stored routine is executed; - SP-cache is flushed in the end of the session. The problem was that SP-cache might grow without any limit. Although this was not a pure memory leak (the SP-cache is flushed when session is closed), this is still a problem, because the user might take much memory by executing many stored routines. The patch fixes this problem in the least-intrusive way. A soft limit (similar to the size of table definition cache) is introduced. To represent such limit the new runtime configuration parameter 'stored_program_cache' is introduced. The value of this parameter is stored in the new global variable stored_program_cache_size that used to control the size of SP-cache to overflow. The parameter 'stored_program_cache' limits number of cached routines for each thread. It has the following min/default/max values given from support: min = 256, default = 256, max = 512 * 1024. Also it should be noted that this parameter limits the size of each cache (for stored procedures and for stored functions) separately. The SP-cache size is checked after top-level statement is parsed. If SP-cache size exceeds the limit specified by parameter 'stored_program_cache' then SP-cache is flushed and memory allocated for cache objects is freed. Such approach allows to flush cache safely when there are dependencies among stored routines. sql/mysqld.cc: Added global variable stored_program_cache_size to store value of configuration parameter 'stored-program-cache'. sql/mysqld.h: Added declaration of global variable stored_program_cache_size. sql/sp_cache.cc: Extended interface for sp_cache by adding helper routine sp_cache_enforce_limit to control size of stored routines cache for overflow. Also added method enforce_limit into class sp_cache that implements control of cache size for overflow. sql/sp_cache.h: Extended interface for sp_cache by adding standalone routine sp_cache_enforce_limit to control size of stored routines cache for overflow. sql/sql_parse.cc: Added flush of sp_cache after processing of next sql-statement received from a client. sql/sql_prepare.cc: Added flush of sp_cache after preparation/execution of next prepared sql-statement received from a client. sql/sys_vars.cc: Added support for configuration parameter stored-program-cache.
14 years ago
WL#4738 streamline/simplify @@variable creation process Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
16 years ago
16 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
[MDEV-10570] Add Flashback support ==== Description ==== Flashback can rollback the instances/databases/tables to an old snapshot. It's implement on Server-Level by full image format binary logs (--binlog-row-image=FULL), so it supports all engines. Currently, it’s a feature inside mysqlbinlog tool (with --flashback arguments). Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine. ==== New Arguments to mysqlbinlog ==== --flashback (-B) It will let mysqlbinlog to work on FLASHBACK mode. ==== New Arguments to mysqld ==== --flashback Setup the server to use flashback. This enables binary log in row mode and will enable extra logging for DDL's needed by flashback feature ==== Example ==== I have a table "t" in database "test", we can compare the output with "--flashback" and without. #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" > /tmp/1.sql #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" -B > /tmp/2.sql Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime). And if you know the exact postion, "--start-postion" is also works, mysqlbinlog will output the flashback logs that can flashback to "--start-postion" position. ==== Implement ==== 1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation. 2. Just do following things: 2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT. For example: INSERT INTO t VALUES (...) ---> DELETE FROM t WHERE ... DELETE FROM t ... ---> INSERT INTO t VALUES (...) 2.2 For Update_Event, swapping the SET part and WHERE part. For example: UPDATE t SET cols1 = vals1 WHERE cols2 = vals2 ---> UPDATE t SET cols2 = vals2 WHERE cols1 = vals1 2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row. For example: DELETE FROM t WHERE id=1; DELETE FROM t WHERE id=2; ...; DELETE FROM t WHERE id=n; ---> DELETE FROM t WHERE id=n; ...; DELETE FROM t WHERE id=2; DELETE FROM t WHERE id=1; 2.4 Output those events from the last one to the first one which mis-operation happened. For example:
9 years ago
13 years ago
14 years ago
Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable. - Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria. - Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write mysql-test/r/features.result: Added test of Feature_delay_key_write mysql-test/r/key_cache.result: Updated tests as the number of blocks has changed mysql-test/r/mysqld--help.result: Updated result mysql-test/suite/maria/maria3.result: Updated result mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result: Test new variable mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test: Test new variable mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test: Test new variable mysql-test/t/features.test: Added test of Feature_delay_key_write mysql-test/t/key_cache.test: Updated tests as the number of blocks has changed mysys/mf_keycache.c: Made CHANGED_BLOCKS_HASH dynamic sql/handler.cc: Updated call to init_key_cache() sql/mysqld.cc: Added "Feature_delay_key_write" Added support for key-cache-file-hash-size sql/mysqld.h: Added support for key-cache-file-hash-size sql/sql_class.h: Added feature_files_opened_with_delayed_keys sql/sys_vars.cc: Added key_cache_file_hash_size storage/maria/ha_maria.cc: Added pagecache_file_hash_size Added counting of files with delay_key_write storage/maria/ma_checkpoint.c: Fixed compiler warning storage/maria/ma_pagecache.c: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_pagecache.h: Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable storage/maria/ma_rt_test.c: Updated parameters for init_pagecache() storage/maria/ma_test1.c: Updated parameters for init_pagecache() storage/maria/ma_test2.c: Updated parameters for init_pagecache() storage/maria/ma_test3.c: Updated parameters for init_pagecache() storage/maria/maria_chk.c: Updated parameters for init_pagecache() storage/maria/maria_ftdump.c: Updated parameters for init_pagecache() storage/maria/maria_pack.c: Updated parameters for init_pagecache() storage/maria/maria_read_log.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_consist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_rwconsist2.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_pagecache_single.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_first_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_max_lsn-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_multithread-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_noflush-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_nologs-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_pagecache-t.c: Updated parameters for init_pagecache() storage/maria/unittest/ma_test_loghandler_purge-t.c: Updated parameters for init_pagecache() storage/myisam/ha_myisam.cc: Added counting of files with delay_key_write storage/myisam/mi_check.c: Updated call to init_key_cache() storage/myisam/mi_test1.c: Updated call to init_key_cache() storage/myisam/mi_test2.c: Updated call to init_key_cache() storage/myisam/mi_test3.c: Updated call to init_key_cache() storage/myisam/mi_test_all.sh: Fixed broken test storage/myisam/myisam_ftdump.c: Updated call to init_key_cache() storage/myisam/myisamchk.c: Updated call to init_key_cache() storage/myisam/myisamlog.c: Updated call to init_key_cache()
12 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
New option for slow logging (log_slow_disable_statements) This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
9 years ago
BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the stmt-cache and the trx-cache. This means that the resource used is twice the amount expected/defined by the user. The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the trx-cache is used. This behavior does not allow to distinguish which cache may be harming performance due to the extra disk accesses and needs to have its in-memory cache increased. To fix the problem, we introduced two new options and status variables related to the stmt-cache: Options: . binlog_stmt_cache_size . max_binlog_stmt_cache_size Status Variables: . binlog_stmt_cache_use . binlog_stmt_cache_disk_use So there are . binlog_cache_size that defines the size of the transactional cache for updates to transactional engines for the binary log. . binlog_stmt_cache_size that defines the size of the statement cache for updates to non-transactional engines for the binary log. . max_binlog_cache_size that sets the total size of the transactional cache. . max_binlog_stmt_cache_size that sets the total size of the statement cache. . binlog_cache_use that identifies the number of transactions that used the temporary transactional binary log cache. . binlog_cache_disk_use that identifies the number of transactions that used the temporary transactional binary log cache but that exceeded the value of binlog_cache_size. . binlog_stmt_cache_use that identifies the number of statements that used the temporary non-transactional binary log cache. . binlog_stmt_cache_disk_use that identifies the number of statements that used the temporary non-transactional binary log cache but that exceeded the value of binlog_stmt_cache_size. include/my_sys.h: Updated message on disk_writes' usage. mysql-test/extra/binlog_tests/binlog_cache_stat.test: Updated the test case and added code to check the new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test: Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. mysql-test/r/mysqld--help-notwin.result: Updated the result file. mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_row_cache_stat.result: Updated the result file. mysql-test/suite/binlog/r/binlog_stm_cache_stat.result: Updated the result file. mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result: Update the result file. mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result: Updated the result file. mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result: Updated the result file. mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result: Updated the result file. mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result: Updated the result file. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test: Added a test case to check the binlog_stmt_cache_size. mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt: Removed because there is no test case max_binlog_cache_size_func. mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test: Added a test case to check the system variable max_binlog_stmt_cache_size. sql/log.cc: There two main changes in here: . Changed the set_write_error() as an error message is set according to the type of the cache. . Created the function set_binlog_cache_info where references to the appropriate status and system variables are set and the server can smoothly compute statistics and set the maximum size for each cache. sql/log.h: Changed the signature of the function in order to identify the error message to be printed out as there is a different error code for each type of cache. sql/mysqld.cc: Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use. sql/mysqld.h: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size. sql/share/errmsg-utf8.txt: Added new error message related to the statement cache. sql/sys_vars.cc: Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
15 years ago
Implementation of Multi-source replication (MDEV:253) Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/ This code is based on code from Taobao, developed by Plinux Other things: - Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS - Almost all usage of 'active_mi' is deleted. - Added parameter to reset_logs() so that one can specify if new logs should be created. - Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex - Made max_relay_log_size depending on master connection. - Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings - Added commands to mysqladmin: start-all-slaves & stop-all-slaves - Removed logging of "next log '%s' is currently active | not active" - Fixed bug in my_vsnprintf() when using positional parameters with length - Added fn_ext2(), which returns pointer to last '.' in file name - max_relay_log_size now acts as a normal slave specific variable - Don't store replication position if innobase_overwrite_relay_log_info is not set - max_relay_log_size copies it's values from max_binlog_size at startup BUILD/SETUP.sh: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) client/mysqladmin.cc: Added commands start-all-slaves & stop-all-slaves client/mysqltest.cc: Added support for error names starting with 'W' Added connection_name support to --sync_with_master cmake/maintainer.cmake: Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it) include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name include/mysql/plugin.h: Added SHOW_SIMPLE_FUNC include/mysql/plugin_audit.h.pp: Updated signature file include/mysql/plugin_auth.h.pp: Updated signature file include/mysql/plugin_ftparser.h.pp: Updated signature file mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/include/setup_fake_relay_log.inc: There is no orphan relay log files anymore mysql-test/mysql-test-run.pl: Added multi_source to test suite mysql-test/r/flush.result: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/r/mysqld--help.result: Updated result mysql-test/r/mysqltest.result: Updated result mysql-test/r/parser.result: Updated result mysql-test/r/signal_code.result: Updated result after introducing new commands mysql-test/r/sp-code.result: Updated result after introducing new commands mysql-test/suite/multi_source: Tests for multi-source mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Test of logs mysql-test/suite/multi_source/info_logs.test: Test of logs mysql-test/suite/multi_source/my.cnf: Setup of multi-master tests Added log-warnings to get more information to the log files mysql-test/suite/multi_source/relaylog_events.result: Test relay log handling mysql-test/suite/multi_source/relaylog_events.test: Test relay log handling mysql-test/suite/multi_source/reset_slave.result: Test RESET SLAVE mysql-test/suite/multi_source/reset_slave.test: Test RESET SLAVE mysql-test/suite/multi_source/simple.result: Simple basic test of multi-source functionality mysql-test/suite/multi_source/simple.test: Simple basic test of multi-source functionality mysql-test/suite/multi_source/skip_counter.result: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/skip_counter.test: Testing skip_counter and max_relay_log_size mysql-test/suite/multi_source/syntax.result: Test of multi-source syntax mysql-test/suite/multi_source/syntax.test: Test of multi-source syntax mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: New warnings mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result: Improved error texts mysql-test/suite/rpl/r/rpl_flush_logs.result: Update results mysql-test/suite/rpl/r/rpl_heartbeat.result: Warning was removed mysql-test/suite/rpl/r/rpl_heartbeat_basic.result: Warning was removed mysql-test/suite/rpl/r/rpl_rotate_logs.result: Updated results because of new error messages mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/r/rpl_skip_replication.result: New error message mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated results after improved RESET SLAVE (we now use less relay log files) mysql-test/suite/rpl/t/rpl_flush_logs.test: Updated tests as relay log files is created a bit differently than before mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test: Test removed as the old DBUG_SYNC entries doesn't exist anymore mysql-test/suite/sys_vars/r/default_master_connection_basic.result: New test to test usage of default_master_connection mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Updated usage of sql_slave_skip_counter mysql-test/suite/sys_vars/t/default_master_connection_basic.test: New test to test usage of default_master_connection mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Updated test for multi-source mysql-test/t/flush.test: Added test for new syntax of flush relay logs (can't repeat relay logs or slave) mysql-test/t/parser.test: Updated test as master_pos_wait() now takes more arguments than before mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name plugin/semisync/semisync_master_plugin.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS sql/event_scheduler.cc: No reason to initialize slave_thread (it's guaranteed to be zero here) sql/item_create.cc: Added connection_name argument to master_pos_wait() Simplified code sql/item_func.cc: Added connection_name argument to master_pos_wait() sql/item_func.h: Added connection_name argument to master_pos_wait() sql/lex.h: Added SLAVES keyword sql/log.cc: Added tag "Master 'connection_name'" to slave errors that has a connection name. Added parameter to reset_logs() so that one can specify if new logs should be created. Removed some wrong casts Changed some constants to defines sql/log.h: Added parameter to reset_logs() Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added variable mysqld_server_initialized so that other functions can test if server is fully initialized. Free all slave data in one place (fewer ifdef's) Removed not needed call to close_active_mi() Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start. Made status variable slave_running multi-source safe max_relay_log_size copies it's values from max_binlog_size at startup SHOW_FUNC -> SHOW_SIMPLE_FUNC sql/mysqld.h: Added mysqld_server_initialized Removed max_relay_log_size sql/rpl_mi.cc: Store connection name and cmp_connection_name (only used for show full slave status) in Master_info Added code for Master_info_index, which handles storage of multi-master information Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code. Create Master_info_index::index_file_names once at init More DBUG_PRINT Give error if Master_info_index::check_duplicate_master_info fails Added start|stop all slaves sql/rpl_mi.h: Added connection_name and Master_info_index Updated prototypes sql/rpl_rli.cc: Added connection_name to relay log files. If we do a full reset, don't create any new relay log files. Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong Made executed_entries and max_relay_log_size depending on master connection. sql/set_var.cc: Fixed that one can get variable name also when one uses DEFAULT sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/share/errmsg-utf8.txt: Added new error messages needed for multi-source Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO Improved error message if connection exists sql/slave.cc: Moved things a bit around to make it easier to handle error conditions. Create a global master_info_index and add the "" connection to it Ensure that new Master_info doesn't fail. Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index. Delete not needed function close_active_mi(). One can achive same thing by calling end_slave(). Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column) Removed logging of "next log '%s' is currently active | not active" Added Slave_received_heartbeats and Slave_heartbeat_period sql/slave.h: Added new defines and prototypes sql/sql_base.cc: More DBUG_PRINT sql/sql_class.cc: Reset thd->connection_name and thd-->default_master_connection sql/sql_class.h: Added thd->connection_name and thd-->default_master_connection Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe. sql/sql_const.h: Added MAX_CONNECTION_NAME sql/sql_insert.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_lex.cc: Reset 'lex->verbose' (to simplify some sql_yacc.yy code) sql/sql_lex.h: Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_load.cc: thd->slave_thread -> thd->rli_slave Removed usage of active_mi sql/sql_parse.cc: Added support for connection_name to all SLAVE commands. - Instead of using active_mi, we now get the current Master_info from master_info_index. - Create new replication threads with CHANGE MASTER - Added support for show_all_master_info()- sql/sql_prepare.cc: Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP sql/sql_reload.cc: Made reset/full slave use master_info_index->get_master_info() instead of active_mi. If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index. Fixed issues with FLUSH RELAY LOGS sql/sql_repl.cc: sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it Add connection name to relay log files. Added connection name to errors. Added some logging for multi-master if log_warnings > 1 stop_slave(): - Don't check if thd is set. It's guaranteed to always be set. change_master(): - Check for duplicate connection names in change_master() - Check for wrong arguments first in file (to simplify error handling) - Register new connections in master_info_index ****** Added multi-source support to show relaylog events ****** check_duplicate_master_info() now generates an error Added parameter to reset_logs() ****** Updated calls to create_signed_file_name() sql/sql_show.cc: Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex sql/sql_yacc.yy: Added optional connection_name to a all relevant master/slave commands Added multi-source support to show relaylog events Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS sql/strfunc.cc: my_global.h shoud always be included first. sql/sys_vars.cc: Added variable default_master_connection Made variable sql_slave_skip_counter multi-source safe Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Added Sys_var_session_lexstring (needed for default_master_connection) Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter). Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable storage/example/ha_example.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/sphinx/ha_sphinx.cc: Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS storage/xtradb/handler/ha_innodb.cc: Don't store replication position if innobase_overwrite_relay_log_info is not set strings/my_vsnprintf.c: Fixed bug when using positional parameters with length
13 years ago
MDEV 4427: query timeouts Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired. - Added timer functions based on pthread_cond_timedwait - Added kill_handlerton() to signal storage engines about kill/timeout - Added support for GRANT ... MAX_STATEMENT_TIME=# - Copy max_statement_time to current user, if stored in mysql.user - Added status variable max_statement_time_exceeded - Added KILL_TIMEOUT - Removed digest hash from performance schema tests as they change all the time. - Updated test results that changed because of the new user variables or new fields in mysql.user This functionallity is inspired by work done by Davi Arnaut at twitter. Test case is copied from Davi's work. Documentation can be found at https://kb.askmonty.org/en/how-to-limittimeout-queries/ mysql-test/r/mysqld--help.result: Updated for new help message mysql-test/suite/perfschema/r/all_instances.result: Added new mutex mysql-test/suite/sys_vars/r/max_statement_time_basic.result: Added testing of max_statement_time mysql-test/suite/sys_vars/t/max_statement_time_basic.test: Added testing of max_statement_time mysql-test/t/max_statement_time.test: Added testing of max_statement_time mysys/CMakeLists.txt: Added thr_timer mysys/my_init.c: mysys/mysys_priv.h: Added new mutex and condition variables Added new mutex and condition variables mysys/thr_timer.c: Added timer functions based on pthread_cond_timedwait() This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime() sql/lex.h: Added MAX_STATEMENT_TIME sql/log_event.cc: Safety fix (timeout should be threated as an interrupted query) sql/mysqld.cc: Added support for timers Added status variable max_statement_time_exceeded sql/share/errmsg-utf8.txt: Added ER_QUERY_TIMEOUT sql/signal_handler.cc: Added support for KILL_TIMEOUT sql/sql_acl.cc: Added support for GRANT ... MAX_STATEMENT_TIME=# Copy max_statement_time to current user sql/sql_class.cc: Added timer functionality to THD. Added thd_kill_timeout() sql/sql_class.h: Added timer functionality to THD. Added KILL_TIMEOUT Added max_statement_time variable in similar manner as long_query_time was done. sql/sql_connect.cc: Added handling of max_statement_time_exceeded sql/sql_parse.cc: Added starting and stopping timers for queries. sql/sql_show.cc: Added max_statement_time_exceeded for user/connects status in MariaDB 10.0 sql/sql_yacc.yy: Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0 sql/structs.h: Added max_statement_time user resource sql/sys_vars.cc: Added max_statement_time variables mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test Removed test as we require all fields in mysql.user table. scripts/mysql_system_tables.sql scripts/mysql_system_tables_data.sql scripts/mysql_system_tables_fix.sql Updated mysql.user with new max_statement_time field
11 years ago
Fix for bug#12695572 - "IMPROVE MDL PERFORMANCE IN PRE-VISTA BY CACHING OR REDUCING CREATEEVENT CALLS". 5.5 versions of MySQL server performed worse than 5.1 versions under single-connection workload in autocommit mode on Windows XP. Part of this slowdown can be attributed to overhead associated with constant creation/destruction of MDL_lock objects in the MDL subsystem. The problem is that creation/destruction of these objects causes creation and destruction of associated synchronization primitives, which are expensive on Windows XP. This patch tries to alleviate this problem by introducing a cache of unused MDL_object_lock objects. Instead of destroying such objects we put them into the cache and then reuse with a new key when creation of a new object is requested. To limit the size of this cache, a new --metadata-locks-cache-size start-up parameter was introduced. mysql-test/r/mysqld--help-notwin.result: Updated test after adding --metadata-locks-cache-size parameter. mysql-test/r/mysqld--help-win.result: Updated test after adding --metadata-locks-cache-size parameter. mysql-test/suite/sys_vars/r/metadata_locks_cache_size_basic.result: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic-master.opt: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic.test: Added test coverage for newly introduced --metadata_locks_cache_size start-up parameter and corresponding global read-only variable. sql/mdl.cc: Introduced caching of unused MDL_object_lock objects, in order to avoid costs associated with constant creation and destruction of such objects in single-connection workloads run in autocommit mode. Such costs can be pretty high on systems where creation and destruction of synchronization primitives require a system call (e.g. Windows XP). To implement this cache,a list of unused MDL_object_lock instances was added to MDL_map object. Instead of being destroyed MDL_object_lock instances are put into this list and re-used later when creation of a new instance is required. Also added MDL_lock::m_version counter to allow threads having outstanding references to an MDL_object_lock instance to notice that it has been moved to the unused objects list. Added a global variable for a start-up parameter that limits the size of the unused objects list. Note that we don't cache MDL_scoped_lock objects since they are supposed to be created only during execution of DDL statements and therefore should not affect performance much. sql/mdl.h: Added a global variable for start-up parameter that limits the size of the unused MDL_object_lock objects list and constant for its default value. sql/sql_plist.h: Added I_P_List<>::pop_front() function. sql/sys_vars.cc: Introduced --metadata-locks-cache-size start-up parameter for specifying size of the cache of unused MDL_object_lock objects.
14 years ago
Added some fixes that should make MyISAM & Aria REPAIR work with more than 4G records - If one specifies --force twice to myisamchk and aria_chk, then we will try to finnish the repair even if sort_buffer would be too small. This was done by dynamically allocate buffer handler objects as long as memory lasts. - New option for myisamchk and aria_chk: create-missing-keys - Changed default size of myisam_sort_buffer_size from 8M to 128M. - Changed default size of sort_buffer_size in aria_chk from 128M to 256M. - Increased information in error message about 'sort_buffer_size' beeing to small. - Print also to 'show warnings' if repair was retried. - Increased size of internal sort-buffer-readers from 16K to 128K - Changed printing of 'number of records' to use %ll instead of casting to long - Changed buffer sizes for myisam and aria to use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines. include/my_global.h: Added MY_ALIGN_DOWN() to get previous alignment (for big memory areas) include/myisam.h: Increased size of types to be able to handle more records include/myisamchk.h: Increased size of types to be able to handle more records Added T_FORCE_SORT_MEMORY to force repair to work even if sort_buffer would not be big enough mysql-test/r/myisam.result: Updated result mysql-test/r/mysqld--help.result: Updated result mysql-test/r/repair.result: Updated result mysql-test/suite/maria/maria.result: Added test cases for some fixed bugs in MyISAM to verify that Aria doesn't have them too. mysql-test/suite/maria/maria.test: Added test cases for some fixed bugs in MyISAM to verify that Aria doesn't have them too. mysql-test/suite/maria/maria3.result: Updated result after sort buffer size increase mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result: Updated result after sort buffer size increase mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result: Updated result after sort buffer size increase mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test: Updated result after sort buffer size increase mysql-test/t/myisam.test: Fixed error messages to not print system specific data mysql-test/t/repair.test: Fixed error messages to not print system specific data storage/maria/ha_maria.cc: Print also to 'show warnings' if repair was retried Changed default size of sort_buffer_size from 128M to 256M (same as in mysqld) storage/maria/ma_check.c: Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT storage/maria/ma_sort.c: Increased size of internal sort-buffer-readers from 16K to 128K Increased size of types to be able to handle more records Added support for T_FORCE_SORT_MEMORY Don't allocate too many extra BUFFPEK at a time (they are probably not needed) Improved error message for "sort_buffer_size is too small" Changed printing of 'number of records' to use %ll instead of casting to long Fixed bug where maria_update_key_parts() was called too early. Fixed bug in detecting result from read_to_buffer(). Added 'out of memory' checking when calling 'alloc_dynamic()'. storage/maria/maria_chk.c: Added --create-missing-keys If one specifies --force twice then we will try to finnish the repair even if sort_buffer would be too small. check_param.sort_buffer_length varialble was used with wrong type. storage/maria/maria_def.h: Increased size of types to be able to handle more records Use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT storage/maria/maria_ftdump.c: Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT storage/maria/maria_read_log.c: Use PAGE_BUFFER_INIT for page cache storage/myisam/ha_myisam.cc: Changed default size of myisam_sort_buffer_size from 8M to 128M storage/myisam/mi_check.c: Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT storage/myisam/myisam_ftdump.c: Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT storage/myisam/myisamchk.c: Added --create-missing-keys If one specifies --force twice then we will try to finnish the repair even if sort_buffer would be too small. check_param.sort_buffer_length varialble was used with wrong type. Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT storage/myisam/myisamdef.h: Increased SORT_BUFFER_INIT to 64M (speeds up repair a lot and most machines have nowadays a lot of memory) Use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT storage/myisam/sort.c: Increased size of internal sort-buffer-readers from 16K to 128K Increased size of types to be able to handle more records Added support for T_FORCE_SORT_MEMORY Don't allocate too many extra BUFFPEK at a time (they are probably not needed) Improved error message for "sort_buffer_size is too small" Changed printing of 'number of records' to use %ll instead of casting to long Fixed bug in detecting result from read_to_buffer(). Added 'out of memory' checking when calling 'alloc_dynamic()'.
13 years ago
MDEV-12387 Push conditions into materialized subqueries The logic and the implementation scheme are similar with the MDEV-9197 Pushdown conditions into non-mergeable views/derived tables How the push down is made on the example: select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 group by x); --> select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 where x>3 group by x having max(y)>10); The implementation scheme: 1. Search for the condition cond that depends only on the fields from the left part of the IN subquery (left_part) 2. Find fields F_group in the select of the right part of the IN subquery (right_part) that are used in the GROUP BY 3. Extract from the cond condition cond_where that depends only on the fields from the left_part that stay at the same places in the left_part (have the same indexes) as the F_group fields in the projection of the right_part 4. Transform cond_where so it can be pushed into the WHERE clause of the right_part and delete cond_where from the cond 5. Transform cond so it can be pushed into the HAVING clause of the right_part The optimization is made in the Item_in_subselect::pushdown_cond_for_in_subquery() and is controlled by the variable condition_pushdown_for_subquery. New test file in_subq_cond_pushdown.test is created. There are also some changes made for setup_jtbm_semi_joins(). Now it is decomposed into the 2 procedures: setup_degenerate_jtbm_semi_joins() that is called before optimize_cond() for cond and setup_jtbm_semi_joins() that is called after optimize_cond(). New setup_jtbm_semi_joins() is made in the way so that the result of its work is the same as if it was called before optimize_cond(). The code that is common for pushdown into materialized derived and into materialized IN subqueries is factored out into pushdown_cond_for_derived(), Item_in_subselect::pushdown_cond_for_in_subquery() and st_select_lex::pushdown_cond_into_where_clause().
8 years ago
16 years ago
16 years ago
16 years ago
Add more execution stages (commit, rollback, etc) This was done to get more information about where time is spent. Now we can get proper timing for time spent in commit, rollback, binlog write etc. Following stages was added: - Commit - Commit_implicit - Rollback - Rollback implicit - Binlog write - Init for update - This is used instead of "Init" for insert, update and delete. - Staring cleanup Following stages where changed: - "Unlocking tables" stage reset stage to previous stage at end - "binlog write" stage resets stage to previous stage at end - "end" -> "end of update loop" - "cleaning up" -> "Reset for next command" - Added stage_searching_rows_for_update when searching for rows to be deleted. Other things: - Renamed all stages to start with big letter (before there was no consitency) - Increased performance_schema_max_stage_classes from 150 to 160. - Most of the test changes in performance schema comes from renaming of stages. - Removed duplicate output of variables and inital state in a lot of performance schema tests. This was done to make it easier to change a default value for a performance variable without affecting all tests. - Added start_server_variables.test to check configuration - Removed some duplicate "closing tables" stages - Updated position for "stage_init_update" and "stage_updating" for delete, insert and update to be just before update loop (for more exact timing). - Don't set "Checking permissions" twice in a row. - Remove stage_end stage from creating views (not done for create table either). - Updated default performance history size from 10 to 20 because of new stages - Ensure that ps_enabled is correct (to be used in a later patch)
8 years ago
MDEV-11952 Oracle-style packages: stage#5 - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
8 years ago
16 years ago
Fixes to get valgrind to work with jemalloc - Added MALLOC_LIBRARY variable to hold name of malloc library - Back ported valgrind related fixes from jemalloc 3.4.1 to the included jemalloc 3.3.1 - Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1 - Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc - Show version related variables in mysqld --help -- Added SHOW_VALUE_IN_HELP marker Increased back_log to 150 as the original value was a bit too small CMakeLists.txt: Added MALLOC_LIBRARY variable to hold name of malloc library cmake/jemalloc.cmake: Added MALLOC_LIBRARY variable to hold name of malloc library config.h.cmake: Added MALLOC_LIBRARY variable to hold name of malloc library extra/jemalloc/ChangeLog: Updates changelog extra/jemalloc/include/jemalloc/internal/arena.h: Backported valgrind fixes from jemalloc 3.4.1 extra/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in: Backported valgrind fixes from jemalloc 3.4.1 extra/jemalloc/include/jemalloc/internal/private_namespace.h: Backported valgrind fixes from jemalloc 3.4.1 extra/jemalloc/include/jemalloc/internal/tcache.h: Backported valgrind fixes from jemalloc 3.4.1 extra/jemalloc/src/arena.c: Backported valgrind fixes from jemalloc 3.4.1 include/my_bitmap.h: Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1 mysql-test/mysql-test-run.pl: Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc mysql-test/valgrind.supp: Supression of memory leak in OpenSuse 12.3 mysys/my_bitmap.c: Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() sql/ha_ndbcluster_binlog.cc: Renames sql/ha_ndbcluster_cond.h: Renames sql/ha_partition.cc: Renames sql/handler.cc: Renames sql/item_subselect.cc: Renames sql/log_event.cc: Renames sql/log_event_old.cc: Renames sql/mysqld.cc: Renames Show version related variables in mysqld --help sql/opt_range.cc: Renames sql/opt_table_elimination.cc: Renames sql/partition_info.cc: Renames sql/rpl_injector.h: Renames sql/set_var.h: Renames sql/slave.cc: Renames sql/sql_bitmap.h: Renames sql/sql_insert.cc: Renames sql/sql_lex.h: Renames sql/sql_parse.cc: Renames sql/sql_partition.cc: Renames sql/sql_select.cc: Renames sql/sql_show.cc: Renames sql/sql_update.cc: Renames sql/sys_vars.cc: Show version related variables in mysqld --help sql/sys_vars.h: Added SHOW_VALUE_IN_HELP marker for variables that should be shown in --help sql/table.cc: Renames sql/table.h: Removed not used bitmap_init_value storage/connect/ha_connect.cc: Removed compiler warning storage/maria/ma_open.c: Renames unittest/mysys/bitmap-t.c: Renames
12 years ago
BUG#13333431 - INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT Problem - The default port number shown in SHOW SLAVE HOSTS is always 3306 though the slave is actually listening on a different port number. This is a problem as the user can not be sure whether this port value can be trusted and so client trying to read replication topology can get confused. Fix - 3306 ceases to be the default value of report-port. Moreover report-port does not have a static default any longer. Instead we initialize report-port to 0 as the new default value and change it based on two checks : 1) If report_port is not set, the slave reports the port number its listening on. (i.e. if report-port is not set we get the actual value of the slave's port number). 2) If report-port is set, we show the value report-port is set to, as the slave's port number. mysql-test/include/show_slave_hosts.inc: A .inc file is added to use show slave hosts in the new test added. mysql-test/r/mysqld--help-notwin.result: Updated the result file to show the default value passed for report-port. mysql-test/suite/rpl/r/rpl_report_port.result: The result file for the new test that is added. mysql-test/suite/rpl/r/rpl_show_slave_hosts.result: Updated the result file to show the default value passed for report-port. mysql-test/suite/rpl/t/rpl_report_port-slave.opt: Option file for the new test added. mysql-test/suite/rpl/t/rpl_report_port.test: Added a test to check the correct functionality of report-port. We check this by running the replication twice. In the first run we do not set the value of report-port through the opt file and get the actual port number of the slave's port. We then restart the server with report-port set to some value (in this case 9000) and check the value reported for the slave's port number. mysql-test/suite/sys_vars/t/report_port_basic.test: Update the test file to show the value for report-port. It is replaced with SLAVE_PORT as the actual value of the report-port will change with each run. sql/mysqld.cc: Changed the value reported by report port : 1. If the value for report-port is not set we assign report-port to be the actual port number of the slave (mysqld_port). 2. If report-port is set we get the value set for the report-port. sql/sys_vars.cc: Passed 0 as the default value of the report-port.
14 years ago
Replication changes for CREATE OR REPLACE TABLE - CREATE TABLE is by default executed on the slave as CREATE OR REPLACE - DROP TABLE is by default executed on the slave as DROP TABLE IF NOT EXISTS This means that a slave will by default continue even if we try to create a table that existed on the slave (the table will be deleted and re-created) or if we try to drop a table that didn't exist on the slave. This should be safe as instead of having the slave stop because of an inconsistency between master and slave, it will fix the inconsistency. Those that would prefer to get a stopped slave instead for the above cases can set slave_ddl_exec_mode to STRICT. - Ensure that a CREATE OR REPLACE TABLE which dropped a table is replicated - DROP TABLE that generated an error on master is handled as an identical DROP TABLE on the slave (IF NOT EXISTS is not added in this case) - Added slave_ddl_exec_mode variable to decide how DDL's are replicated New logic for handling BEGIN GTID ... COMMIT from the binary log: - When we find a BEGIN GTID, we start a transaction and set OPTION_GTID_BEGIN - When we find COMMIT, we reset OPTION_GTID_BEGIN and execute the normal COMMIT code. - While OPTION_GTID_BEGIN is set: - We don't generate implict commits before or after statements - All tables are regarded as transactional tables in the binary log (to ensure things are executed exactly as on the master) - We reset OPTION_GTID_BEGIN also on rollback This will help ensuring that we don't get any sporadic commits (and thus new GTID's) on the slave and will help keep the GTID's between master and slave in sync. mysql-test/extra/rpl_tests/rpl_log.test: Added testing of mode slave_ddl_exec_mode=STRICT mysql-test/r/mysqld--help.result: New help messages mysql-test/suite/rpl/r/create_or_replace_mix.result: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/r/create_or_replace_row.result: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/r/create_or_replace_statement.result: Testing replication of create or replace mysql-test/suite/rpl/r/rpl_gtid_startpos.result: Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave. mysql-test/suite/rpl/r/rpl_row_log.result: Updated result mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Updated result mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result: Updated result mysql-test/suite/rpl/r/rpl_stm_log.result: Updated result mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result: Updated result mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result: Updated result mysql-test/suite/rpl/t/create_or_replace.inc: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_mix.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_mix.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_row.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_row.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_statement.cnf: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/create_or_replace_statement.test: Testing of CREATE OR REPLACE TABLE with replication mysql-test/suite/rpl/t/rpl_gtid_startpos.test: Test must be run in slave_ddl_exec_mode=STRICT as part of the test depends on that DROP TABLE should fail on slave. mysql-test/suite/rpl/t/rpl_stm_log.test: Removed some lines mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result: Testing of slave_ddl_exec_mode mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test: Testing of slave_ddl_exec_mode sql/handler.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. This is to ensure that statments are not commited too early if non transactional tables are used. sql/log.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. Also treat 'direct' log events as transactional (to get them logged as they where on the master) sql/log_event.cc: Ensure that the new error from DROP TABLE when trying to drop a view is treated same as the old one. Store error code that slave expects in THD. Set OPTION_GTID_BEGIN if we find a BEGIN. Reset OPTION_GTID_BEGIN if we find a COMMIT. sql/mysqld.cc: Added slave_ddl_exec_mode_options sql/mysqld.h: Added slave_ddl_exec_mode_options sql/rpl_gtid.cc: Reset OPTION_GTID_BEGIN if we record a gtid (safety) sql/sql_class.cc: Regard all tables as transactional in commit if OPTION_GTID_BEGIN is set. sql/sql_class.h: Added to THD: log_current_statement and slave_expected_error sql/sql_insert.cc: Ensure that CREATE OR REPLACE is logged if table was deleted. Don't do implicit commit for CREATE if we are under OPTION_GTID_BEGIN sql/sql_parse.cc: Change CREATE TABLE -> CREATE OR REPLACE TABLE for slaves Change DROP TABLE -> DROP TABLE IF EXISTS for slaves CREATE TABLE doesn't force implicit commit in case of OPTION_GTID_BEGIN Don't do commits before or after any statement if OPTION_GTID_BEGIN was set. sql/sql_priv.h: Added OPTION_GTID_BEGIN sql/sql_show.cc: Enhanced store_create_info() to also be able to handle CREATE OR REPLACE sql/sql_show.h: Updated prototype sql/sql_table.cc: Ensure that CREATE OR REPLACE is logged if table was deleted. sql/sys_vars.cc: Added slave_ddl_exec_mode sql/transaction.cc: Added warning if we got a GTID under OPTION_GTID_BEGIN
12 years ago
MDEV-5657: Parallel replication. Clean up and improve the parallel implementation code, mainly related to scheduling of work to threads and handling of stop and errors. Fix a lot of bugs in various corner cases that could lead to crashes or corruption. Fix that a single replication domain could easily grab all worker threads and stall all other domains; now a configuration variable --slave-domain-parallel-threads allows to limit the number of workers. Allow next event group to start as soon as previous group begins the commit phase (as opposed to when it ends it); this allows multiple event groups on the slave to participate in group commit, even when no other opportunities for parallelism are available. Various fixes: - Fix some races in the rpl.rpl_parallel test case. - Fix an old incorrect assertion in Log_event iocache read. - Fix repeated malloc/free of wait_for_commit and rpl_group_info objects. - Simplify wait_for_commit wakeup logic. - Fix one case in queue_for_group_commit() where killing one thread would fail to correctly signal the error to the next, causing loss of the transaction after slave restart. - Fix leaking of pthreads (and their allocated stack) due to missing PTHREAD_CREATE_DETACHED attribute. - Fix how one batch of group-committed transactions wait for the previous batch before starting to execute themselves. The old code had a very complex scheduling where the first transaction was handled differently, with subtle bugs in corner cases. Now each event group is always scheduled for a new worker (in a round-robin fashion amongst available workers). Keep a count of how many transactions have started to commit, and wait for that counter to reach the appropriate value. - Fix slave stop to wait for all workers to actually complete processing; before, the wait was for update of last_committed_sub_id, which happens a bit earlier, and could leave worker threads potentially accessing bits of the replication state that is no longer valid after slave stop. - Fix a couple of places where the test suite would kill a thread waiting inside enter_cond() in connection with debug_sync; debug_sync + kill can crash in rare cases due to a race with mysys_var_current_mutex in this case. - Fix some corner cases where we had enter_cond() but no exit_cond(). - Fix that we could get failure in wait_for_prior_commit() but forget to flag the error with my_error(). - Fix slave stop (both for normal stop and stop due to error). Now, at stop we pick a specific safe point (in terms of event groups executed) and make sure that all event groups before that point are executed to completion, and that no event group after start executing; this ensures a safe place to restart replication, even for non-transactional stuff/DDL. In error stop, make sure that all prior event groups are allowed to execute to completion, and that any later event groups that have started are rolled back, if possible. The old code could leave eg. T1 and T3 committed but T2 not, or it could even leave half a transaction not rolled back in some random worker, which would cause big problems when that worker was later reused after slave restart. - Fix the accounting of amount of events queued for one worker. Before, the amount was reduced immediately as soon as the events were dequeued (which happens all at once); this allowed twice the amount of events to be queued in memory for each single worker, which is not what users would expect. - Fix that an error set during execution of one event was sometimes not cleared before executing the next, causing problems with the error reporting. - Fix incorrect handling of thd->killed in worker threads.
12 years ago
16 years ago
Fixed bug#11753187 (formerly known as bug 44585): SP_CACHE BEHAVES AS MEMORY LEAK. Background: - There are caches for stored functions and stored procedures (SP-cache); - There is no similar cache for events; - Triggers are cached together with TABLE objects; - Those SP-caches are per-session (i.e. specific to each session); - A stored routine is represented by a sp_head-instance internally; - SP-cache basically contains sp_head-objects of stored routines, which have been executed in a session; - sp_head-object is added into the SP-cache before the corresponding stored routine is executed; - SP-cache is flushed in the end of the session. The problem was that SP-cache might grow without any limit. Although this was not a pure memory leak (the SP-cache is flushed when session is closed), this is still a problem, because the user might take much memory by executing many stored routines. The patch fixes this problem in the least-intrusive way. A soft limit (similar to the size of table definition cache) is introduced. To represent such limit the new runtime configuration parameter 'stored_program_cache' is introduced. The value of this parameter is stored in the new global variable stored_program_cache_size that used to control the size of SP-cache to overflow. The parameter 'stored_program_cache' limits number of cached routines for each thread. It has the following min/default/max values given from support: min = 256, default = 256, max = 512 * 1024. Also it should be noted that this parameter limits the size of each cache (for stored procedures and for stored functions) separately. The SP-cache size is checked after top-level statement is parsed. If SP-cache size exceeds the limit specified by parameter 'stored_program_cache' then SP-cache is flushed and memory allocated for cache objects is freed. Such approach allows to flush cache safely when there are dependencies among stored routines. sql/mysqld.cc: Added global variable stored_program_cache_size to store value of configuration parameter 'stored-program-cache'. sql/mysqld.h: Added declaration of global variable stored_program_cache_size. sql/sp_cache.cc: Extended interface for sp_cache by adding helper routine sp_cache_enforce_limit to control size of stored routines cache for overflow. Also added method enforce_limit into class sp_cache that implements control of cache size for overflow. sql/sp_cache.h: Extended interface for sp_cache by adding standalone routine sp_cache_enforce_limit to control size of stored routines cache for overflow. sql/sql_parse.cc: Added flush of sp_cache after processing of next sql-statement received from a client. sql/sql_prepare.cc: Added flush of sp_cache after preparation/execution of next prepared sql-statement received from a client. sql/sys_vars.cc: Added support for configuration parameter stored-program-cache.
14 years ago
WL#4738 streamline/simplify @@variable creation process Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies CMakeLists.txt: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled client/mysql.cc: don't crash with --show-warnings when mysqld dies config/ac-macros/plugins.m4: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled include/my_getopt.h: comments include/my_pthread.h: fix double #define mysql-test/mysql-test-run.pl: run sys_vars suite by default properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0 escape gdb command line arguments mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: init_slave+utf8 bug mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: init_slave+utf8 bug mysys/my_getopt.c: Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) mysys/typelib.c: support for flagset sql/ha_ndbcluster.cc: backport from telco tree sql/item_func.cc: Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters sql/sql_builtin.cc.in: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled sql/sql_plugin.cc: Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#32902 plugin variables don't know their names Bug#44797 plugins w/o command-line options have no disabling option in --help sql/sys_vars.cc: all server variables are defined here storage/myisam/ft_parser.c: remove unnecessary updates of param->quot storage/myisam/ha_myisam.cc: myisam_* variables belong here strings/my_vsnprintf.c: %o and %llx unittest/mysys/my_vsnprintf-t.c: %o and %llx tests vio/viosocket.c: bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
16 years ago
  1. Windows bug: happens when a new line is exactly at the right offset.
  2. The following options may be given as the first argument:
  3. --print-defaults Print the program argument list and exit.
  4. --no-defaults Don't read default options from any option file.
  5. The following specify which files/extra groups are read (specified before remaining options):
  6. --defaults-file=# Only read default options from the given file #.
  7. --defaults-extra-file=# Read this file after the global files are read.
  8. --defaults-group-suffix=# Additionally read default groups with # appended as a suffix.
  9. --allow-suspicious-udfs
  10. Allows use of UDFs consisting of only one symbol xxx()
  11. without corresponding xxx_init() or xxx_deinit(). That
  12. also means that one can load any function from any
  13. library, for example exit() from libc.so
  14. --alter-algorithm[=name]
  15. Specify the alter table algorithm. One of: DEFAULT, COPY,
  16. INPLACE, NOCOPY, INSTANT
  17. -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode
  18. will also set transaction isolation level 'serializable'.
  19. --auto-increment-increment[=#]
  20. Auto-increment columns are incremented by this
  21. --auto-increment-offset[=#]
  22. Offset added to Auto-increment columns. Used when
  23. auto-increment-increment != 1
  24. --autocommit Set default value for autocommit (0 or 1)
  25. (Defaults to on; use --skip-autocommit to disable.)
  26. --automatic-sp-privileges
  27. Creating and dropping stored procedures alters ACLs
  28. (Defaults to on; use --skip-automatic-sp-privileges to disable.)
  29. --back-log=# The number of outstanding connection requests MariaDB can
  30. have. This comes into play when the main MariaDB thread
  31. gets very many connection requests in a very short time
  32. (Automatically configured unless set explicitly)
  33. -b, --basedir=name Path to installation directory. All paths are usually
  34. resolved relative to this
  35. --big-tables Old variable, which if set to 1, allows large result sets
  36. by saving all temporary sets to disk, avoiding 'table
  37. full' errors. No longer needed, as the server now handles
  38. this automatically. sql_big_tables is a synonym.
  39. --bind-address=name IP address to bind to.
  40. --binlog-annotate-row-events
  41. Tells the master to annotate RBR events with the
  42. statement that caused these events
  43. (Defaults to on; use --skip-binlog-annotate-row-events to disable.)
  44. --binlog-cache-size=#
  45. The size of the transactional cache for updates to
  46. transactional engines for the binary log. If you often
  47. use transactions containing many statements, you can
  48. increase this to get more performance
  49. --binlog-checksum=name
  50. Type of BINLOG_CHECKSUM_ALG. Include checksum for log
  51. events in the binary log. One of: NONE, CRC32
  52. --binlog-commit-wait-count=#
  53. If non-zero, binlog write will wait at most
  54. binlog_commit_wait_usec microseconds for at least this
  55. many commits to queue up for group commit to the binlog.
  56. This can reduce I/O on the binlog and provide increased
  57. opportunity for parallel apply on the slave, but too high
  58. a value will decrease commit throughput.
  59. --binlog-commit-wait-usec=#
  60. Maximum time, in microseconds, to wait for more commits
  61. to queue up for binlog group commit. Only takes effect if
  62. the value of binlog_commit_wait_count is non-zero.
  63. --binlog-direct-non-transactional-updates
  64. Causes updates to non-transactional engines using
  65. statement format to be written directly to binary log.
  66. Before using this option make sure that there are no
  67. dependencies between transactional and non-transactional
  68. tables such as in the statement INSERT INTO t_myisam
  69. SELECT * FROM t_innodb; otherwise, slaves may diverge
  70. from the master.
  71. --binlog-do-db=name Tells the master it should log updates for the specified
  72. database, and exclude all others not explicitly
  73. mentioned.
  74. --binlog-file-cache-size=#
  75. The size of file cache for the binary log
  76. --binlog-format=name
  77. What form of binary logging the master will use: either
  78. ROW for row-based binary logging, STATEMENT for
  79. statement-based binary logging, or MIXED. MIXED is
  80. statement-based binary logging except for those
  81. statements where only row-based is correct: those which
  82. involve user-defined functions (i.e. UDFs) or the UUID()
  83. function; for those, row-based binary logging is
  84. automatically used.
  85. --binlog-ignore-db=name
  86. Tells the master that updates to the given database
  87. should not be logged to the binary log.
  88. --binlog-optimize-thread-scheduling
  89. Run fast part of group commit in a single thread, to
  90. optimize kernel thread scheduling. On by default. Disable
  91. to run each transaction in group commit in its own
  92. thread, which can be slower at very high concurrency.
  93. This option is mostly for testing one algorithm versus
  94. the other, and it should not normally be necessary to
  95. change it.
  96. (Defaults to on; use --skip-binlog-optimize-thread-scheduling to disable.)
  97. --binlog-row-event-max-size=#
  98. The maximum size of a row-based binary log event in
  99. bytes. Rows will be grouped into events smaller than this
  100. size if possible. The value has to be a multiple of 256.
  101. --binlog-row-image=name
  102. Controls whether rows should be logged in 'FULL',
  103. 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all
  104. columns in the before and after image are logged.
  105. 'NOBLOB', means that mysqld avoids logging blob columns
  106. whenever possible (eg, blob column was not changed or is
  107. not part of primary key). 'MINIMAL', means that a PK
  108. equivalent (PK columns or full row if there is no PK in
  109. the table) is logged in the before image, and only
  110. changed columns are logged in the after image. (Default:
  111. FULL).
  112. --binlog-stmt-cache-size=#
  113. The size of the statement cache for updates to
  114. non-transactional engines for the binary log. If you
  115. often use statements updating a great number of rows, you
  116. can increase this to get more performance.
  117. --bootstrap Used by mysql installation scripts.
  118. --bulk-insert-buffer-size=#
  119. Size of tree cache used in bulk insert optimisation. Note
  120. that this is a limit per thread!
  121. --character-set-client-handshake
  122. Don't ignore client side character set value sent during
  123. handshake.
  124. (Defaults to on; use --skip-character-set-client-handshake to disable.)
  125. --character-set-filesystem=name
  126. Set the filesystem character set.
  127. -C, --character-set-server=name
  128. Set the default character set.
  129. --character-sets-dir=name
  130. Directory where character sets are
  131. -r, --chroot=name Chroot mysqld daemon during startup.
  132. --collation-server=name
  133. Set the default collation.
  134. --column-compression-threshold=#
  135. Minimum column data length eligible for compression
  136. --column-compression-zlib-level=#
  137. zlib compression level (1 gives best speed, 9 gives best
  138. compression)
  139. --column-compression-zlib-strategy=name
  140. The strategy parameter is used to tune the compression
  141. algorithm. Use the value DEFAULT_STRATEGY for normal
  142. data, FILTERED for data produced by a filter (or
  143. predictor), HUFFMAN_ONLY to force Huffman encoding only
  144. (no string match), or RLE to limit match distances to one
  145. (run-length encoding). Filtered data consists mostly of
  146. small values with a somewhat random distribution. In this
  147. case, the compression algorithm is tuned to compress them
  148. better. The effect of FILTERED is to force more Huffman
  149. coding and less string matching; it is somewhat
  150. intermediate between DEFAULT_STRATEGY and HUFFMAN_ONLY.
  151. RLE is designed to be almost as fast as HUFFMAN_ONLY, but
  152. give better compression for PNG image data. The strategy
  153. parameter only affects the compression ratio but not the
  154. correctness of the compressed output even if it is not
  155. set appropriately. FIXED prevents the use of dynamic
  156. Huffman codes, allowing for a simpler decoder for special
  157. applications.
  158. --column-compression-zlib-wrap
  159. Generate zlib header and trailer and compute adler32
  160. check value. It can be used with storage engines that
  161. don't provide data integrity verification to detect data
  162. corruption.
  163. --completion-type=name
  164. The transaction completion type. One of: NO_CHAIN, CHAIN,
  165. RELEASE
  166. --concurrent-insert[=name]
  167. Use concurrent insert with MyISAM. One of: NEVER, AUTO,
  168. ALWAYS
  169. --console Write error output on screen; don't remove the console
  170. window on windows.
  171. --core-file Write core on errors.
  172. -h, --datadir=name Path to the database root directory
  173. --date-format=name The DATE format (ignored)
  174. --datetime-format=name
  175. The DATETIME format (ignored)
  176. --deadlock-search-depth-long=#
  177. Long search depth for the two-step deadlock detection
  178. --deadlock-search-depth-short=#
  179. Short search depth for the two-step deadlock detection
  180. --deadlock-timeout-long=#
  181. Long timeout for the two-step deadlock detection (in
  182. microseconds)
  183. --deadlock-timeout-short=#
  184. Short timeout for the two-step deadlock detection (in
  185. microseconds)
  186. --default-regex-flags=name
  187. Default flags for the regex library. Any combination of:
  188. DOTALL, DUPNAMES, EXTENDED, EXTRA, MULTILINE, UNGREEDY
  189. --default-storage-engine=name
  190. The default storage engine for new tables
  191. --default-time-zone=name
  192. Set the default time zone.
  193. --default-tmp-storage-engine=name
  194. The default storage engine for user-created temporary
  195. tables
  196. --default-week-format=#
  197. The default week format used by WEEK() functions
  198. --delay-key-write[=name]
  199. Specifies how MyISAM tables handles CREATE TABLE
  200. DELAY_KEY_WRITE. If set to ON, the default, any DELAY KEY
  201. WRITEs are honored. The key buffer is then flushed only
  202. when the table closes, speeding up writes. MyISAM tables
  203. should be automatically checked upon startup in this
  204. case, and --external locking should not be used, as it
  205. can lead to index corruption. If set to OFF, DELAY KEY
  206. WRITEs are ignored, while if set to ALL, all new opened
  207. tables are treated as if created with DELAY KEY WRITEs
  208. enabled.
  209. --delayed-insert-limit=#
  210. After inserting delayed_insert_limit rows, the INSERT
  211. DELAYED handler will check if there are any SELECT
  212. statements pending. If so, it allows these to execute
  213. before continuing.
  214. --delayed-insert-timeout=#
  215. How long a INSERT DELAYED thread should wait for INSERT
  216. statements before terminating
  217. --delayed-queue-size=#
  218. What size queue (in rows) should be allocated for
  219. handling INSERT DELAYED. If the queue becomes full, any
  220. client that does INSERT DELAYED will wait until there is
  221. room in the queue again
  222. --div-precision-increment=#
  223. Precision of the result of '/' operator will be increased
  224. on that value
  225. --encrypt-binlog Encrypt binary logs (including relay logs)
  226. --encrypt-tmp-disk-tables
  227. Encrypt temporary on-disk tables (created as part of
  228. query execution)
  229. --encrypt-tmp-files Encrypt temporary files (created for filesort, binary log
  230. cache, etc)
  231. --enforce-storage-engine=name
  232. Force the use of a storage engine for new tables
  233. --event-scheduler[=name]
  234. Enable the event scheduler. Possible values are ON, OFF,
  235. and DISABLED (keep the event scheduler completely
  236. deactivated, it cannot be activated run-time)
  237. --expensive-subquery-limit=#
  238. The maximum number of rows a subquery may examine in
  239. order to be executed during optimization and used for
  240. constant optimization
  241. --expire-logs-days=#
  242. If non-zero, binary logs will be purged after
  243. expire_logs_days days; possible purges happen at startup
  244. and at binary log rotation
  245. --explicit-defaults-for-timestamp
  246. This option causes CREATE TABLE to create all TIMESTAMP
  247. columns as NULL with DEFAULT NULL attribute, Without this
  248. option, TIMESTAMP columns are NOT NULL and have implicit
  249. DEFAULT clauses.
  250. --external-locking Use system (external) locking (disabled by default).
  251. With this option enabled you can run myisamchk to test
  252. (not repair) tables while the MySQL server is running.
  253. Disable with --skip-external-locking.
  254. --extra-max-connections=#
  255. The number of connections on extra-port
  256. --extra-port=# Extra port number to use for tcp connections in a
  257. one-thread-per-connection manner. 0 means don't use
  258. another port
  259. --flashback Setup the server to use flashback. This enables binary
  260. log in row mode and will enable extra logging for DDL's
  261. needed by flashback feature
  262. --flush Flush MyISAM tables to disk between SQL commands
  263. --flush-time=# A dedicated thread is created to flush all tables at the
  264. given interval
  265. --ft-boolean-syntax=name
  266. List of operators for MATCH ... AGAINST ( ... IN BOOLEAN
  267. MODE)
  268. --ft-max-word-len=# The maximum length of the word to be included in a
  269. FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
  270. after changing this variable
  271. --ft-min-word-len=# The minimum length of the word to be included in a
  272. FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
  273. after changing this variable
  274. --ft-query-expansion-limit=#
  275. Number of best matches to use for query expansion
  276. --ft-stopword-file=name
  277. Use stopwords from this file instead of built-in list
  278. --gdb Set up signals usable for debugging. Deprecated, use
  279. --general-log Log connections and queries to a table or log file.
  280. Defaults logging to a file 'hostname'.log or a table
  281. mysql.general_logif --log-output=TABLE is used.
  282. --general-log-file=name
  283. Log connections and queries to given file
  284. --getopt-prefix-matching
  285. Recognize command-line options by their unambiguos
  286. prefixes.
  287. (Defaults to on; use --skip-getopt-prefix-matching to disable.)
  288. --group-concat-max-len=#
  289. The maximum length of the result of function
  290. GROUP_CONCAT()
  291. --gtid-domain-id=# Used with global transaction ID to identify logically
  292. independent replication streams. When events can
  293. propagate through multiple parallel paths (for example
  294. multiple masters), each independent source server must
  295. use a distinct domain_id. For simple tree-shaped
  296. replication topologies, it can be left at its default, 0.
  297. --gtid-ignore-duplicates
  298. When set, different master connections in multi-source
  299. replication are allowed to receive and process event
  300. groups with the same GTID (when using GTID mode). Only
  301. one will be applied, any others will be ignored. Within a
  302. given replication domain, just the sequence number will
  303. be used to decide whether a given GTID has been already
  304. applied; this means it is the responsibility of the user
  305. to ensure that GTID sequence numbers are strictly
  306. increasing.
  307. --gtid-pos-auto-engines=name
  308. List of engines for which to automatically create a
  309. mysql.gtid_slave_pos_ENGINE table, if a transaction using
  310. that engine is replicated. This can be used to avoid
  311. introducing cross-engine transactions, if engines are
  312. used different from that used by table
  313. mysql.gtid_slave_pos
  314. --gtid-strict-mode Enforce strict seq_no ordering of events in the binary
  315. log. Slave stops with an error if it encounters an event
  316. that would cause it to generate an out-of-order binlog if
  317. executed.
  318. -?, --help Display this help and exit.
  319. --histogram-size=# Number of bytes used for a histogram. If set to 0, no
  320. histograms are created by ANALYZE.
  321. --histogram-type=name
  322. Specifies type of the histograms created by ANALYZE.
  323. Possible values are: SINGLE_PREC_HB - single precision
  324. height-balanced, DOUBLE_PREC_HB - double precision
  325. height-balanced.
  326. --host-cache-size=# How many host names should be cached to avoid resolving.
  327. (Automatically configured unless set explicitly)
  328. --idle-readonly-transaction-timeout=#
  329. The number of seconds the server waits for read-only idle
  330. transaction
  331. --idle-transaction-timeout=#
  332. The number of seconds the server waits for idle
  333. transaction
  334. --idle-write-transaction-timeout=#
  335. The number of seconds the server waits for write idle
  336. transaction
  337. --ignore-builtin-innodb
  338. Disable initialization of builtin InnoDB plugin
  339. --ignore-db-dirs=name
  340. Specifies a directory to add to the ignore list when
  341. collecting database names from the datadir. Put a blank
  342. argument to reset the list accumulated so far.
  343. --init-connect=name Command(s) that are executed for each new connection
  344. (unless the user has SUPER privilege)
  345. --init-file=name Read SQL commands from this file at startup
  346. --init-rpl-role=name
  347. Set the replication role. One of: MASTER, SLAVE
  348. --init-slave=name Command(s) that are executed by a slave server each time
  349. the SQL thread starts
  350. --interactive-timeout=#
  351. The number of seconds the server waits for activity on an
  352. interactive connection before closing it
  353. --join-buffer-size=#
  354. The size of the buffer that is used for joins
  355. --join-buffer-space-limit=#
  356. The limit of the space for all join buffers used by a
  357. query
  358. --join-cache-level=#
  359. Controls what join operations can be executed with join
  360. buffers. Odd numbers are used for plain join buffers
  361. while even numbers are used for linked buffers
  362. --keep-files-on-create
  363. Don't overwrite stale .MYD and .MYI even if no directory
  364. is specified
  365. --key-buffer-size=# The size of the buffer used for index blocks for MyISAM
  366. tables. Increase this to get better index handling (for
  367. all reads and multiple writes) to as much as you can
  368. afford
  369. --key-cache-age-threshold=#
  370. This characterizes the number of hits a hot block has to
  371. be untouched until it is considered aged enough to be
  372. downgraded to a warm block. This specifies the percentage
  373. ratio of that number of hits to the total number of
  374. blocks in key cache
  375. --key-cache-block-size=#
  376. The default size of key cache blocks
  377. --key-cache-division-limit=#
  378. The minimum percentage of warm blocks in key cache
  379. --key-cache-file-hash-size=#
  380. Number of hash buckets for open and changed files. If
  381. you have a lot of MyISAM files open you should increase
  382. this for faster flush of changes. A good value is
  383. probably 1/10 of number of possible open MyISAM files.
  384. --key-cache-segments=#
  385. The number of segments in a key cache
  386. -L, --language=name Client error messages in given language. May be given as
  387. a full path. Deprecated. Use --lc-messages-dir instead.
  388. --large-pages Enable support for large pages
  389. --lc-messages=name Set the language used for the error messages.
  390. -L, --lc-messages-dir=name
  391. Directory where error messages are
  392. --lc-time-names=name
  393. Set the language used for the month names and the days of
  394. the week.
  395. --local-infile Enable LOAD DATA LOCAL INFILE
  396. (Defaults to on; use --skip-local-infile to disable.)
  397. --lock-wait-timeout=#
  398. Timeout in seconds to wait for a lock before returning an
  399. error.
  400. --log-basename=name Basename for all log files and the .pid file. This sets
  401. all log file names at once (in 'datadir') and is normally
  402. the only option you need for specifying log files. Sets
  403. names for --log-bin, --log-bin-index, --relay-log,
  404. --relay-log-index, --general-log-file,
  405. --log-slow-query-log-file, --log-error-file, and
  406. --pid-file
  407. --log-bin[=name] Log update queries in binary format. Optional argument
  408. should be name for binary log. If not given
  409. 'datadir'/'log-basename'-bin or 'datadir'/mysql-bin will
  410. be used (the later if --log-basename is not specified).
  411. We strongly recommend to use either --log-basename or
  412. specify a filename to ensure that replication doesn't
  413. stop if the real hostname of the computer changes.
  414. --log-bin-compress Whether the binary log can be compressed
  415. --log-bin-compress-min-len[=#]
  416. Minimum length of sql statement(in statement mode) or
  417. record(in row mode)that can be compressed.
  418. --log-bin-index=name
  419. File that holds the names for last binary log files.
  420. --log-bin-trust-function-creators
  421. If set to FALSE (the default), then when --log-bin is
  422. used, creation of a stored function (or trigger) is
  423. allowed only to users having the SUPER privilege and only
  424. if this stored function (trigger) may not break binary
  425. logging. Note that if ALL connections to this server
  426. ALWAYS use row-based binary logging, the security issues
  427. do not exist and the binary logging cannot break, so you
  428. can safely set this to TRUE
  429. --log-disabled-statements=name
  430. Don't log certain types of statements to general log. Any
  431. combination of: slave, sp
  432. --log-error[=name] Log errors to file (instead of stdout). If file name is
  433. not specified then 'datadir'/'log-basename'.err or the
  434. 'pid-file' path with extension .err is used
  435. --log-isam[=name] Log all MyISAM changes to file.
  436. --log-output=name How logs should be written. Any combination of: NONE,
  437. FILE, TABLE
  438. --log-queries-not-using-indexes
  439. Log queries that are executed without benefit of any
  440. index to the slow log if it is open. Same as
  441. log_slow_filter='not_using_index'
  442. --log-short-format Don't log extra information to update and slow-query
  443. logs.
  444. --log-slave-updates Tells the slave to log the updates from the slave thread
  445. to the binary log. You will need to turn it on if you
  446. plan to daisy-chain the slaves.
  447. --log-slow-admin-statements
  448. Log slow OPTIMIZE, ANALYZE, ALTER and other
  449. administrative statements to the slow log if it is open.
  450. Resets or sets the option 'admin' in
  451. log_slow_disabled_statements
  452. --log-slow-disabled-statements=name
  453. Don't log certain types of statements to slow log. Any
  454. combination of: admin, call, slave, sp
  455. --log-slow-filter=name
  456. Log only certain types of queries to the slow log. If
  457. variable empty alll kind of queries are logged. All
  458. types are bound by slow_query_time, except
  459. 'not_using_index' which is always logged if enabled. Any
  460. combination of: admin, filesort, filesort_on_disk,
  461. filesort_priority_queue, full_join, full_scan,
  462. not_using_index, query_cache, query_cache_miss, tmp_table,
  463. tmp_table_on_disk
  464. --log-slow-rate-limit=#
  465. Write to slow log every #th slow query. Set to 1 to log
  466. everything. Increase it to reduce the size of the slow or
  467. the performance impact of slow logging
  468. --log-slow-slave-statements
  469. Log slow statements executed by slave thread to the slow
  470. log if it is open. Resets or sets the option 'slave' in
  471. log_slow_disabled_statements
  472. --log-slow-verbosity=name
  473. Verbosity level for the slow log. Any combination of:
  474. innodb, query_plan, explain
  475. --log-tc=name Path to transaction coordinator log (used for
  476. transactions that affect more than one storage engine,
  477. when binary log is disabled).
  478. --log-tc-size=# Size of transaction coordinator log.
  479. -W, --log-warnings[=#]
  480. Log some not critical warnings to the general log
  481. file.Value can be between 0 and 11. Higher values mean
  482. more verbosity
  483. --long-query-time=# Log all queries that have taken more than long_query_time
  484. seconds to execute to the slow query log file. The
  485. argument will be treated as a decimal value with
  486. microsecond precision
  487. --low-priority-updates
  488. INSERT/DELETE/UPDATE has lower priority than selects
  489. --lower-case-table-names[=#]
  490. If set to 1 table names are stored in lowercase on disk
  491. and table names will be case-insensitive. Should be set
  492. to 2 if you are using a case insensitive file system
  493. --master-info-file=name
  494. The location and name of the file that remembers the
  495. master and where the I/O replication thread is in the
  496. master's binlogs. Defaults to master.info
  497. --master-retry-count=#
  498. The number of tries the slave will make to connect to the
  499. master before giving up.
  500. --master-verify-checksum
  501. Force checksum verification of logged events in the
  502. binary log before sending them to slaves or printing them
  503. in the output of SHOW BINLOG EVENTS
  504. --max-allowed-packet=#
  505. Max packet length to send to or receive from the server
  506. --max-binlog-cache-size=#
  507. Sets the total size of the transactional cache
  508. --max-binlog-size=# Binary log will be rotated automatically when the size
  509. exceeds this value.
  510. --max-binlog-stmt-cache-size=#
  511. Sets the total size of the statement cache
  512. --max-connect-errors=#
  513. If there is more than this number of interrupted
  514. connections from a host this host will be blocked from
  515. further connections
  516. --max-connections=# The number of simultaneous clients allowed
  517. --max-delayed-threads=#
  518. Don't start more than this number of threads to handle
  519. INSERT DELAYED statements. If set to zero INSERT DELAYED
  520. will be not used
  521. --max-digest-length=#
  522. Maximum length considered for digest text.
  523. --max-error-count=# Max number of errors/warnings to store for a statement
  524. --max-heap-table-size=#
  525. Don't allow creation of heap tables bigger than this
  526. --max-join-size=# Joins that are probably going to read more than
  527. max_join_size records return an error
  528. --max-length-for-sort-data=#
  529. Max number of bytes in sorted records
  530. --max-long-data-size=#
  531. The maximum BLOB length to send to server from
  532. mysql_send_long_data API. Deprecated option; use
  533. max_allowed_packet instead.
  534. --max-prepared-stmt-count=#
  535. Maximum number of prepared statements in the server
  536. --max-recursive-iterations[=#]
  537. Maximum number of iterations when executing recursive
  538. queries
  539. --max-relay-log-size=#
  540. relay log will be rotated automatically when the size
  541. exceeds this value. If 0 at startup, it's set to
  542. max_binlog_size
  543. --max-seeks-for-key=#
  544. Limit assumed max number of seeks when looking up rows
  545. based on a key
  546. --max-session-mem-used=#
  547. Amount of memory a single user session is allowed to
  548. allocate. This limits the value of the session variable
  549. MEM_USED
  550. --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
  551. values (only the first max_sort_length bytes of each
  552. value are used; the rest are ignored)
  553. --max-sp-recursion-depth[=#]
  554. Maximum stored procedure recursion depth
  555. --max-statement-time=#
  556. A query that has taken more than max_statement_time
  557. seconds will be aborted. The argument will be treated as
  558. a decimal value with microsecond precision. A value of 0
  559. (default) means no timeout
  560. --max-tmp-tables=# Unused, will be removed.
  561. --max-user-connections=#
  562. The maximum number of active connections for a single
  563. user (0 = no limit)
  564. --max-write-lock-count=#
  565. After this many write locks, allow some read locks to run
  566. in between
  567. --memlock Lock mysqld in memory.
  568. --metadata-locks-cache-size=#
  569. Unused
  570. --metadata-locks-hash-instances=#
  571. Unused
  572. --min-examined-row-limit=#
  573. Don't write queries to slow log that examine fewer rows
  574. than that
  575. --mrr-buffer-size=# Size of buffer to use when using MRR with range access
  576. --multi-range-count=#
  577. Ignored. Use mrr_buffer_size instead
  578. --myisam-block-size=#
  579. Block size to be used for MyISAM index pages
  580. --myisam-data-pointer-size=#
  581. Default pointer size to be used for MyISAM tables
  582. --myisam-max-sort-file-size=#
  583. Don't use the fast sort index method to created index if
  584. the temporary file would get bigger than this
  585. --myisam-mmap-size=#
  586. Restricts the total memory used for memory mapping of
  587. MySQL tables
  588. --myisam-recover-options[=name]
  589. Specifies how corrupted tables should be automatically
  590. repaired. Any combination of: DEFAULT, BACKUP, FORCE,
  591. QUICK, BACKUP_ALL, OFF
  592. --myisam-repair-threads=#
  593. If larger than 1, when repairing a MyISAM table all
  594. indexes will be created in parallel, with one thread per
  595. index. The value of 1 disables parallel repair
  596. --myisam-sort-buffer-size=#
  597. The buffer that is allocated when sorting the index when
  598. doing a REPAIR or when creating indexes with CREATE INDEX
  599. or ALTER TABLE
  600. --myisam-stats-method=name
  601. Specifies how MyISAM index statistics collection code
  602. should treat NULLs. Possible values of name are
  603. NULLS_UNEQUAL (default behavior for 4.1 and later),
  604. NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
  605. --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
  606. --mysql56-temporal-format
  607. Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
  608. DATETIME, TIMESTAMP columns.
  609. (Defaults to on; use --skip-mysql56-temporal-format to disable.)
  610. --net-buffer-length=#
  611. Buffer length for TCP/IP and socket communication
  612. --net-read-timeout=#
  613. Number of seconds to wait for more data from a connection
  614. before aborting the read
  615. --net-retry-count=# If a read on a communication port is interrupted, retry
  616. this many times before giving up
  617. --net-write-timeout=#
  618. Number of seconds to wait for a block to be written to a
  619. connection before aborting the write
  620. --old Use compatible behavior from previous MariaDB version.
  621. See also --old-mode
  622. --old-alter-table[=name]
  623. Alias for alter_algorithm. Deprecated. Use
  624. --alter-algorithm instead.. One of: DEFAULT, COPY,
  625. INPLACE, NOCOPY, INSTANT
  626. --old-mode=name Used to emulate old behavior from earlier MariaDB or
  627. MySQL versions. Any combination of:
  628. NO_DUP_KEY_WARNINGS_WITH_IGNORE, NO_PROGRESS_INFO,
  629. ZERO_DATE_TIME_CAST
  630. --old-passwords Use old password encryption method (needed for 4.0 and
  631. older clients)
  632. --old-style-user-limits
  633. Enable old-style user limits (before 5.0.3, user
  634. resources were counted per each user+host vs. per
  635. account).
  636. --open-files-limit=#
  637. If this is not 0, then mysqld will use this value to
  638. reserve file descriptors to use with setrlimit(). If this
  639. value is 0 or autoset then mysqld will reserve
  640. max_connections*5 or max_connections + table_cache*2
  641. (whichever is larger) number of file descriptors
  642. (Automatically configured unless set explicitly)
  643. --optimizer-prune-level=#
  644. Controls the heuristic(s) applied during query
  645. optimization to prune less-promising partial plans from
  646. the optimizer search space. Meaning: 0 - do not apply any
  647. heuristic, thus perform exhaustive search; 1 - prune
  648. plans based on number of retrieved rows
  649. --optimizer-search-depth=#
  650. Maximum depth of search performed by the query optimizer.
  651. Values larger than the number of relations in a query
  652. result in better query plans, but take longer to compile
  653. a query. Values smaller than the number of tables in a
  654. relation result in faster optimization, but may produce
  655. very bad query plans. If set to 0, the system will
  656. automatically pick a reasonable value.
  657. --optimizer-selectivity-sampling-limit=#
  658. Controls number of record samples to check condition
  659. selectivity
  660. --optimizer-switch=name
  661. Fine-tune the optimizer behavior. Takes a comma-separated
  662. list of option=value pairs, where value is on, off, or
  663. default, and options are: index_merge, index_merge_union,
  664. index_merge_sort_union, index_merge_intersection,
  665. index_merge_sort_intersection, engine_condition_pushdown,
  666. index_condition_pushdown, derived_merge,
  667. derived_with_keys, firstmatch, loosescan, materialization,
  668. in_to_exists, semijoin, partial_match_rowid_merge,
  669. partial_match_table_scan, subquery_cache, mrr,
  670. mrr_cost_based, mrr_sort_keys, outer_join_with_cache,
  671. semijoin_with_cache, join_cache_incremental,
  672. join_cache_hashed, join_cache_bka,
  673. optimize_join_buffer_size, table_elimination,
  674. extended_keys, exists_to_in, orderby_uses_equalities,
  675. condition_pushdown_for_derived, split_materialized,
  676. condition_pushdown_for_subquery
  677. --optimizer-use-condition-selectivity=#
  678. Controls selectivity of which conditions the optimizer
  679. takes into account to calculate cardinality of a partial
  680. join when it searches for the best execution plan
  681. Meaning: 1 - use selectivity of index backed range
  682. conditions to calculate the cardinality of a partial join
  683. if the last joined table is accessed by full table scan
  684. or an index scan, 2 - use selectivity of index backed
  685. range conditions to calculate the cardinality of a
  686. partial join in any case, 3 - additionally always use
  687. selectivity of range conditions that are not backed by
  688. any index to calculate the cardinality of a partial join,
  689. 4 - use histograms to calculate selectivity of range
  690. conditions that are not backed by any index to calculate
  691. the cardinality of a partial join.5 - additionally use
  692. selectivity of certain non-range predicates calculated on
  693. record samples
  694. --performance-schema
  695. Enable the performance schema.
  696. --performance-schema-accounts-size=#
  697. Maximum number of instrumented user@host accounts. Use 0
  698. to disable, -1 for automated sizing.
  699. --performance-schema-consumer-events-stages-current
  700. Default startup value for the events_stages_current
  701. consumer.
  702. --performance-schema-consumer-events-stages-history
  703. Default startup value for the events_stages_history
  704. consumer.
  705. --performance-schema-consumer-events-stages-history-long
  706. Default startup value for the events_stages_history_long
  707. consumer.
  708. --performance-schema-consumer-events-statements-current
  709. Default startup value for the events_statements_current
  710. consumer.
  711. (Defaults to on; use --skip-performance-schema-consumer-events-statements-current to disable.)
  712. --performance-schema-consumer-events-statements-history
  713. Default startup value for the events_statements_history
  714. consumer.
  715. --performance-schema-consumer-events-statements-history-long
  716. Default startup value for the
  717. events_statements_history_long consumer.
  718. --performance-schema-consumer-events-waits-current
  719. Default startup value for the events_waits_current
  720. consumer.
  721. --performance-schema-consumer-events-waits-history
  722. Default startup value for the events_waits_history
  723. consumer.
  724. --performance-schema-consumer-events-waits-history-long
  725. Default startup value for the events_waits_history_long
  726. consumer.
  727. --performance-schema-consumer-global-instrumentation
  728. Default startup value for the global_instrumentation
  729. consumer.
  730. (Defaults to on; use --skip-performance-schema-consumer-global-instrumentation to disable.)
  731. --performance-schema-consumer-statements-digest
  732. Default startup value for the statements_digest consumer.
  733. (Defaults to on; use --skip-performance-schema-consumer-statements-digest to disable.)
  734. --performance-schema-consumer-thread-instrumentation
  735. Default startup value for the thread_instrumentation
  736. consumer.
  737. (Defaults to on; use --skip-performance-schema-consumer-thread-instrumentation to disable.)
  738. --performance-schema-digests-size=#
  739. Size of the statement digest. Use 0 to disable, -1 for
  740. automated sizing.
  741. --performance-schema-events-stages-history-long-size=#
  742. Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to
  743. disable, -1 for automated sizing.
  744. --performance-schema-events-stages-history-size=#
  745. Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0
  746. to disable, -1 for automated sizing.
  747. --performance-schema-events-statements-history-long-size=#
  748. Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0
  749. to disable, -1 for automated sizing.
  750. --performance-schema-events-statements-history-size=#
  751. Number of rows per thread in EVENTS_STATEMENTS_HISTORY.
  752. Use 0 to disable, -1 for automated sizing.
  753. --performance-schema-events-waits-history-long-size=#
  754. Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to
  755. disable, -1 for automated sizing.
  756. --performance-schema-events-waits-history-size=#
  757. Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0
  758. to disable, -1 for automated sizing.
  759. --performance-schema-hosts-size=#
  760. Maximum number of instrumented hosts. Use 0 to disable,
  761. -1 for automated sizing.
  762. --performance-schema-instrument[=name]
  763. Default startup value for a performance schema
  764. instrument.
  765. --performance-schema-max-cond-classes=#
  766. Maximum number of condition instruments.
  767. --performance-schema-max-cond-instances=#
  768. Maximum number of instrumented condition objects. Use 0
  769. to disable, -1 for automated sizing.
  770. --performance-schema-max-digest-length=#
  771. Maximum length considered for digest text, when stored in
  772. performance_schema tables.
  773. --performance-schema-max-file-classes=#
  774. Maximum number of file instruments.
  775. --performance-schema-max-file-handles=#
  776. Maximum number of opened instrumented files.
  777. --performance-schema-max-file-instances=#
  778. Maximum number of instrumented files. Use 0 to disable,
  779. -1 for automated sizing.
  780. --performance-schema-max-mutex-classes=#
  781. Maximum number of mutex instruments.
  782. --performance-schema-max-mutex-instances=#
  783. Maximum number of instrumented MUTEX objects. Use 0 to
  784. disable, -1 for automated sizing.
  785. --performance-schema-max-rwlock-classes=#
  786. Maximum number of rwlock instruments.
  787. --performance-schema-max-rwlock-instances=#
  788. Maximum number of instrumented RWLOCK objects. Use 0 to
  789. disable, -1 for automated sizing.
  790. --performance-schema-max-socket-classes=#
  791. Maximum number of socket instruments.
  792. --performance-schema-max-socket-instances=#
  793. Maximum number of opened instrumented sockets. Use 0 to
  794. disable, -1 for automated sizing.
  795. --performance-schema-max-stage-classes=#
  796. Maximum number of stage instruments.
  797. --performance-schema-max-statement-classes=#
  798. Maximum number of statement instruments.
  799. --performance-schema-max-table-handles=#
  800. Maximum number of opened instrumented tables. Use 0 to
  801. disable, -1 for automated sizing.
  802. --performance-schema-max-table-instances=#
  803. Maximum number of instrumented tables. Use 0 to disable,
  804. -1 for automated sizing.
  805. --performance-schema-max-thread-classes=#
  806. Maximum number of thread instruments.
  807. --performance-schema-max-thread-instances=#
  808. Maximum number of instrumented threads. Use 0 to disable,
  809. -1 for automated sizing.
  810. --performance-schema-session-connect-attrs-size=#
  811. Size of session attribute string buffer per thread. Use 0
  812. to disable, -1 for automated sizing.
  813. --performance-schema-setup-actors-size=#
  814. Maximum number of rows in SETUP_ACTORS.
  815. --performance-schema-setup-objects-size=#
  816. Maximum number of rows in SETUP_OBJECTS.
  817. --performance-schema-users-size=#
  818. Maximum number of instrumented users. Use 0 to disable,
  819. -1 for automated sizing.
  820. --pid-file=name Pid file used by safe_mysqld
  821. --plugin-dir=name Directory for plugins
  822. --plugin-load=name Semicolon-separated list of plugins to load, where each
  823. plugin is specified as ether a plugin_name=library_file
  824. pair or only a library_file. If the latter case, all
  825. plugins from a given library_file will be loaded.
  826. --plugin-load-add=name
  827. Optional semicolon-separated list of plugins to load.
  828. This option adds to the list specified by --plugin-load
  829. in an incremental way. It can be specified many times,
  830. adding more plugins every time.
  831. --plugin-maturity=name
  832. The lowest desirable plugin maturity. Plugins less mature
  833. than that will not be installed or loaded. One of:
  834. unknown, experimental, alpha, beta, gamma, stable
  835. -P, --port=# Port number to use for connection or 0 to default to,
  836. my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
  837. (3306), whatever comes first
  838. --port-open-timeout=#
  839. Maximum time in seconds to wait for the port to become
  840. free. (Default: No wait).
  841. --preload-buffer-size=#
  842. The size of the buffer that is allocated when preloading
  843. indexes
  844. --profiling-history-size=#
  845. Number of statements about which profiling information is
  846. maintained. If set to 0, no profiles are stored. See SHOW
  847. PROFILES.
  848. --progress-report-time=#
  849. Seconds between sending progress reports to the client
  850. for time-consuming statements. Set to 0 to disable
  851. progress reporting.
  852. --proxy-protocol-networks=name
  853. Enable proxy protocol for these source networks. The
  854. syntax is a comma separated list of IPv4 and IPv6
  855. networks. If the network doesn't contain mask, it is
  856. considered to be a single host. "*" represents all
  857. networks and must the only directive on the line. String
  858. "localhost" represents non-TCP local connections (Unix
  859. domain socket, Windows named pipe or shared memory).
  860. --query-alloc-block-size=#
  861. Allocation block size for query parsing and execution
  862. --query-cache-limit=#
  863. Don't cache results that are bigger than this
  864. --query-cache-min-res-unit=#
  865. The minimum size for blocks allocated by the query cache
  866. --query-cache-size=#
  867. The memory allocated to store results from old queries
  868. --query-cache-strip-comments
  869. Strip all comments from a query before storing it in the
  870. query cache
  871. --query-cache-type=name
  872. OFF = Don't cache or retrieve results. ON = Cache all
  873. results except SELECT SQL_NO_CACHE ... queries. DEMAND =
  874. Cache only SELECT SQL_CACHE ... queries
  875. --query-cache-wlock-invalidate
  876. Invalidate queries in query cache on LOCK for write
  877. --query-prealloc-size=#
  878. Persistent buffer for query parsing and execution
  879. --range-alloc-block-size=#
  880. Allocation block size for storing ranges during
  881. optimization
  882. --read-binlog-speed-limit=#
  883. Maximum speed(KB/s) to read binlog from master (0 = no
  884. limit)
  885. --read-buffer-size=#
  886. Each thread that does a sequential scan allocates a
  887. buffer of this size for each table it scans. If you do
  888. many sequential scans, you may want to increase this
  889. value
  890. --read-only Make all non-temporary tables read-only, with the
  891. exception for replication (slave) threads and users with
  892. the SUPER privilege
  893. --read-rnd-buffer-size=#
  894. When reading rows in sorted order after a sort, the rows
  895. are read through this buffer to avoid a disk seeks
  896. --relay-log=name The location and name to use for relay logs.
  897. --relay-log-index=name
  898. The location and name to use for the file that keeps a
  899. list of the last relay logs
  900. --relay-log-info-file=name
  901. The location and name of the file that remembers where
  902. the SQL replication thread is in the relay logs.
  903. --relay-log-purge if disabled - do not purge relay logs. if enabled - purge
  904. them as soon as they are no more needed.
  905. (Defaults to on; use --skip-relay-log-purge to disable.)
  906. --relay-log-recovery
  907. Enables automatic relay log recovery right after the
  908. database startup, which means that the IO Thread starts
  909. re-fetching from the master right after the last
  910. transaction processed.
  911. --relay-log-space-limit=#
  912. Maximum space to use for all relay logs
  913. --replicate-annotate-row-events
  914. Tells the slave to write annotate rows events received
  915. from the master to its own binary log. Ignored if
  916. log_slave_updates is not set
  917. (Defaults to on; use --skip-replicate-annotate-row-events to disable.)
  918. --replicate-do-db=name
  919. Tells the slave thread to restrict replication to the
  920. specified database. To specify more than one database,
  921. use the directive multiple times, once for each database.
  922. Note that this will only work if you do not use
  923. cross-database queries such as UPDATE some_db.some_table
  924. SET foo='bar' while having selected a different or no
  925. database. If you need cross database updates to work,
  926. make sure you have 3.23.28 or later, and use
  927. replicate-wild-do-table=db_name.%.
  928. --replicate-do-table=name
  929. Tells the slave thread to restrict replication to the
  930. specified table. To specify more than one table, use the
  931. directive multiple times, once for each table. This will
  932. work for cross-database updates, in contrast to
  933. replicate-do-db.
  934. --replicate-events-marked-for-skip=name
  935. Whether the slave should replicate events that were
  936. created with @@skip_replication=1 on the master. Default
  937. REPLICATE (no events are skipped). Other values are
  938. FILTER_ON_SLAVE (events will be sent by the master but
  939. ignored by the slave) and FILTER_ON_MASTER (events marked
  940. with @@skip_replication=1 will be filtered on the master
  941. and never be sent to the slave).
  942. --replicate-ignore-db=name
  943. Tells the slave thread to not replicate to the specified
  944. database. To specify more than one database to ignore,
  945. use the directive multiple times, once for each database.
  946. This option will not work if you use cross database
  947. updates. If you need cross database updates to work, make
  948. sure you have 3.23.28 or later, and use
  949. replicate-wild-ignore-table=db_name.%.
  950. --replicate-ignore-table=name
  951. Tells the slave thread to not replicate to the specified
  952. table. To specify more than one table to ignore, use the
  953. directive multiple times, once for each table. This will
  954. work for cross-database updates, in contrast to
  955. replicate-ignore-db.
  956. --replicate-rewrite-db=name
  957. Updates to a database with a different name than the
  958. original. Example:
  959. replicate-rewrite-db=master_db_name->slave_db_name.
  960. --replicate-same-server-id
  961. In replication, if set to 1, do not skip events having
  962. our server id. Default value is 0 (to break infinite
  963. loops in circular replication). Can't be set to 1 if
  964. --log-slave-updates is used.
  965. --replicate-wild-do-table=name
  966. Tells the slave thread to restrict replication to the
  967. tables that match the specified wildcard pattern. To
  968. specify more than one table, use the directive multiple
  969. times, once for each table. This will work for
  970. cross-database updates. Example:
  971. replicate-wild-do-table=foo%.bar% will replicate only
  972. updates to tables in all databases that start with foo
  973. and whose table names start with bar.
  974. --replicate-wild-ignore-table=name
  975. Tells the slave thread to not replicate to the tables
  976. that match the given wildcard pattern. To specify more
  977. than one table to ignore, use the directive multiple
  978. times, once for each table. This will work for
  979. cross-database updates. Example:
  980. replicate-wild-ignore-table=foo%.bar% will not do updates
  981. to tables in databases that start with foo and whose
  982. table names start with bar.
  983. --report-host=name Hostname or IP of the slave to be reported to the master
  984. during slave registration. Will appear in the output of
  985. SHOW SLAVE HOSTS. Leave unset if you do not want the
  986. slave to register itself with the master. Note that it is
  987. not sufficient for the master to simply read the IP of
  988. the slave off the socket once the slave connects. Due to
  989. NAT and other routing issues, that IP may not be valid
  990. for connecting to the slave from the master or other
  991. hosts
  992. --report-password=name
  993. The account password of the slave to be reported to the
  994. master during slave registration
  995. --report-port=# Port for connecting to slave reported to the master
  996. during slave registration. Set it only if the slave is
  997. listening on a non-default port or if you have a special
  998. tunnel from the master or other clients to the slave. If
  999. not sure, leave this option unset
  1000. --report-user=name The account user name of the slave to be reported to the
  1001. master during slave registration
  1002. --rowid-merge-buff-size=#
  1003. The size of the buffers used [NOT] IN evaluation via
  1004. partial matching
  1005. --rpl-semi-sync-master-enabled
  1006. Enable semi-synchronous replication master (disabled by
  1007. default).
  1008. --rpl-semi-sync-master-timeout=#
  1009. The timeout value (in ms) for semi-synchronous
  1010. replication in the master
  1011. --rpl-semi-sync-master-trace-level=#
  1012. The tracing level for semi-sync replication.
  1013. --rpl-semi-sync-master-wait-no-slave
  1014. Wait until timeout when no semi-synchronous replication
  1015. slave available (enabled by default).
  1016. (Defaults to on; use --skip-rpl-semi-sync-master-wait-no-slave to disable.)
  1017. --rpl-semi-sync-master-wait-point=name
  1018. Should transaction wait for semi-sync ack after having
  1019. synced binlog, or after having committed in storage
  1020. engine.. One of: AFTER_SYNC, AFTER_COMMIT
  1021. --rpl-semi-sync-slave-delay-master
  1022. Only write master info file when ack is needed.
  1023. --rpl-semi-sync-slave-enabled
  1024. Enable semi-synchronous replication slave (disabled by
  1025. default).
  1026. --rpl-semi-sync-slave-kill-conn-timeout[=#]
  1027. Timeout for the mysql connection used to kill the slave
  1028. io_thread's connection on master. This timeout comes into
  1029. play when stop slave is executed.
  1030. --rpl-semi-sync-slave-trace-level=#
  1031. The tracing level for semi-sync replication.
  1032. --safe-mode Skip some optimize stages (for testing). Deprecated.
  1033. --safe-user-create Don't allow new user creation by the user who has no
  1034. write privileges to the mysql.user table.
  1035. --secure-auth Disallow authentication for accounts that have old
  1036. (pre-4.1) passwords
  1037. (Defaults to on; use --skip-secure-auth to disable.)
  1038. --secure-file-priv=name
  1039. Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
  1040. files within specified directory
  1041. --secure-timestamp=name
  1042. Restricts direct setting of a session timestamp. Possible
  1043. levels are: YES - timestamp cannot deviate from the
  1044. system clock, REPLICATION - replication thread can adjust
  1045. timestamp to match the master's, SUPER - a user with this
  1046. privilege and a replication thread can adjust timestamp,
  1047. NO - historical behavior, anyone can modify session
  1048. timestamp
  1049. --server-id=# Uniquely identifies the server instance in the community
  1050. of replication partners
  1051. --session-track-schema
  1052. Track changes to the default schema.
  1053. (Defaults to on; use --skip-session-track-schema to disable.)
  1054. --session-track-state-change
  1055. Track changes to the session state.
  1056. --session-track-system-variables=name
  1057. Track changes in registered system variables.
  1058. --session-track-transaction-info=name
  1059. Track changes to the transaction attributes. OFF to
  1060. disable; STATE to track just transaction state (Is there
  1061. an active transaction? Does it have any data? etc.);
  1062. CHARACTERISTICS to track transaction state and report all
  1063. statements needed to start a transaction withthe same
  1064. characteristics (isolation level, read only/read
  1065. write,snapshot - but not any work done / data modified
  1066. within the transaction).
  1067. --show-slave-auth-info
  1068. Show user and password in SHOW SLAVE HOSTS on this
  1069. master.
  1070. --silent-startup Don't print [Note] to the error log during startup.
  1071. --skip-bdb Deprecated option; Exist only for compatibility with old
  1072. my.cnf files
  1073. --skip-grant-tables Start without grant tables. This gives all users FULL
  1074. ACCESS to all tables.
  1075. --skip-host-cache Don't cache host names.
  1076. --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
  1077. 'localhost'.
  1078. --skip-networking Don't allow connection with TCP/IP
  1079. --skip-show-database
  1080. Don't allow 'SHOW DATABASE' commands
  1081. --skip-slave-start If set, slave is not autostarted.
  1082. --slave-compressed-protocol
  1083. Use compression on master/slave protocol
  1084. --slave-ddl-exec-mode=name
  1085. How replication events should be executed. Legal values
  1086. are STRICT and IDEMPOTENT (default). In IDEMPOTENT mode,
  1087. replication will not stop for DDL operations that are
  1088. idempotent. This means that CREATE TABLE is treated as
  1089. CREATE TABLE OR REPLACE and DROP TABLE is treated as DROP
  1090. TABLE IF EXISTS.
  1091. --slave-domain-parallel-threads=#
  1092. Maximum number of parallel threads to use on slave for
  1093. events in a single replication domain. When using
  1094. multiple domains, this can be used to limit a single
  1095. domain from grabbing all threads and thus stalling other
  1096. domains. The default of 0 means to allow a domain to grab
  1097. as many threads as it wants, up to the value of
  1098. slave_parallel_threads.
  1099. --slave-exec-mode=name
  1100. How replication events should be executed. Legal values
  1101. are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode,
  1102. replication will not stop for operations that are
  1103. idempotent. For example, in row based replication
  1104. attempts to delete rows that doesn't exist will be
  1105. ignored. In STRICT mode, replication will stop on any
  1106. unexpected difference between the master and the slave.
  1107. --slave-load-tmpdir=name
  1108. The location where the slave should put its temporary
  1109. files when replicating a LOAD DATA INFILE command
  1110. --slave-max-allowed-packet=#
  1111. The maximum packet length to sent successfully from the
  1112. master to slave.
  1113. --slave-net-timeout=#
  1114. Number of seconds to wait for more data from any
  1115. master/slave connection before aborting the read
  1116. --slave-parallel-max-queued=#
  1117. Limit on how much memory SQL threads should use per
  1118. parallel replication thread when reading ahead in the
  1119. relay log looking for opportunities for parallel
  1120. replication. Only used when --slave-parallel-threads > 0.
  1121. --slave-parallel-mode=name
  1122. Controls what transactions are applied in parallel when
  1123. using --slave-parallel-threads. Possible values:
  1124. "optimistic" tries to apply most transactional DML in
  1125. parallel, and handles any conflicts with rollback and
  1126. retry. "conservative" limits parallelism in an effort to
  1127. avoid any conflicts. "aggressive" tries to maximise the
  1128. parallelism, possibly at the cost of increased conflict
  1129. rate. "minimal" only parallelizes the commit steps of
  1130. transactions. "none" disables parallel apply completely.
  1131. --slave-parallel-threads=#
  1132. If non-zero, number of threads to spawn to apply in
  1133. parallel events on the slave that were group-committed on
  1134. the master or were logged with GTID in different
  1135. replication domains. Note that these threads are in
  1136. addition to the IO and SQL threads, which are always
  1137. created by a replication slave
  1138. --slave-parallel-workers=#
  1139. Alias for slave_parallel_threads
  1140. --slave-run-triggers-for-rbr=name
  1141. Modes for how triggers in row-base replication on slave
  1142. side will be executed. Legal values are NO (default), YES
  1143. and LOGGING. NO means that trigger for RBR will not be
  1144. running on slave. YES and LOGGING means that triggers
  1145. will be running on slave, if there was not triggers
  1146. running on the master for the statement. LOGGING also
  1147. means results of that the executed triggers work will be
  1148. written to the binlog.
  1149. --slave-skip-errors=name
  1150. Tells the slave thread to continue replication when a
  1151. query event returns an error from the provided list
  1152. --slave-sql-verify-checksum
  1153. Force checksum verification of replication events after
  1154. reading them from relay log. Note: Events are always
  1155. checksum-verified by slave on receiving them from the
  1156. network before writing them to the relay log
  1157. (Defaults to on; use --skip-slave-sql-verify-checksum to disable.)
  1158. --slave-transaction-retries=#
  1159. Number of times the slave SQL thread will retry a
  1160. transaction in case it failed with a deadlock, elapsed
  1161. lock wait timeout or listed in
  1162. slave_transaction_retry_errors, before giving up and
  1163. stopping
  1164. --slave-transaction-retry-errors=name
  1165. Tells the slave thread to retry transaction for
  1166. replication when a query event returns an error from the
  1167. provided list. Deadlock and elapsed lock wait timeout
  1168. errors are automatically added to this list
  1169. --slave-transaction-retry-interval=#
  1170. Interval of the slave SQL thread will retry a transaction
  1171. in case it failed with a deadlock or elapsed lock wait
  1172. timeout or listed in slave_transaction_retry_errors
  1173. --slave-type-conversions=name
  1174. Set of slave type conversions that are enabled. If the
  1175. variable is empty, no conversions are allowed and it is
  1176. expected that the types match exactly. Any combination
  1177. of: ALL_LOSSY, ALL_NON_LOSSY
  1178. --slow-launch-time=#
  1179. If creating the thread takes longer than this value (in
  1180. seconds), the Slow_launch_threads counter will be
  1181. incremented
  1182. --slow-query-log Log slow queries to a table or log file. Defaults logging
  1183. to a file 'hostname'-slow.log or a table mysql.slow_log
  1184. if --log-output=TABLE is used. Must be enabled to
  1185. activate other slow log options.
  1186. --slow-query-log-file=name
  1187. Log slow queries to given log file. Defaults logging to
  1188. 'hostname'-slow.log. Must be enabled to activate other
  1189. slow log options
  1190. --socket=name Socket file to use for connection
  1191. --sort-buffer-size=#
  1192. Each thread that needs to do a sort allocates a buffer of
  1193. this size
  1194. --sql-mode=name Sets the sql mode. Any combination of: REAL_AS_FLOAT,
  1195. PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE,
  1196. IGNORE_BAD_TABLE_OPTIONS, ONLY_FULL_GROUP_BY,
  1197. NO_UNSIGNED_SUBTRACTION, NO_DIR_IN_CREATE, POSTGRESQL,
  1198. ORACLE, MSSQL, DB2, MAXDB, NO_KEY_OPTIONS,
  1199. NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, MYSQL323, MYSQL40,
  1200. ANSI, NO_AUTO_VALUE_ON_ZERO, NO_BACKSLASH_ESCAPES,
  1201. STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE,
  1202. NO_ZERO_DATE, ALLOW_INVALID_DATES,
  1203. ERROR_FOR_DIVISION_BY_ZERO, TRADITIONAL,
  1204. NO_AUTO_CREATE_USER, HIGH_NOT_PRECEDENCE,
  1205. NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH,
  1206. EMPTY_STRING_IS_NULL, SIMULTANEOUS_ASSIGNMENT
  1207. --stack-trace Print a symbolic stack trace on failure
  1208. (Defaults to on; use --skip-stack-trace to disable.)
  1209. --standard-compliant-cte
  1210. Allow only CTEs compliant to SQL standard
  1211. (Defaults to on; use --skip-standard-compliant-cte to disable.)
  1212. --stored-program-cache=#
  1213. The soft upper limit for number of cached stored routines
  1214. for one connection.
  1215. --strict-password-validation
  1216. When password validation plugins are enabled, reject
  1217. passwords that cannot be validated (passwords specified
  1218. as a hash)
  1219. (Defaults to on; use --skip-strict-password-validation to disable.)
  1220. -s, --symbolic-links
  1221. Enable symbolic link support.
  1222. --sync-binlog=# Synchronously flush binary log to disk after every #th
  1223. event. Use 0 (default) to disable synchronous flushing
  1224. --sync-frm Sync .frm files to disk on creation
  1225. (Defaults to on; use --skip-sync-frm to disable.)
  1226. --sync-master-info=#
  1227. Synchronously flush master info to disk after every #th
  1228. event. Use 0 to disable synchronous flushing
  1229. --sync-relay-log=# Synchronously flush relay log to disk after every #th
  1230. event. Use 0 to disable synchronous flushing
  1231. --sync-relay-log-info=#
  1232. Synchronously flush relay log info to disk after every
  1233. #th transaction. Use 0 to disable synchronous flushing
  1234. --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
  1235. safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
  1236. value different for different invocations, even within
  1237. the same statement.
  1238. --system-versioning-alter-history=name
  1239. Versioning ALTER TABLE mode. ERROR: Fail ALTER with
  1240. error; KEEP: Keep historical system rows and subject them
  1241. to ALTER
  1242. --table-cache=# Deprecated; use --table-open-cache instead.
  1243. --table-definition-cache=#
  1244. The number of cached table definitions
  1245. --table-open-cache=#
  1246. The number of cached open tables
  1247. --table-open-cache-instances=#
  1248. Maximum number of table cache instances
  1249. --tc-heuristic-recover=name
  1250. Decision to use in heuristic recover process. One of: OFF,
  1251. COMMIT, ROLLBACK
  1252. --tcp-keepalive-interval=#
  1253. The interval, in seconds, between when successive
  1254. keep-alive packets are sent if no acknowledgement is
  1255. received.If set to 0, system dependent default is used.
  1256. (Automatically configured unless set explicitly)
  1257. --tcp-keepalive-probes=#
  1258. The number of unacknowledged probes to send before
  1259. considering the connection dead and notifying the
  1260. application layer.If set to 0, system dependent default
  1261. is used. (Automatically configured unless set explicitly)
  1262. --tcp-keepalive-time=#
  1263. Timeout, in milliseconds, with no activity until the
  1264. first TCP keep-alive packet is sent.If set to 0, system
  1265. dependent default is used. (Automatically configured
  1266. unless set explicitly)
  1267. --tcp-nodelay Set option TCP_NODELAY (disable Nagle's algorithm) on
  1268. socket
  1269. (Defaults to on; use --skip-tcp-nodelay to disable.)
  1270. --thread-cache-size=#
  1271. How many threads we should keep in a cache for reuse.
  1272. These are freed after 5 minutes of idle time
  1273. --thread-pool-idle-timeout=#
  1274. Timeout in seconds for an idle thread in the thread
  1275. pool.Worker thread will be shut down after timeout
  1276. --thread-pool-max-threads=#
  1277. Maximum allowed number of worker threads in the thread
  1278. pool
  1279. --thread-pool-oversubscribe=#
  1280. How many additional active worker threads in a group are
  1281. allowed.
  1282. --thread-pool-prio-kickup-timer=#
  1283. The number of milliseconds before a dequeued low-priority
  1284. statement is moved to the high-priority queue
  1285. --thread-pool-priority=name
  1286. Threadpool priority. High priority connections usually
  1287. start executing earlier than low priority.If priority set
  1288. to 'auto', the the actual priority(low or high) is
  1289. determined based on whether or not connection is inside
  1290. transaction.
  1291. --thread-pool-size=#
  1292. Number of thread groups in the pool. This parameter is
  1293. roughly equivalent to maximum number of concurrently
  1294. executing threads (threads in a waiting state do not
  1295. count as executing).
  1296. --thread-pool-stall-limit=#
  1297. Maximum query execution time in milliseconds,before an
  1298. executing non-yielding thread is considered stalled.If a
  1299. worker thread is stalled, additional worker thread may be
  1300. created to handle remaining clients.
  1301. --thread-stack=# The stack size for each thread
  1302. --time-format=name The TIME format (ignored)
  1303. --timed-mutexes Specify whether to time mutexes. Deprecated, has no
  1304. effect.
  1305. --tmp-disk-table-size=#
  1306. Max size for data for an internal temporary on-disk
  1307. MyISAM or Aria table.
  1308. --tmp-memory-table-size=#
  1309. If an internal in-memory temporary table exceeds this
  1310. size, MariaDB will automatically convert it to an on-disk
  1311. MyISAM or Aria table. Same as tmp_table_size.
  1312. --tmp-table-size=# Alias for tmp_memory_table_size. If an internal in-memory
  1313. temporary table exceeds this size, MariaDB will
  1314. automatically convert it to an on-disk MyISAM or Aria
  1315. table.
  1316. -t, --tmpdir=name Path for temporary files. Several paths may be specified,
  1317. separated by a colon (:), in this case they are used in a
  1318. round-robin fashion
  1319. --transaction-alloc-block-size=#
  1320. Allocation block size for transactions to be stored in
  1321. binary log
  1322. --transaction-isolation=name
  1323. Default transaction isolation level. One of:
  1324. READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ,
  1325. SERIALIZABLE
  1326. --transaction-prealloc-size=#
  1327. Persistent buffer for transactions to be stored in binary
  1328. log
  1329. --transaction-read-only
  1330. Default transaction access mode. True if transactions are
  1331. read-only.
  1332. --updatable-views-with-limit=name
  1333. YES = Don't issue an error message (warning only) if a
  1334. VIEW without presence of a key of the underlying table is
  1335. used in queries with a LIMIT clause for updating. NO =
  1336. Prohibit update of a VIEW, which does not contain a key
  1337. of the underlying table and the query uses a LIMIT clause
  1338. (usually get from GUI tools)
  1339. --use-stat-tables=name
  1340. Specifies how to use system statistics tables. One of:
  1341. NEVER, COMPLEMENTARY, PREFERABLY
  1342. -u, --user=name Run mysqld daemon as user.
  1343. --userstat Enables statistics gathering for USER_STATISTICS,
  1344. CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS
  1345. tables in the INFORMATION_SCHEMA
  1346. -v, --verbose Used with --help option for detailed help.
  1347. -V, --version[=name]
  1348. Output version information and exit.
  1349. --wait-timeout=# The number of seconds the server waits for activity on a
  1350. connection before closing it
  1351. Variables (--variable-name=value)
  1352. allow-suspicious-udfs FALSE
  1353. alter-algorithm DEFAULT
  1354. auto-increment-increment 1
  1355. auto-increment-offset 1
  1356. autocommit TRUE
  1357. automatic-sp-privileges TRUE
  1358. back-log 80
  1359. big-tables FALSE
  1360. bind-address (No default value)
  1361. binlog-annotate-row-events TRUE
  1362. binlog-cache-size 32768
  1363. binlog-checksum CRC32
  1364. binlog-commit-wait-count 0
  1365. binlog-commit-wait-usec 100000
  1366. binlog-direct-non-transactional-updates FALSE
  1367. binlog-file-cache-size 16384
  1368. binlog-format MIXED
  1369. binlog-optimize-thread-scheduling TRUE
  1370. binlog-row-event-max-size 8192
  1371. binlog-row-image FULL
  1372. binlog-stmt-cache-size 32768
  1373. bulk-insert-buffer-size 8388608
  1374. character-set-client-handshake TRUE
  1375. character-set-filesystem binary
  1376. character-sets-dir MYSQL_CHARSETSDIR/
  1377. chroot (No default value)
  1378. column-compression-threshold 100
  1379. column-compression-zlib-level 6
  1380. column-compression-zlib-strategy DEFAULT_STRATEGY
  1381. column-compression-zlib-wrap FALSE
  1382. completion-type NO_CHAIN
  1383. concurrent-insert AUTO
  1384. console TRUE
  1385. date-format %Y-%m-%d
  1386. datetime-format %Y-%m-%d %H:%i:%s
  1387. deadlock-search-depth-long 15
  1388. deadlock-search-depth-short 4
  1389. deadlock-timeout-long 50000000
  1390. deadlock-timeout-short 10000
  1391. default-regex-flags
  1392. default-storage-engine myisam
  1393. default-time-zone (No default value)
  1394. default-tmp-storage-engine (No default value)
  1395. default-week-format 0
  1396. delay-key-write ON
  1397. delayed-insert-limit 100
  1398. delayed-insert-timeout 300
  1399. delayed-queue-size 1000
  1400. div-precision-increment 4
  1401. encrypt-binlog FALSE
  1402. encrypt-tmp-disk-tables FALSE
  1403. encrypt-tmp-files FALSE
  1404. enforce-storage-engine (No default value)
  1405. event-scheduler OFF
  1406. expensive-subquery-limit 100
  1407. expire-logs-days 0
  1408. explicit-defaults-for-timestamp FALSE
  1409. external-locking FALSE
  1410. extra-max-connections 1
  1411. extra-port 0
  1412. flashback FALSE
  1413. flush FALSE
  1414. flush-time 0
  1415. ft-boolean-syntax + -><()~*:""&|
  1416. ft-max-word-len 84
  1417. ft-min-word-len 4
  1418. ft-query-expansion-limit 20
  1419. ft-stopword-file (No default value)
  1420. gdb FALSE
  1421. general-log FALSE
  1422. getopt-prefix-matching FALSE
  1423. group-concat-max-len 1048576
  1424. gtid-domain-id 0
  1425. gtid-ignore-duplicates FALSE
  1426. gtid-pos-auto-engines
  1427. gtid-strict-mode FALSE
  1428. help TRUE
  1429. histogram-size 0
  1430. histogram-type SINGLE_PREC_HB
  1431. host-cache-size 279
  1432. idle-readonly-transaction-timeout 0
  1433. idle-transaction-timeout 0
  1434. idle-write-transaction-timeout 0
  1435. ignore-builtin-innodb FALSE
  1436. ignore-db-dirs
  1437. init-connect
  1438. init-file (No default value)
  1439. init-rpl-role MASTER
  1440. init-slave
  1441. interactive-timeout 28800
  1442. join-buffer-size 262144
  1443. join-buffer-space-limit 2097152
  1444. join-cache-level 2
  1445. keep-files-on-create FALSE
  1446. key-buffer-size 134217728
  1447. key-cache-age-threshold 300
  1448. key-cache-block-size 1024
  1449. key-cache-division-limit 100
  1450. key-cache-file-hash-size 512
  1451. key-cache-segments 0
  1452. large-pages FALSE
  1453. lc-messages en_US
  1454. lc-messages-dir MYSQL_SHAREDIR/
  1455. lc-time-names en_US
  1456. local-infile TRUE
  1457. lock-wait-timeout 86400
  1458. log-bin (No default value)
  1459. log-bin-compress FALSE
  1460. log-bin-compress-min-len 256
  1461. log-bin-index (No default value)
  1462. log-bin-trust-function-creators FALSE
  1463. log-disabled-statements sp
  1464. log-error
  1465. log-isam myisam.log
  1466. log-output FILE
  1467. log-queries-not-using-indexes FALSE
  1468. log-short-format FALSE
  1469. log-slave-updates FALSE
  1470. log-slow-admin-statements TRUE
  1471. log-slow-disabled-statements sp
  1472. log-slow-filter admin,filesort,filesort_on_disk,filesort_priority_queue,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
  1473. log-slow-rate-limit 1
  1474. log-slow-slave-statements TRUE
  1475. log-slow-verbosity
  1476. log-tc tc.log
  1477. log-warnings 2
  1478. long-query-time 10
  1479. low-priority-updates FALSE
  1480. lower-case-table-names 1
  1481. master-info-file master.info
  1482. master-retry-count 86400
  1483. master-verify-checksum FALSE
  1484. max-allowed-packet 16777216
  1485. max-binlog-cache-size 18446744073709547520
  1486. max-binlog-size 1073741824
  1487. max-binlog-stmt-cache-size 18446744073709547520
  1488. max-connect-errors 100
  1489. max-connections 151
  1490. max-delayed-threads 20
  1491. max-digest-length 1024
  1492. max-error-count 64
  1493. max-heap-table-size 16777216
  1494. max-join-size 18446744073709551615
  1495. max-length-for-sort-data 1024
  1496. max-long-data-size 16777216
  1497. max-prepared-stmt-count 16382
  1498. max-recursive-iterations 18446744073709551615
  1499. max-relay-log-size 1073741824
  1500. max-seeks-for-key 18446744073709551615
  1501. max-session-mem-used 9223372036854775807
  1502. max-sort-length 1024
  1503. max-sp-recursion-depth 0
  1504. max-statement-time 0
  1505. max-tmp-tables 32
  1506. max-user-connections 0
  1507. max-write-lock-count 18446744073709551615
  1508. memlock FALSE
  1509. metadata-locks-cache-size 1024
  1510. metadata-locks-hash-instances 8
  1511. min-examined-row-limit 0
  1512. mrr-buffer-size 262144
  1513. multi-range-count 256
  1514. myisam-block-size 1024
  1515. myisam-data-pointer-size 6
  1516. myisam-max-sort-file-size 9223372036853727232
  1517. myisam-mmap-size 18446744073709551615
  1518. myisam-recover-options BACKUP,QUICK
  1519. myisam-repair-threads 1
  1520. myisam-sort-buffer-size 134216704
  1521. myisam-stats-method NULLS_UNEQUAL
  1522. myisam-use-mmap FALSE
  1523. mysql56-temporal-format TRUE
  1524. net-buffer-length 16384
  1525. net-read-timeout 30
  1526. net-retry-count 10
  1527. net-write-timeout 60
  1528. old FALSE
  1529. old-alter-table DEFAULT
  1530. old-mode
  1531. old-passwords FALSE
  1532. old-style-user-limits FALSE
  1533. optimizer-prune-level 1
  1534. optimizer-search-depth 62
  1535. optimizer-selectivity-sampling-limit 100
  1536. optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on
  1537. optimizer-use-condition-selectivity 1
  1538. performance-schema FALSE
  1539. performance-schema-accounts-size -1
  1540. performance-schema-consumer-events-stages-current FALSE
  1541. performance-schema-consumer-events-stages-history FALSE
  1542. performance-schema-consumer-events-stages-history-long FALSE
  1543. performance-schema-consumer-events-statements-current TRUE
  1544. performance-schema-consumer-events-statements-history FALSE
  1545. performance-schema-consumer-events-statements-history-long FALSE
  1546. performance-schema-consumer-events-waits-current FALSE
  1547. performance-schema-consumer-events-waits-history FALSE
  1548. performance-schema-consumer-events-waits-history-long FALSE
  1549. performance-schema-consumer-global-instrumentation TRUE
  1550. performance-schema-consumer-statements-digest TRUE
  1551. performance-schema-consumer-thread-instrumentation TRUE
  1552. performance-schema-digests-size -1
  1553. performance-schema-events-stages-history-long-size -1
  1554. performance-schema-events-stages-history-size -1
  1555. performance-schema-events-statements-history-long-size -1
  1556. performance-schema-events-statements-history-size -1
  1557. performance-schema-events-waits-history-long-size -1
  1558. performance-schema-events-waits-history-size -1
  1559. performance-schema-hosts-size -1
  1560. performance-schema-instrument
  1561. performance-schema-max-cond-classes 80
  1562. performance-schema-max-cond-instances -1
  1563. performance-schema-max-digest-length 1024
  1564. performance-schema-max-file-classes 50
  1565. performance-schema-max-file-handles 32768
  1566. performance-schema-max-file-instances -1
  1567. performance-schema-max-mutex-classes 200
  1568. performance-schema-max-mutex-instances -1
  1569. performance-schema-max-rwlock-classes 40
  1570. performance-schema-max-rwlock-instances -1
  1571. performance-schema-max-socket-classes 10
  1572. performance-schema-max-socket-instances -1
  1573. performance-schema-max-stage-classes 160
  1574. performance-schema-max-statement-classes 200
  1575. performance-schema-max-table-handles -1
  1576. performance-schema-max-table-instances -1
  1577. performance-schema-max-thread-classes 50
  1578. performance-schema-max-thread-instances -1
  1579. performance-schema-session-connect-attrs-size -1
  1580. performance-schema-setup-actors-size 100
  1581. performance-schema-setup-objects-size 100
  1582. performance-schema-users-size -1
  1583. port 3306
  1584. port-open-timeout 0
  1585. preload-buffer-size 32768
  1586. profiling-history-size 15
  1587. progress-report-time 5
  1588. protocol-version 10
  1589. proxy-protocol-networks
  1590. query-alloc-block-size 16384
  1591. query-cache-limit 1048576
  1592. query-cache-min-res-unit 4096
  1593. query-cache-size 1048576
  1594. query-cache-strip-comments FALSE
  1595. query-cache-type OFF
  1596. query-cache-wlock-invalidate FALSE
  1597. query-prealloc-size 24576
  1598. range-alloc-block-size 4096
  1599. read-binlog-speed-limit 0
  1600. read-buffer-size 131072
  1601. read-only FALSE
  1602. read-rnd-buffer-size 262144
  1603. relay-log (No default value)
  1604. relay-log-index (No default value)
  1605. relay-log-info-file relay-log.info
  1606. relay-log-purge TRUE
  1607. relay-log-recovery FALSE
  1608. relay-log-space-limit 0
  1609. replicate-annotate-row-events TRUE
  1610. replicate-events-marked-for-skip REPLICATE
  1611. replicate-same-server-id FALSE
  1612. report-host (No default value)
  1613. report-password (No default value)
  1614. report-port 0
  1615. report-user (No default value)
  1616. rowid-merge-buff-size 8388608
  1617. rpl-semi-sync-master-enabled FALSE
  1618. rpl-semi-sync-master-timeout 10000
  1619. rpl-semi-sync-master-trace-level 32
  1620. rpl-semi-sync-master-wait-no-slave TRUE
  1621. rpl-semi-sync-master-wait-point AFTER_COMMIT
  1622. rpl-semi-sync-slave-delay-master FALSE
  1623. rpl-semi-sync-slave-enabled FALSE
  1624. rpl-semi-sync-slave-kill-conn-timeout 5
  1625. rpl-semi-sync-slave-trace-level 32
  1626. safe-user-create FALSE
  1627. secure-auth TRUE
  1628. secure-file-priv (No default value)
  1629. secure-timestamp NO
  1630. server-id 1
  1631. session-track-schema TRUE
  1632. session-track-state-change FALSE
  1633. session-track-system-variables autocommit,character_set_client,character_set_connection,character_set_results,time_zone
  1634. session-track-transaction-info OFF
  1635. show-slave-auth-info FALSE
  1636. silent-startup FALSE
  1637. skip-grant-tables TRUE
  1638. skip-name-resolve FALSE
  1639. skip-networking FALSE
  1640. skip-show-database FALSE
  1641. skip-slave-start FALSE
  1642. slave-compressed-protocol FALSE
  1643. slave-ddl-exec-mode IDEMPOTENT
  1644. slave-domain-parallel-threads 0
  1645. slave-exec-mode STRICT
  1646. slave-max-allowed-packet 1073741824
  1647. slave-net-timeout 60
  1648. slave-parallel-max-queued 131072
  1649. slave-parallel-mode conservative
  1650. slave-parallel-threads 0
  1651. slave-parallel-workers 0
  1652. slave-run-triggers-for-rbr NO
  1653. slave-skip-errors OFF
  1654. slave-sql-verify-checksum TRUE
  1655. slave-transaction-retries 10
  1656. slave-transaction-retry-errors 1213,1205
  1657. slave-transaction-retry-interval 0
  1658. slave-type-conversions
  1659. slow-launch-time 2
  1660. slow-query-log FALSE
  1661. sort-buffer-size 2097152
  1662. sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  1663. stack-trace TRUE
  1664. standard-compliant-cte TRUE
  1665. stored-program-cache 256
  1666. strict-password-validation TRUE
  1667. symbolic-links FALSE
  1668. sync-binlog 0
  1669. sync-frm FALSE
  1670. sync-master-info 10000
  1671. sync-relay-log 10000
  1672. sync-relay-log-info 10000
  1673. sysdate-is-now FALSE
  1674. system-versioning-alter-history ERROR
  1675. table-cache 421
  1676. table-definition-cache 400
  1677. table-open-cache 421
  1678. table-open-cache-instances 8
  1679. tc-heuristic-recover OFF
  1680. tcp-keepalive-interval 0
  1681. tcp-keepalive-probes 0
  1682. tcp-keepalive-time 0
  1683. tcp-nodelay TRUE
  1684. thread-cache-size 151
  1685. thread-pool-idle-timeout 60
  1686. thread-pool-max-threads 65536
  1687. thread-pool-oversubscribe 3
  1688. thread-pool-prio-kickup-timer 1000
  1689. thread-pool-priority auto
  1690. thread-pool-stall-limit 500
  1691. thread-stack 299008
  1692. time-format %H:%i:%s
  1693. timed-mutexes FALSE
  1694. tmp-disk-table-size 18446744073709551615
  1695. tmp-memory-table-size 16777216
  1696. tmp-table-size 16777216
  1697. transaction-alloc-block-size 8192
  1698. transaction-isolation REPEATABLE-READ
  1699. transaction-prealloc-size 4096
  1700. transaction-read-only FALSE
  1701. updatable-views-with-limit YES
  1702. use-stat-tables NEVER
  1703. userstat FALSE
  1704. verbose TRUE
  1705. wait-timeout 28800
  1706. To see what values a running MySQL server is using, type
  1707. 'mysqladmin variables' instead of 'mysqld --verbose --help'.