final class MisplacedPrivilege
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

A privilege, a column list or an object kind that GRANT or REVOKE writes at a level that does not take it.

The server rejects the statement with the error the error field names: ER_ILLEGAL_GRANT_FOR_TABLE for a column list outside a table, a routine kind without a routine name, or a privilege outside TABLE_ACLS on a table or PROC_ACLS on a routine; ER_WRONG_USAGE for a privilege outside DB_ACLS on a database; ER_ILLEGAL_PRIVILEGE_LEVEL for a dynamic privilege outside the global level (only a warning under REVOKE IF EXISTS, which is not reported); ER_PARSE_ERROR for a column list on a routine. Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html#grant-privilege-levels, https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html.

Describing the problemdoctest
(new \SqlSemantics\Platform\MySql\Statement\Account\Problem\MisplacedPrivilege('RELOAD', 'database shop', 'ER_WRONG_USAGE'))->message() // => 'RELOAD cannot be granted at database shop (ER_WRONG_USAGE).'

Properties§

public string $privilege
public string $level
public string $error

Methods§

public function __construct(
    public string $privilege,
    public string $level,
    public string $error,
)

Parameters

$privilegestringThe privilege, column list or object kind, as a person reads it
$levelstringThe level as the manual names it
$errorstringThe server error the statement fails with
public function message(): string

Describes the problem.

Returns

string
Test cases 1

Test cases 3§

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

Dedicated tests 1
Other tests reaching this symbol 2

Relations§

Instantiated in 6