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
00749980
Commit
00749980
authored
Mar 10, 2020
by
Varun Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing a compilation failure on windows
parent
9ae01587
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
sql/filesort.cc
sql/filesort.cc
+28
-3
No files found.
sql/filesort.cc
View file @
00749980
...
...
@@ -67,6 +67,31 @@ static Addon_fields *get_addon_fields(TABLE *table, uint sortlength,
static
bool
check_if_pq_applicable
(
Sort_param
*
param
,
SORT_INFO
*
info
,
TABLE
*
table
,
ha_rows
records
,
size_t
memory_available
);
static
void
store_key_part_length
(
uint32
num
,
uchar
*
to
,
uint
bytes
)
{
switch
(
bytes
)
{
case
1
:
*
to
=
(
uchar
)
num
;
break
;
case
2
:
int2store
(
to
,
num
);
break
;
case
3
:
int3store
(
to
,
num
);
break
;
case
4
:
int4store
(
to
,
num
);
break
;
default:
DBUG_ASSERT
(
0
);
}
}
static
uint32
read_keypart_length
(
const
uchar
*
from
,
uint
bytes
)
{
switch
(
bytes
)
{
case
1
:
return
from
[
0
];
case
2
:
return
uint2korr
(
from
);
case
3
:
return
uint3korr
(
from
);
case
4
:
return
uint4korr
(
from
);
default:
DBUG_ASSERT
(
0
);
return
0
;
}
}
// @param sortlen [Maximum] length of the sort key
void
Sort_param
::
init_for_filesort
(
uint
sortlen
,
TABLE
*
table
,
ha_rows
maxrows
,
bool
sort_positions
)
...
...
@@ -2773,8 +2798,8 @@ int SORT_FIELD_ATTR::compare_packed_varstrings(uchar *a, size_t *a_len,
else
*
a_len
=
*
b_len
=
0
;
a_length
=
read_
lowendian
(
a
,
length_bytes
);
b_length
=
read_
lowendian
(
b
,
length_bytes
);
a_length
=
read_
keypart_length
(
a
,
length_bytes
);
b_length
=
read_
keypart_length
(
b
,
length_bytes
);
*
a_len
+=
length_bytes
+
a_length
;
*
b_len
+=
length_bytes
+
b_length
;
...
...
@@ -2921,7 +2946,7 @@ SORT_FIELD_ATTR::pack_sort_string(uchar *to, const LEX_CSTRING &str,
data_length
=
original_length
-
suffix_length
;
// length stored in lowendian form
store_
lowendian
(
data_length
+
suffix_length
,
to
,
length_bytes
);
store_
key_part_length
(
data_length
+
suffix_length
,
to
,
length_bytes
);
to
+=
length_bytes
;
// copying data length bytes to the buffer
memcpy
(
to
,
(
uchar
*
)
str
.
str
,
data_length
);
...
...
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