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
cee1b3dd
Commit
cee1b3dd
authored
Feb 07, 2011
by
Ole John Aske
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for bug#59308 from mysql-5.1 -> mysql-5.5
parents
2f3fdbcf
221ce922
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
173 additions
and
86 deletions
+173
-86
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+25
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+17
-0
sql/sql_select.cc
sql/sql_select.cc
+131
-86
No files found.
mysql-test/r/order_by.result
View file @
cee1b3dd
...
...
@@ -1639,6 +1639,31 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 8 NULL 10 Using index; Using temporary; Using filesort
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where
DROP TABLE t1, t2;
#
# Bug #59110: Memory leak of QUICK_SELECT_I allocated memory
# and
# Bug #59308: Incorrect result for
SELECT DISTINCT <col>... ORDER BY <col> DESC
# Use Valgrind to detect #59110!
#
CREATE TABLE t1 (a INT,KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
EXPLAIN SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index a a 5 NULL 10 Using where; Using index; Using filesort
SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
a 1
10 1
9 1
8 1
7 1
6 1
5 1
4 1
3 1
2 1
DROP TABLE t1;
End of 5.1 tests
#
# Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
...
...
mysql-test/t/order_by.test
View file @
cee1b3dd
...
...
@@ -1493,6 +1493,23 @@ LIMIT 2;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug #59110: Memory leak of QUICK_SELECT_I allocated memory
--
echo
# and
--
echo
# Bug #59308: Incorrect result for
--
echo
SELECT
DISTINCT
<
col
>...
ORDER
BY
<
col
>
DESC
--
echo
--
echo
# Use Valgrind to detect #59110!
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
),(
10
);
EXPLAIN
SELECT
DISTINCT
a
,
1
FROM
t1
WHERE
a
<>
1
ORDER
BY
a
DESC
;
SELECT
DISTINCT
a
,
1
FROM
t1
WHERE
a
<>
1
ORDER
BY
a
DESC
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
...
...
sql/sql_select.cc
View file @
cee1b3dd
This diff is collapsed.
Click to expand it.
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