mariadb/mysql-test/suite/ndb/t
Mattias Jonsson f50c4207f2 Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt

The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
PARTITION took another code path (over mysql_alter_table instead of
mysql_admin_table) which differs in two ways:
1) alter table opens the tables in a different way than admin tables do
   resulting in returning with error before it tried the command
2) alter table does not start to send any diagnostic rows to the client
   which the lower admin functions continue to use -> resulting in
   assertion crash

The fix:
Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
Adding check in mysql_admin_table to setup the partition list for
which partitions that should be used.


Partitioned tables will still not work with
REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
to tables, REPAIR TABLE t USE_FRM, and check that the data still
fulfills the partitioning function and then move the table back to
being a partition.

NOTE: I have removed the following functions from the handler
interface:
analyze_partitions, check_partitions, optimize_partitions,
repair_partitions
Since they are not longer needed.
THIS ALTERS THE STORAGE ENGINE API

mysql-test/r/handler_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb_mysql.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/partition.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/r/trigger-trans.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/ndb/r/ndb_partition_key.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/inc/partition_alter4.inc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_myisam.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/rpl/r/rpl_failed_optimize.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/t/partition.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
sql/ha_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a function for returning admin commands result rows
  Updated handle_opt_partitions to handle admin commands result rows,
  and some error filtering (as mysql_admin_table do).
  
  Removed the functions analyze/check/optimize/repair_partitions
  since they have no longer any use.
sql/ha_partition.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/mysql_priv.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added set_part_state for reuse of code in mysql_admin_table.
  (Originally fond in sql/sql_partition.cc:prep_alter_part_table)
sql/protocol.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added one assert and a debug print.
sql/sql_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Refactored code for setting up partition state, set_part_state,
  now used in both prep_alter_part_table and
  sql_table.cc:mysql_admin_table.
  Removed code for handling ANALYZE/CHECK/OPTIMIZE/REPAIR partitions,
  since it is now handled by mysql_admin_table.
sql/sql_table.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added functionality in mysql_admin_table to work with partitioned
  tables.
  Fixed a possible assertion bug for HA_ADMIN_TRY_ALTER
  (If analyze would output a row, it fails since the row was already
  started).
sql/sql_yacc.yy:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  instead of taking the ALTER TABLE path.
  Added reset of alter_info for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  since it is now used by partitioned tables.
storage/myisam/mi_check.c:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Changed warning message from "Found X parts  Should be: Y parts"
  to "Found X key parts. Should be Y", since it could be confusing
  with partitioned tables.
2008-08-11 20:02:03 +02:00
..
disabled.def Disabled 5.1 tests (and reported bugs) 2008-07-25 13:32:05 +03:00
loaddata_autocom_ndb.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_alter_table.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_alter_table2.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_alter_table3.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_auto_increment.test ndb_auto_increment.result: 2007-11-06 10:57:49 +01:00
ndb_autoinc.test Shouldn't let the non-deterministic temperary filename output in result file for bug#30417 2008-01-10 17:39:50 +08:00
ndb_basic.test Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb 2007-10-26 08:57:10 +02:00
ndb_binlog_basic.test Fixed errors found by pushbuild: 2007-08-16 16:47:31 +03:00
ndb_binlog_ddl_multi.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main 2007-07-25 15:40:43 +02:00
ndb_binlog_discover.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main 2007-07-25 15:40:43 +02:00
ndb_binlog_format.test update bug dependency on failing test 2007-07-13 16:06:12 +02:00
ndb_binlog_ignore_db-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_binlog_ignore_db.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main 2007-07-25 15:40:43 +02:00
ndb_binlog_log_bin.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main 2007-07-25 15:40:43 +02:00
ndb_binlog_multi.test Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main 2007-07-25 15:40:43 +02:00
ndb_bitfield.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_blob.test backport test for bug#30674 2007-12-10 13:29:23 +01:00
ndb_blob_partition.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_bug26793.test rpl_ndb_dd_partitions-slave.opt: 2007-08-21 16:26:00 +02:00
ndb_bug31477.test ndb - bug#31477 - in 5.1 move ndb_bug31477.test to suite/ndb 2008-01-29 15:02:03 +01:00
ndb_cache.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_cache2.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_cache_multi.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_cache_multi2.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_charset.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_condition_pushdown.test Merge sama.ndb.mysql.com:/export/space/pekka/ndb/version/my50-bug34107 2008-01-31 14:47:50 +01:00
ndb_config.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_config2.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_cursor.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_database.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_dd_alter.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_dd_basic.test ndb - bug#33619 2008-02-03 21:24:59 +01:00
ndb_dd_ddl.test ndb_dd_ddl.test, ndb_dd_ddl.result: 2007-08-22 15:54:10 +02:00
ndb_dd_disk2memory.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_dd_dump.test ndb_dd_dump.test, ndb_dd_dump.result: 2007-08-21 21:22:35 +02:00
ndb_dd_sql_features.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_gis.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_grant.later WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_index.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_index_ordered.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_index_unique.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_insert.test Merge mysql.com:/home/marty/MySQL/mysql-5.0-ndb 2007-11-05 21:11:15 +01:00
ndb_limit.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_load.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_loaddatalocal.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_lock.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_lock_table.test BUG#30996: Committed too early when autocommit and lock table 2007-09-14 00:10:47 +02:00
ndb_minmax.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_multi.test workaround for case insensitive filesystems 2007-11-05 13:33:20 +01:00
ndb_multi_row.test Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. 2007-11-01 15:08:00 +01:00
ndb_partition_error.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_partition_error2-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_partition_error2.test WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_partition_key.test Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that 2008-08-11 20:02:03 +02:00
ndb_partition_list.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_partition_range.test Bug #33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition 2007-12-18 13:40:35 +01:00
ndb_read_multi_range.test manual merge 2007-08-21 14:41:50 +02:00
ndb_rename.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_replace.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_restore.test ndb_restore.result, ndb_restore.test: 2008-01-25 10:43:30 +01:00
ndb_restore_compat.test Merge jhe@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb 2007-08-30 16:17:32 +08:00
ndb_restore_different_endian_data.test BUG#27543 Backup and restore can compatible with different endians for blob attribute 2007-09-05 13:01:30 +00:00
ndb_restore_partition-master.opt WL#3933 Split main test suite to rpl, rpl_ndb and ndb 2007-06-27 14:28:02 +02:00
ndb_restore_partition.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_restore_print.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_row_format.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_single_user.test Merge sita.local:/Users/tsmith/m/bk/51 2007-07-09 03:27:03 -06:00
ndb_sp.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_subquery.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_temporary.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_transaction.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_trigger.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_truncate.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_types.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndb_update.test Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb 2007-10-02 14:23:59 +02:00
ndb_update_no_read.test commit of WL#3686 test case already in 5.1 to get regression testing, no code committed 2007-10-26 11:42:33 +02:00
ndb_view.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ndbapi.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
ps_7ndb.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00
strict_autoinc_5ndb.test Merge maint1.mysql.com:/data/localhome/tsmith/bk/51 2007-07-04 22:38:53 +02:00