Hi Jon,
On 3/3/11 8:15 AM, Jon Olav Hauglid wrote:
> #At file:///export/home/x/mysql-5.5-bug11755431/ based on
> revid:alexander.barkov@stripped
>
> 3368 Jon Olav Hauglid 2011-03-03
> Bug #11755431 (former 47205)
> MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT
> SUPPORTING NATIVE REPAIR
OK to push. Some minor comments below.
> 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) does not support 'REPAIR
> TABLE'.
s/does/do/
> 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.
Please also add a note that FORCE was previously unused (mention Bug#24091).
[...]
> === modified file 'mysql-test/t/mysqlcheck.test'
> --- a/mysql-test/t/mysqlcheck.test 2010-10-08 07:09:47 +0000
> +++ b/mysql-test/t/mysqlcheck.test 2011-03-03 11:15:45 +0000
> @@ -229,3 +229,83 @@ drop table `t1-1`;
> --error 1
> --exec $MYSQL_CHECK -aoc test "#mysql50#t1-1"
>
> +
> +--echo #
> +--echo # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR
> +--echo # ENGINES NOT SUPPORTING NATIVE
> +--echo #
> +
> +--disable_warnings
> +DROP TABLE IF EXISTS bug47205;
> +--enable_warnings
> +
> +--echo #
> +--echo # Test 1: Check that ALTER TABLE ... rebuilds the table
> +
> +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
> + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
Test case needs a have_innodb check.
>
> === modified file 'sql/share/errmsg-utf8.txt'
> --- a/sql/share/errmsg-utf8.txt 2011-02-21 15:49:03 +0000
> +++ b/sql/share/errmsg-utf8.txt 2011-03-03 11:15:45 +0000
> @@ -6397,3 +6397,8 @@ ER_STMT_CACHE_FULL
>
> ER_MULTI_UPDATE_KEY_CONFLICT
> eng "Primary key/partition key update is not allowed since the table is updated
> both as '%-.192s' and '%-.192s'."
> +
> +# When translating this error mesage make sure to include "ALTER TABLE" in the
mesage -> message
Regards,
Davi