- 22 May, 2017 2 commits
-
-
Alexander Barkov authored
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
-
Alexander Barkov authored
MDEV-12860 Out-of-range error on CREATE..SELECT with a view using MAX and EXTRACT(MINUTE_MICROSECOND..)
-
- 21 May, 2017 1 commit
-
-
Alexander Barkov authored
This is a joint patch for: MDEV-12856 Wrong result set metadata for DIV MDEV-12857 Out-of-range errors on CREATE..SELECT 2222222222 DIV 1
-
- 20 May, 2017 1 commit
-
-
Alexander Barkov authored
-
- 19 May, 2017 2 commits
-
-
Alexander Barkov authored
1. Adding the forgotten "SET sql_mode=STRICT_ALL_TABLES" into the test. 2. STRICT_ALL_TABLES revealed that CAST(0xFFFFFFFF AS SIGNED), e.g. with a hex number with 8 hex digits, did not work well. Fixing Item_func_unsigned::create_tmp_field() and Item_func_unsigned::create_field_for_create_select() to handle this corner case.
-
Alexander Barkov authored
-
- 18 May, 2017 2 commits
-
-
Alexander Barkov authored
-
halfspawn authored
-
- 17 May, 2017 3 commits
-
-
Alexander Barkov authored
MDEV-12833 Split Column_definition::create_length_to_internal_length() to virtual methods in Type_handler
-
Alexander Barkov authored
MDEV-12826 Add Type_handler::val_int_signed_typecast() and Type_handler::val_int_unsigned_typecast()
-
Alexander Barkov authored
- Adding new virtual methods in Type_handler: * Column_definition_prepare_stage1() * Column_definition_prepare_stage2() * calc_pack_length() - Using new methods to remove type specific code in: * Global function calc_pack_length() * Column_definition::prepare_create_field() * The loop body mysql_prepare_create_table() * Column_definition::sp_prepare_create_field()
-
- 16 May, 2017 1 commit
-
-
Alexander Barkov authored
-
- 15 May, 2017 2 commits
-
-
Alexander Barkov authored
Introducing a new class Type_holder (used internally in sql_union.cc), to reuse exactly the same data type attribute aggregation Type_handler API for hybrid functions and UNION. This fixes a number of bugs in UNION: - MDEV-9495 Wrong field type for a UNION of a signed and an unsigned INT expression - MDEV-9497 UNION and COALESCE produce different field types for DECIMAL+INT - MDEV-12594 UNION between fixed length double columns does not always preserve scale - MDEV-12595 UNION converts INT to BIGINT - MDEV-12599 UNION is not symmetric when mixing INT and CHAR Details: - sql_union.cc: Reusing attribute aggregation for UNION. Adding new methods: * st_select_lex_unit::join_union_type_handlers() * st_select_lex_unit::join_union_type_attributes() * st_select_lex_unit::join_union_item_types() Removing the old join_types()-based code. - Changing Type_handler::Item_hybrid_func_fix_attributes() to accept "name", Type_handler_hybrid_field_type, Type_all_attributes as three separate parameters instead of a single Item_hybrid_func parameter, to make it possible to pass both Item_hybrid_func and Type_holder. - Moving the former special GEOMETRY and ENUM/SET attribute aggregation code from Item_type_holder::join_types() to * Type_handler_typelib::Item_hybrid_func_fix_attributes(). * Type_handler_geometry::Item_hybrid_func_fix_attrubutes(). This makes GEOMETRY/ENUM/SET symmetric with all other data types (from the UNION point of view). Removing Item_type_holder::join_types() and Item_type_holder::get_full_info(). - Adding new methods into Type_all_attributes: * Type_all_attributes::set_geometry_type() and Item_hybrid_func::set_geometry_type(). * Adding Type_all_attributes::get_typelib(). * Adding Type_all_attributes::set_typelib(). - Adding Type_handler_typelib as a common parent for Type_handler_enum and Type_handler_set, to avoid code duplication: they have already had two common methods, and we're adding one more shared method. - Adding Type_all_attributes::set_maybe_null(), as some type handlers may want to set maybe_null (e.g. Type_handler_geometry) during data type attribute aggregation. - Changing Type_geometry_attributes() to accept Type_handler and Type_all_attributes as two separate parameters, instead of a single Item parameter, to make it possible to pass Type_holder. - Adding Item_args::add_argument(). - Moving Item_args::alloc_arguments() from "protected" to "public". - Moving Item_type_holder::Item_type_holder() from item.cc to item.h, as now it's very simple. Btw, this constructor should probably be eventually removed. It's now used only in sql_show.cc, which could be modified to use Item_return_decimal (for symmetry with Item_return_xxx created for all other data types). Or, another option: remove all Item_return_xxx and use Item_type_holder for all data types instead. - storage/tokudb/mysql-test/tokudb/r/type_float.result Recording new results (MDEV-12594). - mysql-test/r/cte_recursive.result Recording new results (MDEV-9497) - mysql-test/r/subselect*.result Recording new results (MDEV-12595) - mysql-test/r/metadata.result Recording new results (MDEV-9495) - mysql-test/r/temp_table.result Recording new results (MDEV-12594) - mysql-test/r/type_float.result Recording new results (MDEV-12594)
-
Alexander Barkov authored
MDEV-12798 Item_param does not preserve exact field type in EXECUTE IMMEDIATE 'CREATE TABLE AS SELECT ?' USING POINT(1,1)
-
- 13 May, 2017 1 commit
-
-
Michael Widenius authored
This push just fixes tests, nothing wrong in server
-
- 11 May, 2017 2 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
"mtr --ps func_str" failed: pad_str was erroneously appended with a new space on every PS execution. Adding pad_str.length(0) into fix_length_and_dec() to avoid this.
-
- 10 May, 2017 4 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
This patch for MDEV-12770 is also fixing: MDEV-12769 Arithmetic operators with temporal types create excessive column types
-
- 08 May, 2017 1 commit
-
-
halfspawn authored
-
- 07 May, 2017 7 commits
-
-
Monty authored
- SETVAL(sequence_name, next_value, is_used, round) - ALTER SEQUENCE, including RESTART WITH Other things: - Added handler::extra() option HA_EXTRA_PREPARE_FOR_ALTER_TABLE to signal ha_sequence() that it should allow write_row statments. - ALTER ONLINE TABLE now works with SEQUENCE:s
-
Monty authored
Other things - Ensure that ut_d() is set to EXPR if ut_ad() is DEBUG_ASSERT() If not, we will get a crash in purge_sys_t::~purge_sys_t() as this ut_ad() code expect's that the ut_d() codes has been executed
-
Monty authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
- 06 May, 2017 7 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
Adding "const" qualifier to Item::cols(), and to the "Item *cmp" parameter to Type_handler::make_const_item_for_comparison()
-
Alexander Barkov authored
This gives better performance, as excludes handler-by-type lookup.
-
Alexander Barkov authored
-
- 05 May, 2017 4 commits
-
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
-
Alexander Barkov authored
This is a join patch fixing these two bugs: MDEV-12560 Wrong data type for SELECT NULL UNION SELECT Point(1,1) MDEV-12665 Hybrid functions do not preserve geometry type
-