mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch '10.1' into 10.2
But without f4f48e06215..f8a800bec81 - fixes for MDEV-12672 and related issues. 10.2 specific fix follows...
This commit is contained in:
35
sql/table.cc
35
sql/table.cc
@ -5066,23 +5066,28 @@ void TABLE_LIST::cleanup_items()
|
||||
|
||||
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
|
||||
{
|
||||
/* VIEW's CHECK OPTION CLAUSE */
|
||||
if (check_option && check_option->val_int() == 0)
|
||||
if (check_option)
|
||||
{
|
||||
TABLE_LIST *main_view= top_table();
|
||||
const char *name_db= (main_view->view ? main_view->view_db.str :
|
||||
main_view->db);
|
||||
const char *name_table= (main_view->view ? main_view->view_name.str :
|
||||
main_view->table_name);
|
||||
my_error(ER_VIEW_CHECK_FAILED, MYF(ignore_failure ? ME_JUST_WARNING : 0),
|
||||
name_db, name_table);
|
||||
return ignore_failure ? VIEW_CHECK_SKIP : VIEW_CHECK_ERROR;
|
||||
/* VIEW's CHECK OPTION CLAUSE */
|
||||
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)
|
||||
{
|
||||
TABLE_LIST *main_view= top_table();
|
||||
const char *name_db= (main_view->view ? main_view->view_db.str :
|
||||
main_view->db);
|
||||
const char *name_table= (main_view->view ? main_view->view_name.str :
|
||||
main_view->table_name);
|
||||
my_error(ER_VIEW_CHECK_FAILED, MYF(ignore_failure ? ME_JUST_WARNING : 0),
|
||||
name_db, name_table);
|
||||
return ignore_failure ? VIEW_CHECK_SKIP : VIEW_CHECK_ERROR;
|
||||
}
|
||||
}
|
||||
int result= table->verify_constraints(ignore_failure);
|
||||
/* We check thd->error() because it can be set by conversion problem. */
|
||||
if (thd->is_error())
|
||||
return(VIEW_CHECK_ERROR);
|
||||
return result;
|
||||
return table->verify_constraints(ignore_failure);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user