classPasswordAssignment
final class PasswordAssignment
implements SetItem
uses Snapshot
@visibility public.A password assignment among other assignments of a MySQL 5.6 SET: SET @a = 1, PASSWORD FOR u = PASSWORD('x').
Rule: MYSQL-SET-PASSWORD-001. MySQL 5.6 reads PASSWORD [FOR user] = … as one item of the SET list; it assigns the password of the account, or of the current user without FOR, in order with the other items. A SET whose only item is a password is the account statement SET PASSWORD of the account family. Facts: none; the password is a literal or a hashing call the account family models. Terminates: the parts are leaves. Source: https://dev.mysql.com/doc/refman/5.6/en/set-password.html, https://dev.mysql.com/doc/refman/5.6/en/set-variable.html. Status: Implemented.
$set = (new \SqlSemantics\Platform\MySql\Semantics('mysql-5.6.51'))->analyze("SET @a = 1, PASSWORD FOR u = 'x'");
[$set->statement->items[1]->user?->user->value, $set->toString()] // => ['u', "SET @a = 1, PASSWORD FOR u = 'x'"]Properties§
public Password $passwordpublic Account|null $user = nullMethods§
public function deriveItem(Derivation $derivation): voidDerives nothing: the parts are literals and account names.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites PASSWORD, the account, an equals sign and the password.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 55
- method-call Output::symbol() line 59
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.