classDropIndex
final class DropIndex
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.DROP INDEX name ON t [ALGORITHM = …] [LOCK = …]: a request to remove an index of a table.
Mirrors PT_drop_index_stmt. Rule: MYSQL-DROP-INDEX-001. The table resolves by MYSQL-CHANGE-TARGET-001 and its resolution is the relation fact of the statement node; PRIMARY names the primary key. A declaration context holds no indexes, so the index name is kept unresolved. The ALGORITHM and LOCK options are kept in the order written. The statement changes no declaration and provides none. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-index.html. Status: Implemented.
$drop = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('DROP INDEX i ON t LOCK SHARED');
[$drop->statement->index->value, $drop->toString()] // => ['i', 'DROP INDEX i ON t LOCK = SHARED']Properties§
public list<AlterOption> $optionspublic Name $indexpublic QualifiedName $tableMethods§
public function __construct(
public Name $index,
public QualifiedName $table,
list<AlterOption> $options = [],
)Parameters
$index | Name | The index name |
$table | QualifiedName | The table with its optional database |
$options | list<AlterOption> | The ALGORITHM and LOCK options in order |
Calls 3
- static-call Check::input() line 50
- static-call Check::listOf() line 51
- class-const AlterOption::class() line 51
public function deriveStatement(Derivation $derivation): voidRecords the resolution of the table and derives the options.
Parameters
$derivation | Derivation |
Calls 3
- method-call Derivation::target() line 59
- method-call Targets::target() line 59
- new Targets line 59
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 6
- method-call Output::keyword() line 70
- class-const NameUse::Label() line 70
- method-call Output::name() line 72
- class-const NameUse::Qualifier() line 72
- class-const NameUse::Relation() line 74
- method-call Output::node() line 76
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
DropIndexTestcalls