summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | MDEV-28632 Change default of explicit_defaults_for_timestamp to ONSergei Golubchik2022-08-101-1/+1
|/ / / / / /
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-07-016-11/+77
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-07-016-11/+77
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-07-016-11/+77
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.4 into 10.5Marko Mäkelä2022-07-016-11/+77
| | | |\ \ \ | | | | |/ /
| | | | * | Merge 10.3 into 10.4Marko Mäkelä2022-07-016-11/+77
| | | | |\ \ | | | | | |/
| | | | | * MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned ↵Nayuta Yanagisawa2022-06-286-11/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table | Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed. The bug is caused by a similar mechanism as MDEV-21027. The function, check_insert_or_replace_autoincrement, failed to open all the partitions on INSERT SELECT statements and it results in the assertion error.
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-06-285-0/+39
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-06-285-0/+39
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-06-275-0/+39
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge 10.4 into 10.5Marko Mäkelä2022-06-275-0/+39
| | | |\ \ \ | | | | |/ /
| | | | * | Merge 10.3 into 10.4Marko Mäkelä2022-06-279-0/+68
| | | | |\ \ | | | | | |/
| | | | | * MDEV-21027 Assertion `part_share->auto_inc_initialized || ↵Shunsuke Tokunaga2022-06-165-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher ha_partition::set_auto_increment_if_higher expects part_share->auto_inc_initialized is true or can_use_for_auto_inc_init() is false (but as the comment of this method says, it returns false only if we use Spider engine with DROP TABLE or ALTER TABLE query). However, part_share->auto_inc_initialized becomes true only after all partitions are opened (since 6dce6aecebe6ef78a14cb5c5c5daa8a355551e40). Therefore, I added a conditional expression in order to read all partitions when we execute REPLACE on a table that has an AUTO_INCREMENT column. Reviewed by: Nayuta Yanagisawa Reviewed by: Alexey Botchkov
| | | | | * MDEV-26127 Assertion `err != DB_DUPLICATE_KEY' failed or InnoDB: Failing ↵Nayuta Yanagisawa2022-06-134-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertion: id != 0 on ALTER ... REBUILD PARTITION During rebuild of partition, the partitioning engine calls alter_close_table(), which does not unlock and close some table instances of the target table. Then, the engine fails to rename partitions because there are table instances that are still locked. Closing all the table instance of the target table fixes the bug.
* | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-06-144-0/+29
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.6 into 10.7Marko Mäkelä2022-06-144-0/+29
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.5 into 10.6Marko Mäkelä2022-06-144-0/+29
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-26127 Assertion `err != DB_DUPLICATE_KEY' failed or InnoDB: Failing ↵Nayuta Yanagisawa2022-06-134-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertion: id != 0 on ALTER ... REBUILD PARTITION During rebuild of partition, the partitioning engine calls alter_close_table(), which does not unlock and close some table instances of the target table. Then, the engine fails to rename partitions because there are table instances that are still locked. Closing all the table instance of the target table fixes the bug.
* | | | | | Merge branch '10.7' into 10.8Sergei Golubchik2022-05-112-1/+2
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.6' into 10.7Sergei Golubchik2022-05-112-1/+2
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.5' into 10.6Sergei Golubchik2022-05-102-1/+2
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.4' into 10.5Sergei Golubchik2022-05-092-1/+2
| | | |\ \ \ | | | | |/ /
| | | | * | Merge branch '10.3' into 10.4Sergei Golubchik2022-05-082-1/+2
| | | | |\ \ | | | | | |/
| | | | | * Merge branch '10.2' into 10.3Oleksandr Byelkin2022-05-032-1/+2
| | | | | |\
| | | | | | * MDEV-27065 fixup: disable tests under valgrindNayuta Yanagisawa2022-04-242-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The server behaves differently on the DATA/INDEX DIRECTORY clause under valgrind because symlink is disabled under valgrind.
* | | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-04-274-3/+87
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.6 into 10.7Marko Mäkelä2022-04-264-3/+87
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-214-3/+87
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge 10.4 into 10.5Marko Mäkelä2022-04-214-3/+87
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Merge 10.3 into 10.4Marko Mäkelä2022-04-214-3/+87
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge remote-tracking branch 'origin/10.2' into 10.3Alexander Barkov2022-04-144-3/+87
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-27065 Partitioning tables with custom data directories moves data back ↵Nayuta Yanagisawa2022-04-084-3/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to default directory The partitioning engine does not support the table-level DATA/INDEX DIRECTORY specification. If one create a non-partitioned table with the DATA/INDEX DIRECTORY option and then performs ALTER TABLE ... PARTITION BY on it, the DATA/INDEX DIRECTORY specification of the old schema is ignored. The behavior might be a bit surprising for users because the value of a usual table option applies to all the partitions. Thus, we raise a warning on such ALTER TABLE ... PARTITION BY.
* | | | | | | Merge 10.7 into 10.8Daniel Black2022-03-252-0/+16
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.6 into 10.7Daniel Black2022-03-242-0/+16
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | MDEV-28079 Shutdown hangs after altering innodb partition fts tableThirunarayanan Balathandayuthapani2022-03-162-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - InnoDB purge waits at resume_FTS() while shutting down. This happens after altering the FTS innodb partition table. stop_FTS() has been called for each partition, but it calls resume_FTS() only once and it leads to hang during shutdown. This issue was introduced by commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39(MDEV-25506).
* | | | | | | MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option valuesNayuta Yanagisawa2022-03-012-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a partition with engine-defined partition options is added by ALTER, it shows the correct definition in SHOW CREATE, but the actual values get inherited from the previous partition. The cause of the bug is that the server did not parse the options associated with the newly added partition. In the case of ALTER, the complete part_info, which represents the partition structure after ALTER, is built by prep_alter_part_table(). So, we need to parse engine-defined partition options after the call of the function.
* | | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-02-042-0/+2
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-02-042-0/+2
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-02-032-0/+2
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2022-02-012-0/+2
| | | |\ \ \ \ | | | | |/ / /
| | | | * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2022-01-302-0/+2
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge branch '10.2' into 10.3mariadb-10.3.33Oleksandr Byelkin2022-01-292-0/+2
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-26870 --skip-symbolic-links does not disallow .isl file creationMarko Mäkelä2022-01-212-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InnoDB DATA DIRECTORY attribute is not implemented via symbolic links but something similar, *.isl files that contain the names of data files. InnoDB failed to ignore the DATA DIRECTORY attribute even though the server was started with --skip-symbolic-links. Native ALTER TABLE in InnoDB will retain the DATA DIRECTORY attribute of the table, no matter if the table will be rebuilt or not. Generic ALTER TABLE (with ALGORITHM=COPY) as well as TRUNCATE TABLE will discard the DATA DIRECTORY attribute. All tests have been run with and without the ./mtr option --mysqld=--skip-symbolic-links and some tests that use the InnoDB DATA DIRECTORY attribute have been adjusted for this.
| | | | * | | Merge 10.3 into 10.4Marko Mäkelä2020-10-222-0/+33
| | | | |\ \ \ | | | | | |/ /
| | | | | * | MDEV-23248 Server crashes in mi_extra / ha_partition::loop_extra_alter upon ↵Monty2020-10-162-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REORGANIZE This also fixes some issues with MDEV-23730 s3.replication_partition 'innodb,mix' segv The problem was that mysql_change_partitions() closes all handler files in case of error, which was not properly reflected in fast_alter_partition_table(). This caused handle_alter_part_error() to try to close already closed tables, which caused the crash. Fixed fast_alter_partion_table() to reflect when tables are opened. I also fixed that ha_partition::change_partitions() resets m_new_file in case of errors. Either of the above changes fixes the issue, but both are needed to ensure that the code works as expected.
* | | | | | | MDEV-5271 Support engine-defined attributes per partitionNayuta Yanagisawa2022-01-242-0/+387
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to specify engine-defined attributes on partitions as well as tables. If an engine-defined attribute is only specified at the table level, it applies to all the partitions in the table. This is a backward-compatible behavior. If the same attribute is specified both at the table level and the partition level, the per-partition one takes precedence. So, we can consider per-table attributes as default values. One cannot specify engine-defined attributes on subpartitions. Implementation details: * We store per-partition attributes in the partition_element class because we already have the part_comment field, which is for per-partition comments. * In the case of ALTER TABLE statements, the partition_elements in table->part_info is set up by mysql_unpack_partition(). So, we parse per-partition attributes after the call of the function.
* | | | | | MDEV-22165 CONVERT TABLE: move in partition from existing tableAleksey Midenkov2021-10-266-261/+1382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syntax for CONVERT TABLE ALTER TABLE tbl_name CONVERT TABLE tbl_name TO PARTITION partition_name partition_spec Examples: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN MAX_VALUE(); New ALTER_PARTITION_CONVERT_IN command for fast_alter_partition_table() is done in alter_partition_convert_in() function which basically does ha_rename_table(). Table structure and data check is basically the same as in EXCHANGE PARTITION command. And these are done by compare_table_with_partition() and check_table_data(). Atomic DDL is done by the scheme from MDEV-22166 (see the corresponding commit message). The only differnce is that it also has to drop source table frm and that is done by WFRM_DROP_CONVERTED_FROM. Initial patch was done by Dmitry Shulga <dmitry.shulga@mariadb.com>
* | | | | | Review and crash-safety fixAleksey Midenkov2021-10-262-3/+182
| | | | | |
* | | | | | MDEV-22166 CONVERT PARTITION: move out partition into a tableAleksey Midenkov2021-10-268-5/+2732
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syntax for CONVERT keyword ALTER TABLE tbl_name [alter_option [, alter_option] ...] | [partition_options] partition_option: { ... | CONVERT PARTITION partition_name TO TABLE tbl_name } Examples: ALTER TABLE t1 CONVERT PARTITION p2 TO TABLE tp2; New ALTER_PARTITION_CONVERT_OUT command for fast_alter_partition_table() is done in alter_partition_convert_out() function which basically does ha_rename_table(). Partition to extract is marked with the same flag as dropped partition: PART_TO_BE_DROPPED. Note that we cannot have multiple partitioning commands in one ALTER. For DDL logging basically the principle is the same as for other fast_alter_partition_table() commands. The only difference is that it integrates late Atomic DDL functions and introduces additional phase of WFRM_BACKUP_ORIGINAL. That is required for binlog consistency because otherwise we could not revert back after WFRM_INSTALL_SHADOW is done. And before DDL log is complete if we crash or fail the altered table will be already new but binlog will miss that ALTER command. Note that this is different from all other atomic DDL in that it rolls back until the ddl_log_complete() is done even if everything was done fully before the crash. Test cases added to: parts.alter_table \ parts.partition_debug \ versioning.partition \ atomic.alter_partition
* | | | | | Vanilla cleanups and refactoringsAleksey Midenkov2021-10-267-479/+418
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dead code cleanup: part_info->num_parts usage was wrong and working incorrectly in mysql_drop_partitions() because num_parts is already updated in prep_alter_part_table(). We don't have to update part_info->partitions because part_info is destroyed at alter_partition_lock_handling(). Cleanups: - DBUG_EVALUATE_IF() macro replaced by shorter form DBUG_IF(); - Typo in ER_KEY_COLUMN_DOES_NOT_EXITS. Refactorings: - Splitted write_log_replace_delete_frm() into write_log_delete_frm() and write_log_replace_frm(); - partition_info via DDL_LOG_STATE; - set_part_info_exec_log_entry() removed. DBUG_EVALUATE removed DBUG_EVALUTATE was only added for consistency together with DBUG_EVALUATE_IF. It is not used anywhere in the code. DBUG_SUICIDE() fix on release build On release DBUG_SUICIDE() was statement. It was wrong as DBUG_SUICIDE() is used in expression context.