diff options
author | unknown <bell@sanja.is.com.ua> | 2005-08-17 22:42:53 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-08-17 22:42:53 +0300 |
commit | cf7b1241d12303df480fde5795ebe24c8e9c26d1 (patch) | |
tree | 69a6b7be81be6064ed5340c7b4754d17b9823cf2 /sql/sql_view.cc | |
parent | d33b968f0304161bdd0c74764f71630862e33a9a (diff) | |
download | mariadb-git-cf7b1241d12303df480fde5795ebe24c8e9c26d1.tar.gz |
sql_view.cc:
correct exit from mysql_create_view to restore ennvironment (BUG#12468)
view.result, view.test:
test of CRETE VIEW in SP
mysql-test/t/view.test:
test of CRETE VIEW in SP
mysql-test/r/view.result:
test of CRETE VIEW in SP
sql/sql_view.cc:
correct exit from mysql_create_view to restore ennvironment
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index c3222f951bb..1881cdc324f 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -234,7 +234,10 @@ bool mysql_create_view(THD *thd, (check_access(thd, DROP_ACL, view->db, &view->grant.privilege, 0, 0) || grant_option && check_grant(thd, DROP_ACL, view, 0, 1, 0)))) - DBUG_RETURN(TRUE); + { + res= TRUE; + goto err; + } for (sl= select_lex; sl; sl= sl->next_select()) { for (tbl= sl->get_table_list(); tbl; tbl= tbl->next_local) @@ -247,7 +250,8 @@ bool mysql_create_view(THD *thd, { my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), "ANY", thd->priv_user, thd->host_or_ip, tbl->table_name); - DBUG_RETURN(TRUE); + res= TRUE; + goto err; } /* Mark this table as a table which will be checked after the prepare @@ -306,7 +310,10 @@ bool mysql_create_view(THD *thd, #endif if (open_and_lock_tables(thd, tables)) - DBUG_RETURN(TRUE); + { + res= TRUE; + goto err; + } /* check that tables are not temporary and this VIEW do not used in query @@ -374,7 +381,10 @@ bool mysql_create_view(THD *thd, } if (check_duplicate_names(select_lex->item_list, 1)) - DBUG_RETURN(TRUE); + { + res= TRUE; + goto err; + } #ifndef NO_EMBEDDED_ACCESS_CHECKS /* @@ -404,7 +414,8 @@ bool mysql_create_view(THD *thd, my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), "create view", thd->priv_user, thd->host_or_ip, item->name, view->table_name); - DBUG_RETURN(TRUE); + res= TRUE; + goto err; } } } |