-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A cleanup for MDEV-9217 Split Item::tmp_table_field_from_field_type()…
… into virtual methods in Type_handler Fixing that the server tried to create the old decimal for: CREATE TABLE t2 AS SELECT old_decimal_field FROM t1 UNION SELECT bigint_field FROM t1; CREATE TABLE t2 AS SELECT old_decimal_field FROM t1 UNION SELECT mediumint_field FROM t1; CREATE TABLE t2 AS SELECT year FROM t1 UNION SELECT old_decimal_field FROM t1; CREATE TABLE t2 AS SELCT COALESCE(old_decimal_field) FROM t1; Solution: 1. field_types_merge_rules[][] had three MYSQL_TYPE_DECIMAL remainders. Fixing to MYSQL_TYPE_NEWDECIMAL, like it is done for all other type pairs. This fixes the above queries with UNION. 2. Convert MYSQL_TYPE_DECIMAL to MYSQL_TYPE_NEWDECIMAL in Item::tmp_table_field_from_field_type(). This fixed the above query with COALESCE. 3. Adding "new Field_decimal" into Type_handler_olddecimal::make_table_field(). In case if something goes wrong it will crash on assert only in debug builds, while create the old decimal in release. Note, this "new Field_decimal" will be needed later anyway, when we reuse Type_handler::make_table_field() in make_field() in field.cc.
- Loading branch information
Alexander Barkov
committed
Apr 24, 2017
1 parent
7913743
commit 5f1544f
Showing
5 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters