summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.6 into 10.7Marko Mäkelä2023-01-132-6/+90
|\
| * Merge 10.5 into 10.6Marko Mäkelä2023-01-132-6/+90
| |\
| | * Merge 10.4 into 10.5Marko Mäkelä2023-01-132-6/+90
| | |\
| | | * Merge 10.3 into 10.4Marko Mäkelä2023-01-132-0/+85
| | | |\
| | | | * MDEV-30378 Versioned REPLACE succeeds with ON DELETE RESTRICT constraintNikita Malyavin2023-01-122-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | node->is_delete was incorrectly set to NO_DELETE for a set of operations. In general we shouldn't rely on sql_command and look for more abstract ways to control the behavior. trg_event_map seems to be a suitable way. To mind replica nodes, it is ORed with slave_fk_event_map, which stores trg_event_map when replica has triggers disabled.
* | | | | Merge 10.6 into 10.7Marko Mäkelä2023-01-048-3/+130
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2023-01-038-3/+130
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.4 into 10.5Marko Mäkelä2023-01-038-3/+130
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2023-01-038-3/+130
| | | |\ \ | | | | |/
| | | | * MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORYAleksey Midenkov2022-12-278-3/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. In case of system-versioned table add row_end into FTS_DOC_ID index in fts_create_common_tables() and innobase_create_key_defs(). fts_n_uniq() returns 1 or 2 depending on whether the table is system-versioned. After this patch recreate of FTS_DOC_ID index is required for existing system-versioned tables. If you see this message in error log or server warnings: "InnoDB: Table db/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB" use this command to fix the table: ALTER TABLE db.t1 FORCE; 2. Fix duplicate history for secondary unique index like it was done in MDEV-23644 for clustered index (932ec586aad). In case of existing history row which conflicts with currently inseted row we check in row_ins_scan_sec_index_for_duplicate() whether that row was inserted as part of current transaction. In that case we indicate with DB_FOREIGN_DUPLICATE_KEY that new history row is not needed and should be silently skipped. 3. Some parts of MDEV-21138 (7410ff436e9) reverted. Skipping of FTS_DOC_ID index for history rows made problems with purge system. Now this is fixed differently by p.2. 4. wait_all_purged.inc checks that we didn't affect non-history rows so they are deleted and purged correctly. Additional FTS fixes fts_init_get_doc_id(): exclude history rows from max_doc_id calculation. fts_init_get_doc_id() callback is used only for crash recovery. fts_add_doc_by_id(): set max value for row_end field. fts_read_stopword(): stopwords table can be system-versioned too. We now read stopwords only for current data. row_insert_for_mysql(): exclude history rows from doc_id validation. row_merge_read_clustered_index(): exclude history_rows from doc_id processing. fts_load_user_stopword(): for versioned table retrieve row_end field and skip history rows. For non-versioned table we retrieve 'value' field twice (just for uniformity). FTS tests for System Versioning now include maybe_versioning.inc which adds 3 combinations: 'vers' for debug build sets sysvers_force and sysvers_hide. sysvers_force makes every created table system-versioned, sysvers_hide hides WITH SYSTEM VERSIONING for SHOW CREATE. Note: basic.test, stopword.test and versioning.test do not require debug for 'vers' combination. This is controlled by $modify_create_table in maybe_versioning.inc and these tests run WITH SYSTEM VERSIONING explicitly which allows to test 'vers' combination on non-debug builds. 'vers_trx' like 'vers' sets sysvers_force_trx and sysvers_hide. That tests FTS with trx_id-based System Versioning. 'orig' works like before: no System Versioning is added, no debug is required. Upgrade/downgrade test for System Versioning is done by innodb_fts.versioning. It has 2 combinations: 'prepare' makes binaries in std_data (requires old server and OLD_BINDIR). It tests upgrade/downgrade against old server as well. 'upgrade' tests upgrade against binaries in std_data. Cleanups: Removed innodb-fts-stopword.test as it duplicates stopword.test
* | | | | MDEV-29841 More descriptive text for ER_PARTITION_WRONG_TYPEbb-10.7-midenokAleksey Midenkov2022-11-112-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For commands (1) alter table t1 add partition (partition p2); (2) alter table t1 add partition (partition px history); It printed the same error message: Wrong partitioning type, expected type: `SYSTEM_TIME` For (1) it is not clear from the syntax that we are trying to add HASH partition. For (2) it is not clear that the table partitioning is different than SYSTEM_TIME. Now it prints what type we are trying to add to what type of partitioning. Fixed warning unused function rename_field_in_list() for compilation without partitioning.
* | | | | Revert "MDEV-29841 More descriptive text for ER_PARTITION_WRONG_TYPE"Marko Mäkelä2022-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6f8fb41f213dd34b43ef6f3819b4be12f6b26c01 because it broke cmake -DPLUGIN_PARTITION=NO
* | | | | Merge branch '10.7' into bb-10.7-releaseOleksandr Byelkin2022-11-072-2/+21
|\ \ \ \ \
| * | | | | MDEV-29841 Partition by system_time can be converted into table but not backAleksey Midenkov2022-10-312-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrong error code was returned because of prematurely tested condition for wrong partition type. Now the condition for CONVERT IN is tested first.
| * | | | | MDEV-29841 More descriptive text for ER_PARTITION_WRONG_TYPEAleksey Midenkov2022-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For commands (1) alter table t1 add partition (partition p2); (2) alter table t1 add partition (partition px history); It printed the same error message: Wrong partitioning type, expected type: `SYSTEM_TIME` For (1) it is not clear from the syntax that we are trying to add HASH partition. For (2) it is not clear that the table partitioning is different than SYSTEM_TIME. Now it prints what type we are trying to add to what type of partitioning.
* | | | | | fix results after mergeOleksandr Byelkin2022-10-311-1/+1
| | | | | |
* | | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-10-295-1/+225
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-10-254-0/+224
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | To prevent ASAN heap-use-after-poison in the MDEV-16549 part of ./mtr --repeat=6 main.derived the initialization of Name_resolution_context was cleaned up.
| | * | | Merge 10.4 into 10.5Marko Mäkelä2022-10-252-7/+9
| | | | |
| | * | | Merge 10.4 into 10.5Marko Mäkelä2022-10-254-0/+222
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2022-10-254-0/+222
| | | |\ \ | | | | |/
| | | | * MDEV-19569 Assertion `table_list->table' failed in find_field_in_table_ref.Alexey Botchkov2022-10-192-0/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disallow subqueries in The PARTITIN BY INTERVAL syntax. Fix various interval types that now fail as they break syntax in the par file.
| | | | * MDEV-29750 triggers can modify historySergei Golubchik2022-10-162-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | should be the same behavior as for virtual columns: * a warning on every inserted row * silently ignored in a trigger
* | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-10-041-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.5' into 10.6Sergei Golubchik2022-10-021-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.4' into 10.5Sergei Golubchik2022-10-021-1/+1
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.3' into 10.4Sergei Golubchik2022-10-011-1/+1
| | | |\ \ | | | | |/
| | | | * MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DBAnel Husakovic2022-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added missing information about database of corresponding table for various types of commands - Update some typos - Reviewed by: <vicentiu@mariadb.org>
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-09-2111-136/+134
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-09-209-107/+107
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2022-09-149-107/+107
| | |\ \ \ | | | |/ /
| | | * | Merge 10.3 into 10.4Marko Mäkelä2022-09-139-83/+83
| | | |\ \ | | | | |/
| | | | * MDEV-29446 Change SHOW CREATE TABLE to display default collationAlexander Barkov2022-09-129-83/+83
| | | | |
* | | | | Merge branch '10.6' into 10.7mariadb-10.7.4Sergei Golubchik2022-05-182-0/+29
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.5' into 10.6mariadb-10.6.8Sergei Golubchik2022-05-182-0/+29
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.4' into 10.5mariadb-10.5.16Sergei Golubchik2022-05-182-0/+29
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.3' into 10.4mariadb-10.4.25Sergei Golubchik2022-05-182-0/+29
| | | |\ \ | | | | |/
| | | | * MDEV-28552 Assertion `inited==RND' failed in handler::ha_rnd_endAleksey Midenkov2022-05-182-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | We cannot permanently change bits in read_partitions in the middle of processing because ha_rnd_init()/ha_rnd_end() depends on that.
* | | | | Merge branch '10.6' into 10.7Sergei Golubchik2022-05-117-18/+740
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.5' into 10.6Sergei Golubchik2022-05-106-14/+724
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.4' into 10.5Sergei Golubchik2022-05-096-5/+726
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.3' into 10.4Sergei Golubchik2022-05-086-5/+734
| | | |\ \ | | | | |/
| | | | * MDEV-20077 Warning on full history partition is delayed until next DML statementAleksey Midenkov2022-04-294-26/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved LIMIT warning from vers_set_hist_part() to new call vers_check_limit() at table unlock phase. At that point read_partitions bitmap is already pruned by DML code (see prune_partitions(), find_used_partitions()) so we have to set corresponding bits for working history partition. Also we don't do my_error(ME_WARNING|ME_ERROR_LOG), because at that point it doesn't update warnings number, so command reports 0 warnings (but warning list is still updated). Instead we do push_warning_printf() and sql_print_warning() separately. Under LOCK TABLES external_lock(F_UNLCK) is not executed. There is start_stmt(), but no corresponding "stop_stmt()". So for that mode we call vers_check_limit() directly from close_thread_tables(). Test result has been changed according to new LIMIT and warning printing algorithm. For convenience all LIMIT warnings are marked with "You see warning above ^". TODO MDEV-20345 fixed. Now vers_history_generating() contains fine-grained list of DML-commands that can generate history (and TODO mechanism worked well).
| | | | * MDEV-28271 Assertion on TRUNCATE PARTITION for PARTITION BY SYSTEM_TIMEAleksey Midenkov2022-04-292-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like in MDEV-27217 vers_set_hist_part() for LIMIT depends on all partitions selected in read_partitions. That bugfix just disabled partition selection for DELETE with this check: if (table->pos_in_table_list && table->pos_in_table_list->partition_names) { return HA_ERR_PARTITION_LIST; } ALTER TABLE TRUNCATE PARTITION is a different story. First, it doesn't update pos_in_table_list->partition_names, but thd->lex->alter_info.partition_names. But we cannot depend on that since alter_info will be stale for DML. Second, we should not disable TRUNCATE PARTITION for that to be consistent with TRUNCATE TABLE behavior. Now we don't do vers_set_hist_part() for ALTER TABLE as this command is not DML, so it does not produce history.
| | | | * MDEV-28254 Wrong position for row_start, row_end after adding column to ↵Aleksey Midenkov2022-04-222-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit versioned table Implicit system-versioned table does not contain system fields in SHOW CREATE. Therefore after mysqldump recovery such table has system fields in the last place in frm image. The original table meanwhile does not guarantee these system fields on last place because adding new fields via ALTER TABLE places them last. Thus the order of fields may be different between master and slave, so row-based replication may fail. To fix this on ALTER TABLE we now place system-invisible fields always last in frm image. If the table was created via old revision and has an incorrect order of fields it can be fixed via any copy operation of ALTER TABLE, f.ex.: ALTER TABLE t1 FORCE; To check the order of fields in frm file one can use hexdump: hexdump -C t1.frm Note, the replication fails only when all 3 conditions are met: 1. row-based or mixed mode replication; 2. table has new fields added via ALTER TABLE; 3. table was rebuilt on some, but not all nodes via mysqldump image. Otherwise it will operate properly even with incorrect order of fields.
| | | | * MDEV-25546 LIMIT partitioning does not respect ROLLBACKAleksey Midenkov2022-04-222-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vers_info->hist_part retained stale value after ROLLBACK. The algorithm in vers_set_hist_part() continued iteration from that value. The simplest solution is to process partitions each time from start for LIMIT in vers_set_hist_part().
* | | | | Merge 10.6 into 10.7Marko Mäkelä2022-04-262-0/+25
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-212-0/+25
| |\ \ \ \ | | |/ / /
| | * | | Merge branch 10.4 into 10.5Daniel Black2022-04-212-0/+25
| | |\ \ \ | | | |/ / | | | | | | | | | | A few of constaint -> constraint
| | | * | MDEV-24529 Assertion failed in vers_select_conds_t::printOleg Smirnov2022-04-182-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | This commit adds processing of SYSTEM_TIME_BEFORE and SYSTEM_TIME_HISTORY to vers_select_conds_t::print().