summaryrefslogtreecommitdiff
path: root/sql/field.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2023-01-131-1/+1
|\
| * Merge 10.4 into 10.5Marko Mäkelä2023-01-131-1/+1
| |\
| | * Merge branch '10.3' into 10.4Sergei Golubchik2023-01-101-1/+1
| | |\
| | | * fix typoslilinjie2023-01-051-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: lilinjie <lilinjie@uniontech.com>
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-12-131-2/+3
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-12-131-2/+3
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2022-12-131-2/+4
| | |\ \ | | | |/
| | | * cleanup: VCOL_NOT_VIRTUAL->VCOL_NEXTVALSergei Golubchik2022-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rename to stress that is a specific hack for Item_func_nextval and should not be used for other items. If a vcol uses Item_func_nextval, a corresponding table for the sequence should be added to the prelocking list (in that sense NEXTVAL is not simply a function, but more like a subquery), see add_internal_tables() in DML_prelocking_strategy::handle_table(). At the moment it is only implemented for DEFAULT, not for GENERATED ALWAYS AS, thus the VCOL_NEXTVAL hack.
| | | * MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in ↵Alexander Barkov2022-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type 'int' in strings/dtoa.c Fixing a few problems relealed by UBSAN in type_float.test - multiplication overflow in dtoa.c - uninitialized Field::geom_type (and Field::srid as well) - Wrong call-back function types used in combination with SHOW_FUNC. Changes in the mysql_show_var_func data type definition were not properly addressed all around the code by the following commits: b4ff64568c88ab3ce559e7bd39853d9cbf86704a 18feb62feeb833494d003615861b9c78ec008a90 0ee879ff8ac1b80cd9a963015344f5698a81f309 Adding a helper SHOW_FUNC_ENTRY() function and replacing all mysql_show_var_func declarations using SHOW_FUNC to SHOW_FUNC_ENTRY, to catch mysql_show_var_func in the future at compilation time.
* | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-11-021-2/+0
|\ \ \ \ | |/ / /
| * | | Merge branch '10.4' into 10.5Oleksandr Byelkin2022-10-261-2/+0
| |\ \ \ | | |/ /
| | * | MDEV-28545 MyISAM reorganize partition corrupt older table formatAlexander Barkov2022-10-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ALTER related code cannot do at the same time both: - modify partitions - change column data types Explicit changing of a column data type together with a partition change is prohibited by the parter, so this is not allowed and returns a syntax error: ALTER TABLE t MODIFY ts BIGINT, DROP PARTITION p1; This fix additionally disables implicit data type upgrade (e.g. from "MariaDB 5.3 TIME" to "MySQL 5.6 TIME", or the other way around according to the current mysql56_temporal_format) in case of an ALTER modifying partitions, e.g.: ALTER TABLE t DROP PARTITION p1; In such commands now only the partition change happens, while the data types stay unchanged. One can additionally run: ALTER TABLE t FORCE; either before or after the ALTER modifying partitions to upgrade data types according to mysql56_temporal_format.
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-09-261-3/+3
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-09-261-3/+3
| |\ \ \ | | |/ /
| | * | MDEV-29613 Improve WITH_DBUG_TRACE=OFFMarko Mäkelä2022-09-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 28325b08633372cc343dfcbc41fe252020cf6e6e a compile-time option was introduced to disable the macros DBUG_ENTER and DBUG_RETURN or DBUG_VOID_RETURN. The parameter name WITH_DBUG_TRACE would hint that it also covers DBUG_PRINT statements. Let us do that: WITH_DBUG_TRACE=OFF shall disable DBUG_PRINT() as well. A few InnoDB recovery tests used to check that some output from DBUG_PRINT("ib_log", ...) is present. We can live without those checks. Reviewed by: Vladislav Vaintroub
* | | | Merge branch '10.5' into bb-10.6-releaseOleksandr Byelkin2022-08-031-1/+2
|\ \ \ \ | |/ / /
| * | | MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure ↵Sergei Golubchik2022-08-021-0/+1
| | | | | | | | | | | | | | | | works inconsistently
| * | | MDEV-29225 make explicit_defaults_for_timestamps SESSION variableSergei Golubchik2022-08-021-1/+1
| | | | | | | | | | | | | | | | make @@explicit_defaults_for_timestamp session variable
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-07-271-3/+3
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-07-271-3/+3
| |\ \ \ | | |/ /
| | * | Merge branch '10.3' into 10.4Oleksandr Byelkin2022-07-271-3/+3
| | |\ \ | | | |/
| | | * MDEV-29041 Redundant truncation warning on CAST(string_column AS DECIMAL)Alexander Barkov2022-07-061-3/+3
| | | |
* | | | Merge 10.5 into 10.6Marko Mäkelä2022-07-011-3/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.4 into 10.5Marko Mäkelä2022-07-011-3/+2
| |\ \ \ | | |/ /
| | * | Merge 10.3 into 10.4Marko Mäkelä2022-07-011-3/+2
| | |\ \ | | | |/
| | | * Fix most clang-15 -Wunused-but-set-variableMarko Mäkelä2022-07-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | Also, refactor trx_i_s_common_fill_table() to remove dead code. Warnings about yynerrs in Bison-generated yyparse() will remain for now.
* | | | Merge branch '10.5' into 10.6Sergei Golubchik2022-05-101-3/+4
|\ \ \ \ | |/ / /
| * | | Merge branch '10.4' into 10.5Sergei Golubchik2022-05-091-3/+4
| |\ \ \ | | |/ /
| | * | Merge branch '10.3' into 10.4Sergei Golubchik2022-05-081-3/+4
| | |\ \ | | | |/
| | | * Merge branch '10.2' into 10.3Oleksandr Byelkin2022-05-031-5/+12
| | | |\
| | | | * MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And ↵Alexey Botchkov2022-04-261-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size. Precision should be kept below DECIMAL_MAX_SCALE for computations. It can be bigger in Item_decimal. I'd fix this too but it changes the existing behaviour so problemmatic to ix.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-211-0/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.4 into 10.5Marko Mäkelä2022-04-211-0/+5
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2022-04-211-0/+5
| | |\ \ \ | | | |/ /
| | | * | MDEV-24176 Server crashes after insert in the table with virtualAleksey Midenkov2022-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column generated using date_format() and if() vcol_info->expr is allocated on expr_arena at parsing stage. Since expr item is allocated on expr_arena all its containee items must be allocated on expr_arena too. Otherwise fix_session_expr() will encounter prematurely freed item. When table is reopened from cache vcol_info contains stale expression. We refresh expression via TABLE::vcol_fix_exprs() but first we must prepare a proper context (Vcol_expr_context) which meets some requirements: 1. As noted above expr update must be done on expr_arena as there may be new items created. It was a bug in fix_session_expr_for_read() and was just not reproduced because of no second refix. Now refix is done for more cases so it does reproduce. Tests affected: vcol.binlog 2. Also name resolution context must be narrowed to the single table. Tested by: vcol.update main.default vcol.vcol_syntax gcol.gcol_bugfixes 3. sql_mode must be clean and not fail expr update. sql_mode such as MODE_NO_BACKSLASH_ESCAPES, MODE_NO_ZERO_IN_DATE, etc must not affect vcol expression update. If the table was created successfully any further evaluation must not fail. Tests affected: main.func_like Reviewed by: Sergei Golubchik <serg@mariadb.org>
* | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-02-031-43/+54
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2022-02-011-43/+18
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2022-01-301-10/+2
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.2' into 10.3mariadb-10.3.33Oleksandr Byelkin2022-01-291-10/+2
| | | |\ \ | | | | |/
| | | | * MDEV-26129 Bad results with join comparing case insensitive VARCHAR/ENUM/SET ↵bb-10.2-MDEV-26129Alexander Barkov2022-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expression to a _bin ENUM column Range optimizer incorrectly was used for ENUM columns when the operation collation did not match the column collation. Adding a virtual implementation of Field_enum::can_optimize_range() which tests if the column and the operation collation match.
| | * | | MDEV-25904 New collation functions to compare InnoDB style trimmed NO PAD ↵bb-10.4-bar-MDEV-25904Alexander Barkov2022-01-211-33/+14
| | | | | | | | | | | | | | | | | | | | strings
| * | | | MDEV-27018 IF and COALESCE lose "json" propertybb-10.5-bar-MDEV-27018Alexander Barkov2022-01-211-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hybrid functions (IF, COALESCE, etc) did not preserve the JSON property from their arguments. The same problem was repeatable for single row subselects. The problem happened because the method Item::is_json_type() was inconsistently implemented across the Item hierarchy. For example, Item_hybrid_func and Item_singlerow_subselect did not override is_json_type(). Solution: - Removing Item::is_json_type() - Implementing specific JSON type handlers: Type_handler_string_json Type_handler_varchar_json Type_handler_tiny_blob_json Type_handler_blob_json Type_handler_medium_blob_json Type_handler_long_blob_json - Reusing the existing data type infrastructure to pass JSON type handlers across all item types, including classes Item_hybrid_func and Item_singlerow_subselect. Note, these two classes themselves do not need any changes! - Extending the data type infrastructure so data types can inherit their properties (e.g. aggregation rules) from their base data types. E.g. VARCHAR/JSON acts as VARCHAR, LONGTEXT/JSON acts as LONGTEXT when mixed to a non-JSON data type. This is done by: - adding virtual method Type_handler::type_handler_base() - adding a helper class Type_handler_pair - refactoring Type_handler_hybrid_field_type methods aggregate_for_result(), aggregate_for_min_max(), aggregate_for_num_op() to use Type_handler_pair. This change also fixes: MDEV-27361 Hybrid functions with JSON arguments do not send format metadata Also, adding mtr tests for JSON replication. It was not covered yet. And the current patch changes the replication code slightly.
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-10-181-2/+17
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-26742 Assertion `field->type_handler() == this' failed in ↵bb-10.5-bar-MDEV-26742Alexander Barkov2021-10-141-2/+17
| | | | | | | | | | | | | | | | | | | | FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
* | | | | Merge 10.5 into 10.6Marko Mäkelä2021-10-131-1/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | The changes to galera.galear_var_replicate_myisam_on in commit d9b933bec6061758c5d7b34f55afcae32a85c110 are omitted due to conflicts with commit 27d66d644cf2ebe9201e0362f2050036cce2908a.
| * | | | Merge 10.4 into 10.5Marko Mäkelä2021-10-131-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.3 into 10.4Marko Mäkelä2021-10-131-1/+1
| | |\ \ \ | | | |/ /
| | | * | MDEV-22660 System versioning cleanupsAleksey Midenkov2021-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Cleaned up Vers_parse_info::check_sys_fields(); - Renamed VERS_SYS_START_FLAG, VERS_SYS_END_FLAG to VERS_ROW_START, VERS_ROW_END.
| | | * | Fixed compile errors when compiling with HAVE_valgrindMichael Widenius2021-08-241-1/+1
| | | | |
* | | | | Merge 10.5 to 10.6Marko Mäkelä2021-08-191-1/+2
|\ \ \ \ \ | |/ / / /