mariadb/mysql-test/suite/parts/r
Monty c4cad8d50c MDEV-33449 improving repair of tables
This task is to ensure we have a clear definition and rules of how to
repair or optimize a table.

The rules are:

- REPAIR should be used with tables that are crashed and are
  unreadable (hardware issues with not readable blocks, blocks with
  'unexpected data' etc)
- OPTIMIZE table should be used to optimize the storage layout for the
  table (recover space for delete rows and optimize the index
  structure.
- ALTER TABLE table_name FORCE should be used to rebuild the .frm file
  (the table definition) and the table (with the original table row
  format). If the table is from and older MariaDB/MySQL release with a
  different storage format, it will convert the data to the new
  format. ALTER TABLE ... FORCE is used as part of mariadb-upgrade

Here follows some more background:

The 3 ways to repair a table are:
1) ALTER TABLE table_name FORCE" (not other options).
   As an alias we allow: "ALTER TABLE table_name ENGINE=original_engine"
2) "REPAIR TABLE" (without FORCE)
3) "OPTIMIZE TABLE"

All of the above commands will optimize row space usage (which means that
space will be needed to hold a temporary copy of the table) and
re-generate all indexes. They will also try to replicate the original
table definition as exact as possible.

For ALTER TABLE and "REPAIR TABLE without FORCE", the following will hold:
If the table is from an older MariaDB version and data conversion is
needed (for example for old type HASH columns, MySQL JSON type or new
TIMESTAMP format) "ALTER TABLE table_name FORCE, algorithm=COPY" will be
used.

The differences between the algorithms are
1) Will use the fastest algorithm the engine supports to do a full repair
   of the table (except if data conversions are is needed).
2) Will use the storage engine internal REPAIR facility (MyISAM, Aria).
   If the engine does not support REPAIR then
   "ALTER TABLE FORCE, ALGORITHM=COPY" will be used.
   If there was data incompatibilities (which means that FORCE was used)
   then there will be a warning after REPAIR that ALTER TABLE FORCE is
   still needed.
   The reason for this is that REPAIR may be able to go around data
   errors (wrong incompatible data, crashed or unreadable sectors) that
   ALTER TABLE cannot do.
3) Will use the storage engine internal OPTIMIZE. If engine does not
   support optimize, then "ALTER TABLE FORCE" is used.

The above will ensure that ALTER TABLE FORCE is able to
correct almost any errors in the row or index data.  In case of
corrupted blocks then REPAIR possible followed by ALTER TABLE is needed.
This is important as mariadb-upgrade executes ALTER TABLE table_name
FORCE for any table that must be re-created.

Bugs fixed with InnoDB tables when using ALTER TABLE FORCE:
- No error for INNODB_DEFAULT_ROW_FORMAT=COMPACT even if row length
  would be too wide. (Independent of innodb_strict_mode).
- Tables using symlinks will be symlinked after any of the above commands
  (Independent of the setting of --symbolic-links)

If one specifies an algorithm together with ALTER TABLE FORCE, things
will work as before (except if data conversion is required as then
the COPY algorithm is enforced).

ALTER TABLE .. OPTIMIZE ALL PARTITIONS will work as before.

Other things:
- FORCE argument added to REPAIR to allow one to first run internal
  repair to fix damaged blocks and then follow it with ALTER TABLE.
- REPAIR will not update frm_version if ha_check_for_upgrade() finds
  that table is still incompatible with current version. In this case the
  REPAIR will end with an error.
- REPAIR for storage engines that does not have native repair, like InnoDB,
  is now using ALTER TABLE FORCE.
- REPAIR csv-table USE_FRM now works.
  - It did not work before as CSV tables had extension list in wrong
    order.
- Default error messages length for %M increased from 128 to 256 to not
  cut information from REPAIR.
- Documented HA_ADMIN_XX variables related to repair.
- Added HA_ADMIN_NEEDS_DATA_CONVERSION to signal that we have to
  do data conversions when converting the table (and thus ALTER TABLE
  copy algorithm is needed).
