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
d66c171e
Commit
d66c171e
authored
Apr 22, 2017
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the bug mdev-12554.
When the WHERE condition is always FALSE then JOIN::join_tab is NULL.
parent
54a995cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
mysql-test/r/cte_recursive.result
mysql-test/r/cte_recursive.result
+12
-0
mysql-test/t/cte_recursive.test
mysql-test/t/cte_recursive.test
+12
-0
sql/sql_union.cc
sql/sql_union.cc
+1
-1
No files found.
mysql-test/r/cte_recursive.result
View file @
d66c171e
...
...
@@ -2759,3 +2759,15 @@ set standard_compliant_cte=default;
select @@standard_compliant_cte;
@@standard_compliant_cte
1
#
# mdev-12554: impossible where in recursive select
#
CREATE TABLE t1 (i int);
INSERT INTO t1 VALUES (1),(2);
WITH RECURSIVE
cte(f) AS ( SELECT i FROM t1 UNION SELECT f FROM t1, cte WHERE 1=0 )
SELECT * FROM cte;
f
1
2
DROP TABLE t1;
mysql-test/t/cte_recursive.test
View file @
d66c171e
...
...
@@ -1834,3 +1834,15 @@ drop table objects, modules, module_arguments, module_results;
set
standard_compliant_cte
=
default
;
select
@@
standard_compliant_cte
;
--
echo
#
--
echo
# mdev-12554: impossible where in recursive select
--
echo
#
CREATE
TABLE
t1
(
i
int
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
WITH
RECURSIVE
cte
(
f
)
AS
(
SELECT
i
FROM
t1
UNION
SELECT
f
FROM
t1
,
cte
WHERE
1
=
0
)
SELECT
*
FROM
cte
;
DROP
TABLE
t1
;
sql/sql_union.cc
View file @
d66c171e
...
...
@@ -1261,7 +1261,7 @@ bool st_select_lex_unit::exec_recursive()
!
is_unrestricted
);
if
(
!
with_element
->
rec_result
->
first_rec_table_to_update
)
with_element
->
rec_result
->
first_rec_table_to_update
=
rec_table
;
if
(
with_element
->
level
==
1
)
if
(
with_element
->
level
==
1
&&
rec_table
->
reginfo
.
join_tab
)
rec_table
->
reginfo
.
join_tab
->
preread_init_done
=
true
;
}
for
(
Item_subselect
*
sq
=
with_element
->
sq_with_rec_ref
.
first
;
...
...
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