classCheckTable
final class CheckTable
implements Statement
uses Snapshot
@visibility public.CHECK TABLE t, … [option …]: a request to check tables for errors.
Mirrors PT_check_table_stmt (Sql_cmd_check_table). Rule: MYSQL-CHECK-TABLE-001. Each table resolves by MYSQL-SERVER-TABLES-001 and its resolution is the relation fact of its MaintainedTable; a table named twice is NonUniqueTable. The options are kept in written order; the server merges them into flags. TABLE and TABLES are synonyms; TABLE is written. The server returns one row per table and message; its columns are MYSQL-ADMIN-ROWS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/check-table.html. Status: Implemented.
$statement = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('check tables t for upgrade quick');
[$statement->toString(), $statement->statement->options[0] === \SqlSemantics\Platform\MySql\Statement\Server\CheckOption::ForUpgrade] // => ['CHECK TABLE t FOR UPGRADE QUICK', true]Properties§
public list<MaintainedTable> $tablespublic list<CheckOption> $optionsMethods§
public function __construct(list<MaintainedTable> $tables, list<CheckOption> $options = [])Parameters
$tables | list<MaintainedTable> | The tables in written order; at least one |
$options | list<CheckOption> | The options in written order |
Throws
InvalidConstruction When the table list is empty or an option list holds a foreign valueCalls 4
- method-call MaintainedTables::checked() line 54
- new MaintainedTables line 54
- static-call Check::listOf() line 55
- class-const CheckOption::class() line 55
public function deriveStatement(Derivation $derivation): voidRecords the resolution of each table, reports a table named twice, and records the result rows.
Parameters
$derivation | Derivation |
Calls 4
- method-call MaintainedTables::derive() line 63
- new MaintainedTables line 63
- method-call AdminRows::admin() line 64
- new AdminRows line 64
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call MaintainedTables::render() line 72
- new MaintainedTables line 72
- method-call Output::keyword() line 74
- function-call
explodeline 74
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.