Commit 1015196e authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: TABLE_LIST::view_check_option

don't prepare for checking view's CHECK OPTION, if
there is no CHECK OPTION in the first place.
parent e84f5356
......@@ -4628,25 +4628,28 @@ void TABLE_LIST::cleanup_items()
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
Counting_error_handler ceh;
thd->push_internal_handler(&ceh);
bool res= check_option && check_option->val_int() == 0;
thd->pop_internal_handler();
if (ceh.errors)
return(VIEW_CHECK_ERROR);
if (res)
{
TABLE_LIST *main_view= top_table();
if (ignore_failure)
if (check_option)
{
Counting_error_handler ceh;
thd->push_internal_handler(&ceh);
bool res= check_option->val_int() == 0;
thd->pop_internal_handler();
if (ceh.errors)
return(VIEW_CHECK_ERROR);
if (res)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_VIEW_CHECK_FAILED, ER(ER_VIEW_CHECK_FAILED),
main_view->view_db.str, main_view->view_name.str);
return(VIEW_CHECK_SKIP);
TABLE_LIST *main_view= top_table();
if (ignore_failure)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_VIEW_CHECK_FAILED, ER(ER_VIEW_CHECK_FAILED),
main_view->view_db.str, main_view->view_name.str);
return(VIEW_CHECK_SKIP);
}
my_error(ER_VIEW_CHECK_FAILED, MYF(0), main_view->view_db.str,
main_view->view_name.str);
return(VIEW_CHECK_ERROR);
}
my_error(ER_VIEW_CHECK_FAILED, MYF(0), main_view->view_db.str,
main_view->view_name.str);
return(VIEW_CHECK_ERROR);
}
return(VIEW_CHECK_OK);
}
......
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