diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-04-27 14:37:27 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-27 14:37:27 +0400 |
commit | 441349aa0659f07828af7c09164e142b8d565b3a (patch) | |
tree | 0beb4b056427a6ce7d0ec14722172746e418f130 /sql/item_sum.h | |
parent | b445c1ebb5d7012b3994b37a6a9a58c6585040af (diff) | |
download | mariadb-git-441349aa0659f07828af7c09164e142b8d565b3a.tar.gz |
MDEV-12588 Add Type_handler::type_handler_for_tmp_table() and Type_handler::type_handler_for_union()
1. Implementing the task according to the description:
a. Adding Type_handler::type_handler_for_tmp_table().
b. Adding Type_handler::type_handler_for_union_table.
c. Adding helper methods Type_handler::varstring_type_handler(const Item*),
Type_handler::blob_type_handler(const Item*)
d. Removing Item::make_string_field() and
Item_func_group_concat::make_string_field().
They are not needed any more.
e. Simplifying Item::tmp_table_field_from_field_type() to just two lines.
f. Renaming Item_type_holder::make_field_by_type() and implementing
virtual Item_type_holder::create_tmp_field() instead.
The new implementation is also as simple as two lines.
g. Adding a new virtual method Type_all_attributes::get_typelib(),
to access to TYPELIB definitions for ENUM and SET columns.
h. Simplifying the code branch for TIME_RESULT, DECIMAL_RESULT, STRING_RESULT
in Item::create_tmp_field(). It's now just one line.
i. Implementing Type_handler_enum::make_table_field() and
Type_handler_set::make_table_field().
2. Code simplification in Field_str constructor calls.
a. Changing the "CHARSET_INFO *cs" argument in constuctors for Field_str
and its descendants to "const DTCollation &collation". This is to
avoid two step initialization:
- setting Field_str::derivation and Field_str::repertoire to the
default values first
- then resetting them using:
set_derivation(item->derivation, item->repertoire).
b. Removing Field::set_derivation()
c. Adding a new constructor DTCollation(CHARSET_INFO *cs),
for the old code compatibility.
3. Changes in test results
As a side effect some test results have changed, because
in the old version Item::make_string_field() converted
TINYBLOB to VARCHAR(255). Now TINYBLOB is preserved.
a. sp-row.result
This query:
CREATE TABLE t1 AS SELECT tinyblob_sp_variable;
Now preserves TINYBLOB as the data type.
Before the patch a VARCHAR(255) was created.
b. gis-debug.result
This is a debug test, to make sure that + and - operators
are commutative and non-commutative correspondingly.
The exact data type is not really important.
(But anyway, it now chooses a better data type that fits the result)
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 039ae0de1a8..33ee83f147b 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1636,9 +1636,6 @@ class Item_func_group_concat : public Item_sum friend int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)), void* item_arg); -protected: - virtual Field *make_string_field(TABLE *table); - public: Item_func_group_concat(THD *thd, Name_resolution_context *context_arg, bool is_distinct, List<Item> *is_select, |