summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-04-03 01:23:45 +0300
committerunknown <bell@sanja.is.com.ua>2005-04-03 01:23:45 +0300
commita50bf2f06b3fa5472394013d02c80d3a4d4e5c44 (patch)
tree9f02dc153cdeac60bc3fdc94514fb2b802ece8d7 /sql/table.cc
parent8af8c530404c63ea9ded5fe5e89b1255cee5c91c (diff)
downloadmariadb-git-a50bf2f06b3fa5472394013d02c80d3a4d4e5c44.tar.gz
- stackoverflow check added for view of view processing
- fixed bug in join view processing - postreview fixes (BUG#9398 & BUG#8703) sql/sql_base.cc: used original TABLE object to get correct name of table and db sql/sql_view.cc: fixed bug of assigning select_lex for join view sql/table.cc: comment fixed stack overflow check added new method for underlying base table finding sql/table.h: comment fixed new method for underlying base table finding
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc33
1 files changed, 32 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 9238d8aa68e..e1f15926c03 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1716,7 +1716,7 @@ void st_table_list::restore_want_privilege()
check_opt_type - WHITH CHECK OPTION type (VIEW_CHECK_NONE,
VIEW_CHECK_LOCAL, VIEW_CHECK_CASCADED)
NOTES
- ancestor is list of tables and views used by view
+ ancestor is list of tables and views used by view (underlying tables/views)
DESCRIPTION
It is:
@@ -1750,6 +1750,9 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds,
bool res= FALSE;
DBUG_ENTER("st_table_list::setup_ancestor");
+ if (check_stack_overrun(thd, (char *)&res))
+ return TRUE;
+
for (tbl= ancestor; tbl; tbl= tbl->next_local)
{
if (tbl->ancestor &&
@@ -1987,6 +1990,34 @@ ok:
/*
+ Find underlying base tables (TABLE_LIST) which represent given
+ table_to_find (TABLE)
+
+ SYNOPSIS
+ st_table_list::find_underlying_table()
+ table_to_find table to find
+
+ RETURN
+ 0 table is not found
+ found table reference
+*/
+
+st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
+{
+ /* is this real table and table which we are looking for? */
+ if (table == table_to_find && ancestor == 0)
+ return this;
+
+ for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ {
+ TABLE_LIST *result;
+ if ((result= tbl->find_underlying_table(table_to_find)))
+ return result;
+ }
+ return 0;
+}
+
+/*
cleunup items belonged to view fields translation table
SYNOPSIS