classChoices
final class Choices
Checks the ALGORITHM and LOCK names of online data definition statements against the release.
Rule: MYSQL-ALTER-CHOICES-001. The server compares the name without regard to case with the values of its release: ALGORITHM INPLACE and COPY, INSTANT from 8.0 on, and DEFAULT as a name in 5.6 and 5.7 only; LOCK NONE, SHARED and EXCLUSIVE, and DEFAULT as a name in 5.6 and 5.7 only. The keyword DEFAULT is always accepted. Any other name is the diagnostic UnknownAlterChoice. Terminates: constant work. Source: https://github.com/mysql/mysql-server/blob/mysql-5.7.44/sql/sql_alter.cc (Alter_info::set_requested_algorithm, set_requested_lock), https://github.com/mysql/mysql-server/blob/mysql-8.4.7/sql/sql_yacc.yy (alter_algorithm_option_value, alter_lock_option_value). Status: Implemented.
Methods§
public function algorithm(?Name $name, Derivation $derivation): voidReports an ALGORITHM name the release does not know.
Parameters
$name | ?Name | |
$derivation | Derivation |
Called from 1
Calls 2
- method-call Choices::check() line 35
- method-call Choices::legacy() line 35
public function lock(?Name $name, Derivation $derivation): voidReports a LOCK name the release does not know.
Parameters
$name | ?Name | |
$derivation | Derivation |
Called from 1
Calls 2
- method-call Choices::check() line 43
- method-call Choices::legacy() line 43
public function legacy(Derivation $derivation): boolTells whether the release is 5.6 or 5.7.
Parameters
$derivation | Derivation |
Returns
boolCalled from 2
Calls 2
- class-const GrammarRelease::MySql5651() line 53
- class-const GrammarRelease::MySql5744() line 53
public function check(
?Name $name,
list<string> $known,
bool $lock,
Derivation $derivation,
): voidReports a name that is none of the known values.
Parameters
$name | ?Name | |
$known | list<string> | The values the server accepts, in upper case |
$lock | bool | |
$derivation | Derivation |
Called from 2
Calls 4
- function-call
in_arrayline 63 - function-call
strtoupperline 63 - method-call Derivation::report() line 64
- new UnknownAlterChoice line 64
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ChoicesTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Statement\Alter\Modifier\AlgorithmOption::deriveOption() packages/sql-semantics-mysql/src/Statement/Alter/Modifier/AlgorithmOption.php:47
- new SqlSemantics\Platform\MySql\Statement\Alter\Modifier\LockOption::deriveOption() packages/sql-semantics-mysql/src/Statement/Alter/Modifier/LockOption.php:46
Method calls 2
- method-call SqlSemantics\Platform\MySql\Statement\Alter\Modifier\AlgorithmOption::deriveOption() packages/sql-semantics-mysql/src/Statement/Alter/Modifier/AlgorithmOption.php:47
- method-call SqlSemantics\Platform\MySql\Statement\Alter\Modifier\LockOption::deriveOption() packages/sql-semantics-mysql/src/Statement/Alter/Modifier/LockOption.php:46