summaryrefslogtreecommitdiff
path: root/mysql-test/suite/federated
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-30540 Wrong result with IN list length reaching ↵Monty2023-03-021-1/+1
| | | | | | | | | | | | | | | | | | | IN_PREDICATE_CONVERSION_THRESHOLD The problem was the mysql_derived_prepare() did not correctly set 'distinct' when creating a temporary derivated table. Fixed by separating checking for distinct for queries with and without UNION. Other things: - Fixed bug in generate_derived_keys_for_table() where we set the wrong bit for join_tab->keys - Cleaned up JOIN::drop_unused_derived_keys() - Changed TABLE::use_index() to keep unique keys and update share->key_parts Author: Sergei Petrunia <sergey@mariadb.com>, monty@mariadb.org
* Do a proper cleanup in testcase for MDEV-30569Sergei Petrunia2023-02-152-0/+2
|
* Merge 11.0-selectivity into 11.0Sergei Petrunia2023-02-154-6/+61
|\
| * MDEV-30569: Assertion ...ha_table_flags() in Duplicate_weedout_picker::check_qepSergei Petrunia2023-02-102-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DuplicateWeedout semi-join optimization requires that the tables in the parent subquery provide rowids that can be compared across table scans. Most engines support this, federated is the only exception. DuplicateWeedout is the default catch-all semi-join strategy, which must be always available. If it is not available for some edge case, it's better to disable semi-join conversion altogether. This is what was done in the fix for MDEV-30395. However that fix has put the check before the view processing, so it didn't detect federated tables inside mergeable VIEWs. This patch moves the check to be done at a later phase, when mergeable views are already merged.
| * Change cost for REF to take into account cost for 1 extra key read_nextMonty2023-02-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-30032: EXPLAIN FORMAT=JSON output: part #2: print 'loops'.Sergei Petrunia2023-02-031-0/+6
| |
| * MDEV-30032: EXPLAIN FORMAT=JSON output: print costsSergei Petrunia2023-02-032-0/+13
| | | | | | | | Basic printout for join and table execution costs.
| * Derived tables and union can now create distinct keysMonty2023-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is that instead of marking all select_lex's with DISTINCT, we only mark those that really need distinct result. Benefits of this change: - Temporary tables used with derived tables, UNION, IN are now smaller as duplicates are removed already on the insert phase. - The optimizer can now produce better plans with EQ_REF. This can be seen from the tests where several queries does not anymore materialize derived tables twice. - Queries affected by 'in_predicate_conversion_threshold' where large IN lists are converted to sub query produces better plans. Other things: - Removed on duplicate call to sel->init_select() in LEX::add_primary_to_query_expression_body() - I moved the testing of tab->table->pos_in_table_list->is_materialized_derived() in join_read_const_table() to the caller as it caused problems for derived tables that could be proven to be const tables. This also is likely to fix some bugs as if join_read_const_table() was aborted, the table was left marked as JT_CONST, which cannot be good. I added an ASSERT there for now that can be removed when the code has been properly tested.
* | MDEV-29668 SUPER should not allow actions that have fine-grained dedicated ↵Sergei Golubchik2023-02-062-7/+7
|/ | | | | | | | | | | | | | | | | | | privileges SUPER privilege used to allow various actions that were alternatively allowed by one of BINLOG ADMIN, BINLOG MONITOR, BINLOG REPLAY, CONNECTION ADMIN, FEDERATED ADMIN, REPL MASTER ADMIN, REPL SLAVE ADMIN, SET USER, SLAVE MONITOR. Now SUPER no longer does that, one has to grant one of the fine-grained privileges above to be to perform corresponding actions. On upgrade from MariaDB versions 10.11 and below all the privileges above are granted automatically if the user has SUPER. As a side-effect, such an upgrade will allow SUPER-user to run SHOW BINLOG EVENTS, SHOW RELAYLOG EVENTS, SHOW SLAVE HOSTS, even if he wasn't able to do it before the upgrade.
* Merge branch '10.10' into 10.11Oleksandr Byelkin2023-01-182-0/+62
|\
| * Merge branch '10.9' into 10.10Oleksandr Byelkin2023-01-182-0/+62
| |\
| | * Merge branch '10.7' into 10.8Oleksandr Byelkin2023-01-182-0/+62
| | |\
| | | * Merge branch '10.6' into 10.7Oleksandr Byelkin2023-01-182-0/+62
| | | |\
| | | | * MDEV-30395 Wrong result with semijoin and Federated as outer tableMonty2023-01-132-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that federated engine does not support comparable rowids which was not taken into account by semijoin code. Fixed by checking that we don't use semijoin with tables that does not support comparable rowids. Other things: - Fixed some typos in the code comments
* | | | | Merge 10.10 into 10.11Marko Mäkelä2022-11-212-1/+103
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.9 into 10.10Marko Mäkelä2022-11-212-1/+103
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.7 into 10.8Marko Mäkelä2022-11-092-1/+103
| | |\ \ \ | | | |/ /
| | | * | Merge 10.6 into 10.7Marko Mäkelä2022-11-092-1/+103
| | | |\ \ | | | | |/
| | | | * Merge 10.4 into 10.5Marko Mäkelä2022-11-082-1/+103
| | | | |\
| | | | | * MDEV-29624 MDEV-29655 Fix ASAN errors on pushdown of derived tableOleg Smirnov2022-10-312-1/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived was performed in multiple places if code. This not only made the code more difficult to maintain but also led to memory leaks and ASAN heap-use-after-free errors. This commit puts deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
| | | * | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-022-0/+97
| | | |\ \ \ | | | | |/ /
* | | | | | Merge branch '10.10' into 10.11Oleksandr Byelkin2022-11-032-0/+97
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.9' into 10.10mariadb-10.10.2Oleksandr Byelkin2022-11-032-0/+97
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-11-022-0/+97
| | |\ \ \ \
| | | * \ \ \ Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-022-0/+97
| | | |\ \ \ \ | | | | |/ / / | | | |/| / / | | | | |/ /
| | | | * | Merge branch '10.4' into 10.5Oleksandr Byelkin2022-10-262-0/+97
| | | | |\ \ | | | | | |/
| | | | | * MDEV-29640 FederatedX does not properly handle pushdown in case of ↵Oleg Smirnov2022-10-262-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | difference in local and remote table names FederatedX table may refer to a table with a different name on the remote server: test> CREATE TABLE t2 (...) ENGINE="FEDERATEDX" CONNECTION="mysql://user:pass@192.168.1.111:9308/federatedx/t1"; test> select * from t2 where ...; This could cause an issue with federated_pushdown=1, because FederatedX pushes the query (or derived table's) text to the remote server. The remote server will try to read from table t2 (while it should read from t1). Solution: do not allow pushing down queries with tables that have different db_name.table name on the local and remote server. This patch also fixes: MDEV-29863 Server crashes in federatedx_txn::acquire after select from the FederatedX table with partitions Solution: disallow pushdown when partitioned FederatedX tables are used.
* | | | | | MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)Luis Eduardo Oliveira Lizardo2022-10-261-0/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add query optimizer timer to ANALYZE FORMAT=JSON * Adapt tests and results * Change logic to always close the writer after printing query blocks
* | | | | Merge 10.9 into 10.10Marko Mäkelä2022-10-131-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.7 into 10.8Marko Mäkelä2022-10-131-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.6 into 10.7Marko Mäkelä2022-10-131-0/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.4 into 10.5Marko Mäkelä2022-10-061-0/+1
| | | |\ \ | | | | |/
| | | | * MDEV-29710: Skip some more tests on ValgrindMarko Mäkelä2022-10-051-0/+1
| | | | |
* | | | | Merge 10.9 into 10.10Marko Mäkelä2022-09-214-7/+7
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.7 into 10.8Marko Mäkelä2022-09-214-7/+7
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.6 into 10.7Marko Mäkelä2022-09-214-7/+7
| | |\ \ \ | | | |/ /
| | | * | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2022-09-144-7/+7
| | | |\ \ | | | | |/
| | | | * Merge 10.3 into 10.4Marko Mäkelä2022-09-134-7/+7
| | | | |\
| | | | | * MDEV-29446 Change SHOW CREATE TABLE to display default collationAlexander Barkov2022-09-124-7/+7
| | | | | |
* | | | | | MDEV-28632 Change default of explicit_defaults_for_timestamp to ONSergei Golubchik2022-08-101-1/+1
| | | | | |
* | | | | | Revert the commit with MDEV-28926: Add time spent on query optimizer to JSON ↵bb-10.10-spetrunia3Sergei Petrunia2022-07-251-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ANALYZE It will go into 10.11. Author: Luis Eduardo Oliveira Lizardo <108760288+mariadb-LuisLizardo@users.noreply.github.com> Date: Mon Jul 18 17:48:01 2022 +0200 MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193) * Add query optimizer timer to ANALYZE FORMAT=JSON * Adapt tests and results * Change logic to always close the writer after printing query blocks
* | | | | | MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)Luis Eduardo Oliveira Lizardo2022-07-181-0/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add query optimizer timer to ANALYZE FORMAT=JSON * Adapt tests and results * Change logic to always close the writer after printing query blocks
* | | | | Merge 10.7 into 10.8Marko Mäkelä2022-03-081-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.6 into 10.7Marko Mäkelä2022-03-081-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Marko Mäkelä2022-03-071-0/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2022-03-071-0/+1
| | | |\ \ | | | | |/
| | | | * Merge 10.2 into 10.3Marko Mäkelä2022-03-041-0/+1
| | | | |\
| | | | | * federated.rpl failed if federatedx was not compiledMonty2022-03-011-0/+1
| | | | | |
* | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-02-044-0/+128
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-02-044-0/+128
| |\ \ \ \ \ | | |/ / / /