Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e7efc8b9
Commit
e7efc8b9
authored
Mar 27, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge host.loc:/home/uchum/work/5.0-opt-35193
into host.loc:/home/uchum/work/5.0-opt
parents
88c29180
b6bf896b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
mysql-test/r/view.result
mysql-test/r/view.result
+18
-0
mysql-test/t/view.test
mysql-test/t/view.test
+23
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-0
No files found.
mysql-test/r/view.result
View file @
e7efc8b9
...
...
@@ -3659,6 +3659,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.
# -----------------------------------------------------------------
mysql-test/t/view.test
View file @
e7efc8b9
...
...
@@ -3537,6 +3537,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
# -----------------------------------------------------------------
sql/sql_select.cc
View file @
e7efc8b9
...
...
@@ -15806,6 +15806,14 @@ void st_select_lex::print(THD *thd, String *str)
/* go through join tree */
print_join
(
thd
,
str
,
&
top_join_list
);
}
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment