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
4d58d1f1
Commit
4d58d1f1
authored
Jun 24, 2010
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
ea73b23e
a95e7ee0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
5 deletions
+38
-5
mysql-test/r/select.result
mysql-test/r/select.result
+15
-0
mysql-test/t/select.test
mysql-test/t/select.test
+10
-0
sql/sql_select.cc
sql/sql_select.cc
+13
-5
No files found.
mysql-test/r/select.result
View file @
4d58d1f1
...
...
@@ -4856,4 +4856,19 @@ a b c
SELECT * FROM t1 WHERE 102 < c;
a b c
DROP TABLE t1;
#
# Bug #54459: Assertion failed: param.sort_length,
# file .\filesort.cc, line 149 (part II)
#
CREATE TABLE t1(a ENUM('') NOT NULL);
INSERT INTO t1 VALUES (), (), ();
EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
1
1
1
1
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/select.test
View file @
4d58d1f1
...
...
@@ -4117,4 +4117,14 @@ SELECT * FROM t1 WHERE 102 < c;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #54459: Assertion failed: param.sort_length,
--
echo
# file .\filesort.cc, line 149 (part II)
--
echo
#
CREATE
TABLE
t1
(
a
ENUM
(
''
)
NOT
NULL
);
INSERT
INTO
t1
VALUES
(),
(),
();
EXPLAIN
SELECT
1
FROM
t1
ORDER
BY
a
COLLATE
latin1_german2_ci
;
SELECT
1
FROM
t1
ORDER
BY
a
COLLATE
latin1_german2_ci
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
4d58d1f1
...
...
@@ -586,13 +586,21 @@ JOIN::prepare(Item ***rref_pointer_array,
{
Item
*
item
=
*
ord
->
item
;
/*
Disregard sort order if there's only "{VAR}CHAR(0) NOT NULL" fields
there. Such fields don't contain any data to sort.
Disregard sort order if there's only
zero length NOT NULL fields (e.g. {VAR}CHAR(0) NOT NULL") or
zero length NOT NULL string functions there.
Such tuples don't contain any data to sort.
*/
if
(
!
real_order
&&
(
item
->
type
()
!=
Item
::
FIELD_ITEM
||
((
Item_field
*
)
item
)
->
field
->
maybe_null
()
||
((
Item_field
*
)
item
)
->
field
->
sort_length
()))
/* Not a zero length NOT NULL field */
((
item
->
type
()
!=
Item
::
FIELD_ITEM
||
((
Item_field
*
)
item
)
->
field
->
maybe_null
()
||
((
Item_field
*
)
item
)
->
field
->
sort_length
())
&&
/* AND not a zero length NOT NULL string function. */
(
item
->
type
()
!=
Item
::
FUNC_ITEM
||
item
->
maybe_null
||
item
->
result_type
()
!=
STRING_RESULT
||
item
->
max_length
)))
real_order
=
TRUE
;
if
(
item
->
with_sum_func
&&
item
->
type
()
!=
Item
::
SUM_FUNC_ITEM
)
...
...
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