#At file:///home/andrei/MySQL/BZR/2a-23May/WL/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped
3246 Andrei Elkin 2010-12-14 [merge]
merge from wl5569 repo
added:
mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result
mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test
modified:
mysql-test/extra/rpl_tests/rpl_crash_safe.inc
mysql-test/r/mysqld--help-notwin.result
mysql-test/r/mysqld--help-win.result
mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result
mysql-test/suite/rpl/r/rpl_row_crash_safe.result
mysql-test/suite/rpl/r/rpl_stm_crash_safe.result
mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt
mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt
mysql-test/suite/rpl/t/rpl_stm_crash_safe-slave.opt
mysql-test/suite/sys_vars/r/all_vars.result
scripts/mysql_install_db.pl.in
scripts/mysql_install_db.sh
sql/lock.cc
sql/mysqld.cc
sql/mysqld.h
sql/rpl_info.cc
sql/rpl_info.h
sql/rpl_info_factory.cc
sql/rpl_info_table.cc
sql/rpl_info_table.h
sql/rpl_info_table_access.cc
sql/rpl_rli.cc
sql/rpl_slave.cc
sql/sql_parse.cc
=== modified file 'mysql-test/extra/rpl_tests/rpl_crash_safe.inc'
--- a/mysql-test/extra/rpl_tests/rpl_crash_safe.inc 2010-10-27 11:50:22 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_crash_safe.inc 2010-12-13 21:16:31 +0000
@@ -11,8 +11,6 @@ if (`SELECT HEX(@commands) = HEX('config
{
--sync_slave_with_master
SHOW CREATE TABLE mysql.slave_relay_log_info;
- ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
- SHOW CREATE TABLE mysql.slave_relay_log_info;
connection master;
--source extra/rpl_tests/rpl_mixing_engines.inc
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result 2010-12-14 08:57:16 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result 2010-12-14 14:46:20 +0000
@@ -271,6 +271,8 @@ The following options may be given as th
If set to 1 table names are stored in lowercase on disk
and table names will be case-insensitive. Should be set
to 2 if you are using a case insensitive file system
+ --master-info-engine=name
+ The storage engine for the master info repository
--master-info-file=name
The location and name of the file that remembers the
master and where the I/O replication thread is in the
@@ -538,6 +540,8 @@ The following options may be given as th
--relay-log=name The location and name to use for relay logs
--relay-log-index=name
File that holds the names for relay log files.
+ --relay-log-info-engine=name
+ The storage engine for the relay info repository
--relay-log-info-file=name
The location and name of the file that remembers where
the SQL replication thread is in the relay logs
@@ -772,6 +776,8 @@ The following options may be given as th
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
+ --worker-info-engine=name
+ The storage engine for the worker info repository
--worker-info-repository=name
Defines the type of the repository for the worker
information.
@@ -863,6 +869,7 @@ log-warnings 1
long-query-time 10
low-priority-updates FALSE
lower-case-table-names 1
+master-info-engine (No default value)
master-info-file master.info
master-info-repository FILE
master-retry-count 86400
@@ -956,6 +963,7 @@ read-only FALSE
read-rnd-buffer-size 262144
relay-log (No default value)
relay-log-index (No default value)
+relay-log-info-engine (No default value)
relay-log-info-file relay-log.info
relay-log-info-repository FILE
relay-log-purge TRUE
@@ -1011,6 +1019,7 @@ transaction-prealloc-size 4096
updatable-views-with-limit YES
verbose TRUE
wait-timeout 28800
+worker-info-engine (No default value)
worker-info-repository FILE
To see what values a running MySQL server is using, type
=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result 2010-12-13 14:52:50 +0000
+++ b/mysql-test/r/mysqld--help-win.result 2010-12-14 12:51:30 +0000
@@ -270,6 +270,8 @@ The following options may be given as th
If set to 1 table names are stored in lowercase on disk
and table names will be case-insensitive. Should be set
to 2 if you are using a case insensitive file system
+ --master-info-engine=name
+ The storage engine for the master info repository
--master-info-file=name
The location and name of the file that remembers the
master and where the I/O replication thread is in the
@@ -529,6 +531,8 @@ The following options may be given as th
--relay-log=name The location and name to use for relay logs
--relay-log-index=name
File that holds the names for relay log files.
+ --relay-log-info-engine=name
+ The storage engine for the relay info repository
--relay-log-info-file=name
The location and name of the file that remembers where
the SQL replication thread is in the relay logs
@@ -776,6 +780,8 @@ The following options may be given as th
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
+ --worker-info-engine=name
+ The storage engine for the worker info repository
--worker-info-repository=name
Defines the type of the repository for the worker
information.
@@ -866,6 +872,7 @@ log-warnings 1
long-query-time 10
low-priority-updates FALSE
lower-case-table-names 1
+master-info-engine (No default value)
master-info-file master.info
master-info-repository FILE
master-retry-count 86400
@@ -957,6 +964,7 @@ read-only FALSE
read-rnd-buffer-size 262144
relay-log (No default value)
relay-log-index (No default value)
+relay-log-info-engine (No default value)
relay-log-info-file relay-log.info
relay-log-info-repository FILE
relay-log-purge TRUE
@@ -1017,6 +1025,7 @@ transaction-prealloc-size 4096
updatable-views-with-limit YES
verbose TRUE
wait-timeout 28800
+worker-info-engine (No default value)
worker-info-repository FILE
To see what values a running MySQL server is using, type
=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result 2010-11-16 12:48:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result 2010-12-13 21:16:31 +0000
@@ -25,19 +25,6 @@ slave_relay_log_info CREATE TABLE `slave
`Master_log_pos` bigint(20) unsigned NOT NULL,
`Sql_delay` int(11) NOT NULL,
PRIMARY KEY (`Master_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table Create Table
-slave_relay_log_info CREATE TABLE `slave_relay_log_info` (
- `Master_id` int(10) unsigned NOT NULL,
- `Number_of_lines` int(10) unsigned NOT NULL,
- `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Relay_log_pos` bigint(20) unsigned NOT NULL,
- `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Master_log_pos` bigint(20) unsigned NOT NULL,
- `Sql_delay` int(11) NOT NULL,
- PRIMARY KEY (`Master_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
SET SQL_LOG_BIN=0;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
=== modified file 'mysql-test/suite/rpl/r/rpl_row_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_row_crash_safe.result 2010-11-16 12:48:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_crash_safe.result 2010-12-13 21:16:31 +0000
@@ -25,19 +25,6 @@ slave_relay_log_info CREATE TABLE `slave
`Master_log_pos` bigint(20) unsigned NOT NULL,
`Sql_delay` int(11) NOT NULL,
PRIMARY KEY (`Master_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table Create Table
-slave_relay_log_info CREATE TABLE `slave_relay_log_info` (
- `Master_id` int(10) unsigned NOT NULL,
- `Number_of_lines` int(10) unsigned NOT NULL,
- `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Relay_log_pos` bigint(20) unsigned NOT NULL,
- `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Master_log_pos` bigint(20) unsigned NOT NULL,
- `Sql_delay` int(11) NOT NULL,
- PRIMARY KEY (`Master_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
SET SQL_LOG_BIN=0;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
=== modified file 'mysql-test/suite/rpl/r/rpl_stm_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_crash_safe.result 2010-11-16 12:48:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_crash_safe.result 2010-12-13 21:16:31 +0000
@@ -25,19 +25,6 @@ slave_relay_log_info CREATE TABLE `slave
`Master_log_pos` bigint(20) unsigned NOT NULL,
`Sql_delay` int(11) NOT NULL,
PRIMARY KEY (`Master_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table Create Table
-slave_relay_log_info CREATE TABLE `slave_relay_log_info` (
- `Master_id` int(10) unsigned NOT NULL,
- `Number_of_lines` int(10) unsigned NOT NULL,
- `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Relay_log_pos` bigint(20) unsigned NOT NULL,
- `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
- `Master_log_pos` bigint(20) unsigned NOT NULL,
- `Sql_delay` int(11) NOT NULL,
- PRIMARY KEY (`Master_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
SET SQL_LOG_BIN=0;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
=== modified file 'mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt 2010-10-27 11:50:22 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt 2010-12-13 21:16:31 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1
=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt 2010-10-27 11:50:22 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt 2010-12-13 21:16:31 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1
=== modified file 'mysql-test/suite/rpl/t/rpl_stm_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_crash_safe-slave.opt 2010-10-27 11:50:22 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_crash_safe-slave.opt 2010-12-13 21:16:31 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1
=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result 2010-12-13 14:52:50 +0000
+++ b/mysql-test/suite/sys_vars/r/all_vars.result 2010-12-13 21:16:31 +0000
@@ -18,7 +18,6 @@ OPT_MTS_WORKER_UNDERRUN_LEVEL
SLAVE_RUN_QUERY_IN_PARALLEL
INNODB_STATS_PERSISTENT_SAMPLE_PAGES
RELAY_LOG_BASENAME
-MTS_CHECKPOINT_PERIOD
LOG_BIN_BASENAME
INNODB_ANALYZE_IS_PERSISTENT
INNODB_RESET_MONITOR_COUNTER
@@ -38,7 +37,6 @@ OPT_MTS_WORKER_UNDERRUN_LEVEL
SLAVE_RUN_QUERY_IN_PARALLEL
INNODB_STATS_PERSISTENT_SAMPLE_PAGES
RELAY_LOG_BASENAME
-MTS_CHECKPOINT_PERIOD
LOG_BIN_BASENAME
INNODB_ANALYZE_IS_PERSISTENT
INNODB_RESET_MONITOR_COUNTER
=== added file 'mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result'
--- a/mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result 2010-12-14 12:51:30 +0000
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.mts_checkpoint_period;
+SELECT @start_global_value;
+@start_global_value
+300
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+300
+select @@session.mts_checkpoint_period;
+ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable
+show global variables like 'mts_checkpoint_period';
+Variable_name Value
+mts_checkpoint_period 300
+show session variables like 'mts_checkpoint_period';
+Variable_name Value
+mts_checkpoint_period 300
+select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
+VARIABLE_NAME VARIABLE_VALUE
+MTS_CHECKPOINT_PERIOD 300
+select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+VARIABLE_NAME VARIABLE_VALUE
+MTS_CHECKPOINT_PERIOD 300
+set global mts_checkpoint_period=1;
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+1
+set session mts_checkpoint_period=1;
+ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable and should be set with SET GLOBAL
+set global mts_checkpoint_period=1.1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period=1e1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period="foo";
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period=0;
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+0
+set global mts_checkpoint_period=cast(-1 as unsigned int);
+Warnings:
+Warning 1292 Truncated incorrect mts_checkpoint_period value: '18446744073709551615'
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+4294967295
+SET @@global.mts_checkpoint_period = @start_global_value;
+SELECT @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+300
=== added file 'mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test'
--- a/mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test 2010-12-13 21:16:31 +0000
@@ -0,0 +1,44 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.mts_checkpoint_period;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.mts_checkpoint_period;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.mts_checkpoint_period;
+show global variables like 'mts_checkpoint_period';
+show session variables like 'mts_checkpoint_period';
+select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
+select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+
+#
+# show that it's writable
+#
+set global mts_checkpoint_period=1;
+select @@global.mts_checkpoint_period;
+--error ER_GLOBAL_VARIABLE
+set session mts_checkpoint_period=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period="foo";
+
+#
+# min/max values
+#
+set global mts_checkpoint_period=0;
+select @@global.mts_checkpoint_period;
+set global mts_checkpoint_period=cast(-1 as unsigned int);
+select @@global.mts_checkpoint_period;
+
+SET @@global.mts_checkpoint_period = @start_global_value;
+SELECT @@global.mts_checkpoint_period;
=== modified file 'scripts/mysql_install_db.pl.in'
--- a/scripts/mysql_install_db.pl.in 2010-10-25 10:39:01 +0000
+++ b/scripts/mysql_install_db.pl.in 2010-12-13 21:16:31 +0000
@@ -79,11 +79,6 @@ Usage: $0 [OPTIONS]
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
- --rpl-engine=engine The storage engine used for the mysql.slave_master_info and
- mysql.slave_relay_log_info tables. By default, both tables are
- created using the MyISAM storage engine. However, any storage
- engine available to the server may be used. If a crash-safe
- slave is required, the storage engine must be transactional.
All other options are passed to the mysqld program
@@ -122,7 +117,6 @@ sub parse_arguments
"builddir=s", # FIXME not documented
"srcdir=s",
"ldata|datadir=s",
- "rpl-engine=s",
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
@@ -459,29 +453,6 @@ if ( open(PIPE, "| $mysqld_install_cmd_l
report_verbose($opt,"OK");
# ----------------------------------------------------------------------
- # Pipe ALTER TABLE mysql.slave_master_info|slave_relay_log_info to "mysqld --bootstrap"
- # ----------------------------------------------------------------------
-
- if ($opt->{'rpl-engine'})
- {
- report_verbose_wait($opt,"Setting engine for mysql.slave_master_info mysql.slave_relay_log_info tables...");
- if ( open(PIPE, "| $mysqld_install_cmd_line") )
- {
- print PIPE "use mysql;\n";
- print PIPE "ALTER TABLE mysql.slave_master_info ENGINE= " . $opt->{'rpl-engine'} . ";\n";
- print PIPE "ALTER TABLE mysql.slave_relay_log_info ENGINE= " . $opt->{'$rpl-engine'} . ";\n";
- close PIPE;
-
- report_verbose($opt,"OK");
- }
- else
- {
- warning($opt,"CRASH-SAFE SLAVE IS NOT COMPLETELY CONFIGURED!",
- "The \"CRASH-SAFE SLAVE\" might not work properly.");
- }
- }
-
- # ----------------------------------------------------------------------
# Pipe fill_help_tables.sql to "mysqld --bootstrap"
# ----------------------------------------------------------------------
=== modified file 'scripts/mysql_install_db.sh'
--- a/scripts/mysql_install_db.sh 2010-10-25 10:39:01 +0000
+++ b/scripts/mysql_install_db.sh 2010-12-13 21:16:31 +0000
@@ -63,11 +63,6 @@ Usage: $0 [OPTIONS]
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
- --rpl-engine=engine The storage engine used for the mysql.slave_master_info and
- mysql.slave_relay_log_info tables. By default, both tables are
- created using the MyISAM storage engine. However, any storage
- engine available to the server may be used. If a crash-safe
- slave is required, the storage engine must be transactional.
All other options are passed to the mysqld program
@@ -120,8 +115,6 @@ parse_arguments()
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
defaults="$arg" ;;
- --rpl-engine=*) rpl_engine=`parse_arg "$arg"` ;;
-
--cross-bootstrap|--windows)
# Used when building the MySQL system tables on a different host than
# the target. The platform-independent files that are created in
@@ -434,19 +427,6 @@ else
exit 1
fi
-if test -n "$rpl_engine"
-then
- s_echo "Setting engine for mysql.slave_master_info mysql.slave_relay_log_info tables..."
- if { echo "use mysql;"; echo "ALTER TABLE mysql.slave_master_info ENGINE= $rpl_engine;"; echo "ALTER TABLE mysql.slave_relay_log_info ENGINE= $rpl_engine;"; } | $mysqld_install_cmd_line > /dev/null
- then
- s_echo "OK"
- else
- echo
- echo "WARNING: CRASH-SAFE SLAVE IS NOT COMPLETELY CONFIGURED!"
- echo "The \"CRASH-SAFE SLAVE\" might not work properly."
- fi
-fi
-
s_echo "Filling help tables..."
if { echo "use mysql;"; cat $fill_help_tables; } | $mysqld_install_cmd_line > /dev/null
then
=== modified file 'sql/lock.cc'
--- a/sql/lock.cc 2010-11-23 22:37:59 +0000
+++ b/sql/lock.cc 2010-12-13 21:16:31 +0000
@@ -154,8 +154,10 @@ lock_tables_check(THD *thd, TABLE **tabl
or hold any type of lock in a session,
since this would be a DOS attack.
*/
- if (t->reginfo.lock_type >= TL_READ_NO_INSERT ||
- thd->lex->sql_command == SQLCOM_LOCK_TABLES)
+ if ((t->reginfo.lock_type >= TL_READ_NO_INSERT ||
+ thd->lex->sql_command == SQLCOM_LOCK_TABLES) &&
+ thd->lex->sql_command != SQLCOM_ALTER_TABLE &&
+ !thd->slave_thread)
{
my_error(ER_CANT_LOCK_RPL_INFO_TABLE, MYF(0));
DBUG_RETURN(1);
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2010-12-14 08:57:16 +0000
+++ b/sql/mysqld.cc 2010-12-14 14:46:20 +0000
@@ -339,6 +339,9 @@ static char *lc_time_names_name;
char *my_bind_addr_str;
static char *default_collation_name;
char *default_storage_engine;
+char *master_info_engine= 0;
+char *relay_log_info_engine= 0;
+char *worker_info_engine= 0;
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
static I_List<THD> thread_cache;
static bool binlog_format_used= false;
@@ -5965,6 +5968,15 @@ struct my_option my_long_options[]=
{"default-storage-engine", 0, "The default storage engine for new tables",
&default_storage_engine, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0 },
+ {"master-info-engine", 0, "The storage engine for the master info repository",
+ &master_info_engine, 0, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0 },
+ {"relay-log-info-engine", 0, "The storage engine for the relay info repository",
+ &relay_log_info_engine, 0, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0 },
+ {"worker-info-engine", 0, "The storage engine for the worker info repository",
+ &worker_info_engine, 0, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0 },
{"default-time-zone", 0, "Set the default time zone.",
&default_tz_name, &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h 2010-12-14 08:57:16 +0000
+++ b/sql/mysqld.h 2010-12-14 14:46:20 +0000
@@ -122,6 +122,9 @@ extern my_bool opt_enable_shared_memory;
extern char *default_tz_name;
extern Time_zone *default_tz;
extern char *default_storage_engine;
+extern char *master_info_engine;
+extern char *relay_log_info_engine;
+extern char *worker_info_engine;
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
extern bool opt_using_transactions;
=== modified file 'sql/rpl_info.cc'
--- a/sql/rpl_info.cc 2010-12-13 15:57:01 +0000
+++ b/sql/rpl_info.cc 2010-12-14 12:51:30 +0000
@@ -42,18 +42,14 @@ void Rpl_info::set_rpl_info_handler(Rpl_
}
Rpl_info_coordinator::Rpl_info_coordinator(const char* type, const char* psf)
- : Rpl_info(type)
+ : Rpl_info(type), mutex_info(0), cond_info(0), key_mutex_info(0),
+ key_cond_info(0)
{
register_mutexes(psf);
}
bool Rpl_info_coordinator::register_mutexes(const char* description)
{
- PSI_mutex_info *mutex_info= NULL;
- PSI_cond_info *cond_info= NULL;
- PSI_mutex_key *key_mutex_info= NULL;
- PSI_cond_key *key_cond_info= NULL;
-
const int NUMBER_MUTEX_INFO= 2;
const int RUN_LOCK_IDX= 0;
const int DATA_LOCK_IDX= 1;
@@ -118,8 +114,8 @@ err:
if (mutex_info)
delete []mutex_info;
- if (mutex_info)
- delete []mutex_info;
+ if (cond_info)
+ delete []cond_info;
return (TRUE);
}
@@ -135,6 +131,18 @@ Rpl_info_coordinator::~Rpl_info_coordina
mysql_cond_destroy(&data_cond);
mysql_cond_destroy(&start_cond);
mysql_cond_destroy(&stop_cond);
+
+ if (key_mutex_info)
+ delete []key_mutex_info;
+
+ if (key_cond_info)
+ delete []key_cond_info;
+
+ if (mutex_info)
+ delete []mutex_info;
+
+ if (cond_info)
+ delete []cond_info;
}
DBUG_VOID_RETURN;
=== modified file 'sql/rpl_info.h'
--- a/sql/rpl_info.h 2010-12-08 01:30:32 +0000
+++ b/sql/rpl_info.h 2010-12-14 12:51:30 +0000
@@ -133,6 +133,11 @@ protected:
bool register_mutexes(const char* description);
private:
+ PSI_mutex_info *mutex_info;
+ PSI_cond_info *cond_info;
+ PSI_mutex_key *key_mutex_info;
+ PSI_cond_key *key_cond_info;
+
Rpl_info_coordinator& operator=(const Rpl_info_coordinator& info);
Rpl_info_coordinator(const Rpl_info_coordinator& info);
};
=== modified file 'sql/rpl_info_factory.cc'
--- a/sql/rpl_info_factory.cc 2010-12-09 16:17:32 +0000
+++ b/sql/rpl_info_factory.cc 2010-12-13 21:16:31 +0000
@@ -18,14 +18,6 @@
#include "rpl_slave.h"
#include "rpl_info_factory.h"
-/*
- We need to replace these definitions by an option that states the
- engine one wants to use in the master info repository.
-*/
-#define master_info_engine NULL
-#define relay_log_info_engine NULL
-#define worker_info_engine NULL
-
#define NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR 1
#define NUMBER_OF_FIELDS_TO_IDENTIFY_WORKER 2
=== modified file 'sql/rpl_info_table.cc'
--- a/sql/rpl_info_table.cc 2010-12-08 00:33:48 +0000
+++ b/sql/rpl_info_table.cc 2010-12-13 21:16:31 +0000
@@ -15,12 +15,12 @@
#include "rpl_info_table.h"
#include "rpl_utility.h"
-#include "sql_parse.h"
+#include "sql_prepare.h"
Rpl_info_table::Rpl_info_table(uint nparam,
const char* param_schema,
const char *param_table)
-:Rpl_info_handler(nparam)
+:Rpl_info_handler(nparam), is_transactional(FALSE)
{
str_schema.str= str_table.str= NULL;
str_schema.length= str_table.length= 0;
@@ -444,16 +444,37 @@ char* Rpl_info_table::do_get_description
bool Rpl_info_table::do_is_transactional()
{
+ return is_transactional;
+}
+
+bool Rpl_info_table::change_engine(const char *engine)
+{
+ bool error= TRUE;
ulong saved_mode;
TABLE *table= NULL;
Open_tables_backup backup;
- bool is_trans= FALSE;
-
- DBUG_ENTER("Rpl_info_table::do_is_transactional");
+ String query;
+ LEX_STRING lex;
+
+ DBUG_ENTER("Rpl_info_table::do_check_info");
THD *thd= access->create_thd();
-
+ Ed_connection conn(thd);
saved_mode= thd->variables.sql_mode;
+ tmp_disable_binlog(thd);
+
+ if (query.append(STRING_WITH_LEN("ALTER TABLE ")) ||
+ query.append(description) ||
+ query.append(STRING_WITH_LEN(" ENGINE= ")) ||
+ query.append(engine) ||
+ query.append(";"))
+ goto err;
+
+ lex.str= query.c_ptr_safe();
+ lex.length= query.length();
+
+ if ((error= conn.execute_direct(lex)))
+ goto err;
/*
Opens and locks the rpl_info table before accessing it.
@@ -461,30 +482,11 @@ bool Rpl_info_table::do_is_transactional
if (!access->open_table(thd, str_schema, str_table,
get_number_info(), TL_READ,
&table, &backup))
- is_trans= table->file->has_transactions();
+ is_transactional= table->file->has_transactions();
access->close_table(thd, table, &backup, 0);
- thd->variables.sql_mode= saved_mode;
- access->drop_thd(thd);
- DBUG_RETURN(is_trans);
-}
-
-bool Rpl_info_table::change_engine(const char *engine)
-{
- bool error= TRUE;
- ulong saved_mode;
-
- DBUG_ENTER("Rpl_info_table::do_change_engine");
-
- THD *thd= access->create_thd();
-
- saved_mode= thd->variables.sql_mode;
- tmp_disable_binlog(thd);
-
- /* TODO: Change the engine using internal functions */
-
- error= FALSE;
+err:
reenable_binlog(thd);
thd->variables.sql_mode= saved_mode;
access->drop_thd(thd);
=== modified file 'sql/rpl_info_table.h'
--- a/sql/rpl_info_table.h 2010-12-07 03:05:41 +0000
+++ b/sql/rpl_info_table.h 2010-12-13 21:16:31 +0000
@@ -60,6 +60,12 @@ private:
*/
Rpl_info_table_access *access;
+ /*
+ Identifies if a table is transactional or non-transactional.
+ This is used to provide a crash-safe behaviour.
+ */
+ bool is_transactional;
+
int do_init_info(const ulong *uidx, const uint nidx);
int do_check_info(const ulong *uidx, const uint nidx);
void do_end_info(const ulong *uidx, const uint nidx);
=== modified file 'sql/rpl_info_table_access.cc'
--- a/sql/rpl_info_table_access.cc 2010-11-11 11:53:01 +0000
+++ b/sql/rpl_info_table_access.cc 2010-12-13 21:16:31 +0000
@@ -307,6 +307,7 @@ THD *Rpl_info_table_access::create_thd()
thd= new THD;
thd->thread_stack= (char*) &thd;
thd->store_globals();
+ thd->security_ctx->skip_grants();
}
else
thd= current_thd;
=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc 2010-12-13 16:53:32 +0000
+++ b/sql/rpl_rli.cc 2010-12-14 12:51:30 +0000
@@ -64,7 +64,7 @@ Relay_log_info::Relay_log_info(bool is_s
cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
group_master_log_pos(0), log_space_total(0), ignore_log_space_limit(0),
last_master_timestamp(0), slave_skip_counter(0),
- abort_pos_wait(0), until_condition(UNTIL_NONE),
+ abort_pos_wait(0), slave_exec_mode(0), until_condition(UNTIL_NONE),
until_log_pos(0), retried_trans(0),
tables_to_lock(0), tables_to_lock_count(0),
rows_query_ev(NULL), last_event_start_time(0),
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2010-12-14 08:57:16 +0000
+++ b/sql/rpl_slave.cc 2010-12-14 14:46:20 +0000
@@ -2794,8 +2794,6 @@ int apply_event_and_update_pos(Log_event
if (!ev->when)
ev->when= my_time(0);
ev->thd = thd; // because up to this point, ev->thd == 0
- if (!rli->is_in_group() && rli->slave_exec_mode != slave_exec_mode_options)
- rli->slave_exec_mode= slave_exec_mode_options;
int reason= ev->shall_skip(rli);
if (reason == Log_event::EVENT_SKIP_COUNT)
@@ -3898,70 +3896,15 @@ bool mts_recovery_routine(Relay_log_info
"%s from pos %lu, maxsize %lu.", log_name,
(ulong) job.group_relay_log_pos, (ulong) s.st_size);
- bool found= FALSE;
- int res= 0;
while ((ev= Log_event::read_log_event(&log, 0, &fdle,
opt_master_verify_checksum)))
{
DBUG_ASSERT(ev->is_valid());
- String buffer;
- const char *db= ev->get_db();
-
- if (db != NULL)
- {
- buffer.set_int(strlen(db), FALSE, &my_charset_bin);
- buffer.append(db);
- found= job.db_ids->search_id(buffer.c_ptr_safe());
- }
-
- sql_print_information("Recovery relay log info. Event %s on db %s "
- "sets cursor to pos %lu and was handled by worker(%d).",
- ev->get_type_str(), db, (ulong) my_b_tell(&log),
- found);
- if (!found)
- {
- delete ev;
- ev= NULL;
- break;
- }
-
- res= ev->apply_event(rli);
delete ev;
ev= NULL;
-
- if (res)
- goto end;
- }
- if (!found)
- {
- sql_print_information("Before updating RLI "
- "group_relay_log_name %s, "
- "group_relay_log_pos %lu, "
- "group_master_log_name %s, "
- "group_master_lo_pos %lu.",
- rli->get_group_relay_log_name(),
- (ulong) rli->get_group_relay_log_pos(),
- rli->get_group_master_log_name(),
- (ulong) rli->get_group_master_log_pos());
-
- rli->set_group_relay_log_pos(job.group_relay_log_pos);
- rli->set_group_relay_log_name(job.group_relay_log_name);
- rli->set_group_master_log_pos(job.group_master_log_pos);
- rli->set_group_master_log_name(job.group_master_log_name);
-
- sql_print_information("After updating RLI "
- "group_relay_log_name %s, "
- "group_relay_log_pos %lu, "
- "group_master_log_name %s, "
- "group_master_lo_pos %lu.",
- rli->get_group_relay_log_name(),
- (ulong) rli->get_group_relay_log_pos(),
- rli->get_group_master_log_name(),
- (ulong) rli->get_group_master_log_pos());
}
}
- error= FALSE;
end:
if (desc)
@@ -4395,8 +4338,8 @@ pthread_handler_t handle_slave_sql(void
TODO: Alfranio, to settle invocation point. It's moved to possibly
please an assert in the following block
*/
- if (rli->is_parallel_exec() && mts_recovery_routine(rli))
- goto err;
+ //if (rli->is_parallel_exec() && mts_recovery_routine(rli))
+ // goto err;
#ifndef DBUG_OFF
{
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2010-12-08 00:33:48 +0000
+++ b/sql/sql_parse.cc 2010-12-13 21:16:31 +0000
@@ -298,8 +298,7 @@ void init_update_queries(void)
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS |
- CF_WRITE_RPL_INFO_COMMAND;
+ CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_TRUNCATE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20101214144620-ewagjogg7uz31cgk.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3246) | Andrei Elkin | 14 Dec |