summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-05-22 13:44:26 +0400
committerAlexander Barkov <bar@mariadb.org>2017-05-22 13:44:26 +0400
commitc84bbeda7f42e940553aee5377f64d2452872138 (patch)
treed0e04a77dae1f9c958d180deab40924de760fd7d /sql/item_sum.h
parentfeb15f4e45788550eb20292f22ab74d5fd7242c7 (diff)
downloadmariadb-git-c84bbeda7f42e940553aee5377f64d2452872138.tar.gz
MDEV-12858 + MDEV+12859 + MDEV-12862 - a join patch fixing a few data type problems with CREATE..SELECT
MDEV-12858 Out-of-range error for CREATE..SELECT unsigned_int_column+1 MDEV-12859 Out-of-range error for CREATE..SELECT @a:=EXTRACT(MINUTE_MICROSECOND FROM..) MDEV-12862 Data type of @a:=1e0 depends on the session character set 1. Moving a part of Item::create_tmp_field() into a new helper method Item::create_tmp_field_int() and reusing it in Item::create_tmp_field() and Item_func_signed::create_tmp_field(). Fixing the code in Item::create_tmp_field_int() to call Type_handler::make_table_field() instead of doing "new Field_long[long]" directly. This change revealed a problem reported in MDEV-12862. 2. Changing the "long vs longlong" cut-off length for - Item_func::create_tmp_field() - Item_sum::create_tmp_field() - Item_func_get_user_var::create_tmp_field() from MY_INT32_NUM_DECIMAL_DIGITS to (MY_INT32_NUM_DECIMAL_DIGITS - 2). This fixes MDEV-12858. After this change, the "convert_int_length" parameter to Item::create_tmp_field() is not needed any more, because (MY_INT32_NUM_DECIMAL_DIGITS - 2) is always passed. So removing the "convert_int_length" parameter. 3. Fixing Item::create_tmp_field() to pass max_char_length() instead of max_length to the constructor of Field_double(). This fixes MDEV-12862. 4. Additionally, fixing - Type_handler_{tiny|short|int24|long|longlong}::make_table_field() - Type_handler_{float|double}::make_table_field() to pass max_char_length() instead of max_length to Field contructors. This is needed by the change (1). 5. Adding new tests, and recording new correct results in the old tests in: - mysql-test/r/type_ranges.result - storage/tokudb/mysql-test/tokudb/r/type_ranges.result
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index c1485738b11..14a2fd0c0ec 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -510,7 +510,7 @@ public:
Item *get_tmp_table_item(THD *thd);
Field *create_tmp_field(bool group, TABLE *table)
{
- return Item::create_tmp_field(group, table, MY_INT32_NUM_DECIMAL_DIGITS);
+ return Item::create_tmp_field(group, table);
}
virtual bool collect_outer_ref_processor(void *param);
bool init_sum_func_check(THD *thd);