1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.0' into 10.1

This commit is contained in:
Sergei Golubchik
2017-09-21 22:02:21 +02:00
87 changed files with 144 additions and 95 deletions

View File

@ -4715,24 +4715,30 @@ void TABLE_LIST::cleanup_items()
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
if (check_option && check_option->val_int() == 0)
if (check_option)
{
TABLE_LIST *main_view= top_table();
if (ignore_failure)
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_THD(thd, 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_THD(thd, 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);
}
/* We check thd->error() because it can be set by conversion problem. */
if (thd->is_error())
return(VIEW_CHECK_ERROR);
return(VIEW_CHECK_OK);
}