mariadb/client
Jon Olav Hauglid 0db0e64f33 Bug #11755431 (former 47205)
MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT
SUPPORTING NATIVE REPAIR

Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue
'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the
tables are compatible with the current version of MySQL. Any tables that are
found incompatible are then upgraded using 'REPAIR TABLE'.

The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'.
This caused any such tables to be left incompatible. As a result such tables were
not properly fixed by the mysql_upgrade tool.

This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return
a different error message if the engine does not support REPAIR. Instead of
"Table upgrade required. Please do "REPAIR TABLE ..." it will report
"Table rebuild required. Please do "ALTER TABLE ... FORCE ..."

Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of
'REPAIR TABLE' in these cases.

This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table.
This change should be reflected in the documentation. Before this patch,
'ALTER TABLE ... FORCE' was unused (See Bug#11746162)

Test case added to mysqlcheck.test


client/mysqlcheck.c:
  Changed mysqlcheck to do 'ALTER TABLE ... FORCE' if
  'CHECK TABLE FOR UPGRADE' reports ER_TABLE_NEEDS_REBUILD
  and not ER_TABLE_NEEDS_UPGRADE.
mysql-test/r/mysqlcheck.result:
  Added regression test.
mysql-test/std_data/bug47205.frm:
  InnoDB 5.0 FRM which contains a varchar primary key using
  utf8_general_ci. This is an incompatible FRM for 5.5.
mysql-test/t/mysqlcheck.test:
  Added regression test.
sql/handler.h:
  Added new HA_CAN_REPAIR flag.
sql/share/errmsg-utf8.txt:
  Added new error message ER_TABLE_NEEDS_REBUILD
sql/sql_admin.cc:
  Changed 'CHECK TABLE FOR UPDATE' to give ER_TABLE_NEEDS_REBUILD
  instead of ER_TABLE_NEEDS_UPGRADE if the engine does not support
  REPAIR (as indicated by the new HA_CAN_REPAIR flag).
sql/sql_lex.h:
  Remove unused ALTER_FORCE flag.
sql/sql_yacc.yy:
  Make sure ALTER TABLE ... FORCE recreates the table
  by setting the ALTER_RECREATE flag as the ALTER_FORCE
  flag was unused.
storage/archive/ha_archive.h:
  Added new HA_CAN_REPAIR flag to Archive
storage/csv/ha_tina.h:
  Added new HA_CAN_REPAIR flag to CSV
storage/federated/ha_federated.h:
  Added new HA_CAN_REPAIR flag to Federated
storage/myisam/ha_myisam.cc:
  Added new HA_CAN_REPAIR flag to MyISAM
2011-03-08 09:41:57 +01:00
..
client_priv.h Remove last traces of HAVE_NDBCLUSTER_DB define - it has not had an effect in a long time and is just confusing. 2011-02-21 11:15:29 +01:00
CMakeLists.txt merge of mysql-5.5 into mysql-5.5-wl1054 2010-09-20 17:17:32 +03:00
completion_hash.cc Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled 2010-07-08 18:20:08 -03:00
completion_hash.h - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
echo.c echo.c: 2007-03-20 18:31:49 +01:00
get_password.c fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
my_readline.h Auto-merge from mysql-5.1 for bug#57450. 2011-02-05 11:04:15 +06:00
mysql.cc Automerge from mysql-5.1 for follow-up bug#57450. 2011-02-09 12:50:11 +06:00
mysql_upgrade.c Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqladmin.cc Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqlbinlog.cc Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqlcheck.c Bug #11755431 (former 47205) 2011-03-08 09:41:57 +01:00
mysqldump.c Merge of fix for bug#11766310 from mysql-5.1 -> mysql-5.5. 2011-02-21 12:42:27 +05:30
mysqlimport.c Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqlshow.c Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqlslap.c Bug#58139 : default-auth option not recognized in MySQL standard 2011-01-16 09:29:05 +05:30
mysqltest.cc merge of bug 47902 and (null-merge) of bug 57924. 2011-01-26 19:33:53 +01:00
readline.cc Automerge from mysql-5.1 for follow-up bug#57450. 2011-02-09 17:16:33 +06:00
sql_string.cc Bug#55077: Assertion failed: width > 0 && to != ((void *)0), 2010-08-25 19:57:53 +04:00
sql_string.h Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-10-19 20:51:34 -02:00