summaryrefslogtreecommitdiff
path: root/mysql-test/main/partition_alter.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.9 into 10.10Marko Mäkelä2022-12-141-0/+10
|\
| * Merge 10.6 into 10.7Marko Mäkelä2022-12-131-0/+10
| |\
| | * Merge 10.5 into 10.6Marko Mäkelä2022-12-131-0/+10
| | |\
| | | * Merge 10.4 into 10.5Marko Mäkelä2022-12-131-0/+10
| | | |\
| | | | * Merge 10.3 into 10.4Marko Mäkelä2022-12-131-0/+10
| | | | |\
| | | | | * MDEV-30112 ASAN errors in Item_ident::print / generate_partition_syntaxbb-10.3-midenokAleksey Midenkov2022-12-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like in MDEV-16110 we must release items allocated on thd->mem_root by reopening the table. MDEV-16290 relocated MDEV-16110 fix in 10.5 so it works for MDEV-28576 as well. 10.3 without MDEV-16290 now duplicates this fix.
| * | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-021-0/+26
| |\ \ \ \ \ | | |/ / / /
* | | | | | Merge branch '10.9' into 10.10mariadb-10.10.2Oleksandr Byelkin2022-11-031-0/+26
|\ \ \ \ \ \
| * \ \ \ \ \ Merge branch '10.6' into 10.7Oleksandr Byelkin2022-11-021-0/+26
| |\ \ \ \ \ \ | | |/ / / / / | |/| / / / / | | |/ / / /
| | * | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-11-021-0/+26
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.4' into 10.5Oleksandr Byelkin2022-10-261-0/+26
| | | |\ \ \ | | | | |/ /
| | | | * | MDEV-28545 MyISAM reorganize partition corrupt older table formatAlexander Barkov2022-10-251-0/+26
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.9 into 10.10Marko Mäkelä2022-10-131-0/+54
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.6 into 10.7Marko Mäkelä2022-10-131-0/+54
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.5 into 10.6Marko Mäkelä2022-10-121-0/+52
| | |\ \ \ | | | |/ /
| | | * | MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned ↵Aleksey Midenkov2022-10-071-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table 10.5 part: test cases and comments. The code is in the merge commit 74fe1c44aa1 When f.ex. table is partitioned by HASH(a) and we rename column `a' to `b' partitioning filter stays unchanged: HASH(a). That's the wrong behavior. The patch updates partitioning filter in accordance to the new columns names. That includes partition/subpartition expression and partition/subpartition field list.
| | | * | Merge 10.4 into 10.5Aleksey Midenkov2022-10-071-0/+11
| | | |\ \ | | | | |/
| | | | * MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned ↵Aleksey Midenkov2022-10-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table When f.ex. table is partitioned by HASH(a) and we rename column `a' to `b' partitioning filter stays unchanged: HASH(a). That's the wrong behavior. The patch updates partitioning filter in accordance to the new columns names. That includes partition/subpartition expression and partition/subpartition field list.
* | | | | MDEV-28632 Change default of explicit_defaults_for_timestamp to ONSergei Golubchik2022-08-101-2/+2
|/ / / /
* | | | MDEV-26471 Syntax extension: do not require PARTITION keyword in partition ↵Aleksey Midenkov2021-10-261-0/+47
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition Instead of create or replace table t1 (x int) partition by range(x) ( partition p1 values less than (10), partition pn values less than maxvalue); it should be possible to type in shorter form: create or replace table t1 (x int) partition by range(x) ( p1 values less than (10), pn values less than maxvalue); As above examples demonstrate, make PARTITION keyword in partition definition optional.
* | | MDEV-25506 (3 of 3): Do not delete .ibd files before commitMarko Mäkelä2021-06-091-9/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a complete rewrite of DROP TABLE, also as part of other DDL, such as ALTER TABLE, CREATE TABLE...SELECT, TRUNCATE TABLE. The background DROP TABLE queue hack is removed. If a transaction needs to drop and create a table by the same name (like TRUNCATE TABLE does), it must first rename the table to an internal #sql-ib name. No committed version of the data dictionary will include any #sql-ib tables, because whenever a transaction renames a table to a #sql-ib name, it will also drop that table. Either the rename will be rolled back, or the drop will be committed. Data files will be unlinked after the transaction has been committed and a FILE_RENAME record has been durably written. The file will actually be deleted when the detached file handle returned by fil_delete_tablespace() will be closed, after the latches have been released. It is possible that a purge of the delete of the SYS_INDEXES record for the clustered index will execute fil_delete_tablespace() concurrently with the DDL transaction. In that case, the thread that arrives later will wait for the other thread to finish. HTON_TRUNCATE_REQUIRES_EXCLUSIVE_USE: A new handler flag. ha_innobase::truncate() now requires that all other references to the table be released in advance. This was implemented by Monty. ha_innobase::delete_table(): If CREATE TABLE..SELECT is detected, we will "hijack" the current transaction, drop the table in the current transaction and commit the current transaction. This essentially fixes MDEV-21602. There is a FIXME comment about making the check less failure-prone. ha_innobase::truncate(), ha_innobase::delete_table(): Implement a fast path for temporary tables. We will no longer allow temporary tables to use the adaptive hash index. dict_table_t::mdl_name: The original table name for the purpose of acquiring MDL in purge, to prevent a race condition between a DDL transaction that is dropping a table, and purge processing undo log records of DML that had executed before the DDL operation. For #sql-backup- tables during ALTER TABLE...ALGORITHM=COPY, the dict_table_t::mdl_name will differ from dict_table_t::name. dict_table_t::parse_name(): Use mdl_name instead of name. dict_table_rename_in_cache(): Update mdl_name. For the internal FTS_ tables of FULLTEXT INDEX, purge would acquire MDL on the FTS_ table name, but not on the main table, and therefore it would be able to run concurrently with a DDL transaction that is dropping the table. Previously, the DROP TABLE queue hack prevented a race between purge and DDL. For now, we introduce purge_sys.stop_FTS() to prevent purge from opening any table, while a DDL transaction that may drop FTS_ tables is in progress. The function fts_lock_table(), which will be invoked before the dictionary is locked, will wait for purge to release any table handles. trx_t::drop_table_statistics(): Drop statistics for the table. This replaces dict_stats_drop_index(). We will drop or rename persistent statistics atomically as part of DDL transactions. On lock conflict for dropping statistics, we will fail instantly with DB_LOCK_WAIT_TIMEOUT, because we will be holding the exclusive data dictionary latch. trx_t::commit_cleanup(): Separated from trx_t::commit_in_memory(). Relax an assertion around fts_commit() and allow DB_LOCK_WAIT_TIMEOUT in addition to DB_DUPLICATE_KEY. The call to fts_commit() is entirely misplaced here and may obviously break the consistency of transactions that affect FULLTEXT INDEX. It needs to be fixed separately. dict_table_t::n_foreign_key_checks_running: Remove (MDEV-21175). The counter was a work-around for missing meta-data locking (MDL) on the SQL layer, and not really needed in MariaDB. ER_TABLE_IN_FK_CHECK: Replaced with ER_UNUSED_28. HA_ERR_TABLE_IN_FK_CHECK: Remove. row_ins_check_foreign_constraints(): Do not acquire dict_sys.latch either. The SQL-layer MDL will protect us. This was reviewed by Thirunarayanan Balathandayuthapani and tested by Matthias Leich.
* | Merge 10.4 into 10.5Marko Mäkelä2020-05-311-5/+49
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2020-05-271-5/+49
| |
* | Merge 10.4 into 10.5Marko Mäkelä2020-04-251-0/+19
|\ \ | |/ | | | | | | The functional changes of commit 5836191c8f0658d5d75484766fdcc3d838b0a5c1 (MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
| * MDEV-17091 - Assertion failed after dropping versioningNikita Malyavin2020-04-021-0/+19
| | | | | | | | | | | | | | | | Assertion `old_part_id == m_last_part' failed in ha_partition::update_row or `part_id == m_last_part' in ha_partition::delete_row upon UPDATE/DELETE after dropping versioning PRIMARY KEY change hadn't been treated as partition reorganization in case of partitioning by KEY() (without parameters). * set `*partition_changed= true` in the described case. * since add/drop system versioning does not affect alter_info->key_list, it required separate attention
* | MDEV-16678: Ignore #sql-ib tables in main.partition_alterMarko Mäkelä2020-01-031-2/+9
|/ | | | We missed this in commit 89633995e4962a7ad4a241cdf62ee637990d6787.
* Merge branch '10.2' into 10.3Sergei Golubchik2019-01-031-2/+0
|
* Create 'main' test directory and move 't' and 'r' thereMichael Widenius2018-03-291-0/+127