fixed error processing of prepare in VIEW creation (BUG#4801)
mysql-test/r/view.result: test of error processing found in preparation phase mysql-test/t/view.test: test of error processing found in preparation phase sql/sql_view.cc: fixed error processing of prepare
This commit is contained in:
parent
acd4f7debd
commit
9ca63e55bc
@ -1036,3 +1036,9 @@ a
|
|||||||
4
|
4
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE VIEW v02 AS SELECT * FROM DUAL;
|
||||||
|
ERROR HY000: No tables used
|
||||||
|
SHOW TABLES;
|
||||||
|
Tables_in_test table_type
|
||||||
|
t2 BASE TABLE
|
||||||
|
v4 VIEW
|
||||||
|
@ -973,3 +973,10 @@ select * from t1;
|
|||||||
|
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# error on preparation
|
||||||
|
#
|
||||||
|
-- error 1096
|
||||||
|
CREATE VIEW v02 AS SELECT * FROM DUAL;
|
||||||
|
SHOW TABLES;
|
||||||
|
@ -183,8 +183,15 @@ int mysql_create_view(THD *thd,
|
|||||||
|
|
||||||
// prepare select to resolve all fields
|
// prepare select to resolve all fields
|
||||||
lex->view_prepare_mode= 1;
|
lex->view_prepare_mode= 1;
|
||||||
if ((res= unit->prepare(thd, 0, 0)))
|
if (unit->prepare(thd, 0, 0))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
some errors from prepare are reported to user, if is not then
|
||||||
|
it will be checked after err: label
|
||||||
|
*/
|
||||||
|
res= 1;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
/* view list (list of view fields names) */
|
/* view list (list of view fields names) */
|
||||||
if (lex->view_list.elements)
|
if (lex->view_list.elements)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user