classStatementRule
final class StatementRule
Lowers the statements of the table change family other than the actions of ALTER TABLE.
Rule: MYSQL-TABLE-CHANGE-STATEMENT-001. Scope: the DROP TABLE and DROP INDEX alternatives of drop (5.6, 5.7), drop_table_stmt, drop_index_stmt, rename, table_to_table_list, table_to_table, truncate, truncate_stmt, opt_table_sym, partition_entry, and ALTER TABLE through MYSQL-ALTER-STATEMENT-001. TABLE and TABLES are synonyms; the TABLE of TRUNCATE is optional. RENAME USER belongs to the account family, which lowers its list. Constructs: DropTable, DropIndex, RenameTable, TableRenaming, TruncateTable, TargetTable, PartitionEntry. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-table.html, https://dev.mysql.com/doc/refman/8.4/en/drop-index.html, https://dev.mysql.com/doc/refman/8.4/en/rename-table.html, https://dev.mysql.com/doc/refman/8.4/en/truncate-table.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers one statement of the family.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:49
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::definition() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:59
Calls 14
- class-const StatementRule::STATEMENTS() line 83
- static-call ImplementationGap::production() line 83
- method-call StatementRule::dropTable() line 84
- new DropIndex line 85
- method-call Form::node() line 86
- method-call ModifierRule::pair() line 88
- new ModifierRule line 88
- method-call StatementRule::rename() line 90
- method-call StatementRule::renameUsers() line 91
- method-call StatementRule::truncate() line 92
- method-call PartitionRule::entry() line 93
- new PartitionRule line 93
- method-call AlterRule::statement() line 94
- new AlterRule line 94
Lowers DROP TABLE.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Form::node() line 105
- new TargetTable line 108
- new DropTable line 111
public function rename(Form $form): RenameTableLowers RENAME TABLE.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call Form::node() line 126
- method-call Lowering::form() line 127
- static-call ImplementationGap::production() line 129
- method-call Lists::items() line 132
- new Lists line 132
- new TableRenaming line 137
- new RenameTable line 140
Hands RENAME USER to the account family.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- function-call
countline 150 - method-call Form::node() line 151
public function truncate(Form $form): TruncateTableLowers TRUNCATE TABLE.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Lowering::form() line 164
- method-call Form::node() line 164
- class-const StatementRule::TABLE_WORDS() line 165
- static-call ImplementationGap::production() line 166
- new TruncateTable line 169
Private surface 3§
Implementation details, listed for orientation only.
private const STATEMENTS = ['drop: DROP opt_temporary table_or_tables if_exists table_list opt_restrict' =…private const TABLE_WORDS = ['opt_table_sym:' => true, 'opt_table_sym: TABLE_SYM' => true, 'opt_table:' => …private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
StatementRuleTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:49
- new SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::definition() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:59
Method calls 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:49
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::definition() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:59