Description:
According to Vlad, executing CHECK TABLE would actually cause a repair on the entire tablespace. This differs significantly from the desired behavior, which is to only check a specific table and take no action on it. Action should be taken only when REPAIR TABLE is explicitly requested.
In addition, Vlad reports that the repair procedure causes database pages to be erroneously freed, which in turn causes corruption.
This issue also prevents the RQG from safely issuing CHECK TABLE in order to verify the data after recovery. On the other hand, the Maria team has explicitly requested that CHECK TABLE is used after recovery on their tests.
How to repeat:
Examine the code. A RQG test may also be provided if needed.
Suggested fix:
* Disable CHECK TABLE until fixed, by returning "unsupported" instead;
* If possible, restrict the operation of CHECK|REPAIR TABLE to the table in question, and implement a separate command for operations on the entire tablespace;
* Make sure CHECK|REPAIR table does not free database pages that are actually in use, as reported by Vlad.