summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-08-17 22:24:20 -0700
committerunknown <igor@rurik.mysql.com>2005-08-17 22:24:20 -0700
commite1ea6cc5b8b3929fa596f62e7aeac2101a1620e1 (patch)
tree50378999ee2936818acf109cf44ab432ceff4b1c /sql/sql_view.cc
parent4d2bf4befcf6a91978c60b9a402301e864ed999e (diff)
parentc9fa6a47bdb3dc52dc6bcf2fc924c95d7e40f2a1 (diff)
downloadmariadb-git-e1ea6cc5b8b3929fa596f62e7aeac2101a1620e1.tar.gz
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0 sql/sql_view.cc: Auto merged
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 577d1d32fcc..af21b43e5c9 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -306,9 +306,11 @@ bool mysql_create_view(THD *thd,
/*
check that tables are not temporary and this VIEW do not used in query
- (it is possible with ALTERing VIEW)
- */
- for (tbl= tables; tbl; tbl= tbl->next_global)
+ (it is possible with ALTERing VIEW).
+ open_and_lock_tables can change the value of tables,
+ e.g. it may happen if before the function call tables was equal to 0.
+ */
+ for (tbl= tables= lex->query_tables; tbl; tbl= tbl->next_global)
{
/* is this table temporary and is not view? */
if (tbl->table->s->tmp_table != NO_TMP_TABLE && !tbl->view &&