summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-03-28 15:13:31 +0300
committerunknown <bell@sanja.is.com.ua>2005-03-28 15:13:31 +0300
commitdaddf263e5b347dd4ce763674c6c3b37af2d0803 (patch)
treeabaf6431b6a4ac4bc0bfee9962284ccf6a91588a /sql/sql_derived.cc
parent7ff83a3f7f520feda32fb5cf68da54771542cc80 (diff)
downloadmariadb-git-daddf263e5b347dd4ce763674c6c3b37af2d0803.tar.gz
fixed mechanism of detection selection from table wich we update
(BUG##9398, BUG#8703) fixed wrong join view detection in multi-delete which lead to server crash mysql-test/r/lowercase_view.result: added new tests of updation and selection from the same table mysql-test/r/view.result: added new tests of updation and selection from the same table added test of multidelete command over join view which lead to server crash test suite from bugs #9398 and #8703 mysql-test/t/lowercase_view.test: added new tests of updation and selection from the same table mysql-test/t/view.test: added new tests of updation and selection from the same table added test of multidelete command over join view which lead to server crash test suite from bugs #9398 and #8703 sql/sql_base.cc: changed procedure of finding tables sql/sql_class.cc: added derived table procession detection sql/sql_class.h: added derived table procession detection sql/sql_delete.cc: fixed detection of selection from table which update for multidelete sql/sql_derived.cc: added derived table procession detection sql/sql_lex.cc: added detection os SELECTs processed inside derived tables removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views) sql/sql_lex.h: added detection os SELECTs processed inside derived tables removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views) sql/sql_parse.cc: removed wrong test of join view (for multidelete in can be not only first table) sql/sql_prepare.cc: added detection os SELECTs processed inside derived tables (reset it for reusing in PS/SP) sql/sql_select.cc: added detection os SELECTs processed inside derived tables sql/sql_update.cc: fixed detection of selection from table which update for multiupdate
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index eb7b3e8a319..4fcde212716 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -43,8 +43,10 @@
int
mysql_handle_derived(LEX *lex, int (*processor)(THD*, LEX*, TABLE_LIST*))
{
+ int res= 0;
if (lex->derived_tables)
{
+ lex->thd->derived_tables_processing= TRUE;
for (SELECT_LEX *sl= lex->all_selects_list;
sl;
sl= sl->next_select_in_list())
@@ -53,9 +55,8 @@ mysql_handle_derived(LEX *lex, int (*processor)(THD*, LEX*, TABLE_LIST*))
cursor;
cursor= cursor->next_local)
{
- int res;
if ((res= (*processor)(lex->thd, lex, cursor)))
- return res;
+ goto out;
}
if (lex->describe)
{
@@ -68,7 +69,9 @@ mysql_handle_derived(LEX *lex, int (*processor)(THD*, LEX*, TABLE_LIST*))
}
}
}
- return 0;
+out:
+ lex->thd->derived_tables_processing= FALSE;
+ return res;
}