classRoleOrPrivilegeMismatch
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.
(new \SqlSemantics\Platform\MySql\Statement\Account\Problem\RoleOrPrivilegeMismatch('SELECT', true))->message() // => 'SELECT is not a role: illegal authorization identifier.'Properties§
public string $itempublic bool $roleExpectedMethods§
public function __construct(public string $item, public bool $roleExpected)Parameters
$item | string | The item as a person reads it |
$roleExpected | bool | Whether the statement reads the item as a role |
public function message(): stringDescribes the problem.
Returns
stringTest cases 1
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.