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

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
This commit is contained in:
unknown
2004-02-09 14:44:03 +02:00
parent 584ddfdab2
commit 61f0e69cb6
8 changed files with 62 additions and 32 deletions

View File

@ -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