classAlgorithmOption
final class AlgorithmOption
implements AlterOption, AlterModifier
uses Snapshot
@visibility public.ALGORITHM [=] DEFAULT | name: the algorithm the server must use for a table change.
The grammar reads the algorithm as an identifier; the server accepts INPLACE and COPY, INSTANT from 8.0 on, and the word DEFAULT spelled as an identifier in 5.6 and 5.7, compared without regard to case. Any other name is the diagnostic UnknownAlterChoice (MYSQL-ALTER-CHOICES-001). The name is kept as written; the keyword DEFAULT is the absent name. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-performance.
$option = new \SqlSemantics\Platform\MySql\Statement\Alter\Modifier\AlgorithmOption(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('INPLACE'));
$option->algorithm?->value // => 'INPLACE'Properties§
public Name|null $algorithmMethods§
public function __construct(public Name|null $algorithm)Parameters
$algorithm | Name|null | The algorithm name, or null for the keyword DEFAULT |
public function deriveOption(Derivation $derivation): voidReports an algorithm the server of the release does not know.
Parameters
$derivation | Derivation |
Called from 1
Calls 2
- method-call Choices::algorithm() line 47
- new Choices line 47
public function deriveCommand(Derivation $derivation, Environment $scope): voidDerives the option as an action of ALTER TABLE.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 1
- method-call AlgorithmOption::deriveOption() line 55
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 63
- method-call Output::name() line 67
- class-const NameUse::Label() line 67
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AlgorithmOptionTestcalls