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
cf3bed86
Commit
cf3bed86
authored
Sep 04, 2006
by
timour/timka@lamia.home
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#21787: COUNT(*) + ORDER BY + LIMIT returns wrong result
Fix an error in the bug fix.
parent
5a0d5670
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
sql/sql_select.cc
sql/sql_select.cc
+8
-7
No files found.
sql/sql_select.cc
View file @
cf3bed86
...
...
@@ -5576,10 +5576,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
keyinfo
->
key_length
=
0
;
keyinfo
->
rec_per_key
=
0
;
keyinfo
->
algorithm
=
HA_KEY_ALG_UNDEF
;
for
(;
group
;
group
=
group
->
next
,
key_part_info
++
)
ORDER
*
cur_group
=
group
;
for
(;
cur_group
;
cur_group
=
cur_group
->
next
,
key_part_info
++
)
{
Field
*
field
=
(
*
group
->
item
)
->
get_tmp_table_field
();
bool
maybe_null
=
(
*
group
->
item
)
->
maybe_null
;
Field
*
field
=
(
*
cur_
group
->
item
)
->
get_tmp_table_field
();
bool
maybe_null
=
(
*
cur_
group
->
item
)
->
maybe_null
;
key_part_info
->
null_bit
=
0
;
key_part_info
->
field
=
field
;
key_part_info
->
offset
=
field
->
offset
();
...
...
@@ -5591,8 +5592,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
0
:
FIELDFLAG_BINARY
;
if
(
!
using_unique_constraint
)
{
group
->
buff
=
(
char
*
)
group_buff
;
if
(
!
(
group
->
field
=
field
->
new_field
(
thd
->
mem_root
,
table
)))
cur_
group
->
buff
=
(
char
*
)
group_buff
;
if
(
!
(
cur_
group
->
field
=
field
->
new_field
(
thd
->
mem_root
,
table
)))
goto
err
;
/* purecov: inspected */
if
(
maybe_null
)
{
...
...
@@ -5606,11 +5607,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
key_part_info
->
null_bit
=
field
->
null_bit
;
key_part_info
->
null_offset
=
(
uint
)
(
field
->
null_ptr
-
(
uchar
*
)
table
->
record
[
0
]);
group
->
field
->
move_field
((
char
*
)
++
group
->
buff
);
cur_group
->
field
->
move_field
((
char
*
)
++
cur_
group
->
buff
);
group_buff
++
;
}
else
group
->
field
->
move_field
((
char
*
)
group_buff
);
cur_
group
->
field
->
move_field
((
char
*
)
group_buff
);
group_buff
+=
key_part_info
->
length
;
}
keyinfo
->
key_length
+=
key_part_info
->
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