summaryrefslogtreecommitdiff
path: root/plugin/type_inet/mysql-test/type_inet
Commit message (Collapse)AuthorAgeFilesLines
* Change cost for REF to take into account cost for 1 extra key read_nextMonty2023-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main difference in code path between EQ_REF and REF is that for REF we have to do an extra read_next on the index to check that there is no more matching rows. Before this patch we added a preference of EQ_REF by ensuring that REF would always estimate to find at least 2 rows. This patch adds the cost of the extra key read_next to REF access and removes the code that limited REF to at least 2 rows. For some queries this can have a big effect as the total estimated rows will be halved for each REF table with 1 rows. multi_range cost calculations are also changed to take into account the difference between EQ_REF and REF. The effect of the patch to the test suite: - About 80 test case changed - Almost all changes where for EXPLAIN where estimated rows for REF where changed from 2 to 1. - A few test cases using explain extended had a change of 'filtered'. This is because of the estimated rows are now closer to the calculated selectivity. - A very few test had a change of table order. This is because the change of estimated rows from 2 to 1 or the small cost change for REF (main.subselect_sj_jcl6, main.group_by, main.dervied_cond_pushdown, main.distinct, main.join_nested, main.order_by, main.join_cache) - No key statistics and the estimated rows are now smaller which cased estimated filtering to be lower. (main.subselect_sj_mat) - The number of total rows are halved. (main.derived_cond_pushdown) - Plans with 1 row changed to use RANGE instead of REF. (main.group_min_max) - ALL changed to REF (main.key_diff) - Key changed from ref + index_only to PRIMARY key for InnoDB, as OPTIMIZER_ROW_LOOKUP_COST + OPTIMIZER_ROW_NEXT_FIND_COST is smaller than OPTIMIZER_KEY_LOOKUP_COST + OPTIMIZER_KEY_NEXT_FIND_COST. (main.join_outer_innodb) - Cost changes printouts (main.opt_trace*) - Result order change (innodb_gis.rtree)
* MDEV-30146 Change maturity of plugins for January 2023 ReleasesAlexander Barkov2023-01-201-1/+1
|
* Merge 10.9 into 10.10Marko Mäkelä2022-09-2128-95/+95
|\
| * Merge 10.7 into 10.8Marko Mäkelä2022-09-2114-47/+47
| |\
| | * Merge 10.6 into 10.7Marko Mäkelä2022-09-2114-47/+47
| | |\
| | | * Merge 10.5 into 10.6Marko Mäkelä2022-09-207-33/+33
| | | |\
| | | | * Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2022-09-147-33/+33
| | | | |
* | | | | Merge 10.9 into 10.10Marko Mäkelä2022-08-292-0/+27
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.7 into 10.8Marko Mäkelä2022-08-242-0/+27
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.6 into 10.7Marko Mäkelä2022-08-242-0/+27
| | |\ \ \ | | | |/ /
| | | * | MDEV-29355 Backport templatized INET6 implementation from 10.7 to 10.6Alexander Barkov2022-08-232-0/+43
| | | | |
| | | * | Merge 10.5 into 10.6Marko Mäkelä2022-08-232-0/+27
| | | |\ \ | | | | |/
| | | | * MDEV-27099 Subquery using the ALL keyword on INET6 columns produces a wrong ↵Alexander Barkov2022-08-232-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | result This problem was earlier fixed by MDEV-27101. Adding INET6 tests only.
| * | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-08-0911-236/+1136
| |\ \ \ \ | | |/ / /
* | | | | MDEV-28632 Change default of explicit_defaults_for_timestamp to ONSergei Golubchik2022-08-104-5/+5
| | | | |
* | | | | Merge branch '10.9' into 10.10Oleksandr Byelkin2022-08-0920-580/+1560
|\ \ \ \ \
| * \ \ \ \ Merge branch '10.7' into 10.8Oleksandr Byelkin2022-08-0810-234/+1132
| |\ \ \ \ \ | | |/ / / / | |/| / / / | | |/ / /
| | * | | MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it ↵Alexander Barkov2022-08-0510-234/+1132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | solves, breaks usability 1. Store assignment failures on incompatible data types now raise errors if: - STRICT_ALL_TABLES or STRICT_TRANS_TABLES sql_mode is used, and - IGNORE is not used Otherwise, only a warning is raised and the statement continues. 2. Changing the error/warning test as follows: -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `db`.`t`.`col` so in case of a big table it's easier to see which column has the problem. The new error text is also applied to SP variables.
* | | | | Merge 10.9 into 10.10Marko Mäkelä2022-07-284-0/+138
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.7 into 10.8Marko Mäkelä2022-07-284-0/+138
| |\ \ \ \ | | |/ / /
| | * | | MDEV-27015 Assertion `!is_null()' failed in FixedBinTypeBundle<FbtImpl>::Fbt ↵bb-10.7-barAlexander Barkov2022-07-054-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FixedBinTypeBundle<FbtImpl>::Field_fbt::to_fbt() The assuption that Field::is_null() is always false when Field_fbt::val_native() or Field_fbt::to_fbt() are called was wrong. In some cases, e.g. when this helper Field method is called: inline String *val_str(String *str, const uchar *new_ptr) we temporarily reset Field::ptr to some alternative record buffer but don't reset null_ptr, so null_ptr still points to null flags of the original record. In such cases it's meaningless to test the original Field::null_ptr when Field::ptr is temporarily reset: they don't relate to each other. Removing the DBUG_ASSERT.
* | | | | MDEV-23287 The INET4 data typeAlexander Barkov2022-07-0851-0/+7889
|/ / / /
* | | | Merge 10.7 into 10.8Marko Mäkelä2022-06-2812-51/+1862
|\ \ \ \ | |/ / /
| * | | MDEV-28963 Incompatible data type assignment through SP vars is not ↵Alexander Barkov2022-06-275-0/+740
| | | | | | | | | | | | | | | | consistent with columns
| * | | MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ↵Alexander Barkov2022-06-2712-49/+1118
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ALTER Now INSERT, UPDATE, ALTER statements involving incompatible data type pairs, e.g.: UPDATE TABLE t1 SET col_inet6=col_int; INSERT INTO t1 (col_inet6) SELECT col_in FROM t2; ALTER TABLE t1 MODIFY col_inet6 INT; consistently return an error at the statement preparation time: ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' and abort the statement before starting interating rows. This error is the same with what is raised for queries like: SELECT col_inet6 FROM t1 UNION SELECT col_int FROM t2; SELECT COALESCE(col_inet6, col_int) FROM t1; Before this change the error was caught only during the execution time, when a Field_xxx::store_xxx() was called for the very firts row. The behavior was not consistent between various statements and could do different things: - abort the statement - set a column to the data type default value (e.g. '::' for INET6) - set a column to NULL A typical old error was: ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`a` at row 1 EXCEPTION: Note, there is an exception: a multi-row INSERT..VALUES, e.g.: INSERT INTO t1 (col_a,col_b) VALUES (a1,b1),(a2,b2); checks assignment compability at the preparation time for the very first row only: (col_a,col_b) vs (a1,b1) Other rows are still checked at the execution time and return the old warnings or errors in case of a failure. This is done because catching all rows at the preparation time would change behavior significantly. So it still works according to the STRICT_XXX_TABLES sql_mode flags and the table transaction ability. This is too late to change this behavior in 10.7. There is no a firm decision yet if a multi-row INSERT..VALUES behavior will change in later versions.
* | | Merge 10.7 into 10.8Marko Mäkelä2022-06-071-0/+1
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.5' into 10.6Monty2022-06-062-0/+37
| |\ \ | | |/
| | * MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"bb-10.5-barAlexander Barkov2022-06-032-0/+37
| | | | | | | | | | | | This is a 10.5 version of the patch.
* | | Merge 10.7 into 10.8Marko Mäkelä2022-06-062-0/+36
|\ \ \
| * | | MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"Alexander Barkov2022-06-032-0/+36
| |/ / | | | | | | | | | This is a 10.7 version of the patch.
* | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-02-042-0/+131
|\ \ \ | |/ /
| * | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-02-032-0/+131
| |\ \ | | |/
| | * MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || ↵Alexander Barkov2022-01-282-0/+39
| | | | | | | | | | | | item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref
| | * MDEV-27018 IF and COALESCE lose "json" propertybb-10.5-bar-MDEV-27018Alexander Barkov2022-01-212-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | MDEV-22256 Assertion `length == pack_length()' failed in ↵bb-10.8-bar-MDEV-22256Alexander Barkov2021-12-292-0/+54
|/ / | | | | | | | | | | | | | | Field_timestamp_with_dec::sort_string Adding 10.5 specific tests only. No code change. The patches for MDEV-21580 and MDEV-22715 fixed this problem.
* | Merge 10.5 into 10.6Marko Mäkelä2021-10-272-0/+61
|\ \ | |/
| * MDEV-26732 Assertion `0' failed in Item::val_nativebb-10.5-bar-MDEV-26732Alexander Barkov2021-10-262-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion Type_handler_inet6::create_item_copy() created a generic Item_copy_string, which does not implement val_native() - it has a dummy implementation with DBUG_ASSERT(0), which made the server crash. Fix: - Adding a new class Type_handler_inet6 which implements val_native(). - Fixing Type_handler_inet6::create_item_copy() to make Item_copy_inet6 instead of Item_copy_string.
* | Merge 10.5 into 10.6Marko Mäkelä2021-10-184-0/+76
|\ \ | |/
| * MDEV-26742 Assertion `field->type_handler() == this' failed in ↵bb-10.5-bar-MDEV-26742Alexander Barkov2021-10-144-0/+76
| | | | | | | | FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
* | Merge 10.5 into 10.6Marko Mäkelä2021-09-161-0/+3
|\ \ | |/
| * Merge branch '10.4' into 10.5Monty2021-09-151-0/+3
| | | | | | | | Fixed also an error in suite/perfschema/t/transaction_nested_events-master.opt
* | Merge branch '10.5' into 10.6Oleksandr Byelkin2021-08-021-1/+1
|\ \ | |/
| * MDEV-26226 Change Maturity of plugins inet6 and s3 to stableSergei Golubchik2021-07-281-1/+1
| | | | | | | | from gamma
* | MDEV-8334: Rename utf8 to utf8mb3Rucha Deodhar2021-05-192-5/+5
|/ | | | | | This patch changes the main name of 3 byte character set from utf8 to utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default, so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
* Merge branch 'bb-10.4-release' into bb-10.5-releaseSergei Golubchik2021-02-152-2/+2
|
* increase INET6 plugin maturitySergei Golubchik2020-12-211-1/+1
|
* INET6 type plugin -> BetaSergei Golubchik2020-10-271-1/+1
|
* MDEV-23054 Assertion `!item->null_value' failed in ↵Alexander Barkov2020-08-112-0/+65
| | | | | | | | | | | | | | Type_handler_inet6::make_sort_key_part (#2) IFNULL(inet6_not_null_expr, 'foo') erroneously set its nullability to NOT NULL. Fix: - Moving the line "maybe_null= args[1]->maybe_null" before the call of fix_length_and_dec2(), so the call of Type_handler method Item_hybrid_func_fix_attributes() can reset it when desired. - Fixing Type_handler_inet6::Item_hybrid_func_fix_attributes() to ignore args[0] when detecting nullability of IFNULL().
* change buitin plugin types from Alpha to Stable as neededSergei Golubchik2020-08-071-8/+8
| | | | | | for the functionality that was part of the server for years and is moved in 10.5 into a [statically linked] plugin without changing the underlying code.
* MDEV-21765 Possibly inconsistent behavior of BIT_xx functions with INET6 fieldAlexander Barkov2020-06-092-0/+25
| | | | | Disallow BIT_AND(), BIT_OR(), BIT_XOR() for data types GEOMETRY and INET6, as they cannot return any useful integer values.