classLoadRule
final class LoadRule
Lowers LOAD DATA and LOAD XML of every release.
Rule: MYSQL-LOAD-LOWERING-001. Scope: load (5.6, 5.7), load_stmt (8.0 and later), data_or_xml, load_data_lock, opt_local, opt_from_keyword, load_source_type, opt_source_count, opt_source_order, opt_compression_algorithm, opt_xml_rows_identified_by, opt_ignore_lines, lines_or_rows, opt_field_or_var_spec, fields_or_vars, field_or_var, opt_load_data_set_spec, load_data_set_list, load_data_set_elem, opt_load_parallel, opt_load_memory, opt_load_algorithm. The parts of the statement are found by their nonterminal, each of which occurs once in every production. A number that the grammar reads as a bare NUM token is a Numeral of its digits. The word before the file count must be COUNT, as the server's grammar action requires. Terminates: the parts are strict subtrees; lists are flattened by MYSQL-DML-LIST-001. Source: https://dev.mysql.com/doc/refman/8.4/en/load-data.html, https://dev.mysql.com/doc/refman/8.4/en/load-xml.html, sql/sql_yacc.yy 8.4. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a node of load or load_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When the word before the number of files is not COUNTCalled from 1
Calls 17
- class-const LoadRule::STATEMENTS() line 96
- static-call ImplementationGap::production() line 97
- method-call LoadRule::flag() line 105
- new FormatRule line 106
- new LoadTable line 109
- method-call LoadRule::format() line 110
- method-call LoadRule::lock() line 111
- method-call LoadRule::input() line 112
- new WriteTarget line 114
- method-call FormatRule::charset() line 115
- method-call LoadRule::tagged() line 116
- method-call FormatRule::fields() line 118
- method-call FormatRule::lines() line 119
- method-call LoadRule::ignored() line 120
- method-call LoadRule::columns() line 121
- method-call LoadRule::assignments() line 122
- method-call LoadRule::bulk() line 123
public function format(Node $node): LoadFormatLowers a node of data_or_xml.
Parameters
$node | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 134
- class-const LoadRule::FORMATS() line 136
- static-call ImplementationGap::production() line 136
Lowers a node of load_data_lock; no modifier is null.
Parameters
$node | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 146
- function-call
array_key_existsline 147 - class-const LoadRule::LOCKS() line 147
- static-call ImplementationGap::production() line 148
public function source(Node $node): LoadSourceLowers a node of load_source_type.
Parameters
$node | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 161
- class-const LoadRule::SOURCES() line 163
- static-call ImplementationGap::production() line 163
public function flag(?Node $node): boolLowers an optional word: whether it is written; an absent part is not.
Parameters
$node | ?Node |
Returns
boolThrows
ImplementationGap When a production has no ruleCalled from 5
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:105
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::input() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:192
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::input() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:193
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::ignored() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:246
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::bulk() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:341
Calls 3
- method-call Lowering::form() line 176
- class-const LoadRule::FLAGS() line 178
- static-call ImplementationGap::production() line 178
Lowers what is read: LOCAL, the source kind, the file, COUNT and IN PRIMARY KEY ORDER.
Parameters
$parts | array<string, Node> |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When the word before the number of files is not COUNTCalled from 1
Calls 8
- method-call LoadRule::source() line 190
- class-const LoadSource::Infile() line 190
- method-call LoadRule::flag() line 192
- method-call Lowering::form() line 194
- new LoadInput line 196
- static-call ImplementationGap::production() line 203
- function-call
strcasecmpline 206 - new AnalysisException line 207
Lowers a node of opt_compression_algorithm or opt_xml_rows_identified_by; an absent clause is null.
Parameters
$clause | ?Node |
Returns
?TextThrows
ImplementationGap When a production has no ruleCalled from 2
Calls 3
- method-call Lowering::form() line 223
- function-call
countline 227 - static-call ImplementationGap::production() line 228
Lowers a node of opt_ignore_lines; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 239
- static-call ImplementationGap::production() line 244
- method-call LoadRule::flag() line 246
public function columns(Node $spec): list<ColumnUse|UserVariable>Lowers a node of opt_field_or_var_spec; an absent or empty list is empty.
Parameters
$spec | Node |
Returns
list<ColumnUse|UserVariable>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 259
- static-call ImplementationGap::production() line 264
- method-call ListRule::items() line 267
- new ListRule line 267
public function assignments(Node $spec): list<Assignment>Lowers a node of opt_load_data_set_spec; an absent clause is empty.
Parameters
$spec | Node |
Returns
list<Assignment>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call Lowering::form() line 287
- static-call ImplementationGap::production() line 292
- new ValueRule line 294
- method-call ListRule::items() line 296
- new ListRule line 296
- new Assignment line 302
- method-call ValueRule::value() line 302
public function bulk(array<string, Node> $parts): ?BulkOptionsLowers the options of a bulk load; none is null.
Parameters
$parts | array<string, Node> |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 326
- static-call ImplementationGap::production() line 330
- method-call LoadRule::flag() line 341
- new BulkOptions line 343
Private surface 6§
Implementation details, listed for orientation only.
private const STATEMENTS = ['load: LOAD data_or_xml load_data_lock opt_local INFILE TEXT_STRING_filesystem…private const FORMATS = ['data_or_xml: DATA_SYM' => \SqlSemantics\Platform\MySql\Statement\Dml\Load\Loa…private const LOCKS = ['load_data_lock:' => null, 'load_data_lock: CONCURRENT' => \SqlSemantics\Platf…private const SOURCES = ['load_source_type: INFILE_SYM' => \SqlSemantics\Platform\MySql\Statement\Dml\L…private const FLAGS = ['opt_local:' => false, 'opt_local: LOCAL_SYM' => true, 'opt_source_order:' => …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
LoadRuleTestcalls