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
823d4da7
Commit
823d4da7
authored
Mar 20, 2002
by
bar@gw.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for crash in the case of non-string fields
parent
5da75998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
sql/filesort.cc
sql/filesort.cc
+15
-8
No files found.
sql/filesort.cc
View file @
823d4da7
...
...
@@ -925,10 +925,13 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
{
sortorder
->
length
=
sortorder
->
field
->
pack_length
();
#ifdef USE_STRCOLL
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
if
(
use_strcoll
(
cs
)
&&
!
sortorder
->
field
->
binary
())
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
if
(
!
sortorder
->
field
->
binary
())
{
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
if
(
use_strcoll
(
cs
))
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
}
#endif
}
if
(
sortorder
->
field
->
maybe_null
())
...
...
@@ -937,15 +940,19 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
else
{
#ifdef USE_STRCOLL
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
#endif
switch
((
sortorder
->
result_type
=
sortorder
->
item
->
result_type
()))
{
case
STRING_RESULT
:
sortorder
->
length
=
sortorder
->
item
->
max_length
;
#ifdef USE_STRCOLL
if
(
use_strcoll
(
cs
)
&&
!
sortorder
->
item
->
binary
)
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
if
(
!
sortorder
->
item
->
binary
)
{
// BAR TODO: need checking that it is really Field_str based class
CHARSET_INFO
*
cs
=
((
Field_str
*
)(
sortorder
->
field
))
->
charset
();
if
(
use_strcoll
(
cs
))
sortorder
->
length
=
sortorder
->
length
*
cs
->
strxfrm_multiply
;
}
#endif
break
;
case
INT_RESULT
:
...
...
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