- Fixed typo in error message (caused test changes).
2024-05-27 12:39:03 +02:00
..
alter_data_directory_innodb.result MDEV-29983 Deprecate innodb_file_per_table 2023-01-11 17:55:56 +02:00
alter_table,list.rdiff Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
alter_table.result MDEV-33655 Remove alter_algorithm 2024-05-27 12:39:03 +02:00
backup_log.result Revert MDEV-25292 Atomic CREATE OR REPLACE TABLE 2022-10-27 23:13:41 +02:00
backup_log_rocksdb.result MDEV-18465 Logging of DDL statements during backup 2021-05-19 22:54:13 +02:00
cache.result MDEV Assertion `partition_id == m_extra_cache_part_id' failed in ha_partition::late_extra_no_cache 2017-12-12 15:10:53 +02:00
debug_innodb_crash.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
debug_innodb_fail.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
debug_myisam_crash.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
debug_myisam_fail.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
engine_defined_part_attributes.result Merge 10.7 into 10.8 2022-09-21 09:52:09 +03:00
fulltext.result MDEV-17627 Assertion `inited==RND' failed in handler::ha_rnd_end() upon actions on partitioned table with FTS 2019-07-12 19:38:10 +02:00
insert_ignore-5421.result
longname.result MDEV-29983 Deprecate innodb_file_per_table 2023-01-11 17:55:56 +02:00
mdev_21007.result MDEV-21007 Do not assert auto_increment_value unless all parts open 2024-04-08 16:35:21 +10:00
optimizer.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
part_blocked_sql_func_innodb.result
part_blocked_sql_func_myisam.result
part_ctype_tis620.result Merge 10.4 into 10.5 2022-11-30 13:10:52 +02:00
part_ctype_utf32.result
part_supported_sql_func_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
part_supported_sql_func_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter1_1_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_1_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter1_2_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_alter1_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_maria.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_1_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_1_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_2_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_maria.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter2_2_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_alter3_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_alter3_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter4_innodb.result MDEV-33449 improving repair of tables 2024-05-27 12:39:03 +02:00
partition_alter4_myisam.result Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
partition_alter_innodb.result MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
partition_alter_instant.result MDEV-33655 Remove alter_algorithm 2024-05-27 12:39:03 +02:00
partition_alter_maria.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_alter_myisam.result Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
partition_auto_increment_archive.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_auto_increment_blackhole.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_innodb.result Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
partition_auto_increment_maria.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_max.result MDEV-9519: Data corruption will happen on the Galera cluster size change 2019-02-26 08:09:04 +02:00
partition_auto_increment_memory.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_auto_increment_myisam.result MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher upon REPLACE with partition pruning 2022-12-07 16:34:56 +09:00
partition_basic_innodb.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_basic_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_basic_symlink_innodb.result MDEV-29983 Deprecate innodb_file_per_table 2023-01-11 17:55:56 +02:00
partition_basic_symlink_myisam.result Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
partition_bigint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bigint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bit_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_bit_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_char_innodb.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_char_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_datetime_innodb.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_datetime_myisam.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_debug.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
partition_debug_innodb.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
partition_debug_sync_innodb.result Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
partition_decimal_innodb.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_decimal_myisam.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_double_innodb.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_double_myisam.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_engine_innodb.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
partition_engine_myisam.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
partition_exch_innodb.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_myisam.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_myisam_innodb.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_qa_1_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exch_qa_1_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exch_qa_2.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa_3.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exch_qa_4_innodb.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_qa_4_myisam.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_qa_5_innodb.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_5_myisam.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_6.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_7_innodb.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
partition_exch_qa_7_myisam.result MDEV-5215 prerequisite: remove test and test_* database hacks in the test suite 2022-11-01 16:33:00 +01:00
partition_exch_qa_8_innodb.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_8_myisam.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
partition_exch_qa_10.result
partition_exch_qa_11.result MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
partition_exch_qa_12.result
partition_exch_qa_13.result
partition_exch_qa_14.result MDEV-13157 Specifying DATA DIRECTORY in tables leads to failing EXCHANGE PARTITION 2017-09-18 10:40:26 +02:00
partition_exch_qa_15.result cleanup parts.partition_exch_* tests 2017-09-18 10:40:26 +02:00
partition_exchange_archive.result
partition_exchange_blackhole.result
partition_exchange_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exchange_memory.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_exchange_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_float_innodb.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_float_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_innodb_status_file.result
partition_int_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_int_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mdev6067.result MDEV-7635: Part 1 2017-02-10 06:30:42 -05:00
partition_mediumint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mediumint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_mgm_lc0_archive.result
partition_mgm_lc0_innodb.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc0_memory.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc0_myisam.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_archive.result
partition_mgm_lc1_innodb.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_memory.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc1_myisam.result MDEV-21472: ALTER TABLE ... ANALYZE PARTITION ... with EITS reads and locks all rows 2024-01-30 09:19:01 +02:00
partition_mgm_lc2_archive.result
partition_mgm_lc2_innodb.result MDEV-15253: Default optimizer setting changes for MariaDB 10.4 2018-12-09 09:22:00 +05:30
partition_mgm_lc2_memory.result MDEV-15253: Default optimizer setting changes for MariaDB 10.4 2018-12-09 09:22:00 +05:30
partition_mgm_lc2_myisam.result MDEV-15253: Default optimizer setting changes for MariaDB 10.4 2018-12-09 09:22:00 +05:30
partition_open.result introduce hton->drop_table() method 2020-07-04 01:44:46 +02:00
partition_purge.result MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
partition_recover_myisam.result Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
partition_repair_myisam.result Add support for minimum field width for strings to my_vsnprintf() 2021-05-19 22:27:29 +02:00
partition_smallint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_smallint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_special_innodb.result Merge branch '10.11' into 11.0 2023-11-08 17:09:44 +01:00
partition_special_myisam.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
partition_syntax_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_syntax_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_t55.out
partition_tinyint_innodb.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_tinyint_myisam.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
partition_value_innodb.result MDEV-18650: Options deprecated in previous versions - storage_engine 2020-02-13 13:42:01 +02:00
partition_value_myisam.result MDEV-18650: Options deprecated in previous versions - storage_engine 2020-02-13 13:42:01 +02:00
percona_nonflushing_analyze_debug.result Added test cases for preceding test 2023-02-03 00:00:35 +03:00
print_error.result MDEV-15336 Server crashes in handler::print_error / ha_partition::print_error upon query timeout 2018-02-24 01:28:51 +01:00
reorganize.result MDEV-23730 s3.replication_partition 'innodb,mix' segv 2020-10-21 03:09:29 +03:00
reorganize_partition_innodb.result MDEV-29983 Deprecate innodb_file_per_table 2023-01-11 17:55:56 +02:00
rpl_partition.result Merge 10.9 into 10.10 2022-09-21 10:59:56 +03:00
show_create.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
truncate_locked.result MDEV-15551 Server hangs or assertion `strcmp(share->unique_file_name,filename) || share->last_version' fails in test_if_reopen or unexpected ER_LOCK_DEADLOCK 2018-07-19 11:35:39 +02:00
update_and_cache.result MDEV-16741 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache 2018-09-10 19:30:06 +02:00