content_image/870009.jpg content_image/870016.jpg
When running the CHECK TABLE  statement, the CSV  file is checked for validity by looking for the correct field separators, escaped fields (matching or missing quotation marks), the correct number of fields compared to the table definition and the existence of a corresponding CSV  metafile. The first invalid row discovered causes an error. Checking a valid table produces output like that shown here: 

mysql> CHECK TABLE csvtest; +--------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------------+-------+----------+----------+ | test.csvtest | check | status | OK | +--------------+-------+----------+----------+ 

A check on a corrupted table returns a fault such as 

mysql> CHECK TABLE csvtest; +--------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------------+-------+----------+----------+ | test.csvtest | check | error | Corrupt | +--------------+-------+----------+----------+ 

To repair a table, use REPAIR TABLE , which copies as many valid rows from the existing CSV  data as possible, and then replaces the existing CSV  file with the recovered rows. Any rows beyond the corrupted data are lost. 

## 16.4.2 CSV Limitations 

mysql> REPAIR TABLE csvtest; +--------------+--------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------------+--------+----------+----------+ | test.csvtest | repair | status | OK | +--------------+--------+----------+----------+ 

<img src='content_image/870009.jpg'>

The CSV  storage engine does not support indexing. 

The CSV  storage engine does not support partitioning. 

## Warning 

During repair, only the rows from the CSV  file up to the first damaged row are copied to the new table. All other rows from the first damaged row to the end of the table are removed, even valid rows. 

All tables that you create using the CSV  storage engine must have the NOT NULL  attribute on all columns. 

## 16.5 The ARCHIVE Storage Engine 

The ARCHIVE  storage engine produces special-purpose tables that store large amounts of unindexed data in a very small footprint. 

<img src='content_image/870016.jpg'>

