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

Decides what a statement does with a name by the kind of relation its declaration is.

Rule: MYSQL-RELATION-KIND-001. A CREATE VIEW declares a view; every other declaration MySQL provides is a base table. Where a statement needs a base table (ALTER TABLE, CREATE INDEX, CREATE TRIGGER, CREATE TABLE ... LIKE, HANDLER ... OPEN) a declared view is refused with ER_WRONG_OBJECT ("is

  • not BASE TABLE"); where it needs a view (ALTER VIEW, CREATE OR REPLACE

VIEW, SHOW CREATE VIEW, DROP VIEW) a declared base table is refused with ER_WRONG_OBJECT ("is not VIEW"). DROP TABLE does not find a view (ER_BAD_TABLE_ERROR, a note under IF EXISTS), nor does TRUNCATE TABLE (ER_NO_SUCH_TABLE). DROP VIEW IF EXISTS of a base table is refused in 8.1, 8.2, 8.3, 9.0 and 9.1 and only noted in the other releases. A declaration of a kind MySQL does not have (a materialized view, a foreign table, a sequence) decides nothing. Verified on live servers of each release. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-view.html, https://dev.mysql.com/doc/refman/8.4/en/drop-table.html, https://dev.mysql.com/doc/refman/8.4/en/create-view.html, https://dev.mysql.com/doc/refman/8.4/en/show-create-table.html, https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html. Status: Implemented.

Methods§

public function require(
    Derivation $derivation,
    QualifiedName $name,
    ?TableResolution $resolution,
    RelationKind $needed,
): void

Reports a refusal when a name the statement needs as one kind resolves to a declaration of the other.

Parameters

$derivationDerivation
$nameQualifiedName
$resolution?TableResolution
$neededRelationKindBaseTable or View
Test cases 1
Called from 9
Calls 6

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3

Relations§

Instantiated in 12
Method calls 12