don't error out on unknown options in the
replication thread or when opening a table
This commit is contained in:
parent
f1fb9b67c4
commit
c9b10e250d
25
mysql-test/suite/rpl/r/rpl_table_options.result
Normal file
25
mysql-test/suite/rpl/r/rpl_table_options.result
Normal file
@ -0,0 +1,25 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
install plugin example soname 'ha_example.so';
|
||||
set storage_engine=example;
|
||||
create table t1 (a int not null) ull=12340;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL
|
||||
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12340
|
||||
drop table t1;
|
||||
set storage_engine=default;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
uninstall plugin example;
|
1
mysql-test/suite/rpl/t/rpl_table_options-master.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_table_options-master.opt
Normal file
@ -0,0 +1 @@
|
||||
$EXAMPLE_PLUGIN_OPT
|
31
mysql-test/suite/rpl/t/rpl_table_options.test
Normal file
31
mysql-test/suite/rpl/t/rpl_table_options.test
Normal file
@ -0,0 +1,31 @@
|
||||
--source include/not_windows_embedded.inc
|
||||
--source include/have_example_plugin.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--replace_regex /\.dll/.so/
|
||||
eval install plugin example soname $HA_EXAMPLE_SO;
|
||||
set storage_engine=example;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
|
||||
#
|
||||
# only master has example engine installed,
|
||||
# the slave will have the table created in myisam,
|
||||
# that does not have ULL table option.
|
||||
# but because the table was created by the replication
|
||||
# slave thread, the table will be created anyway, even if
|
||||
# the option is unknown.
|
||||
#
|
||||
create table t1 (a int not null) ull=12340;
|
||||
show create table t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
show create table t1;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
set storage_engine=default;
|
||||
select 1;
|
||||
uninstall plugin example;
|
@ -77,22 +77,18 @@ void engine_option_value::link(engine_option_value **start,
|
||||
static bool report_wrong_value(THD *thd, const char *name, const char *val,
|
||||
my_bool suppress_warning)
|
||||
{
|
||||
if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS))
|
||||
if (suppress_warning)
|
||||
return 0;
|
||||
|
||||
if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS) &&
|
||||
!thd->slave_thread)
|
||||
{
|
||||
my_error(ER_BAD_OPTION_VALUE, MYF(0), val, name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
We may need to suppress warnings to avoid duplicate messages
|
||||
about the same option (option list is parsed more than once during
|
||||
CREATE/ALTER table).
|
||||
Errors are not suppressed, as they abort the execution on the first parsing.
|
||||
*/
|
||||
if (!suppress_warning)
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_BAD_OPTION_VALUE,
|
||||
ER(ER_BAD_OPTION_VALUE), val, name);
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_OPTION_VALUE,
|
||||
ER(ER_BAD_OPTION_VALUE), val, name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -100,23 +96,22 @@ static bool report_unknown_option(THD *thd, engine_option_value *val,
|
||||
my_bool suppress_warning)
|
||||
{
|
||||
DBUG_ENTER("report_unknown_option");
|
||||
if (val->parsed)
|
||||
|
||||
if (val->parsed || suppress_warning)
|
||||
{
|
||||
DBUG_PRINT("info", ("parsed => exiting"));
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS))
|
||||
if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS) &&
|
||||
!thd->slave_thread)
|
||||
{
|
||||
my_error(ER_UNKNOWN_OPTION, MYF(0), val->name.str);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
if (!suppress_warning)
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_UNKNOWN_OPTION,
|
||||
ER(ER_UNKNOWN_OPTION),
|
||||
val->name.str);
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_UNKNOWN_OPTION, ER(ER_UNKNOWN_OPTION), val->name.str);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user