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
5b8a24cf
Commit
5b8a24cf
authored
Nov 17, 2009
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Plain Diff
merging.
parents
8afc2658
cd994f0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
sql/item_sum.cc
sql/item_sum.cc
+15
-3
sql/item_sum.h
sql/item_sum.h
+1
-0
No files found.
sql/item_sum.cc
View file @
5b8a24cf
...
...
@@ -28,6 +28,18 @@
#include "mysql_priv.h"
#include "sql_select.h"
/**
Calculate the affordable RAM limit for structures like TREE or Unique
used in Item_sum_*
*/
ulonglong
Item_sum
::
ram_limitation
(
THD
*
thd
)
{
return
min
(
thd
->
variables
.
tmp_table_size
,
thd
->
variables
.
max_heap_table_size
);
}
/**
Prepare an aggregate function item for checking context conditions.
...
...
@@ -833,7 +845,7 @@ bool Aggregator_distinct::setup(THD *thd)
}
DBUG_ASSERT
(
tree
==
0
);
tree
=
new
Unique
(
compare_key
,
cmp_arg
,
tree_key_length
,
thd
->
variables
.
max_heap_table_size
);
item_sum
->
ram_limitation
(
thd
)
);
/*
The only time tree_key_length could be 0 is if someone does
count(distinct) on a char(0) field - stupid thing to do,
...
...
@@ -902,7 +914,7 @@ bool Aggregator_distinct::setup(THD *thd)
are converted to binary representation as well.
*/
tree
=
new
Unique
(
simple_raw_key_cmp
,
&
tree_key_length
,
tree_key_length
,
thd
->
variables
.
max_heap_table_size
);
item_sum
->
ram_limitation
(
thd
)
);
DBUG_RETURN
(
tree
==
0
);
}
...
...
@@ -3514,7 +3526,7 @@ bool Item_func_group_concat::setup(THD *thd)
unique_filter
=
new
Unique
(
group_concat_key_cmp_with_distinct
,
(
void
*
)
this
,
tree_key_length
,
thd
->
variables
.
max_heap_table_size
);
ram_limitation
(
thd
)
);
DBUG_RETURN
(
FALSE
);
}
...
...
sql/item_sum.h
View file @
5b8a24cf
...
...
@@ -364,6 +364,7 @@ protected:
Item
**
orig_args
,
*
tmp_orig_args
[
2
];
table_map
used_tables_cache
;
bool
forced_const
;
static
ulonglong
ram_limitation
(
THD
*
thd
);
public:
...
...
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