mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge
sql/sql_parse.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/derived.result: SCCS merged mysql-test/t/derived.test: e merge
This commit is contained in:
@@ -2665,15 +2665,29 @@ mysql_execute_command(THD *thd)
|
||||
table_count++;
|
||||
/* All tables in aux_tables must be found in FROM PART */
|
||||
TABLE_LIST *walk;
|
||||
for (walk=(TABLE_LIST*) tables ; walk ; walk=walk->next)
|
||||
for (walk= (TABLE_LIST*) tables; walk; walk= walk->next)
|
||||
{
|
||||
if (!strcmp(auxi->real_name,walk->real_name) &&
|
||||
!strcmp(walk->db,auxi->db))
|
||||
if (!strcmp(auxi->real_name, walk->alias) &&
|
||||
!strcmp(walk->db, auxi->db))
|
||||
break;
|
||||
}
|
||||
if (!walk)
|
||||
{
|
||||
net_printf(thd,ER_NONUNIQ_TABLE,auxi->real_name);
|
||||
if (lex->derived_tables)
|
||||
{
|
||||
// are we trying to delete derived table?
|
||||
for (walk= (TABLE_LIST*) tables; walk; walk= walk->next)
|
||||
{
|
||||
if (!strcmp(auxi->real_name,walk->alias) &&
|
||||
walk->derived)
|
||||
{
|
||||
net_printf(thd, ER_NON_UPDATABLE_TABLE,
|
||||
auxi->real_name, "DELETE");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
net_printf(thd, ER_NONUNIQ_TABLE, auxi->real_name);
|
||||
goto error;
|
||||
}
|
||||
walk->lock_type= auxi->lock_type;
|
||||
|
||||
Reference in New Issue
Block a user