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
196e995c
Commit
196e995c
authored
May 29, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cheat when all parts of count(distinct) key are binary
parent
6ecaac01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
sql/item_sum.cc
sql/item_sum.cc
+13
-2
No files found.
sql/item_sum.cc
View file @
196e995c
...
...
@@ -926,15 +926,26 @@ bool Item_sum_count_distinct::setup(THD *thd)
}
else
// too bad, cannot cheat - there is more than one field
{
cmp_arg
=
(
void
*
)
this
;
compare_key
=
(
qsort_cmp2
)
composite_key_cmp
;
bool
all_binary
=
1
;
Field
**
field
,
**
field_end
;
field_end
=
(
field
=
table
->
field
)
+
table
->
fields
;
for
(
key_len
=
0
;
field
<
field_end
;
++
field
)
{
key_len
+=
(
*
field
)
->
field_length
;
if
(
!
(
*
field
)
->
binary
())
all_binary
=
0
;
}
rec_offset
=
table
->
reclength
-
key_len
;
if
(
all_binary
)
{
compare_key
=
(
qsort_cmp2
)
simple_raw_key_cmp
;
cmp_arg
=
(
void
*
)
key_len
;
}
else
{
compare_key
=
(
qsort_cmp2
)
composite_key_cmp
;
cmp_arg
=
(
void
*
)
this
;
}
}
init_tree
(
&
tree
,
min
(
max_heap_table_size
,
sortbuff_size
/
16
),
...
...
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