classSetPassword
final class SetPassword
implements Statement
uses Snapshot
@visibility public.SET PASSWORD [FOR account] {= 'password' | TO RANDOM} [REPLACE 'current'] [RETAIN CURRENT PASSWORD]: a request to set an account's password.
Mirrors PT_option_value_no_option_type_password and its _for form (8.0), and set_var_password (5.x). Rule: MYSQL-SET-PASSWORD-001. Without FOR the session's own account is changed. The password is an operand with its exact value; TO RANDOM (8.0.18+) asks the server to generate one and return it as a result row. MySQL 5.x writes PASSWORD() or OLD_PASSWORD() around the string (Password). Source: https://dev.mysql.com/doc/refman/8.4/en/set-password.html, https://dev.mysql.com/doc/refman/5.7/en/set-password.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze("set password for app = 'pw' retain current password")->toString() // => "SET PASSWORD FOR app = 'pw' RETAIN CURRENT PASSWORD"Properties§
public Account|null $userpublic Password|null $passwordpublic Text|null $replace = nullpublic bool $retainCurrent = falseMethods§
public function __construct(
public Account|null $user,
public Password|null $password,
public Text|null $replace = null,
public bool $retainCurrent = false,
)Parameters
Calls 1
- static-call Check::input() line 43
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement names no relation and no expression.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 58
- method-call Output::symbol() line 65
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetPasswordTestcalls