mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Merge host.loc:/home/uchum/work/5.0-opt
into host.loc:/home/uchum/work/5.1-opt
This commit is contained in:
commit
57afe19c8b
3 changed files with 49 additions and 0 deletions
|
@ -3654,6 +3654,24 @@ DROP TABLE t1;
|
|||
|
||||
# -- End of test case for Bug#34337.
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
|
||||
# -- causing syntax error
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
|
||||
|
||||
SELECT * FROM v1;
|
||||
1
|
||||
1
|
||||
SHOW CREATE TABLE v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1
|
||||
|
||||
DROP VIEW v1;
|
||||
|
||||
# -- End of test case for Bug#35193.
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.0 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
|
|
@ -3533,6 +3533,29 @@ DROP TABLE t1;
|
|||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
|
||||
--echo # -- causing syntax error
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM v1;
|
||||
SHOW CREATE TABLE v1;
|
||||
|
||||
--echo
|
||||
|
||||
DROP VIEW v1;
|
||||
|
||||
--echo
|
||||
--echo # -- End of test case for Bug#35193.
|
||||
--echo
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.0 tests.
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
|
|
@ -16502,6 +16502,14 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
|
|||
/* go through join tree */
|
||||
print_join(thd, str, &top_join_list, query_type);
|
||||
}
|
||||
else if (where)
|
||||
{
|
||||
/*
|
||||
"SELECT 1 FROM DUAL WHERE 2" should not be printed as
|
||||
"SELECT 1 WHERE 2": the 1st syntax is valid, but the 2nd is not.
|
||||
*/
|
||||
str->append(STRING_WITH_LEN(" from DUAL "));
|
||||
}
|
||||
|
||||
// Where
|
||||
Item *cur_where= where;
|
||||
|
|
Loading…
Reference in a new issue