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

A privilege in the role list of GRANT … TO or REVOKE … FROM, or a role written with a host in a privilege list.

The grammar accepts both, and the server then rejects the statement with a syntax error: "Illegal authorization identifier" for a privilege read as a role, "Illegal privilege identifier" for a role read as a privilege (PT_role_or_privilege::get_user and get_privilege). Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html#grant-roles.

Describing the problemdoctest
(new \SqlSemantics\Platform\MySql\Statement\Account\Problem\RoleOrPrivilegeMismatch('SELECT', true))->message() // => 'SELECT is not a role: illegal authorization identifier.'

Properties§

public string $item
public bool $roleExpected

Methods§

public function __construct(public string $item, public bool $roleExpected)

Parameters

$itemstringThe item as a person reads it
$roleExpectedboolWhether the statement reads the item as a role
public function message(): string

Describes the problem.

Returns

string
Test cases 1

Test cases 4§

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 3

Relations§

Instantiated in 2