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
369da478
Commit
369da478
authored
Mar 14, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
2cb3a5d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
sql/filesort.cc
sql/filesort.cc
+6
-10
No files found.
sql/filesort.cc
View file @
369da478
...
@@ -95,7 +95,7 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
...
@@ -95,7 +95,7 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
ha_rows
*
examined_rows
)
ha_rows
*
examined_rows
)
{
{
int
error
;
int
error
;
uint
memavl
,
old_memavl
,
maxbuffer
,
skr
;
uint
memavl
,
old_memavl
,
m
in_sort_memory
,
m
axbuffer
,
skr
;
BUFFPEK
*
buffpek
;
BUFFPEK
*
buffpek
;
ha_rows
records
;
ha_rows
records
;
uchar
**
sort_keys
;
uchar
**
sort_keys
;
...
@@ -162,7 +162,8 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
...
@@ -162,7 +162,8 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
#endif
#endif
memavl
=
sortbuff_size
;
memavl
=
sortbuff_size
;
while
(
memavl
>=
MIN_SORT_MEMORY
)
min_sort_memory
=
max
(
MIN_SORT_MEMORY
,
param
.
sort_length
*
MERGEBUFF2
);
while
(
memavl
>=
min_sort_memory
)
{
{
if
((
ulonglong
)
(
records
+
1
)
*
(
param
.
sort_length
+
sizeof
(
char
*
))
+
sizeof
(
BUFFPEK
)
*
10
<
if
((
ulonglong
)
(
records
+
1
)
*
(
param
.
sort_length
+
sizeof
(
char
*
))
+
sizeof
(
BUFFPEK
)
*
10
<
(
ulonglong
)
memavl
)
(
ulonglong
)
memavl
)
...
@@ -192,18 +193,13 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
...
@@ -192,18 +193,13 @@ ha_rows filesort(TABLE **table, SORT_FIELD *sortorder, uint s_length,
else
else
my_free
((
gptr
)
sort_keys
,
MYF
(
0
));
my_free
((
gptr
)
sort_keys
,
MYF
(
0
));
old_memavl
=
memavl
;
old_memavl
=
memavl
;
if
((
memavl
=
memavl
/
4
*
3
)
<
MIN_SORT_MEMORY
&&
old_memavl
>
MIN_SORT_MEMORY
)
if
((
memavl
=
memavl
/
4
*
3
)
<
min_sort_memory
&&
old_memavl
>
min_sort_memory
)
memavl
=
MIN_SORT_MEMORY
;
memavl
=
min_sort_memory
;
}
}
param
.
keys
--
;
param
.
keys
--
;
maxbuffer
+=
10
;
/* Some extra range */
maxbuffer
+=
10
;
/* Some extra range */
if
(
memavl
<
param
.
sort_length
*
MERGEBUFF2
)
if
(
memavl
<
min_sort_memory
)
{
my_error
(
ER_OUT_OF_SORTMEMORY
,
MYF
(
0
));
goto
err
;
}
if
(
memavl
<
MIN_SORT_MEMORY
)
{
{
my_error
(
ER_OUTOFMEMORY
,
MYF
(
ME_ERROR
+
ME_WAITTANG
),
sortbuff_size
);
my_error
(
ER_OUTOFMEMORY
,
MYF
(
ME_ERROR
+
ME_WAITTANG
),
sortbuff_size
);
goto
err
;
goto
err
;
...
...
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