final class MaintenanceRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql\Lowering\Server". Code outside that scope must not name this declaration.

Lowers the table maintenance statements and their options.

Rule: MYSQL-MAINTENANCE-001. Scope: analyze, check, optimize, repair (5.6, 5.7), analyze_table_stmt, check_table_stmt, optimize_table_stmt, repair_table_stmt (8.0 and later), checksum, opt_checksum_type, opt_mi_check_type, opt_mi_check_types, mi_check_types, mi_check_type, opt_mi_repair_type, opt_mi_repair_types, mi_repair_types, mi_repair_type, opt_histogram, opt_histogram_update_param, opt_histogram_num_buckets, opt_histogram_auto_update. TABLE and TABLES are synonyms and LOCAL is NO_WRITE_TO_BINLOG (LeafNoise). The options are kept in written order. The bucket count is a NUM token, kept as written. Constructs: AnalyzeTable, CheckTable, ChecksumTable, OptimizeTable, RepairTable, MaintainedTable, UpdateHistogram, LoadHistogram, DropHistogram. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/table-maintenance-statements.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function tables(Node $list): list<MaintainedTable>
public function options(Node $options): list<Form>
public function checksum(Node $mode): ?ChecksumMode
public function histogram(Node $histogram): ?Histogram

Lowers the histogram request of ANALYZE TABLE: a node of opt_histogram.

Parameters

$histogramNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function update(list<Name> $columns, Node $parameters): UpdateHistogram|LoadHistogram
public function optionalBuckets(Node $buckets): ?Numeral

Lowers the optional bucket count of MySQL 8.4 and later: a node of opt_histogram_num_buckets.

Parameters

$bucketsNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function automatic(Node $update): ?HistogramUpdate

Lowers MANUAL UPDATE or AUTO UPDATE: a node of opt_histogram_auto_update.

Parameters

$updateNode

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4

Private surface 5§

Implementation details, listed for orientation only.

private const CHECKS = ['mi_check_type: QUICK' => \SqlSemantics\Platform\MySql\Statement\Server\CheckO…
private const REPAIRS = ['mi_repair_type: QUICK' => \SqlSemantics\Platform\MySql\Statement\Server\Repai…
private const LISTS = ['opt_mi_check_type:' => null, 'opt_mi_check_types:' => null, 'opt_mi_repair_ty…
private const STATEMENTS = ['analyze: ANALYZE_SYM opt_no_write_to_binlog table_or_tables table_list' => ['…
private Lowering $lowering

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 3
Method calls 3