summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-16 17:47:53 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-16 17:47:53 +0300
commite754501a1256129baf9c8eb9e0f79a9ca2f56313 (patch)
tree9c788da0200b12528d96a708e9fb19bcbb791ec7 /sql/sql_lex.cc
parent3b4c38336d554ecddec1ad41f60c50fff15a702d (diff)
parent6c2330407f99b0bab1db68ec38789fc10a3518ec (diff)
downloadmariadb-git-e754501a1256129baf9c8eb9e0f79a9ca2f56313.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-update-4.1 sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2fa169ce999..ff681e720b5 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1550,6 +1550,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())
@@ -1561,7 +1562,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()
@@ -1572,11 +1573,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())