Commit 4568a72c authored by Sergei Golubchik's avatar Sergei Golubchik

don't do a warning for bad table options in replication slave thread

otherwise ALTER TABLE can break replication
parent 674be2fd
...@@ -5,24 +5,27 @@ set storage_engine=example; ...@@ -5,24 +5,27 @@ set storage_engine=example;
connection slave; connection slave;
connection master; connection master;
create table t1 (a int not null) ull=12340; create table t1 (a int not null) ull=12340;
alter table t1 ull=12350;
Warnings:
Note 1105 EXAMPLE DEBUG: ULL 12340 -> 12350
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 ) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12350
connection slave; connection slave;
connection slave; connection slave;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `ull`=12340 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `ull`=12350 */
set sql_mode=ignore_bad_table_options; set sql_mode=ignore_bad_table_options;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12340 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12350
connection master; connection master;
drop table t1; drop table t1;
set storage_engine=default; set storage_engine=default;
......
...@@ -18,6 +18,7 @@ connection master; ...@@ -18,6 +18,7 @@ connection master;
# the option is unknown. # the option is unknown.
# #
create table t1 (a int not null) ull=12340; create table t1 (a int not null) ull=12340;
alter table t1 ull=12350;
show create table t1; show create table t1;
sync_slave_with_master; sync_slave_with_master;
......
...@@ -97,14 +97,13 @@ static bool report_unknown_option(THD *thd, engine_option_value *val, ...@@ -97,14 +97,13 @@ static bool report_unknown_option(THD *thd, engine_option_value *val,
{ {
DBUG_ENTER("report_unknown_option"); DBUG_ENTER("report_unknown_option");
if (val->parsed || suppress_warning) if (val->parsed || suppress_warning || thd->slave_thread)
{ {
DBUG_PRINT("info", ("parsed => exiting")); DBUG_PRINT("info", ("parsed => exiting"));
DBUG_RETURN(FALSE); 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); my_error(ER_UNKNOWN_OPTION, MYF(0), val->name.str);
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment