diff options
author | unknown <bell@sanja.is.com.ua> | 2004-02-09 14:44:03 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-02-09 14:44:03 +0200 |
commit | 61f0e69cb60b9db858bad3b6de6fa0b8b2f03899 (patch) | |
tree | d823a9d8db9cbcd5878af1651e74b2afa0277116 /sql/sql_derived.cc | |
parent | 584ddfdab2316c0b0520c6903fe6bf4b8a435b0a (diff) | |
download | mariadb-git-61f0e69cb60b9db858bad3b6de6fa0b8b2f03899.tar.gz |
ufter revview fix (BUG#2120)
mysql-test/r/derived.result:
test of error handling in derived tables with UPDATE & DELETE
mysql-test/t/derived.test:
test of error handling in derived tables with UPDATE & DELETE
sql/mysql_priv.h:
opened tables counter added to avoid loop of tables calculating in lock_tables
sql/sql_acl.cc:
opened tables counter added to avoid loop of tables calculating in lock_tables, here it is just for compatibility
sql/sql_base.cc:
removed unneeded assignment
opened tables counter added to avoid loop of tables calculating in lock_tables
commentary fixed
sql/sql_derived.cc:
mysql_derived made static
variable res moved in place where it used
priveleges written in correct place
sql/sql_handler.cc:
opened tables counter added to avoid loop of tables calculating in lock_tables
sql/sql_parse.cc:
mistyping in commentary fixed
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index a307b59b525..6e70fdd46d5 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -25,7 +25,8 @@ #include "sql_select.h" #include "sql_acl.h" -int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, TABLE_LIST *t); +static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, + TABLE_LIST *t); /* Resolve derived tables in all queries @@ -39,10 +40,10 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, TABLE_LIST *t); -1 Error 1 Error and error message given */ + int mysql_handle_derived(LEX *lex) { - int res= 0; if (lex->derived_tables) { for (SELECT_LEX *sl= lex->all_selects_list; @@ -53,13 +54,12 @@ mysql_handle_derived(LEX *lex) cursor; cursor= cursor->next) { + int res; if (cursor->derived && (res=mysql_derived(lex->thd, lex, cursor->derived, cursor))) { - if (res < 0 || lex->thd->net.report_error) - send_error(lex->thd, lex->thd->killed ? ER_SERVER_SHUTDOWN : 0); - return 1; + return res; } } if (lex->describe) @@ -108,8 +108,8 @@ mysql_handle_derived(LEX *lex) */ -int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, - TABLE_LIST *org_table_list) +static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, + TABLE_LIST *org_table_list) { SELECT_LEX *first_select= unit->first_select(); TABLE *table; @@ -197,7 +197,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, table->derived_select_number= first_select->select_number; table->tmp_table= TMP_TABLE; #ifndef NO_EMBEDDED_ACCESS_CHECKS - org_table_list->grant.privilege= SELECT_ACL; + table->grant.privilege= SELECT_ACL; #endif org_table_list->db= (char *)""; // Force read of table stats in the optimizer |