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.
This commit is contained in:
Sergei Golubchik 2017-09-21 10:03:40 +02:00
parent e84f5356c3
commit 1015196e0a

View File

@ -4627,10 +4627,12 @@ void TABLE_LIST::cleanup_items()
*/
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
if (check_option)
{
Counting_error_handler ceh;
thd->push_internal_handler(&ceh);
bool res= check_option && check_option->val_int() == 0;
bool res= check_option->val_int() == 0;
thd->pop_internal_handler();
if (ceh.errors)
return(VIEW_CHECK_ERROR);
@ -4648,6 +4650,7 @@ int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
main_view->view_name.str);
return(VIEW_CHECK_ERROR);
}
}
return(VIEW_CHECK_OK);
}