1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

check that table used in multi-update is unique added (BUG#5455)

This commit is contained in:
bell@sanja.is.com.ua
2004-09-08 13:39:15 +03:00
parent dab8918647
commit 0badc913bb
6 changed files with 70 additions and 20 deletions

View File

@ -1548,6 +1548,7 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
1 - found
0 - OK (table did not found)
*/
bool st_select_lex_unit::check_updateable(char *db, char *table)
{
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
@ -1559,7 +1560,7 @@ bool st_select_lex_unit::check_updateable(char *db, char *table)
/*
Find db.table which will be updated in this select and
underlayed ones (except derived tables)
underlaying ones (except derived tables)
SYNOPSIS
st_select_lex::check_updateable()
@ -1570,11 +1571,30 @@ bool st_select_lex_unit::check_updateable(char *db, char *table)
1 - found
0 - OK (table did not found)
*/
bool st_select_lex::check_updateable(char *db, char *table)
{
if (find_real_table_in_list(get_table_list(), db, table))
return 1;
return check_updateable_in_subqueries(db, table);
}
/*
Find db.table which will be updated in underlaying subqueries
SYNOPSIS
st_select_lex::check_updateable_in_subqueries()
db - data base name
table - real table name
RETURN
1 - found
0 - OK (table did not found)
*/
bool st_select_lex::check_updateable_in_subqueries(char *db, char *table)
{
for (SELECT_LEX_UNIT *un= first_inner_unit();
un;
un= un->next_unit())