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
21778b8a
Commit
21778b8a
authored
Jan 20, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
764ca7e6
66465914
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
0 deletions
+77
-0
mysql-test/main/distinct.result
mysql-test/main/distinct.result
+36
-0
mysql-test/main/distinct.test
mysql-test/main/distinct.test
+38
-0
mysql-test/suite/galera/disabled.def
mysql-test/suite/galera/disabled.def
+1
-0
sql/sql_limit.h
sql/sql_limit.h
+2
-0
No files found.
mysql-test/main/distinct.result
View file @
21778b8a
...
...
@@ -1070,3 +1070,39 @@ UNION
1
drop table t1;
End of 5.5 tests
#
# MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
#
CREATE TABLE t1 (
id int(7) NOT NULL AUTO_INCREMENT,
name varchar(50) DEFAULT NULL,
primary key (id)
);
INSERT INTO t1 VALUES (1, 'Reed'), (10, 'no-child');
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
parent_id int(7) NOT NULL,
name varchar(100) DEFAULT NULL,
primary key (id),
key(parent_id)
);
INSERT INTO t2 VALUES (1, 1,'John'), (2, 2,'no-parent');
SELECT DISTINCT p.id
FROM t1 p LEFT JOIN t2 c ON p.id = c.parent_id
WHERE p.id=1
LIMIT 0;
id
SELECT DISTINCT p.id
FROM t1 p LEFT JOIN t2 c ON p.id = c.parent_id
WHERE p.id=1
LIMIT 0 offset 5;
id
# Test the second part of the fix: just check that "LIMIT 0 OFFSET n" is
# handled in the same way as "LIMIT 0"
explain select * from t1 limit 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
explain select * from t1 limit 0 offset 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
drop table t1, t2;
mysql-test/main/distinct.test
View file @
21778b8a
...
...
@@ -818,3 +818,41 @@ UNION
drop
table
t1
;
--
echo
End
of
5.5
tests
--
echo
#
--
echo
# MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
--
echo
#
CREATE
TABLE
t1
(
id
int
(
7
)
NOT
NULL
AUTO_INCREMENT
,
name
varchar
(
50
)
DEFAULT
NULL
,
primary
key
(
id
)
);
INSERT
INTO
t1
VALUES
(
1
,
'Reed'
),
(
10
,
'no-child'
);
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
parent_id
int
(
7
)
NOT
NULL
,
name
varchar
(
100
)
DEFAULT
NULL
,
primary
key
(
id
),
key
(
parent_id
)
);
INSERT
INTO
t2
VALUES
(
1
,
1
,
'John'
),
(
2
,
2
,
'no-parent'
);
SELECT
DISTINCT
p
.
id
FROM
t1
p
LEFT
JOIN
t2
c
ON
p
.
id
=
c
.
parent_id
WHERE
p
.
id
=
1
LIMIT
0
;
SELECT
DISTINCT
p
.
id
FROM
t1
p
LEFT
JOIN
t2
c
ON
p
.
id
=
c
.
parent_id
WHERE
p
.
id
=
1
LIMIT
0
offset
5
;
--
echo
# Test the second part of the fix: just check that "LIMIT 0 OFFSET n" is
--
echo
# handled in the same way as "LIMIT 0"
explain
select
*
from
t1
limit
0
;
explain
select
*
from
t1
limit
0
offset
10
;
drop
table
t1
,
t2
;
mysql-test/suite/galera/disabled.def
View file @
21778b8a
...
...
@@ -15,6 +15,7 @@ GCF-939 : MDEV-21520 galera.GCF-939
MDEV-20225 : MDEV-20886 galera.MDEV-20225
MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-328D : MDEV-27550 ER_LOCK_DEADLOCK is gone after MDEV-27025
MW-329 : MDEV-19962 Galera test failure on MW-329
galera_applier_ftwrl_table_alter : MDEV-26502 : galera.galera_applier_ftwrl_table_alter MTR failed : Result content mismatch
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
...
...
sql/sql_limit.h
View file @
21778b8a
...
...
@@ -37,6 +37,8 @@ class Select_limit_counters
void
set_limit
(
ha_rows
limit
,
ha_rows
offset
,
bool
with_ties_arg
)
{
if
(
limit
==
0
)
offset
=
0
;
offset_limit_cnt
=
offset
;
select_limit_cnt
=
limit
;
with_ties
=
with_ties_arg
;
...
...
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