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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1f9763c1
Commit
1f9763c1
authored
Dec 21, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some test that was not relevant for MySQL (and which caused problems in MySQL 4.1)
parent
a7d8af9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
23 deletions
+32
-23
sql/filesort.cc
sql/filesort.cc
+32
-23
No files found.
sql/filesort.cc
View file @
1f9763c1
...
@@ -51,17 +51,38 @@ static int merge_index(SORTPARAM *param,uchar *sort_buffer,
...
@@ -51,17 +51,38 @@ static int merge_index(SORTPARAM *param,uchar *sort_buffer,
static
bool
save_index
(
SORTPARAM
*
param
,
uchar
**
sort_keys
,
uint
count
);
static
bool
save_index
(
SORTPARAM
*
param
,
uchar
**
sort_keys
,
uint
count
);
static
uint
sortlength
(
SORT_FIELD
*
sortorder
,
uint
length
);
static
uint
sortlength
(
SORT_FIELD
*
sortorder
,
uint
length
);
/*
/*
Sort a table
SYNOPSIS
filesort()
table Table to sort
sortorder How to sort the table
s_length Number of elements in sortorder
select condition to apply to the rows
special Not used.
(This could be used to sort the rows pointed on by
select->file)
examined_rows Store number of examined rows here
IMPLEMENTATION
Creates a set of pointers that can be used to read the rows
Creates a set of pointers that can be used to read the rows
in sorted order. This should be done with the functions
in sorted order. This should be done with the functions
in records.cc
in records.cc
REQUIREMENTS
Before calling filesort, one must have done
Before calling filesort, one must have done
table->file->info(HA_STATUS_VARIABLE)
table->file->info(HA_STATUS_VARIABLE)
RETURN
HA_POS_ERROR Error
# Number of rows
examined_rows will be set to number of examined rows
The result set is stored in table->io_cache or
The result set is stored in table->io_cache or
table->record_pointers
table->record_pointers
*/
*/
ha_rows
filesort
(
TABLE
*
table
,
SORT_FIELD
*
sortorder
,
uint
s_length
,
ha_rows
filesort
(
TABLE
*
table
,
SORT_FIELD
*
sortorder
,
uint
s_length
,
SQL_SELECT
*
select
,
ha_rows
special
,
ha_rows
max_rows
,
SQL_SELECT
*
select
,
ha_rows
special
,
ha_rows
max_rows
,
...
@@ -127,8 +148,6 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
...
@@ -127,8 +148,6 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
records
=
table
->
file
->
estimate_number_of_rows
();
records
=
table
->
file
->
estimate_number_of_rows
();
selected_records_file
=
0
;
selected_records_file
=
0
;
}
}
if
(
param
.
sort_length
==
param
.
ref_length
&&
records
>
param
.
max_rows
)
records
=
param
.
max_rows
;
/* purecov: inspected */
#ifdef USE_STRCOLL
#ifdef USE_STRCOLL
if
(
use_strcoll
(
default_charset_info
)
&&
if
(
use_strcoll
(
default_charset_info
)
&&
...
@@ -372,16 +391,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
...
@@ -372,16 +391,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if
(
write_keys
(
param
,
sort_keys
,
idx
,
buffpek_pointers
,
tempfile
))
if
(
write_keys
(
param
,
sort_keys
,
idx
,
buffpek_pointers
,
tempfile
))
DBUG_RETURN
(
HA_POS_ERROR
);
DBUG_RETURN
(
HA_POS_ERROR
);
idx
=
0
;
idx
=
0
;
if
(
param
->
ref_length
==
param
->
sort_length
&&
my_b_tell
(
tempfile
)
/
param
->
sort_length
>=
param
->
max_rows
)
{
/*
We are writing the result index file and have found all
rows that we need. Abort the sort and return the result.
*/
error
=
HA_ERR_END_OF_FILE
;
break
;
/* Found enough records */
}
indexpos
++
;
indexpos
++
;
}
}
make_sortkey
(
param
,
sort_keys
[
idx
++
],
ref_pos
);
make_sortkey
(
param
,
sort_keys
[
idx
++
],
ref_pos
);
...
...
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