classMisplacedPrivilege
final class MisplacedPrivilege
implements Diagnostic
uses Snapshot
@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.
(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 $privilegepublic string $levelpublic string $errorMethods§
public function __construct(
public string $privilege,
public string $level,
public string $error,
)Parameters
$privilege | string | The privilege, column list or object kind, as a person reads it |
$level | string | The level as the manual names it |
$error | string | The server error the statement fails with |
public function message(): stringDescribes the problem.
Returns
stringTest 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
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::level() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:114
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::level() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:120
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::fit() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:134
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::fit() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:136
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::fit() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:143
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::fit() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:149