summaryrefslogtreecommitdiff
path: root/sql/sql_type.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | MDEV-20716 Unify make_table_field() and make_table_field_from_def() for ↵Alexander Barkov2019-10-011-106/+16
| | | | | | | | | | | | | | | | integer and real types
* | | | MDEV-20708 Change make_table_field() to get TABLE_SHARE rather than TABLEAlexander Barkov2019-10-011-37/+37
| | | |
* | | | MDEV-20706 Store scale in Column_definition::decimals rather than ↵Alexander Barkov2019-10-011-8/+177
| | | | | | | | | | | | | | | | Column_definition::pack_flag
* | | | MDEV-16144 Default TIMESTAMP clause for SELECT from versionedAleksey Midenkov2019-09-301-68/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Removed TIMESTAMP/TRANSACTION unit auto-detection in favor of default TIMESTAMP. Reasons: 1.1. rare practical use and doubtful advantage of such auto-detection; 1.2. it conflicts with MDEV-16226 (TRX_ID-based versioned tables performance improvement). Needless check_unit membership removed. 2. SQL: versioning type handling refactoring Vers_type_handler hierarchy stores versioning properties of type. virtual Type_handler::vers() accesses specialization of Vers_type_handler for specific type. virtual Vers_type_handler::kind() returns versioning kind (timestamp/trx_id). Removed Type_handler::Vers_history_point_check_unit() in favor of Type_handler::vers(). Renames: require_timestamp() -> require_timestamp_error() require_trx_id() -> require_trx_id_error() EDIT by Alexander Barkov (@abarkov): check_sys_fields() moved to Vers_type_handler::check_sys_fields()
* | | | MDEV-20696 Remove Column_definition::key_lengthAlexander Barkov2019-09-291-9/+43
| | | |
* | | | Cleanup: removing Type_handler members m_name_xxxAlexander Barkov2019-09-171-41/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Hiding the definitions inside Type_handler_xxx::name(). This is needed to avoid exporting members with MYSQL_PLUGIN_IMPORT, which would be needed to compile data type plugins on Windows.
* | | | Cleanup: removing Type_handler members m_version_xxxAlexander Barkov2019-09-171-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing methods instead: const Name version_mysql56() const; const Name version_mariadb53() const; This is needed to avoid exporting members with MYSQL_PLUGIN_IMPORT, which would be needed to compile data type plugins on Windows.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-09-061-3/+38
|\ \ \ \ | |/ / /
| * | | MDEV-20397 Support TIMESTAMP, DATETIME, TIME in ROUND() and TRUNCATE()Alexander Barkov2019-08-221-3/+38
| | | |
* | | | MDEV-20353 Add separate type handlers for unsigned integer data typesAlexander Barkov2019-08-151-53/+224
| | | |
* | | | Revert "MDEV-20342 Turn Field::flags from a member to a method"Alexander Barkov2019-08-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e86010f909fb6b8c4ffd9d6df92991ac079e67e7. Reverting on Monty's request, as this change makes merging things from 10.5 to 10.2 much harder.
* | | | MDEV-20342 Turn Field::flags from a member to a methodAlexander Barkov2019-08-141-4/+3
| | | |
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2019-08-131-67/+6
|\ \ \ \ | |/ / /
| * | | Merge commit '43882e764d6867c6855b1ff057758a3f08b25c55' into 10.4Alexander Barkov2019-08-131-67/+6
| |\ \ \ | | |/ /
| | * | A cleanup for `MDEV-20273 Add class Item_sum_min_max` - removing duplicate codeAlexander Barkov2019-08-091-69/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reusing the MIN()/MAX() fix_length_and_dec() related code for window functions - FIRST_VALUE() - LAST_VALUE() - NTH_VALUE() - LEAD() - LAG
| | * | MDEV-20273 Add class Item_sum_min_maxAlexander Barkov2019-08-071-15/+15
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-08-131-1/+6
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-07-011-1/+6
| |\ \ \ | | |/ /
| | * | MDEV-17551 assert or crashed table when using blobsMonty2019-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was that when long item-strings was converted to VARCHAR, type_handler::string_type_handler() didn't take into account max VARCHAR length. The resulting Aria temporary table was created with a VARCHAR field of length 1 when it should have been 65537. This caused MariaDB to send impossible records to ma_write() and Aria reported eventually the table as crashed. Fixed by updating Type_handler::string_type_handler() to not create too long VARCHAR fields. To make things extra safe, I also added checks in when writing dynamic Aria records to ensure we find the wrong record during write instead of during read.
* | | | MDEV-20332 Wrong UNSIGNED metadata flag returned for ↵Alexander Barkov2019-08-121-1/+1
| | | | | | | | | | | | | | | | COALESCE(unsigned_field,timestamp_field)
* | | | MDEV-20331 Add class Type_numeric_attributesAlexander Barkov2019-08-121-42/+52
| | | |
* | | | MDEV-20326 Add class DTCollation_numericAlexander Barkov2019-08-121-0/+8
| | | |
* | | | MDEV-20175 Move Type_handler_row from Type_collection_std to Type_collection_rowAlexander Barkov2019-07-251-3/+57
| | | |
* | | | MDEV-20052 Add a MEM_ROOT pointer argument to Type_handler::make_xxx_field()Alexander Barkov2019-07-121-151/+213
| | | |
* | | | MDEV-20042 Implement EXTRA2_FIELD_DATA_TYPE_INFO in FRMAlexander Barkov2019-07-111-0/+14
| | | |
* | | | MDEV-19957 Move Type_handler_geometry code from sql_type.h/cc to ↵Alexander Barkov2019-07-051-676/+5
| | | | | | | | | | | | | | | | sql_type_geom.h/cc
* | | | MDEV-19944 Remove GIS data types from keyword list in lex.hAlexander Barkov2019-07-041-0/+105
| | | |
* | | | MDEV-19923 Add type handlers for geometry sub-typesAlexander Barkov2019-07-031-70/+334
| | | |
* | | | MDEV-19908 Add class Type_collectionAlexander Barkov2019-06-291-110/+179
| | | |
* | | | MDEV-19897 Rename source code variable names from utf8 to utf8mb3Alexander Barkov2019-06-281-1/+1
| | | |
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Monty2019-06-271-12/+1
|\ \ \ \ | |/ / /
| * | | NFC: refactor Field::is_equal() and related stuffEugene Kosov2019-06-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make Field::is_equal() const and return bool as it's a naturally fitting type for it. Also it's agrument was narrowed to Column_definition. InnoDB can change type of some columns by itself. InnoDB-specific code used to reside in Field_xxx:is_equal() methods. Now engine-specific stuff was moved to a virtual methods of handler::can_convert{string,varstring,blob,geom}. These methods are called by Field::can_be_converted_by_engine() which is a double dispatch pattern. Some InnoDB-specific code still resides in compare_keys_but_name(). It should be moved from here someday to handler::compare_key_parts(...) or similar. IS_EQUAL_WITH_REINTERPRET_COMPATIBLE_CHARSET IS_EQUAL_WITH_REINTERPRET_COMPATIBLE_CHARSET_BUT_COLLATE: both was removed IS_EQUAL_NO, IS_EQUAL_YES are not needed now and should be removed along with deprecated handler::check_if_incompatible_data(). HA_EXTENDED_TYPES_CONVERSION: was removed as such logic is not needed now by server code. ALTER_COLUMN_EQUAL_PACK_LENGTH: was renamed to a more generic ALTER_COLUMN_TYPE_CHANGE_BY_ENGINE
| * | | MDEV-17301 Change of COLLATE unnecessarily requires ALGORITHM=COPYEugene Kosov2019-06-221-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch is about two cases: 1) On some collate changes it's possible to rebuild only secondary indexes 2) For non-indexed columns collate can be changed INSTANTly Implemented mostly in Field_{string,varstring,blob}::is_equal(). Make this method return how exactly collationa differs. This information is later used by fill_alter_inplace_info() to pass correct info to engine.
* | | | MDEV-19861 Add intfastructure to have ENUM columns in INFORMATION_SCHEMAAlexander Barkov2019-06-261-0/+22
| | | |
* | | | MDEV-19863 Add const to TYPELIB pointersAlexander Barkov2019-06-261-4/+4
| | | |
* | | | MDEV-19843 Modify ST_FIELD_INFO to use Type_handler and LEX_CSTRINGAlexander Barkov2019-06-241-27/+27
| | | |
* | | | MDEV-19710 Split the server side code in rpl_utility.cc into virtual methods ↵Alexander Barkov2019-06-071-11/+4
| | | | | | | | | | | | | | | | in Type_handler
* | | | MDEV-19612 Split ALTER related data type specific code in sql_table.cc to ↵Alexander Barkov2019-05-281-0/+71
| | | | | | | | | | | | | | | | Type_handler
* | | | MDEV-19599 Change db_name, table_name to LEX_CSTRING in Item_ident and ↵Alexander Barkov2019-05-261-12/+12
| | | | | | | | | | | | | | | | Send_field
* | | | MDEV-19593 Split create_schema_table() into virtual methods in Type_handlerAlexander Barkov2019-05-251-0/+190
| | | |
* | | | MDEV-19566 Remove Item::name related strlen() calls in constructors of some ↵Alexander Barkov2019-05-231-4/+4
|/ / / | | | | | | | | | Item_string descendands
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-5/+83
|\ \ \ | |/ /
| * | MDEV-16872 Add CAST(expr AS FLOAT)Alexander Barkov2019-05-161-0/+24
| | |
| * | MDEV-19468 Hybrid type expressions return wrong format for FLOATAlexander Barkov2019-05-151-4/+60
| | |
| * | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\ \ | | |/
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |
* | | | A cleanup for MDEV-19284, MDEV-19285Alexander Barkov2019-05-181-0/+9
| | | | | | | | | | | | | | | | Fixing a test failure tokudb.change_column_varbin_descriptor
* | | | MDEV-8919 Wrong result for CAST(9999999999999999999.0)Alexander Barkov2019-05-171-3/+29
| | | |
* | | | A joint patch for MDEV-19284 and MDEV-19285 (INSTANT ALTER)Alexander Barkov2019-05-161-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes: - MDEV-19284 INSTANT ALTER with ucs2-to-utf16 conversion produces bad data - MDEV-19285 INSTANT ALTER from ascii_general_ci to latin1_general_ci produces corrupt data These regressions were introduced in 10.4.3 by: - MDEV-15564 Avoid table rebuild in ALTER TABLE on collation or charset changes Changes: 1. Cleanup: Adding a helper method Field_longstr::csinfo_change_allows_instant_alter(), to remove some duplicate code in field.cc. 2. Cleanup: removing Type_handler::Charsets_are_compatible() and static function charsets_are_compatible() and introducing new methods in the recently added class Charset instead: - encoding_allows_reinterpret_as() - encoding_and_order_allow_reinterpret_as() 3. Bug fix: Removing the code that allowed instant conversion for ascii-to->8bit and ucs2-to->utf16. This actually fixes MDEV-19284 and MDEV-19285. 4. Bug fix: Adding a helper method Charset::collation_specific_name(). The old corresponding code in Type_handler::Charsets_are_compatible() was not safe against (badly named) user-defined collations whose character set name can be longer than collation name.