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
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
Hide 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,
...
@@ -5576,10 +5576,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
keyinfo
->
key_length
=
0
;
keyinfo
->
key_length
=
0
;
keyinfo
->
rec_per_key
=
0
;
keyinfo
->
rec_per_key
=
0
;
keyinfo
->
algorithm
=
HA_KEY_ALG_UNDEF
;
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
();
Field
*
field
=
(
*
cur_
group
->
item
)
->
get_tmp_table_field
();
bool
maybe_null
=
(
*
group
->
item
)
->
maybe_null
;
bool
maybe_null
=
(
*
cur_
group
->
item
)
->
maybe_null
;
key_part_info
->
null_bit
=
0
;
key_part_info
->
null_bit
=
0
;
key_part_info
->
field
=
field
;
key_part_info
->
field
=
field
;
key_part_info
->
offset
=
field
->
offset
();
key_part_info
->
offset
=
field
->
offset
();
...
@@ -5591,8 +5592,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -5591,8 +5592,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
0
:
FIELDFLAG_BINARY
;
0
:
FIELDFLAG_BINARY
;
if
(
!
using_unique_constraint
)
if
(
!
using_unique_constraint
)
{
{
group
->
buff
=
(
char
*
)
group_buff
;
cur_
group
->
buff
=
(
char
*
)
group_buff
;
if
(
!
(
group
->
field
=
field
->
new_field
(
thd
->
mem_root
,
table
)))
if
(
!
(
cur_
group
->
field
=
field
->
new_field
(
thd
->
mem_root
,
table
)))
goto
err
;
/* purecov: inspected */
goto
err
;
/* purecov: inspected */
if
(
maybe_null
)
if
(
maybe_null
)
{
{
...
@@ -5606,11 +5607,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -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_bit
=
field
->
null_bit
;
key_part_info
->
null_offset
=
(
uint
)
(
field
->
null_ptr
-
key_part_info
->
null_offset
=
(
uint
)
(
field
->
null_ptr
-
(
uchar
*
)
table
->
record
[
0
]);
(
uchar
*
)
table
->
record
[
0
]);
group
->
field
->
move_field
((
char
*
)
++
group
->
buff
);
cur_group
->
field
->
move_field
((
char
*
)
++
cur_
group
->
buff
);
group_buff
++
;
group_buff
++
;
}
}
else
else
group
->
field
->
move_field
((
char
*
)
group_buff
);
cur_
group
->
field
->
move_field
((
char
*
)
group_buff
);
group_buff
+=
key_part_info
->
length
;
group_buff
+=
key_part_info
->
length
;
}
}
keyinfo
->
key_length
+=
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