mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
WL#926 "SUM(DISTINCT) and AVG(DISTINCT)": improvement of SUM(DISTINCT) and
implementation of AVG(DISTINCT) which utilizes the approach with Fields. The patch implemented in October is portede to the up-to-date tree containing DECIMAL type. Tests for AVG(DISTINCT) (although there is not much to test provided that SUM(DISTINCT) works), cleanups for COUNT(DISTINCT) and GROUP_CONCAT() will follow in another changeset.
This commit is contained in:
18
sql/field.cc
18
sql/field.cc
@@ -7150,6 +7150,24 @@ void create_field::create_length_to_internal_length(void)
|
||||
}
|
||||
|
||||
|
||||
void create_field::init_for_tmp_table(enum_field_types sql_type_arg,
|
||||
uint32 length_arg, uint32 decimals,
|
||||
bool maybe_null, bool is_unsigned)
|
||||
{
|
||||
field_name= "";
|
||||
sql_type= sql_type_arg;
|
||||
length= length_arg;;
|
||||
unireg_check= Field::NONE;
|
||||
interval= 0;
|
||||
charset= &my_charset_bin;
|
||||
geom_type= Field::GEOM_GEOMETRY;
|
||||
pack_flag= (FIELDFLAG_NUMBER |
|
||||
((decimals & FIELDFLAG_MAX_DEC) << FIELDFLAG_DEC_SHIFT) |
|
||||
(maybe_null ? FIELDFLAG_MAYBE_NULL : 0) |
|
||||
(is_unsigned ? 0 : FIELDFLAG_DECIMAL));
|
||||
}
|
||||
|
||||
|
||||
enum_field_types get_blob_type_from_length(ulong length)
|
||||
{
|
||||
enum_field_types type;
|
||||
|
||||
Reference in New Issue
Block a user