Oracle 5.0 Reference Manual page 1184

Table of Contents

Advertisement

The
option checks whether the named tables are compatible with the current version
FOR UPGRADE
of MySQL. This option was added in MySQL 5.0.19. With
table to determine whether there have been any incompatible changes in any of the table's data types
or indexes since the table was created. If not, the check succeeds. Otherwise, if there is a possible
incompatibility, the server runs a full check on the table (which might take some time). If the full check
succeeds, the server marks the table's
file ensures that further checks for the table with the same version of the server will be fast.
.frm
Incompatibilities might occur because the storage format for a data type has changed or because its
sort order has changed. Our aim is to avoid these changes, but occasionally they are necessary to
correct problems that would be worse than an incompatibility between releases.
Currently,
FOR UPGRADE
• The indexing order for end-space in
between MySQL 4.1 and 5.0.
• The storage method of the new
• As of MySQL 5.0.62, if your table was created by a different version of the MySQL server than
the one you are currently running,
incompatible version. In this case, the result set returned by
value of
Msg_type
error
"REPAIR TABLE `tbl_name`" to fix it!
• Changes are sometimes made to character sets or collations that require table indexes to be
rebuilt. For details about these changes and when
"Checking Whether Tables or Indexes Must Be
The other check options that can be given are shown in the following table. These options are passed
to the storage engine, which may use them or not.
tables and views.
Type
Meaning
Do not scan the rows to check for incorrect links.
QUICK
Check only tables that have not been closed properly.
FAST
Check only tables that have been changed since the last check or that have not been
CHANGED
closed properly.
Scan rows to verify that deleted links are valid. This also calculates a key checksum
MEDIUM
for the rows and verifies this with a calculated checksum for the keys.
Do a full key lookup for all keys for each row. This ensures that the table is 100%
EXTENDED
consistent, but takes a long time.
If none of the options QUICK, MEDIUM, or
format
tables is MEDIUM. This has the same result as running
MyISAM
on the table. The default check type also is
tbl_name
or
is specified. In that case, the default is QUICK. The row scan is skipped for
CHANGED
FAST
and
because the rows are very seldom corrupted.
FAST
You can combine check options, as in the following example that does a quick check on the table to
determine whether it was closed properly:
CHECK TABLE test_table FAST QUICK;
Note
In some cases,
marked as "corrupted" or "not closed properly" but
any problems in the table. In this case,
Table Maintenance Statements
file with the current MySQL version number. Marking the
.frm
discovers these incompatibilities:
columns for
TEXT
data type changed between MySQL 5.0.3 and 5.0.5.
DECIMAL
FOR UPGRADE
and a
value of
Msg_text
EXTENDED
CHECK TABLE
1164
UPGRADE, the server checks each
FOR
and
InnoDB
MyISAM
indicates that the table has an
CHECK TABLE
Table upgrade required. Please do
detects them, see
FOR UPGRADE
Rebuilt".
uses them; they are ignored for
MyISAM
are specified, the default check type for dynamic-
myisamchk --medium-check
for static-format
MEDIUM
changes the table. This happens if the table is
CHECK TABLE
CHECK TABLE
tables changed
file with an
.frm
contains a line with a
Section 2.19.3,
InnoDB
tables, unless
MyISAM
CHANGED
does not find
marks the table as okay.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents