1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

fixed problem in view over view setup (BUG#7433)

This commit is contained in:
bell@sanja.is.com.ua
2005-01-31 10:43:36 +02:00
parent 25042ae70c
commit e447b88869
3 changed files with 20 additions and 1 deletions

View File

@@ -1750,3 +1750,11 @@ c1
1
drop view v2, v1;
drop table t1, t2;
CREATE TABLE t1 (C1 INT, C2 INT);
CREATE TABLE t2 (C2 INT);
CREATE VIEW v1 AS SELECT C2 FROM t2;
CREATE VIEW v2 AS SELECT C1 FROM t1 LEFT OUTER JOIN v1 USING (C2);
SELECT * FROM v2;
C1
drop view v2, v1;
drop table t1, t2;

View File

@@ -1679,3 +1679,14 @@ select * from v1;
select * from v2;
drop view v2, v1;
drop table t1, t2;
#
# view over other view setup (BUG#7433)
#
CREATE TABLE t1 (C1 INT, C2 INT);
CREATE TABLE t2 (C2 INT);
CREATE VIEW v1 AS SELECT C2 FROM t2;
CREATE VIEW v2 AS SELECT C1 FROM t1 LEFT OUTER JOIN v1 USING (C2);
SELECT * FROM v2;
drop view v2, v1;
drop table t1, t2;

View File

@@ -1613,7 +1613,7 @@ void st_table_list::set_ancestor()
tbl->table->grant= grant;
}
/* if view contain only one table, substitute TABLE of it */
if (!ancestor->next_local)
if (ancestor && !ancestor->next_local)
{
table= ancestor->table;
schema_table= ancestor->schema_table;