summaryrefslogtreecommitdiff
path: root/sql/create_options.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-05-12 19:56:05 +0200
committerSergei Golubchik <sergii@pisem.net>2010-05-12 19:56:05 +0200
commitc9b10e250d96d3f8eab22ebb698654da78fed5d8 (patch)
tree7e0f724494bf68a42cdefa827e15726c64ebb6dd /sql/create_options.cc
parentf1fb9b67c4e9a402bb52ca73881d7641c9837caa (diff)
downloadmariadb-git-c9b10e250d96d3f8eab22ebb698654da78fed5d8.tar.gz
don't error out on unknown options in the
replication thread or when opening a table
Diffstat (limited to 'sql/create_options.cc')
-rw-r--r--sql/create_options.cc31
1 files changed, 13 insertions, 18 deletions
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 8dac8917a6b..c7ede1b2331 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -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);
}