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
da39ca1f
Commit
da39ca1f
authored
Jan 06, 2018
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.2' of
https://github.com/mariadb/server
into 10.2
parents
e6e24fe8
15b1840f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
0 deletions
+151
-0
mysql-test/r/cte_recursive.result
mysql-test/r/cte_recursive.result
+28
-0
mysql-test/r/derived_cond_pushdown.result
mysql-test/r/derived_cond_pushdown.result
+64
-0
mysql-test/t/cte_recursive.test
mysql-test/t/cte_recursive.test
+34
-0
mysql-test/t/derived_cond_pushdown.test
mysql-test/t/derived_cond_pushdown.test
+25
-0
No files found.
mysql-test/r/cte_recursive.result
View file @
da39ca1f
...
@@ -2944,3 +2944,31 @@ limit 1
...
@@ -2944,3 +2944,31 @@ limit 1
);
);
ERROR HY000: Unacceptable mutual recursion with anchored table 'cte_1'
ERROR HY000: Unacceptable mutual recursion with anchored table 'cte_1'
drop table t1;
drop table t1;
#
# mdev-14777: crash caused by the same as in mdev-14755
#
CREATE TABLE t1 (i1 int NOT NULL, i2 int);
CREATE TABLE t2 (d1 int NOT NULL PRIMARY KEY);
CREATE TABLE t3 (i int );
insert into t1 select seq,seq from seq_1_to_100000;
insert into t2 select seq from seq_1000_to_100000;
insert into t3 select seq from seq_1_to_1000;
SELECT *
FROM
(
SELECT *
FROM
(
WITH RECURSIVE rt AS
(
SELECT i2 P, i1 C FROM t1 WHERE i1 IN (SELECT d1 FROM t2)
UNION
SELECT t1.i2 P, rt.C C FROM t1, rt
)
SELECT C,P
FROM ( SELECT P,C FROM rt WHERE NOT EXISTS (SELECT 1 FROM t1) ) Y
) X
WHERE 1 = 1
) K, t3;
C P i
drop table t1,t2,t3;
mysql-test/r/derived_cond_pushdown.result
View file @
da39ca1f
...
@@ -8807,3 +8807,67 @@ EXPLAIN
...
@@ -8807,3 +8807,67 @@ EXPLAIN
}
}
}
}
drop table t1;
drop table t1;
#
# MDEV-13454: consequence of mdev-14368 fixed for 5.5
#
SET sql_mode = 'ONLY_FULL_GROUP_BY';
create table t1 (id int, id2 int);
insert into t1 values (1,1),(2,3),(3,4),(7,2);
create table t2(id2 int);
insert t2 values (1),(2),(3);
SELECT * FROM t1
LEFT OUTER JOIN
(SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2)
WHERE (vc.ct>0);
id2 id ct
1 1 1
3 2 1
2 7 1
EXPLAIN FORMAT=JSON SELECT * FROM t1
LEFT OUTER JOIN
(SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2)
WHERE (vc.ct>0);
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "vc.ct > 0",
"materialized": {
"query_block": {
"select_id": 2,
"having_condition": "ct > 0",
"filesort": {
"sort_key": "t2.id2",
"temporary_table": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
},
"block-nl-join": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 4,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "t1.id2 = vc.id2"
}
}
}
DROP TABLE t1,t2;
SET sql_mode = DEFAULT;
mysql-test/t/cte_recursive.test
View file @
da39ca1f
...
@@ -1998,3 +1998,37 @@ set @var=
...
@@ -1998,3 +1998,37 @@ set @var=
);
);
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# mdev-14777: crash caused by the same as in mdev-14755
--
echo
#
--
source
include
/
have_sequence
.
inc
CREATE
TABLE
t1
(
i1
int
NOT
NULL
,
i2
int
);
CREATE
TABLE
t2
(
d1
int
NOT
NULL
PRIMARY
KEY
);
CREATE
TABLE
t3
(
i
int
);
insert
into
t1
select
seq
,
seq
from
seq_1_to_100000
;
insert
into
t2
select
seq
from
seq_1000_to_100000
;
insert
into
t3
select
seq
from
seq_1_to_1000
;
SELECT
*
FROM
(
SELECT
*
FROM
(
WITH
RECURSIVE
rt
AS
(
SELECT
i2
P
,
i1
C
FROM
t1
WHERE
i1
IN
(
SELECT
d1
FROM
t2
)
UNION
SELECT
t1
.
i2
P
,
rt
.
C
C
FROM
t1
,
rt
)
SELECT
C
,
P
FROM
(
SELECT
P
,
C
FROM
rt
WHERE
NOT
EXISTS
(
SELECT
1
FROM
t1
)
)
Y
)
X
WHERE
1
=
1
)
K
,
t3
;
drop
table
t1
,
t2
,
t3
;
mysql-test/t/derived_cond_pushdown.test
View file @
da39ca1f
...
@@ -1565,3 +1565,28 @@ eval $q;
...
@@ -1565,3 +1565,28 @@ eval $q;
eval
explain
format
=
json
$q
;
eval
explain
format
=
json
$q
;
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-13454: consequence of mdev-14368 fixed for 5.5
--
echo
#
SET
sql_mode
=
'ONLY_FULL_GROUP_BY'
;
create
table
t1
(
id
int
,
id2
int
);
insert
into
t1
values
(
1
,
1
),(
2
,
3
),(
3
,
4
),(
7
,
2
);
create
table
t2
(
id2
int
);
insert
t2
values
(
1
),(
2
),(
3
);
let
$q
=
SELECT
*
FROM
t1
LEFT
OUTER
JOIN
(
SELECT
id2
,
COUNT
(
*
)
as
ct
FROM
t2
GROUP
BY
id2
)
vc
USING
(
id2
)
WHERE
(
vc
.
ct
>
0
);
eval
$q
;
eval
EXPLAIN
FORMAT
=
JSON
$q
;
DROP
TABLE
t1
,
t2
;
SET
sql_mode
=
DEFAULT
;
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