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.

Removing an index while allowing readsdoctest
$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> $options
public Name $index
public QualifiedName $table

Methods§

public function __construct(
    public Name $index,
    public QualifiedName $table,
    list<AlterOption> $options = [],
)

Parameters

$indexNameThe index name
$tableQualifiedNameThe table with its optional database
$optionslist<AlterOption>The ALGORITHM and LOCK options in order
Calls 3
public function deriveStatement(Derivation $derivation): void

Records the resolution of the table and derives the options.

Parameters

$derivationDerivation
Calls 3
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 6

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