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

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

$loweringLoweringThe lowering this rule belongs to
public function format(Node $node): LoadFormat

Lowers a node of data_or_xml.

Parameters

$nodeNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function lock(Node $node): ?LoadLock

Lowers a node of load_data_lock; no modifier is null.

Parameters

$nodeNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function source(Node $node): LoadSource

Lowers a node of load_source_type.

Parameters

$nodeNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function input(array<string, Node> $parts): LoadInput

Lowers what is read: LOCAL, the source kind, the file, COUNT and IN PRIMARY KEY ORDER.

Parameters

$partsarray<string, Node>

Returns

Throws

ImplementationGap When a production has no rule
AnalysisException When the word before the number of files is not COUNT
Called from 1
Calls 8
public function tagged(?Node $clause): ?Text

Lowers a node of opt_compression_algorithm or opt_xml_rows_identified_by; an absent clause is null.

Parameters

$clause?Node

Returns

Throws

ImplementationGap When a production has no rule
Called from 2
Calls 3
public function ignored(Node $clause): ?Numeral

Lowers a node of opt_ignore_lines; an absent clause is null.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
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

$specNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function assignments(Node $spec): list<Assignment>

Lowers a node of opt_load_data_set_spec; an absent clause is empty.

Parameters

$specNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 7
public function bulk(array<string, Node> $parts): ?BulkOptions

Lowers the options of a bulk load; none is null.

Parameters

$partsarray<string, Node>

Returns

Throws

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

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 $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 1
Method calls 1