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() ...@@ -4628,25 +4628,28 @@ void TABLE_LIST::cleanup_items()
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure) int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{ {
Counting_error_handler ceh; if (check_option)
thd->push_internal_handler(&ceh); {
bool res= check_option && check_option->val_int() == 0; Counting_error_handler ceh;
thd->pop_internal_handler(); thd->push_internal_handler(&ceh);
if (ceh.errors) bool res= check_option->val_int() == 0;
return(VIEW_CHECK_ERROR); thd->pop_internal_handler();
if (res) if (ceh.errors)
{ return(VIEW_CHECK_ERROR);
TABLE_LIST *main_view= top_table(); if (res)
if (ignore_failure)
{ {
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, TABLE_LIST *main_view= top_table();
ER_VIEW_CHECK_FAILED, ER(ER_VIEW_CHECK_FAILED), if (ignore_failure)
main_view->view_db.str, main_view->view_name.str); {
return(VIEW_CHECK_SKIP); 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); 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