This is an automated email from the ASF dual-hosted git repository.

CalvinKirs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 015c6a56c81 [feat](auth) Support MySQL-compatible dual password 
(RETAIN CURRENT PASSWORD / DISCARD OLD PASSWORD) (#66115)
015c6a56c81 is described below

commit 015c6a56c81580dc977225446f14c2ff2980417f
Author: Raghvendra Singh <[email protected]>
AuthorDate: Thu Nov 19 07:29:24 2026 +0530

    [feat](auth) Support MySQL-compatible dual password (RETAIN CURRENT 
PASSWORD / DISCARD OLD PASSWORD) (#66115)
    
    ### What problem does this PR solve?
    
    Issue: #66113
    
    `ALTER USER ... IDENTIFIED BY` is a hard cutover — the old password
    stops working the instant the statement commits, so every client
    embedding that account's password must be updated simultaneously or fail
    to authenticate. This makes online credential rotation impossible
    without a maintenance window.
    
    This adds MySQL 8.0-compatible **dual password** support so a password
    can be rotated while the previous one keeps working, on both `ALTER
    USER` and `SET PASSWORD`:
    
    ```sql
    ALTER USER u IDENTIFIED BY 'new' RETAIN CURRENT PASSWORD;   -- old password 
stays valid
    ALTER USER u IDENTIFIED BY 'new';                           -- secondary 
unchanged
    ALTER USER u DISCARD OLD PASSWORD;                          -- evict the 
retained one
    SET PASSWORD = PASSWORD('new') RETAIN CURRENT PASSWORD;
    ```
    
    Doris already mirrors MySQL account management (`PASSWORD_HISTORY`,
    `PASSWORD_EXPIRE`, `FAILED_LOGIN_ATTEMPTS`, `PASSWORD_LOCK_TIME`); this
    fills the remaining gap — `PASSWORD_EXPIRE` can force a rotation, but
    there was no way to comply with it online.
    
    **Why this matters now:** analytical databases are increasingly accessed
    by a large and growing population of machine identities — AI agents, MCP
    servers exposing SQL to LLMs, BI tools, autonomous pipelines — each
    holding a long-lived credential. Rotating a shared credential across
    such a fleet cannot be a synchronized hard cutover; an overlap window is
    the only way to do it online, and a stable principal (vs the
    alternating-account workaround) keeps `fe.audit.log` attribution clean.
    
    ### Semantics (mirrors the MySQL 8.0 manual)
    
    | Rule | MySQL manual |
    |---|---|
    | `RETAIN CURRENT PASSWORD` saves the current primary as the secondary;
    both authenticate | "the current password ... is retained as a secondary
    password" |
    | Exactly one secondary per user; the next `RETAIN` replaces it | dual =
    primary + one secondary |
    | A password change **without** `RETAIN` leaves an existing secondary
    **unchanged** | "the secondary password remains unchanged" |
    | An **empty** new password empties the secondary too, even with
    `RETAIN` | "the secondary password becomes empty as well" |
    | `RETAIN` on an account with an **empty primary** fails | "the
    statement fails" |
    | `DISCARD OLD PASSWORD` (ALTER USER only, as in MySQL) drops the
    secondary if one exists; cannot combine with a password change |
    "discards the secondary password, if one exists" |
    | A change of authentication method — binding the account to an
    authentication integration, unbinding it, or moving it between
    integrations — **discards** the secondary; `RETAIN` is refused across
    such a transition | "If the authentication plugin is changed, the
    secondary password is discarded" |
    | The dual password clauses are **privileged even on one's own account**
    | "The `APPLICATION_PASSWORD_ADMIN` privilege is required to use the
    `RETAIN CURRENT PASSWORD` or `DISCARD OLD PASSWORD` clause ... that
    apply to your own account" |
    
    ### Privileges (revised per review — thanks @CalvinKirs)
    
    The first cut left `SET PASSWORD ... RETAIN CURRENT PASSWORD`
    unprivileged on one's own account, like plain self-service `SET
    PASSWORD`. That is a hole: anyone who briefly holds an account's
    password could set their own, then `RETAIN` the real one back — leaving
    their password parked in the secondary slot as a persistent credential
    that nothing surfaces. MySQL requires `APPLICATION_PASSWORD_ADMIN` for
    the clauses even on one's own account for exactly this reason.
    
    Doris has no dynamic-privilege framework, so the clauses now require the
    **GRANT tier** (the same tier that already gates `ALTER USER` on other
    accounts):
    
    - plain self-service `SET PASSWORD` stays unprivileged — unchanged
    behavior;
    - `SET PASSWORD ... RETAIN CURRENT PASSWORD` requires global GRANT,
    **including on one's own account**;
    - the `ALTER USER` forms were already GRANT-gated by
    `AlterUserInfo.validate()`.
    
    A finer-grained `APPLICATION_PASSWORD_ADMIN`-style privilege — so a
    low-privilege service account can be *delegated* the ability to rotate
    itself with an overlap window without holding GRANT — is left as a
    follow-up — filed as #66198 (it needs a new `Privilege` bit and its own
    compatibility story, better reviewed separately).
    
    ### Design
    
    - **Storage**: `Password` gains a nullable secondary slot (GSON field
    `pwd2`). Absent in images/journals written before this change; ignored
    by binaries without it — tolerant in both directions, so no
    `FeMetaVersion` bump.
    - **Authentication**: primary is tried first, then the secondary,
    against **one snapshot** of the `Password` object, in one shared helper
    behind **both** existing check paths (`checkPasswordInternal` and
    `checkPasswordInternalForUser`), so every protocol lane (MySQL scramble,
    cleartext/LDAP fallback, Arrow Flight, HTTP, stream load) behaves
    identically. Failed-login policy fires only when both miss.
    - **Atomic swap**: a password change builds the full `Password` (new
    primary + carried secondary) and swaps it in as a single reference
    assignment — there is no window where the new primary is visible without
    the retained secondary, which is exactly the window a zero-downtime
    rotation must not have.
    - **Domain accounts**: every copy of a domain account's credentials
    carries **both** password slots (`Password.copyOf`) — the resolved-IP
    users the domain resolver materializes on its periodic pass *and* the
    immediate refresh of those entries right after a password change, an
    `ACCOUNT_LOCK`/`UNLOCK` or a `REQUIRE` change
    (`UserManager.refreshAuthenticationBinding`) — so the retained password
    authenticates on a domain account at once, with no resolver tick in
    between.
    - **Authentication bindings**: a binding transition (into, out of or
    between authentication integrations) retires the retained secondary
    instead of carrying it. The bound-user guard refuses native logins only
    *while* the account is bound, so a password retained before the
    external-authentication period would otherwise come back to life beside
    the new one once the account returns to native authentication. `RETAIN
    CURRENT PASSWORD` is refused into and out of a binding (the current
    password of a bound account is a generated placeholder). The decision is
    derived from the account's state plus the journal's binding, so a
    follower replays the same outcome.
    - **Replay**: the retain flag rides `PrivInfo` on the existing
    `OP_SET_PASSWORD`. `DISCARD OLD PASSWORD` journals an `OP_ALTER_USER`
    entry whose carrier op is `SET_PASSWORD_POLICY` with every option UNSET,
    plus a `discardOldPasswd` marker on `AlterUserOperationLog`. A
    pre-feature binary drops the unknown field and replays a policy update
    that changes nothing (every UNSET branch returns early and nothing is
    re-journaled; the one side effect is a default `PasswordPolicy` row for
    a user that had none, the same row its next login check creates), while
    a current binary reads the marker and drops the secondary. A new
    `AlterUserOpType` name is not journaled because an older FE deserializes
    an unknown enum name as `null` and fails replay, and an
    `OP_SET_PASSWORD` carrier would append the primary to the password
    history and refresh the password creation time (both found in review).
    - **Observability**: the `Password` column of `SHOW ALL GRANTS` / `SHOW
    GRANTS FOR` / `SHOW PROC '/auth'` reads `Yes (dual)` while an account
    holds a retained secondary, so an administrator can list every account
    whose previous password still authenticates (the auditing half of the
    privilege concern above). Authenticating with the retained secondary
    increments a new FE metric `doris_fe_secondary_password_auth_total`
    (plus a DEBUG line naming the account), so operators can confirm every
    consumer has converged on the new password before the next rotation
    evicts the old one. The metric fires only **after** account
    lock/expiration policy passes, so a rejected login never counts as a
    successful secondary authentication.
    - **Grammar**: `RETAIN`/`CURRENT`/`PASSWORD` tokens already existed;
    `DISCARD` and `OLD` are added as **nonReserved** keywords (still usable
    as identifiers).
    
    ### Deliberate differences from MySQL (called out for review)
    
    - **Privileges**: no dynamic-privilege framework in Doris, so GRANT tier
    instead of a dedicated `APPLICATION_PASSWORD_ADMIN` (see above;
    finer-grained privilege left as a follow-up).
    - **No per-user authentication plugins** in Doris, so MySQL's "changing
    the authentication plugin discards the secondary" rule has no analog.
    
    ### Out of scope (follow-ups)
    
    - A finer-grained `APPLICATION_PASSWORD_ADMIN`-equivalent privilege
    (delegated self-rotation without GRANT) — #66198.
    
    ### Rolling upgrade / downgrade
    
    Rolling upgrade: a binary without the change ignores `pwd2` and the
    flags, so it keeps single-password behavior. Until every FE runs this
    version, a not-yet-upgraded FE authenticates against the primary only: a
    login with the retained (old) password is rejected there, and it applies
    a `DISCARD` entry as a no-op. Run all FEs on this version before first
    using the clauses.
    
    Downgrade does not break replay or image load, but it is **not lossless
    once the clauses have been used**: an older binary drops `pwd2` when it
    loads an image and replays `retainPasswd` as a plain set-password, so
    every retained secondary is silently gone after a downgrade and does not
    come back on re-upgrade. Only the primary passwords survive. Re-issue
    `RETAIN CURRENT PASSWORD` after re-upgrading if an overlap window is
    still needed.
    
    ### Tests
    
    `DualPasswordTest`: retain / evict / discard chain; secondary preserved
    on a plain change; empty-new empties the secondary;
    retain-on-empty-primary fails; replay (retain + discard via `PrivInfo`,
    legacy-journal compatibility, old-binary interpretation of a discard
    entry); GSON forward/backward compatibility; parser (ALTER USER + SET
    PASSWORD clauses parse, retain-without-password rejected,
    `DISCARD`/`OLD` still valid as identifiers); **executed parsed
    commands** under a `ConnectContext` — `SET PASSWORD ... RETAIN` requires
    GRANT (rejected without, works with, journaled `PrivInfo` carries the
    flag, `FORWARD_WITH_SYNC` redirect), plain self `SET PASSWORD` stays
    unprivileged, `ALTER USER ... RETAIN` end-to-end, `DISCARD` journals as
    `OP_SET_PASSWORD` and never `OP_ALTER_USER`; account lock rejects
    **both** slots and rejected attempts don't increment the secondary-auth
    metric; domain-resolver refresh carries the retained secondary across a
    rotation, and a domain account authenticates both slots **immediately**
    after `RETAIN`, `ACCOUNT_UNLOCK` and `REQUIRE` (no periodic refresh in
    between); binding lifecycle — bind then unbind leaves the pre-binding
    passwords dead, `RETAIN` refused into and out of a binding, and the
    bind/unbind journals replayed from a retained credential. The `Password`
    column of `SHOW GRANTS` is asserted across retain / plain change /
    discard in both `DualPasswordTest` and `test_dual_password`; the suite's
    expiration step runs on a 16-second interval with 10 s + 8 s sleeps.
    
    ### Behavior change
    
    `ALTER USER` gains optional `RETAIN CURRENT PASSWORD` / `DISCARD OLD
    PASSWORD` clauses; `SET PASSWORD` gains an optional `RETAIN CURRENT
    PASSWORD` clause (requires GRANT, including on one's own account). No
    behavior change for statements that don't use them.
    
    ### Release note
    
    Support MySQL-compatible dual password (`RETAIN CURRENT PASSWORD` /
    `DISCARD OLD PASSWORD`) on `ALTER USER` and `SET PASSWORD` for
    zero-downtime credential rotation, and show which accounts hold a
    retained secondary in the `Password` column of `SHOW GRANTS` (`Yes
    (dual)`).
    
    ---------
    
    Signed-off-by: Raghvendra Singh <[email protected]>
    Co-authored-by: Claude Fable 5.1 <[email protected]>
    Co-authored-by: guoqiang <[email protected]>
---
 .../org/apache/doris/alter/AlterUserOpType.java    |   9 +-
 .../java/org/apache/doris/metric/MetricRepo.java   |   4 +
 .../org/apache/doris/mysql/privilege/Auth.java     | 156 +++-
 .../org/apache/doris/mysql/privilege/Password.java |  34 +
 .../org/apache/doris/mysql/privilege/User.java     |   5 +
 .../apache/doris/mysql/privilege/UserManager.java  | 179 ++++-
 .../doris/nereids/parser/LogicalPlanBuilder.java   |   8 +-
 .../trees/plans/commands/AlterUserCommand.java     |   4 +
 .../trees/plans/commands/info/AlterUserInfo.java   |  39 +
 .../trees/plans/commands/info/SetPassVarOp.java    |  30 +-
 .../doris/persist/AlterUserOperationLog.java       |  34 +
 .../java/org/apache/doris/persist/PrivInfo.java    |  18 +
 .../doris/mysql/privilege/DualPasswordTest.java    | 806 +++++++++++++++++++++
 .../antlr4/org/apache/doris/nereids/DorisLexer.g4  |   2 +
 .../antlr4/org/apache/doris/nereids/DorisParser.g4 |   6 +-
 .../suites/account_p0/test_dual_password.groovy    | 198 +++++
 16 files changed, 1495 insertions(+), 37 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/AlterUserOpType.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/AlterUserOpType.java
index 44977b4b316..da80a56d596 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/AlterUserOpType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/AlterUserOpType.java
@@ -25,5 +25,12 @@ public enum AlterUserOpType {
     LOCK_ACCOUNT,
     UNLOCK_ACCOUNT,
     MODIFY_COMMENT,
-    SET_TLS_REQUIRE
+    SET_TLS_REQUIRE,
+    // MySQL-compatible "DISCARD OLD PASSWORD": evict the retained secondary
+    // password. NB: this name is NEVER written to the journal — a pre-feature
+    // binary would deserialize the unknown enum value as null and fail replay.
+    // The entry is journaled with op = SET_PASSWORD_POLICY (every option
+    // UNSET, a no-op for such binaries) plus a discard marker; see
+    // AlterUserOperationLog.discardOldPassword / 
Auth.discardOldPasswordInternal.
+    DISCARD_OLD_PASSWORD
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/metric/MetricRepo.java 
b/fe/fe-core/src/main/java/org/apache/doris/metric/MetricRepo.java
index e49eba0a02d..2b7b9744476 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/metric/MetricRepo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/metric/MetricRepo.java
@@ -124,6 +124,7 @@ public final class MetricRepo {
     public static LongCounterMetric COUNTER_REQUEST_ALL;
     public static LongCounterMetric COUNTER_QUERY_ALL;
     public static LongCounterMetric COUNTER_QUERY_ERR;
+    public static LongCounterMetric COUNTER_SECONDARY_PASSWORD_AUTH;
     public static LongCounterMetric COUNTER_QUERY_SLOW;
     public static LongCounterMetric COUNTER_QUERY_TABLE;
     public static LongCounterMetric COUNTER_QUERY_OLAP_TABLE;
@@ -587,6 +588,9 @@ public final class MetricRepo {
         DORIS_METRIC_REGISTER.addMetrics(COUNTER_QUERY_ALL);
         COUNTER_QUERY_ERR = new LongCounterMetric("query_err", 
MetricUnit.REQUESTS, "total error query");
         DORIS_METRIC_REGISTER.addMetrics(COUNTER_QUERY_ERR);
+        COUNTER_SECONDARY_PASSWORD_AUTH = new 
LongCounterMetric("secondary_password_auth_total",
+                MetricUnit.REQUESTS, "total authentications with a retained 
secondary password");
+        DORIS_METRIC_REGISTER.addMetrics(COUNTER_SECONDARY_PASSWORD_AUTH);
         COUNTER_QUERY_SLOW = new LongCounterMetric("query_slow", 
MetricUnit.REQUESTS, "total slow query");
         DORIS_METRIC_REGISTER.addMetrics(COUNTER_QUERY_SLOW);
         COUNTER_QUERY_TABLE = new LongCounterMetric("query_table", 
MetricUnit.REQUESTS, "total query from table");
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java
index 67d54177bf0..aabc9773e85 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java
@@ -1192,10 +1192,19 @@ public class Auth implements Writable {
                 false /* set by resolver */, false);
     }
 
+    // MySQL-compatible SET PASSWORD ... RETAIN CURRENT PASSWORD: keep the
+    // previous password valid as the secondary password.
+    public void setPassword(UserIdentity userIdentity, byte[] password,
+            boolean retainCurrent) throws DdlException {
+        setPasswordInternal(userIdentity, password, null, true /* err on non 
exist */,
+                false /* set by resolver */, retainCurrent, false);
+    }
+
     public void replaySetPassword(PrivInfo info) {
         try {
             setPasswordInternal(info.getUserIdent(), info.getPasswd(), null, 
true /* err on non exist */,
-                    false /* set by resolver */, true, true, 
info.getAuthIntegration(), info.getAuthIdentity());
+                    false /* set by resolver */, info.isRetainPasswd(), true, 
true, info.getAuthIntegration(),
+                    info.getAuthIdentity());
         } catch (DdlException e) {
             LOG.error("should not happened", e);
         }
@@ -1203,31 +1212,76 @@ public class Auth implements Writable {
 
     public void setPasswordInternal(UserIdentity userIdent, byte[] password, 
UserIdentity domainUserIdent,
             boolean errOnNonExist, boolean setByResolver, boolean isReplay) 
throws DdlException {
-        setPasswordInternal(userIdent, password, domainUserIdent, 
errOnNonExist, setByResolver, isReplay,
-                false, null, null);
+        setPasswordInternal(userIdent, password, domainUserIdent, 
errOnNonExist, setByResolver,
+                false /* retain current password */, isReplay);
+    }
+
+    public void setPasswordInternal(UserIdentity userIdent, byte[] password, 
UserIdentity domainUserIdent,
+            boolean errOnNonExist, boolean setByResolver, boolean 
retainCurrent,
+            boolean isReplay) throws DdlException {
+        setPasswordInternal(userIdent, password, domainUserIdent, 
errOnNonExist, setByResolver,
+                retainCurrent, isReplay, false, null, null);
     }
 
     private void setPasswordInternal(UserIdentity userIdent, byte[] password, 
UserIdentity domainUserIdent,
-            boolean errOnNonExist, boolean setByResolver, boolean isReplay, 
boolean replaceBinding,
-            String authIntegration, String authIdentity) throws DdlException {
+            boolean errOnNonExist, boolean setByResolver, boolean 
retainCurrent, boolean isReplay,
+            boolean replaceBinding, String authIntegration, String 
authIdentity) throws DdlException {
         Preconditions.checkArgument(!setByResolver || domainUserIdent != null, 
setByResolver + ", " + domainUserIdent);
         writeLock();
         try {
             User user = userManager.getUserByUserIdentity(userIdent);
-            if (!isReplay && !replaceBinding && user != null && 
user.isAuthenticationBound()) {
+            boolean wasBound = user != null && user.isAuthenticationBound();
+            if (!isReplay && !replaceBinding && wasBound) {
                 throw new DdlException("SET PASSWORD is not supported for 
authentication-bound users; "
                         + "use ALTER USER ... IDENTIFIED BY");
             }
             if (!isReplay && authIntegration != null) {
                 userManager.checkDomainAuthenticationBinding(userIdent);
             }
+            if (!isReplay && retainCurrent && (wasBound || authIntegration != 
null)) {
+                // The "current password" of an authentication-bound account 
is a
+                // generated placeholder nobody holds: there is nothing to 
retain
+                // on the way out of a binding, and nothing worth keeping on 
the
+                // way in (native authentication is refused while bound).
+                throw new DdlException("Current password cannot be retained 
for user " + userIdent
+                        + (wasBound ? " because the account is bound to an 
authentication integration"
+                                : " while binding it to an authentication 
integration"));
+            }
             if (!isReplay && authIntegration == null) {
                 if (!passwdPolicyManager.checkPasswordHistory(userIdent, 
password)) {
                     
ErrorReport.reportDdlException(ErrorCode.ERR_CREDENTIALS_CONTRADICT_TO_HISTORY,
                             userIdent.getQualifiedUser(), userIdent.getHost());
                 }
+                if (retainCurrent) {
+                    // MySQL-compatible RETAIN CURRENT PASSWORD constraint:
+                    // "If you specify RETAIN CURRENT PASSWORD for an account
+                    // that has an empty primary password, the statement
+                    // fails." Checked here (not only at analysis) so every
+                    // caller is covered; skipped on replay (the journal
+                    // already passed this check). NB an EMPTY NEW password is
+                    // NOT an error — it empties the secondary as well (MySQL
+                    // semantics, handled in UserManager.setPassword).
+                    if (user == null || user.getPassword() == null
+                            || user.getPassword().getPassword() == null
+                            || user.getPassword().getPassword().length == 0) {
+                        throw new DdlException(
+                                "Current password cannot be retained for user 
" + userIdent
+                                        + " because it does not exist or is 
empty");
+                    }
+                }
             }
-            userManager.setPassword(userIdent, password, errOnNonExist);
+            // An authentication-binding transition (into, out of or between
+            // integrations) retires the retained secondary password instead of
+            // carrying it: MySQL discards the secondary password when the
+            // authentication plugin changes, and the bound-user guard refuses
+            // native logins only WHILE the account is bound, so a password
+            // retained before the external-authentication period would
+            // otherwise come back to life beside the new one once the account
+            // returns to native authentication. Derived from the account's
+            // state and the journal's binding, so a follower replays the same
+            // outcome.
+            boolean bindingChanges = wasBound || authIntegration != null;
+            userManager.setPassword(userIdent, password, errOnNonExist, 
retainCurrent, bindingChanges);
             if (replaceBinding && user != null) {
                 user.setAuthenticationBinding(authIntegration, authIdentity);
             }
@@ -1243,14 +1297,47 @@ public class Auth implements Writable {
             }
 
             if (!isReplay) {
-                PrivInfo info = new PrivInfo(userIdent, null, password, null, 
null);
+                PrivInfo info = new PrivInfo(userIdent, null, password, null, 
null, retainCurrent);
                 info.setAuthenticationBinding(authIntegration, authIdentity);
                 Env.getCurrentEnv().getEditLog().logSetPassword(info);
             }
         } finally {
             writeUnlock();
         }
-        LOG.info("finished to set password for {}. is replay: {}", userIdent, 
isReplay);
+        LOG.info("finished to set password for {}. is replay: {}, retain 
current: {}",
+                userIdent, isReplay, retainCurrent);
+    }
+
+    /**
+     * MySQL-compatible "ALTER USER ... DISCARD OLD PASSWORD": drop the
+     * retained secondary password. Not a password change, so the password
+     * policy state (history, creation time) is left untouched.
+     *
+     * <p>Journaled as an OP_ALTER_USER entry whose carrier op is
+     * SET_PASSWORD_POLICY with every option UNSET plus a discard marker
+     * ({@link AlterUserOperationLog#discardOldPassword}). An FE binary
+     * without this feature ignores the marker and replays a policy update
+     * that changes nothing, so the journal stays readable by pre-feature
+     * binaries with no side effect. A new AlterUserOpType name is not an
+     * option there (an unknown enum name deserializes as null and fails
+     * replay), and neither is OP_SET_PASSWORD with the unchanged primary (a
+     * pre-feature binary's set-password replay appends that primary to the
+     * password history and refreshes the password creation time).
+     */
+    private void discardOldPasswordInternal(UserIdentity userIdent, boolean 
isReplay) throws DdlException {
+        writeLock();
+        try {
+            userManager.discardOldPassword(userIdent, true /* err on non exist 
*/);
+            if (userIdent.isDomain()) {
+                userManager.refreshAuthenticationBinding(userIdent);
+            }
+            if (!isReplay) {
+                
Env.getCurrentEnv().getEditLog().logAlterUser(AlterUserOperationLog.discardOldPassword(userIdent));
+            }
+        } finally {
+            writeUnlock();
+        }
+        LOG.info("finished to discard old password for {}. is replay: {}", 
userIdent, isReplay);
     }
 
     public void setLdapPassword(String ldapPassword) {
@@ -1583,6 +1670,18 @@ public class Auth implements Writable {
         return userAuthInfos;
     }
 
+    /**
+     * The Password column of SHOW ALL GRANTS and SHOW PROC '/auth': "Yes 
(dual)" while the account also holds
+     * a retained secondary password (RETAIN CURRENT PASSWORD), so an 
administrator can list every account whose
+     * previous password still authenticates without reading the audit log for 
RETAIN clauses.
+     */
+    private static String passwordColumnOf(User user) {
+        if (!user.hasPassword()) {
+            return "No";
+        }
+        return user.hasSecondaryPassword() ? "Yes (dual)" : "Yes";
+    }
+
     private void getUserAuthInfo(List<List<String>> userAuthInfos, 
UserIdentity userIdent) {
         // AuthProcDir.TITLE_NAMES
         List<String> userAuthInfo = Lists.newArrayList();
@@ -1616,7 +1715,7 @@ public class Auth implements Writable {
                 // ============== Comment ==============
                 userAuthInfo.add(user.getComment());
                 // ============== Password ==============
-                userAuthInfo.add(user.hasPassword() && 
!user.isAuthenticationBound() ? "Yes" : "No");
+                userAuthInfo.add(user.isAuthenticationBound() ? "No" : 
passwordColumnOf(user));
                 // ============== RequireSan ==============
                 userAuthInfo.add(requireSan);
                 
userAuthInfo.add(Strings.nullToEmpty(user.getAuthIntegration()));
@@ -2123,7 +2222,8 @@ public class Auth implements Writable {
                     integration, info.getAuthIdentity(), 
info.getPasswordOptions());
             byte[] password = integration == null ? info.getPassword() : 
newBoundPassword();
             alterUserInternal(info.isIfExist(), info.getOpType(), 
info.getUserIdent(), password, null,
-                    info.getPasswordOptions(), info.getComment(), false, 
integration, identity);
+                    info.getPasswordOptions(), info.getComment(), 
info.isRetainCurrentPassword(), false,
+                    integration, identity);
         } finally {
             integrations.readUnlock();
         }
@@ -2131,7 +2231,14 @@ public class Auth implements Writable {
 
     public void replayAlterUser(AlterUserOperationLog log) {
         try {
-            alterUserInternal(true, log.getOp(), log.getUserIdent(), 
log.getPassword(), log.getRole(),
+            // A DISCARD OLD PASSWORD entry carries op = SET_PASSWORD_POLICY
+            // (a no-op for pre-feature binaries) plus the discard marker; the
+            // marker decides what this binary replays.
+            AlterUserOpType opType = log.isDiscardOldPassword() ? 
AlterUserOpType.DISCARD_OLD_PASSWORD : log.getOp();
+            // retainCurrent is always false here: the SET_PASSWORD
+            // branch (the only one it applies to) journals via
+            // logSetPassword/PrivInfo, which carries the flag itself.
+            alterUserInternal(true, opType, log.getUserIdent(), 
log.getPassword(), log.getRole(),
                     log.getPasswordOptions(), log.getComment(), true);
         } catch (DdlException e) {
             LOG.error("should not happen", e);
@@ -2141,12 +2248,13 @@ public class Auth implements Writable {
     private void alterUserInternal(boolean ifExists, AlterUserOpType opType, 
UserIdentity userIdent, byte[] password,
                                    String role, PasswordOptions 
passwordOptions, String comment,
                                    boolean isReplay) throws DdlException {
-        alterUserInternal(ifExists, opType, userIdent, password, role, 
passwordOptions, comment, isReplay, null, null);
+        alterUserInternal(ifExists, opType, userIdent, password, role, 
passwordOptions, comment,
+                false /* retain current password */, isReplay, null, null);
     }
 
     private void alterUserInternal(boolean ifExists, AlterUserOpType opType, 
UserIdentity userIdent, byte[] password,
-            String role, PasswordOptions passwordOptions, String comment, 
boolean isReplay,
-            String authIntegration, String authIdentity) throws DdlException {
+            String role, PasswordOptions passwordOptions, String comment, 
boolean retainCurrent,
+            boolean isReplay, String authIntegration, String authIdentity) 
throws DdlException {
         writeLock();
         try {
             if (!doesUserExist(userIdent)) {
@@ -2157,13 +2265,21 @@ public class Auth implements Writable {
             }
             switch (opType) {
                 case SET_PASSWORD:
-                    setPasswordInternal(userIdent, password, null, false, 
false, isReplay, true,
-                            authIntegration, authIdentity);
+                    setPasswordInternal(userIdent, password, null, false, 
false, retainCurrent, isReplay,
+                            true, authIntegration, authIdentity);
                     if (!isReplay && authIntegration != null && 
ConnectContext.get() != null) {
                         ConnectContext.get().getState().setOk(0, 1,
                                 "Local password policies and password history 
cleared");
                     }
                     break;
+                case DISCARD_OLD_PASSWORD:
+                    // MySQL-compatible "ALTER USER ... DISCARD OLD PASSWORD":
+                    // drop the retained secondary password and immediately
+                    // refresh a domain account's resolved-IP entries under the
+                    // same Auth write lock. Journals its own
+                    // OP_ALTER_USER entry (see discardOldPasswordInternal).
+                    discardOldPasswordInternal(userIdent, isReplay);
+                    break;
                 case SET_ROLE:
                     setRoleToUser(userIdent, role);
                     break;
@@ -2195,9 +2311,13 @@ public class Auth implements Writable {
                     || opType == AlterUserOpType.UNLOCK_ACCOUNT)) {
                 userManager.refreshAuthenticationBinding(userIdent);
             }
-            if (opType != AlterUserOpType.SET_PASSWORD && !isReplay) {
+            if (opType != AlterUserOpType.SET_PASSWORD && opType != 
AlterUserOpType.DISCARD_OLD_PASSWORD
+                    && !isReplay) {
                 // For SET_PASSWORD:
                 //      the edit log is wrote in "setPasswordInternal"
+                // For DISCARD_OLD_PASSWORD:
+                //      the edit log is wrote in "discardOldPasswordInternal"
+                //      (a no-op carrier for pre-feature binaries)
                 AlterUserOperationLog log = new AlterUserOperationLog(opType, 
userIdent, password, role,
                         passwordOptions, comment);
                 Env.getCurrentEnv().getEditLog().logAlterUser(log);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Password.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Password.java
index 3692b970f52..9650c5a2198 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Password.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Password.java
@@ -23,6 +23,14 @@ public class Password {
     @SerializedName(value = "pwd")
     private byte[] password;
 
+    // MySQL-compatible dual password: the previous (retained) password,
+    // preserved by ordinary password changes; replaced by the next RETAIN,
+    // discarded explicitly, or cleared by an empty password or binding change.
+    // Nullable; absent in images written before this feature (GSON tolerant
+    // in both directions).
+    @SerializedName(value = "pwd2")
+    private byte[] secondaryPassword;
+
     public Password() {
     }
 
@@ -30,6 +38,20 @@ public class Password {
         this.password = password;
     }
 
+    /**
+     * A new Password holding the same two slots. Every copy of an account's
+     * credentials (the resolved-IP entries the DomainResolver derives from a
+     * domain account, and their immediate refresh after an ALTER) must carry
+     * the retained secondary password as well: a copy built from the primary
+     * alone stops authenticating the old password on that entry right after
+     * a rotation with RETAIN CURRENT PASSWORD.
+     */
+    public static Password copyOf(Password source) {
+        Password copy = new Password(source.getPassword());
+        copy.setSecondaryPassword(source.getSecondaryPassword());
+        return copy;
+    }
+
     public byte[] getPassword() {
         return password;
     }
@@ -37,4 +59,16 @@ public class Password {
     public void setPassword(byte[] password) {
         this.password = password;
     }
+
+    public byte[] getSecondaryPassword() {
+        return secondaryPassword;
+    }
+
+    public void setSecondaryPassword(byte[] secondaryPassword) {
+        this.secondaryPassword = secondaryPassword;
+    }
+
+    public boolean hasSecondaryPassword() {
+        return secondaryPassword != null && secondaryPassword.length > 0;
+    }
 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/User.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/User.java
index 1ec75cab951..765c8279660 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/User.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/User.java
@@ -168,6 +168,11 @@ public class User implements Comparable<User>, 
GsonPostProcessable {
         return password != null && password.getPassword() != null && 
password.getPassword().length != 0;
     }
 
+    /** Whether the account also holds a retained secondary password (RETAIN 
CURRENT PASSWORD). */
+    public boolean hasSecondaryPassword() {
+        return password != null && password.hasSecondaryPassword();
+    }
+
     public String getComment() {
         return comment;
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserManager.java
index deabb9ec7d6..6dc4ed1315e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserManager.java
@@ -28,6 +28,7 @@ import org.apache.doris.common.PatternMatcherException;
 import org.apache.doris.common.io.Text;
 import org.apache.doris.common.io.Writable;
 import org.apache.doris.common.lock.MonitoredReentrantReadWriteLock;
+import org.apache.doris.metric.MetricRepo;
 import org.apache.doris.mysql.MysqlPassword;
 import org.apache.doris.persist.gson.GsonUtils;
 
@@ -149,8 +150,10 @@ public class UserManager implements Writable {
                         hasRemotePasswd(plain, remotePasswd));
             }
             UserIdentity curUser = user.getDomainUserIdentity();
-            if (comparePassword(user.getPassword(), remotePasswd, 
randomString, remotePasswdStr, plain)) {
+            int matchedSlot = matchUserPassword(user, remotePasswd, 
randomString, remotePasswdStr, plain);
+            if (matchedSlot != MATCH_NONE) {
                 
passwdPolicyMgr.checkAccountLockedAndPasswordExpiration(curUser);
+                reportSecondaryPasswordAuth(matchedSlot, remoteUser + "@" + 
remoteHost);
                 if (currentUser != null) {
                     currentUser.add(curUser);
                 }
@@ -180,8 +183,10 @@ public class UserManager implements Writable {
                     hasRemotePasswd(plain, remotePasswd));
         }
         UserIdentity currentIdentity = user.getDomainUserIdentity();
-        if (comparePassword(user.getPassword(), remotePasswd, randomString, 
remotePasswdStr, plain)) {
+        int matchedSlot = matchUserPassword(user, remotePasswd, randomString, 
remotePasswdStr, plain);
+        if (matchedSlot != MATCH_NONE) {
             
passwdPolicyMgr.checkAccountLockedAndPasswordExpiration(currentIdentity);
+            reportSecondaryPasswordAuth(matchedSlot, userIdentity.toString());
             if (currentUser != null) {
                 currentUser.add(currentIdentity);
             }
@@ -220,13 +225,62 @@ public class UserManager implements Writable {
         return remotePasswd.length == 0 ? "NO" : "YES";
     }
 
-    private boolean comparePassword(Password curUserPassword, byte[] 
remotePasswd,
+    // matchUserPassword results: which stored password slot matched.
+    private static final int MATCH_NONE = 0;
+    private static final int MATCH_PRIMARY = 1;
+    private static final int MATCH_SECONDARY = 2;
+
+    /**
+     * Try the primary password, then the retained secondary one
+     * (MySQL-compatible dual password: "RETAIN CURRENT PASSWORD"), against a
+     * SINGLE snapshot of the user's Password object (a concurrent password
+     * change swaps the whole object, so re-reading it could compare the two
+     * slots of two different generations). Returns which slot matched; the
+     * caller reports a secondary-slot match (log + metric) only AFTER account
+     * lock/expiration policy passes, so a rejected login never counts as a
+     * successful secondary authentication.
+     */
+    private int matchUserPassword(User user, byte[] remotePasswd,
+            byte[] randomString, String remotePasswdStr, boolean plain) {
+        Password pwd = user.getPassword();
+        if (comparePassword(pwd.getPassword(), remotePasswd, randomString, 
remotePasswdStr, plain)) {
+            return MATCH_PRIMARY;
+        }
+        if (pwd.hasSecondaryPassword()
+                && comparePassword(pwd.getSecondaryPassword(),
+                        remotePasswd, randomString, remotePasswdStr, plain)) {
+            return MATCH_SECONDARY;
+        }
+        return MATCH_NONE;
+    }
+
+    /**
+     * Report an authentication that succeeded via the retained secondary
+     * password, so operators can tell when all consumers have converged on
+     * the new password: the metric carries the count, and a DEBUG line names
+     * the account (at INFO this would be one line per reconnect of every
+     * consumer still on the old password). Call only after the account
+     * passed lock/expiration policy.
+     */
+    private void reportSecondaryPasswordAuth(int matchedSlot, String 
userDescription) {
+        if (matchedSlot != MATCH_SECONDARY) {
+            return;
+        }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("user {} authenticated with retained secondary 
password", userDescription);
+        }
+        if (MetricRepo.isInit) {
+            MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH.increase(1L);
+        }
+    }
+
+    private boolean comparePassword(byte[] savedPassword, byte[] remotePasswd,
             byte[] randomString, String remotePasswdStr, boolean plain) {
         // check password
         if (plain) {
-            return MysqlPassword.checkPlainPass(curUserPassword.getPassword(), 
remotePasswdStr);
+            return MysqlPassword.checkPlainPass(savedPassword, 
remotePasswdStr);
         } else {
-            byte[] saltPassword = 
MysqlPassword.getSaltFromPassword(curUserPassword.getPassword());
+            byte[] saltPassword = 
MysqlPassword.getSaltFromPassword(savedPassword);
             // when the length of password is zero, the user has no password
             return ((remotePasswd.length == saltPassword.length)
                     && (remotePasswd.length == 0
@@ -273,6 +327,18 @@ public class UserManager implements Writable {
     public User createUserWithoutLock(UserIdentity userIdent, byte[] pwd, 
UserIdentity domainUserIdent,
                                       boolean setByResolver, String comment)
             throws PatternMatcherException {
+        return createUserWithoutLock(userIdent, new Password(pwd), 
domainUserIdent, setByResolver, comment);
+    }
+
+    /**
+     * Variant taking a fully-built Password so callers can carry BOTH
+     * password slots (primary + retained secondary, MySQL-compatible dual
+     * password) in one atomic reference swap — used by the domain resolver
+     * when materializing resolved-IP users.
+     */
+    public User createUserWithoutLock(UserIdentity userIdent, Password pwd, 
UserIdentity domainUserIdent,
+                                      boolean setByResolver, String comment)
+            throws PatternMatcherException {
         if (userIdentityExistWithoutLock(userIdent, true)) {
             User userByUserIdentity = 
getUserByUserIdentityWithoutLock(userIdent);
             if (!userByUserIdentity.isSetByDomainResolver() && setByResolver) {
@@ -295,7 +361,9 @@ public class UserManager implements Writable {
 
         PatternMatcher hostPattern = PatternMatcher
                 .createMysqlPattern(userIdent.getHost(), 
CaseSensibility.HOST.getCaseSensibility());
-        User user = new User(userIdent, pwd, setByResolver, domainUserIdent, 
hostPattern, comment);
+        User user = new User(userIdent, pwd.getPassword(), setByResolver, 
domainUserIdent, hostPattern, comment);
+        // not yet published to nameToUsers — safe to swap in the full object
+        user.setPassword(pwd);
         List<User> nameToLists = nameToUsers.get(userIdent.getQualifiedUser());
         if (CollectionUtils.isEmpty(nameToLists)) {
             nameToLists = Lists.newArrayList(user);
@@ -370,6 +438,36 @@ public class UserManager implements Writable {
     }
 
     public void setPassword(UserIdentity userIdentity, byte[] password, 
boolean errOnNonExist) throws DdlException {
+        setPassword(userIdentity, password, errOnNonExist, false);
+    }
+
+    /**
+     * Set the user's password, with MySQL-compatible dual password semantics:
+     * with {@code retainCurrent} ("RETAIN CURRENT PASSWORD") the previous
+     * primary password becomes the secondary password and remains valid for
+     * authentication; without it an existing secondary password remains
+     * UNCHANGED (MySQL: "If an account has a secondary password and you
+     * change its primary password without specifying RETAIN CURRENT PASSWORD,
+     * the secondary password remains unchanged."). Setting an EMPTY password
+     * empties the secondary password as well, even with retain (also MySQL).
+     */
+    public void setPassword(UserIdentity userIdentity, byte[] password, 
boolean errOnNonExist,
+            boolean retainCurrent) throws DdlException {
+        setPassword(userIdentity, password, errOnNonExist, retainCurrent, 
false);
+    }
+
+    /**
+     * As above; with {@code discardSecondary} the retained secondary password
+     * is dropped instead of carried, whatever {@code retainCurrent} says. Used
+     * for an authentication-binding transition (into, out of or between
+     * authentication integrations): MySQL discards the secondary password
+     * when the authentication plugin changes, and a password retained before
+     * an external-authentication period must not come back to life beside
+     * the new one when the account returns to native authentication (the
+     * bound-user guard refuses native logins only WHILE the account is bound).
+     */
+    public void setPassword(UserIdentity userIdentity, byte[] password, 
boolean errOnNonExist,
+            boolean retainCurrent, boolean discardSecondary) throws 
DdlException {
         User user = getUserByUserIdentity(userIdentity);
         if (user == null) {
             if (errOnNonExist) {
@@ -377,7 +475,55 @@ public class UserManager implements Writable {
             }
             return;
         }
-        user.setPassword(password);
+        Password oldPassword = user.getPassword();
+        byte[] carried;
+        if (discardSecondary || password == null || password.length == 0) {
+            // a binding transition retires the secondary; an empty new 
password
+            // empties it as well, even with RETAIN CURRENT PASSWORD (MySQL
+            // semantics)
+            carried = null;
+        } else if (retainCurrent) {
+            carried = oldPassword == null ? null : oldPassword.getPassword();
+        } else {
+            carried = oldPassword == null ? null : 
oldPassword.getSecondaryPassword();
+        }
+        // Build the full Password first and swap it in as ONE reference
+        // assignment: authentication reads a single Password snapshot, so
+        // there must never be a window where the new primary is visible
+        // without the carried secondary — that window would reject exactly
+        // the old-password consumers this feature keeps alive.
+        Password newPassword = new Password(password);
+        newPassword.setSecondaryPassword(carried);
+        user.setPassword(newPassword);
+    }
+
+    /**
+     * MySQL-compatible "ALTER USER ... DISCARD OLD PASSWORD": drop the
+     * retained secondary password. A user without one is a silent no-op
+     * (MySQL behavior).
+     *
+     * <p>Swaps in a new {@link Password} holding the primary alone instead of
+     * clearing the slot in place, so that, like a password change, it never
+     * mutates a Password object authentication may be reading:
+     * matchUserPassword compares against one snapshot per generation.
+     *
+     * <p>For a domain account ({@code u@['example.com']}), the Auth caller
+     * immediately refreshes the resolved-IP entries under the same write lock,
+     * on both execution and replay, so they stop accepting the discarded
+     * password without waiting for the DomainResolver's next periodic pass.
+     */
+    public void discardOldPassword(UserIdentity userIdentity, boolean 
errOnNonExist) throws DdlException {
+        User user = getUserByUserIdentity(userIdentity);
+        if (user == null) {
+            if (errOnNonExist) {
+                throw new DdlException("user " + userIdentity + " does not 
exist");
+            }
+            return;
+        }
+        Password current = user.getPassword();
+        if (current != null && current.hasSecondaryPassword()) {
+            user.setPassword(new Password(current.getPassword()));
+        }
     }
 
     /** Keep already resolved domain entries consistent with the account's 
binding, TLS and manual lock. */
@@ -389,7 +535,12 @@ public class UserManager implements Writable {
             for (User user : nameToUsers.get(identity.getQualifiedUser())) {
                 if (user.isSetByDomainResolver() && 
identity.equals(user.getDomainUserIdentity())) {
                     user.setAuthenticationBinding(domain.getAuthIntegration(), 
domain.getAuthIdentity());
-                    user.setPassword(domain.getPassword().getPassword());
+                    // both slots: a primary-only copy would stop 
authenticating the
+                    // retained password on every resolved-IP entry right 
after a
+                    // rotation with RETAIN CURRENT PASSWORD (and after an
+                    // ACCOUNT_UNLOCK or REQUIRE change), until the 
DomainResolver's
+                    // next periodic pass rebuilt them
+                    user.setPassword(Password.copyOf(domain.getPassword()));
                     
user.setUserIdentity(createResolvedUserIdentity(identity.getQualifiedUser(),
                             user.getUserIdentity().getHost(), 
domain.getUserIdentity()));
                     user.setDomainUserIdentity(domain.getUserIdentity());
@@ -455,10 +606,16 @@ public class UserManager implements Writable {
                     for (String newIP : entry.getValue()) {
                         UserIdentity domainUserIdent = 
domainUser.getUserIdentity();
                         UserIdentity userIdent = 
createResolvedUserIdentity(userEntry.getKey(), newIP, domainUserIdent);
-                        byte[] password = 
domainUser.getPassword().getPassword();
-                        Preconditions.checkNotNull(password, entry.getKey());
+                        Password domainPassword = domainUser.getPassword();
+                        
Preconditions.checkNotNull(domainPassword.getPassword(), entry.getKey());
+                        // carry BOTH password slots: materializing the
+                        // resolved-IP user from the primary alone would evict
+                        // the retained secondary password (dual password) on
+                        // every resolver refresh after a rotation with
+                        // RETAIN CURRENT PASSWORD
+                        Password ipPassword = Password.copyOf(domainPassword);
                         try {
-                            User resolved = createUserWithoutLock(userIdent, 
password,
+                            User resolved = createUserWithoutLock(userIdent, 
ipPassword,
                                     domainUser.getUserIdentity(), true, "");
                             if (resolved.isSetByDomainResolver()) {
                                 
resolved.setAuthenticationBinding(domainUser.getAuthIntegration(),
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
index d3c7aa0c552..c7bac094768 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
@@ -5894,7 +5894,8 @@ public class LogicalPlanBuilder extends 
DorisParserBaseVisitor<Object> {
             userIdentity = visitUserIdentify(ctx.userIdentify());
         }
         passwordText = stripQuotes(ctx.STRING_LITERAL().getText());
-        return new SetPassVarOp(userIdentity, new PassVar(passwordText, 
ctx.isPlain != null));
+        return new SetPassVarOp(userIdentity, new PassVar(passwordText, 
ctx.isPlain != null),
+                ctx.retainCurrent != null);
     }
 
     @Override
@@ -8789,7 +8790,10 @@ public class LogicalPlanBuilder extends 
DorisParserBaseVisitor<Object> {
         PasswordOptions passwordOptions = 
visitPasswordOption(ctx.passwordOption());
         String comment = ctx.commentSpec() == null ? null : 
visitCommentSpec(ctx.commentSpec());
         TlsOptions tlsOptions = visitRequireClause(ctx.requireClause());
-        AlterUserInfo alterUserInfo = new AlterUserInfo(ifExist, userDesc, 
passwordOptions, comment, tlsOptions);
+        boolean retainCurrentPassword = ctx.retainCurrent != null;
+        boolean discardOldPassword = ctx.discardOld != null;
+        AlterUserInfo alterUserInfo = new AlterUserInfo(ifExist, userDesc, 
passwordOptions, comment, tlsOptions,
+                retainCurrentPassword, discardOldPassword);
         return new AlterUserCommand(alterUserInfo);
     }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterUserCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterUserCommand.java
index 39765e7cc63..1a02c2c40c7 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterUserCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterUserCommand.java
@@ -38,6 +38,10 @@ public class AlterUserCommand extends AlterCommand 
implements NeedAuditEncryptio
         this.alterUserInfo = alterUserInfo;
     }
 
+    public AlterUserInfo getAlterUserInfo() {
+        return alterUserInfo;
+    }
+
     @Override
     public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
         return visitor.visitAlterUserCommand(this, context);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/AlterUserInfo.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/AlterUserInfo.java
index 5316e9051a8..739874d7a82 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/AlterUserInfo.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/AlterUserInfo.java
@@ -45,15 +45,31 @@ public class AlterUserInfo {
     private PasswordOptions passwordOptions;
     private String comment;
     private TlsOptions tlsOptions;
+    // MySQL-compatible dual password clauses on ALTER USER
+    private boolean retainCurrentPassword;
+    private boolean discardOldPassword;
     private Set<AlterUserOpType> ops = Sets.newHashSet();
 
     public AlterUserInfo(boolean ifExist, UserDesc userDesc, PasswordOptions 
passwordOptions, String comment,
             TlsOptions tlsOptions) {
+        this(ifExist, userDesc, passwordOptions, comment, tlsOptions, false, 
false);
+    }
+
+    /**
+     * Full constructor carrying the MySQL-compatible dual password clauses:
+     * retainCurrentPassword = "RETAIN CURRENT PASSWORD" (keep the previous
+     * primary password valid as the secondary password), discardOldPassword =
+     * "DISCARD OLD PASSWORD" (drop the retained secondary password).
+     */
+    public AlterUserInfo(boolean ifExist, UserDesc userDesc, PasswordOptions 
passwordOptions, String comment,
+            TlsOptions tlsOptions, boolean retainCurrentPassword, boolean 
discardOldPassword) {
         this.ifExist = ifExist;
         this.userDesc = userDesc;
         this.passwordOptions = passwordOptions;
         this.comment = comment;
         this.tlsOptions = tlsOptions == null ? TlsOptions.notSpecified() : 
tlsOptions;
+        this.retainCurrentPassword = retainCurrentPassword;
+        this.discardOldPassword = discardOldPassword;
     }
 
     public AlterUserInfo(boolean ifExist, UserDesc userDesc, PasswordOptions 
passwordOptions, String comment) {
@@ -100,6 +116,14 @@ public class AlterUserInfo {
         return tlsOptions;
     }
 
+    public boolean isRetainCurrentPassword() {
+        return retainCurrentPassword;
+    }
+
+    public boolean isDiscardOldPassword() {
+        return discardOldPassword;
+    }
+
     /**
      * validate
      */
@@ -111,6 +135,21 @@ public class AlterUserInfo {
             ops.add(AlterUserOpType.SET_PASSWORD);
         }
 
+        // MySQL-compatible dual password clauses. RETAIN CURRENT PASSWORD is
+        // only meaningful on a password change (MySQL's grammar cannot even
+        // express it without one); DISCARD OLD PASSWORD is a standalone
+        // operation (combining it with a password change is rejected by the
+        // one-operation rule below, matching MySQL). An empty NEW password
+        // with RETAIN is NOT an error — it empties the secondary as well
+        // (MySQL semantics, applied in UserManager.setPassword).
+        if (retainCurrentPassword && !userDesc.hasPassword()) {
+            throw new AnalysisException(
+                    "RETAIN CURRENT PASSWORD requires a password change 
(IDENTIFIED BY)");
+        }
+        if (discardOldPassword) {
+            ops.add(AlterUserOpType.DISCARD_OLD_PASSWORD);
+        }
+
         // may be set comment to "", so not use `Strings.isNullOrEmpty`
         if (tlsOptions.hasRequireClause()) {
             ops.add(AlterUserOpType.SET_TLS_REQUIRE);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/SetPassVarOp.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/SetPassVarOp.java
index 0453ffeb52c..e060f27af3e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/SetPassVarOp.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/SetPassVarOp.java
@@ -34,12 +34,25 @@ import org.apache.doris.qe.ConnectContext;
 public class SetPassVarOp extends SetVarOp {
     private UserIdentity userIdent;
     private PassVar passVar;
+    // MySQL-compatible "RETAIN CURRENT PASSWORD": keep the previous password
+    // valid as the secondary password (dual password). Unlike a plain
+    // self-service password change, the clause is privileged even on one's
+    // OWN account (see validate) — otherwise anyone who briefly holds a
+    // password could park their own in the secondary slot as a persistent,
+    // invisible credential. MySQL gates the same clause behind
+    // APPLICATION_PASSWORD_ADMIN for exactly this reason.
+    private final boolean retainCurrentPassword;
 
     // The password in parameter is a hashed password.
     public SetPassVarOp(UserIdentity userIdent, PassVar passVar) {
+        this(userIdent, passVar, false);
+    }
+
+    public SetPassVarOp(UserIdentity userIdent, PassVar passVar, boolean 
retainCurrentPassword) {
         super(SetType.DEFAULT);
         this.userIdent = userIdent;
         this.passVar = passVar;
+        this.retainCurrentPassword = retainCurrentPassword;
     }
 
     @Override
@@ -62,13 +75,19 @@ public class SetPassVarOp extends SetVarOp {
         }
 
         // check privs.
-        // 1. this is user itself
-        if (isSelf) {
+        // 1. this is user itself. A plain password change on one's own
+        // account requires no privilege, but RETAIN CURRENT PASSWORD does
+        // (falls through to check 3): MySQL requires
+        // APPLICATION_PASSWORD_ADMIN for the clause even on one's own
+        // account, because otherwise anyone who briefly holds a password
+        // could park their own in the secondary slot as a persistent,
+        // invisible credential.
+        if (isSelf && !retainCurrentPassword) {
             return;
         }
 
         // 2. No user can set password for root expect for root user itself
-        if (userIdent.isRootUser()) {
+        if (!isSelf && userIdent.isRootUser()) {
             throw new AnalysisException("Can not set password for root user, 
except root itself");
         }
 
@@ -80,7 +99,7 @@ public class SetPassVarOp extends SetVarOp {
 
     @Override
     public void run(ConnectContext ctx) throws Exception {
-        ctx.getEnv().getAuth().setPassword(userIdent, passVar.getScrambled());
+        ctx.getEnv().getAuth().setPassword(userIdent, passVar.getScrambled(), 
retainCurrentPassword);
     }
 
     @Override
@@ -90,6 +109,9 @@ public class SetPassVarOp extends SetVarOp {
             sb.append(" FOR ").append(userIdent);
         }
         sb.append(" = '*XXX'");
+        if (retainCurrentPassword) {
+            sb.append(" RETAIN CURRENT PASSWORD");
+        }
         return sb.toString();
     }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/persist/AlterUserOperationLog.java 
b/fe/fe-core/src/main/java/org/apache/doris/persist/AlterUserOperationLog.java
index 90580c012f7..38318f89d13 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/persist/AlterUserOperationLog.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/persist/AlterUserOperationLog.java
@@ -45,6 +45,16 @@ public class AlterUserOperationLog implements Writable {
     @SerializedName(value = "comment")
     private String comment;
 
+    // MySQL-compatible "ALTER USER ... DISCARD OLD PASSWORD" marker. Such an
+    // entry is journaled with op = SET_PASSWORD_POLICY and every option UNSET,
+    // so an FE binary WITHOUT this feature (which ignores this field) replays
+    // it as a password-policy update that changes nothing, while a binary with
+    // the feature drops the retained secondary password. Absent in journals
+    // written before this feature (GSON default: false). See
+    // Auth.discardOldPasswordInternal.
+    @SerializedName(value = "discardOldPasswd")
+    private boolean discardOldPassword;
+
     public AlterUserOperationLog(AlterUserOpType opType, UserIdentity 
userIdent, byte[] password,
                                  String role, PasswordOptions passwordOptions, 
String comment) {
         this.op = opType;
@@ -55,10 +65,34 @@ public class AlterUserOperationLog implements Writable {
         this.comment = comment;
     }
 
+    /**
+     * The journal entry for "ALTER USER ... DISCARD OLD PASSWORD". Its carrier
+     * op is SET_PASSWORD_POLICY with {@link PasswordOptions#UNSET_OPTION}: on
+     * a pre-feature binary that replays as a no-op (every UNSET branch of the
+     * policy update returns early and no password is journaled), whereas an
+     * unknown AlterUserOpType name would deserialize as null and fail replay,
+     * and an OP_SET_PASSWORD carrier would append the primary to the password
+     * history and refresh the password creation time. The one side effect a
+     * pre-feature binary keeps is PasswordPolicyManager.getOrCreatePolicy
+     * inserting a default PasswordPolicy for a user that had none - the same
+     * row its next login check would create - so the carrier is a no-op for
+     * the policy values, not strictly for the policy table.
+     */
+    public static AlterUserOperationLog discardOldPassword(UserIdentity 
userIdent) {
+        AlterUserOperationLog log = new 
AlterUserOperationLog(AlterUserOpType.SET_PASSWORD_POLICY, userIdent,
+                null, null, PasswordOptions.UNSET_OPTION, null);
+        log.discardOldPassword = true;
+        return log;
+    }
+
     public AlterUserOpType getOp() {
         return op;
     }
 
+    public boolean isDiscardOldPassword() {
+        return discardOldPassword;
+    }
+
     public UserIdentity getUserIdent() {
         return userIdent;
     }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/PrivInfo.java 
b/fe/fe-core/src/main/java/org/apache/doris/persist/PrivInfo.java
index 3b79713b508..557e64d5439 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/persist/PrivInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/persist/PrivInfo.java
@@ -83,6 +83,12 @@ public class PrivInfo implements Writable {
         authIdentity = identity;
     }
 
+    // MySQL-compatible "RETAIN CURRENT PASSWORD" on a password change: keep
+    // the previous password valid as the secondary password. Absent in
+    // journals written before this feature (GSON default: false).
+    @SerializedName(value = "retainPasswd")
+    private boolean retainPasswd;
+
     private PrivInfo() {
 
     }
@@ -93,6 +99,14 @@ public class PrivInfo implements Writable {
         this(userIdent, privs, passwd, role, passwordOptions, null, null);
     }
 
+    // For set password with the MySQL-compatible RETAIN CURRENT PASSWORD
+    // clause (DISCARD OLD PASSWORD journals via AlterUserOperationLog instead)
+    public PrivInfo(UserIdentity userIdent, PrivBitSet privs, byte[] passwd, 
String role,
+            PasswordOptions passwordOptions, boolean retainPasswd) {
+        this(userIdent, privs, passwd, role, passwordOptions, null, null);
+        this.retainPasswd = retainPasswd;
+    }
+
     public PrivInfo(UserIdentity userIdent, PrivBitSet privs, byte[] passwd, 
String role,
             PasswordOptions passwordOptions, String comment, String userId) {
         this.userIdent = userIdent;
@@ -177,6 +191,10 @@ public class PrivInfo implements Writable {
         return passwd;
     }
 
+    public boolean isRetainPasswd() {
+        return retainPasswd;
+    }
+
     public String getRole() {
         return role;
     }
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/mysql/privilege/DualPasswordTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/mysql/privilege/DualPasswordTest.java
new file mode 100644
index 00000000000..24975e1af92
--- /dev/null
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/mysql/privilege/DualPasswordTest.java
@@ -0,0 +1,806 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.mysql.privilege;
+
+import org.apache.doris.alter.AlterUserOpType;
+import org.apache.doris.analysis.PasswordOptions;
+import org.apache.doris.analysis.RedirectStatus;
+import org.apache.doris.analysis.UserDesc;
+import org.apache.doris.analysis.UserIdentity;
+import org.apache.doris.authentication.AuthenticationIntegrationMgr;
+import org.apache.doris.authentication.AuthenticationIntegrationRuntime;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.AuthenticationException;
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.AuthProcDir;
+import org.apache.doris.datasource.InternalCatalog;
+import org.apache.doris.metric.LongCounterMetric;
+import org.apache.doris.metric.Metric.MetricUnit;
+import org.apache.doris.metric.MetricRepo;
+import org.apache.doris.mysql.MysqlPassword;
+import org.apache.doris.nereids.parser.NereidsParser;
+import org.apache.doris.nereids.trees.plans.commands.AlterUserCommand;
+import org.apache.doris.nereids.trees.plans.commands.CreateUserCommand;
+import org.apache.doris.nereids.trees.plans.commands.SetOptionsCommand;
+import org.apache.doris.nereids.trees.plans.commands.info.CreateUserInfo;
+import org.apache.doris.persist.AlterUserOperationLog;
+import org.apache.doris.persist.EditLog;
+import org.apache.doris.persist.PrivInfo;
+import org.apache.doris.persist.gson.GsonUtils;
+import org.apache.doris.qe.ConnectContext;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.MockedStatic;
+import org.mockito.Mockito;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MySQL-compatible dual password:
+ * ALTER USER ... IDENTIFIED BY ... RETAIN CURRENT PASSWORD keeps the previous
+ * password valid as the secondary across ordinary password changes, until
+ * another RETAIN, DISCARD, an empty password or a binding change replaces it.
+ */
+public class DualPasswordTest {
+
+    private Auth auth;
+    private Env env = Mockito.mock(Env.class);
+    private EditLog editLog = Mockito.mock(EditLog.class);
+    private AccessControllerManager accessManager = 
Mockito.mock(AccessControllerManager.class);
+    private InternalCatalog internalCatalog = 
Mockito.mock(InternalCatalog.class);
+    private AuthenticationIntegrationMgr integrations = new 
AuthenticationIntegrationMgr();
+    private AuthenticationIntegrationRuntime runtime = 
Mockito.mock(AuthenticationIntegrationRuntime.class);
+    private MockedStatic<Env> mockedEnvStatic;
+
+    @BeforeEach
+    public void setUp() throws Exception {
+        auth = new Auth();
+        mockedEnvStatic = Mockito.mockStatic(Env.class);
+        mockedEnvStatic.when(Env::getCurrentEnv).thenReturn(env);
+        Mockito.when(env.getAuth()).thenReturn(auth);
+        // createUser / alterUser take the authentication-integration read lock
+        
Mockito.when(env.getAuthenticationIntegrationMgr()).thenReturn(integrations);
+        // binding an account normalizes its AS identity through the runtime
+        
Mockito.when(env.getAuthenticationIntegrationRuntime()).thenReturn(runtime);
+        Mockito.when(runtime.normalizeBoundIdentity(Mockito.any(), 
Mockito.any()))
+                .thenAnswer(invocation -> invocation.getArgument(1));
+        Mockito.when(env.getEditLog()).thenReturn(editLog);
+        Mockito.when(env.getAccessManager()).thenReturn(accessManager);
+        // ConnectContext.setEnv reads the internal catalog name
+        Mockito.when(internalCatalog.getName()).thenReturn("internal");
+        Mockito.when(env.getInternalCatalog()).thenReturn(internalCatalog);
+    }
+
+    @AfterEach
+    public void tearDown() {
+        mockedEnvStatic.close();
+        ConnectContext.remove();
+    }
+
+    /** A connected session for executing parsed commands. */
+    private ConnectContext ctxFor(UserIdentity currentUser) {
+        ConnectContext ctx = new ConnectContext();
+        ctx.setEnv(env);
+        ctx.setCurrentUserIdentity(currentUser);
+        ctx.setThreadLocalInfo();
+        return ctx;
+    }
+
+    private void grantPriv(boolean hasGrantPriv) {
+        
Mockito.when(accessManager.checkGlobalPriv(Mockito.any(ConnectContext.class),
+                Mockito.eq(PrivPredicate.GRANT))).thenReturn(hasGrantPriv);
+    }
+
+    private UserIdentity createUser(String name) throws DdlException {
+        UserIdentity userIdentity = new UserIdentity(name, "%");
+        userIdentity.setIsAnalyzed();
+        CreateUserCommand createUserCommand = new CreateUserCommand(new 
CreateUserInfo(new UserDesc(userIdentity)));
+        auth.createUser(createUserCommand.getInfo());
+        return userIdentity;
+    }
+
+    private boolean canLogin(String user, String plainPassword) {
+        try {
+            auth.checkPlainPassword(user, "192.168.1.1", plainPassword, null);
+            return true;
+        } catch (AuthenticationException e) {
+            return false;
+        }
+    }
+
+    /** An authentication integration accounts can be bound to (IDENTIFIED 
WITH AUTHENTICATION INTEGRATION). */
+    private void createIntegration(String name) throws DdlException {
+        integrations.createAuthenticationIntegration(name, false,
+                Collections.singletonMap("type", "dual_password_test"), "", 
"root");
+    }
+
+    private void alterUser(ConnectContext ctx, String sql) throws Exception {
+        AlterUserCommand cmd = (AlterUserCommand) new 
NereidsParser().parseSingle(sql);
+        cmd.doRun(ctx, null);
+    }
+
+    private User userOf(UserIdentity identity) {
+        return auth.getUserManager().getUserByUserIdentity(identity);
+    }
+
+    @Test
+    public void testRetainEvictAndDiscard() throws DdlException {
+        UserIdentity user = createUser("rot");
+
+        // initial password p1
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        Assertions.assertTrue(canLogin("rot", "p1"));
+        Assertions.assertFalse(canLogin("rot", "p2"));
+
+        // p2 RETAIN CURRENT PASSWORD -> p1 and p2 both authenticate
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("rot", "p2"));
+        Assertions.assertTrue(canLogin("rot", "p1"));
+        Assertions.assertFalse(canLogin("rot", "p0"));
+
+        // p3 RETAIN -> the one-secondary rule evicts p1; p2 + p3 authenticate
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p3"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("rot", "p3"));
+        Assertions.assertTrue(canLogin("rot", "p2"));
+        Assertions.assertFalse(canLogin("rot", "p1"));
+
+        // p4 WITHOUT retain -> the secondary REMAINS UNCHANGED (MySQL: "the
+        // secondary password remains unchanged"); the replaced primary p3 is
+        // simply gone -> p4 + p2 authenticate, p3 does not
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p4"), null,
+                true, false, false /* no retain */, false);
+        Assertions.assertTrue(canLogin("rot", "p4"));
+        Assertions.assertFalse(canLogin("rot", "p3"));
+        Assertions.assertTrue(canLogin("rot", "p2"));
+
+        // p5 RETAIN, then DISCARD OLD PASSWORD (via the replay path, which is
+        // also what a follower executes) -> only p5 remains
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p5"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("rot", "p4"));
+        auth.replayAlterUser(AlterUserOperationLog.discardOldPassword(user));
+        Assertions.assertTrue(canLogin("rot", "p5"));
+        Assertions.assertFalse(canLogin("rot", "p4"));
+
+        // DISCARD with no secondary present: silent no-op (MySQL: discards
+        // the secondary password, "if one exists")
+        auth.replayAlterUser(AlterUserOperationLog.discardOldPassword(user));
+        Assertions.assertTrue(canLogin("rot", "p5"));
+    }
+
+    @Test
+    public void testRetainRequiresNonEmptyCurrentPassword() throws 
DdlException {
+        UserIdentity user = createUser("empty_cur");
+        // MySQL: "If you specify RETAIN CURRENT PASSWORD for an account that
+        // has an empty primary password, the statement fails."
+        Assertions.assertThrows(DdlException.class, () -> 
auth.setPasswordInternal(user,
+                MysqlPassword.makeScrambledPassword("p1"), null, true, false, 
true /* retain */, false));
+    }
+
+    @Test
+    public void testEmptyNewPasswordEmptiesSecondary() throws DdlException {
+        UserIdentity user = createUser("empty_new");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("empty_new", "p1"));
+
+        // MySQL: "If the new password ... is empty, the secondary password
+        // becomes empty as well, even if RETAIN CURRENT PASSWORD is given."
+        auth.setPasswordInternal(user, new byte[0], null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("empty_new", ""));
+        Assertions.assertFalse(canLogin("empty_new", "p1"));
+        Assertions.assertFalse(canLogin("empty_new", "p2"));
+    }
+
+    @Test
+    public void testRetainReplay() throws DdlException {
+        UserIdentity user = createUser("replayer");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+
+        // a follower replaying OP_SET_PASSWORD with retainPasswd=true must
+        // reach the same dual-slot state as the master
+        auth.replaySetPassword(new PrivInfo(user, null,
+                MysqlPassword.makeScrambledPassword("p2"), null, null, true /* 
retain */));
+        Assertions.assertTrue(canLogin("replayer", "p2"));
+        Assertions.assertTrue(canLogin("replayer", "p1"));
+
+        // and a replay without the flag (all journals written before this
+        // feature, plus any plain password change) behaves like a plain
+        // change: the primary is replaced, the secondary remains UNCHANGED
+        // (MySQL: "the secondary password remains unchanged")
+        auth.replaySetPassword(new PrivInfo(user, null,
+                MysqlPassword.makeScrambledPassword("p3"), null, null));
+        Assertions.assertTrue(canLogin("replayer", "p3"));
+        Assertions.assertFalse(canLogin("replayer", "p2"));
+        Assertions.assertTrue(canLogin("replayer", "p1"));
+    }
+
+    @Test
+    public void testGsonCompat() {
+        // round trip preserves the secondary slot
+        Password password = new 
Password(MysqlPassword.makeScrambledPassword("p2"));
+        
password.setSecondaryPassword(MysqlPassword.makeScrambledPassword("p1"));
+        Password reloaded = 
GsonUtils.GSON.fromJson(GsonUtils.GSON.toJson(password), Password.class);
+        Assertions.assertArrayEquals(password.getPassword(), 
reloaded.getPassword());
+        Assertions.assertArrayEquals(password.getSecondaryPassword(), 
reloaded.getSecondaryPassword());
+        Assertions.assertTrue(reloaded.hasSecondaryPassword());
+
+        // an image/journal written BEFORE this feature deserializes with an
+        // absent secondary slot -> unchanged single-password behavior
+        Password legacy = GsonUtils.GSON.fromJson(
+                GsonUtils.GSON.toJson(new 
Password(MysqlPassword.makeScrambledPassword("p1"))), Password.class);
+        Assertions.assertFalse(legacy.hasSecondaryPassword());
+        Assertions.assertNull(legacy.getSecondaryPassword());
+    }
+
+    @Test
+    public void testParser() {
+        NereidsParser parser = new NereidsParser();
+
+        AlterUserCommand retain = (AlterUserCommand) parser.parseSingle(
+                "ALTER USER u1 IDENTIFIED BY 'x' RETAIN CURRENT PASSWORD");
+        
Assertions.assertTrue(retain.getAlterUserInfo().isRetainCurrentPassword());
+        
Assertions.assertFalse(retain.getAlterUserInfo().isDiscardOldPassword());
+
+        AlterUserCommand discard = (AlterUserCommand) parser.parseSingle(
+                "ALTER USER u1 DISCARD OLD PASSWORD");
+        
Assertions.assertTrue(discard.getAlterUserInfo().isDiscardOldPassword());
+        
Assertions.assertFalse(discard.getAlterUserInfo().isRetainCurrentPassword());
+
+        AlterUserCommand plain = (AlterUserCommand) parser.parseSingle(
+                "ALTER USER u1 IDENTIFIED BY 'x'");
+        
Assertions.assertFalse(plain.getAlterUserInfo().isRetainCurrentPassword());
+        
Assertions.assertFalse(plain.getAlterUserInfo().isDiscardOldPassword());
+
+        // DISCARD and OLD are nonReserved: still valid as identifiers
+        parser.parseSingle("SELECT old, discard FROM discard.old");
+    }
+
+    @Test
+    public void testValidateRejectsRetainWithoutPasswordChange() {
+        // the clause parses on its own; the semantic rejection (RETAIN
+        // requires a password change) lives in AlterUserInfo.validate()
+        NereidsParser parser = new NereidsParser();
+        AlterUserCommand cmd = (AlterUserCommand) parser.parseSingle(
+                "ALTER USER u1 RETAIN CURRENT PASSWORD");
+        
Assertions.assertTrue(cmd.getAlterUserInfo().isRetainCurrentPassword());
+        Assertions.assertThrows(AnalysisException.class, () -> 
cmd.getAlterUserInfo().validate());
+    }
+
+    @Test
+    public void testSetPasswordRetainOverload() throws DdlException {
+        // SET PASSWORD ... RETAIN CURRENT PASSWORD routes through
+        // Auth.setPassword(user, pw, retain=true) — the self-service path a
+        // service account uses to rotate its own credential with an overlap.
+        UserIdentity user = createUser("setpw");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        Assertions.assertTrue(canLogin("setpw", "p1"));
+
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p2"), true 
/* retain */);
+        Assertions.assertTrue(canLogin("setpw", "p2"));         // new primary
+        Assertions.assertTrue(canLogin("setpw", "p1"));         // retained 
secondary
+
+        // a plain SET PASSWORD (retain=false) preserves the secondary (MySQL)
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p3"), 
false);
+        Assertions.assertTrue(canLogin("setpw", "p3"));
+        Assertions.assertTrue(canLogin("setpw", "p1"));         // still valid
+        Assertions.assertFalse(canLogin("setpw", "p2"));        // replaced 
primary gone
+    }
+
+    @Test
+    public void testSetPasswordRetainParses() {
+        // The clause parses on SET PASSWORD; no exception, RETAIN accepted.
+        NereidsParser parser = new NereidsParser();
+        parser.parseSingle("SET PASSWORD = PASSWORD('x') RETAIN CURRENT 
PASSWORD");
+        parser.parseSingle("SET PASSWORD FOR u1 = PASSWORD('x') RETAIN CURRENT 
PASSWORD");
+        // still parses WITHOUT the clause (back-compat)
+        parser.parseSingle("SET PASSWORD = PASSWORD('x')");
+    }
+
+    @Test
+    public void testSetPasswordRetainRequiresGrantPriv() throws Exception {
+        // RETAIN CURRENT PASSWORD is privileged EVEN on one's own account
+        // (MySQL requires APPLICATION_PASSWORD_ADMIN for the clause):
+        // otherwise anyone briefly holding a password could park their own in
+        // the secondary slot as a persistent hidden credential.
+        UserIdentity user = createUser("gated");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        ConnectContext ctx = ctxFor(user);
+
+        NereidsParser parser = new NereidsParser();
+        SetOptionsCommand cmd = (SetOptionsCommand) parser.parseSingle(
+                "SET PASSWORD = PASSWORD('p2') RETAIN CURRENT PASSWORD");
+        // a password change must always forward to master
+        Assertions.assertEquals(RedirectStatus.FORWARD_WITH_SYNC, 
cmd.toRedirectStatus());
+
+        grantPriv(false);
+        Assertions.assertThrows(AnalysisException.class, () -> cmd.run(ctx, 
null));
+        // nothing changed: p1 still the only valid password
+        Assertions.assertTrue(canLogin("gated", "p1"));
+        Assertions.assertFalse(canLogin("gated", "p2"));
+
+        grantPriv(true);
+        cmd.run(ctx, null);
+        Assertions.assertTrue(canLogin("gated", "p2"));
+        Assertions.assertTrue(canLogin("gated", "p1"));
+
+        // the journaled entry carries the retain flag
+        ArgumentCaptor<PrivInfo> captor = 
ArgumentCaptor.forClass(PrivInfo.class);
+        Mockito.verify(editLog, 
Mockito.atLeastOnce()).logSetPassword(captor.capture());
+        PrivInfo journaled = captor.getValue();
+        Assertions.assertTrue(journaled.isRetainPasswd());
+        // DISCARD never rides OP_SET_PASSWORD
+        Mockito.verify(editLog, 
Mockito.never()).logAlterUser(Mockito.any(AlterUserOperationLog.class));
+    }
+
+    @Test
+    public void testPlainSelfSetPasswordStaysUnprivileged() throws Exception {
+        // a plain self-service SET PASSWORD (no RETAIN) still requires no
+        // privilege — unchanged behavior
+        UserIdentity user = createUser("selfplain");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        ConnectContext ctx = ctxFor(user);
+        grantPriv(false);
+
+        NereidsParser parser = new NereidsParser();
+        SetOptionsCommand cmd = (SetOptionsCommand) parser.parseSingle("SET 
PASSWORD = PASSWORD('p2')");
+        cmd.run(ctx, null);
+        Assertions.assertTrue(canLogin("selfplain", "p2"));
+        Assertions.assertFalse(canLogin("selfplain", "p1"));
+    }
+
+    @Test
+    public void testAlterUserRetainExecution() throws Exception {
+        // execute the PARSED ALTER USER command end to end (validate + run),
+        // not just the parser flags
+        UserIdentity admin = createUser("adm");
+        UserIdentity user = createUser("target");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        ConnectContext ctx = ctxFor(admin);
+
+        NereidsParser parser = new NereidsParser();
+        AlterUserCommand cmd = (AlterUserCommand) parser.parseSingle(
+                "ALTER USER 'target'@'%' IDENTIFIED BY 'p2' RETAIN CURRENT 
PASSWORD");
+
+        grantPriv(false);
+        Assertions.assertThrows(AnalysisException.class, () -> cmd.doRun(ctx, 
null));
+        Assertions.assertTrue(canLogin("target", "p1"));
+        Assertions.assertFalse(canLogin("target", "p2"));
+
+        grantPriv(true);
+        cmd.doRun(ctx, null);
+        Assertions.assertTrue(canLogin("target", "p2"));
+        Assertions.assertTrue(canLogin("target", "p1"));
+
+        ArgumentCaptor<PrivInfo> captor = 
ArgumentCaptor.forClass(PrivInfo.class);
+        Mockito.verify(editLog, 
Mockito.atLeastOnce()).logSetPassword(captor.capture());
+        Assertions.assertTrue(captor.getValue().isRetainPasswd());
+    }
+
+    @Test
+    public void testDiscardJournalsAsNoOpPolicyEntry() throws Exception {
+        // DISCARD OLD PASSWORD journals an OP_ALTER_USER entry whose carrier
+        // op is SET_PASSWORD_POLICY with every option UNSET plus the discard
+        // marker. A pre-feature binary ignores the marker and replays a policy
+        // update that changes nothing; it must NOT ride OP_SET_PASSWORD (an
+        // old binary's set-password replay appends to the password history
+        // and refreshes the creation time) nor a new AlterUserOpType name (an
+        // old binary deserializes it as null and fails replay).
+        UserIdentity admin = createUser("adm2");
+        UserIdentity user = createUser("dsc");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("dsc", "p1"));
+        ConnectContext ctx = ctxFor(admin);
+        grantPriv(true);
+
+        NereidsParser parser = new NereidsParser();
+        AlterUserCommand cmd = (AlterUserCommand) parser.parseSingle("ALTER 
USER 'dsc'@'%' DISCARD OLD PASSWORD");
+        Mockito.clearInvocations(editLog); // the setup above journaled 
set-password entries of its own
+        cmd.doRun(ctx, null);
+        Assertions.assertTrue(canLogin("dsc", "p2"));
+        Assertions.assertFalse(canLogin("dsc", "p1"));
+
+        // never journaled as a set-password
+        Mockito.verify(editLog, 
Mockito.never()).logSetPassword(Mockito.any(PrivInfo.class));
+        ArgumentCaptor<AlterUserOperationLog> captor = 
ArgumentCaptor.forClass(AlterUserOperationLog.class);
+        Mockito.verify(editLog, 
Mockito.times(1)).logAlterUser(captor.capture());
+        AlterUserOperationLog journaled = captor.getValue();
+        Assertions.assertTrue(journaled.isDiscardOldPassword());
+        Assertions.assertEquals(AlterUserOpType.SET_PASSWORD_POLICY, 
journaled.getOp());
+        Assertions.assertNull(journaled.getPassword());
+        Assertions.assertNull(journaled.getRole());
+        Assertions.assertNull(journaled.getComment());
+        Assertions.assertEquals(PasswordOptions.UNSET, 
journaled.getPasswordOptions().getExpirePolicySecond());
+        Assertions.assertEquals(PasswordOptions.UNSET, 
journaled.getPasswordOptions().getHistoryPolicy());
+        Assertions.assertEquals(PasswordOptions.UNSET, 
journaled.getPasswordOptions().getLoginAttempts());
+        Assertions.assertEquals(PasswordOptions.UNSET, 
journaled.getPasswordOptions().getPasswordLockSecond());
+        Assertions.assertEquals(PasswordOptions.UNSET, 
journaled.getPasswordOptions().getAccountUnlocked());
+
+        // the marker survives the journal round trip, and the carrier op is
+        // what a pre-feature binary (which drops the unknown field) sees
+        AlterUserOperationLog reloaded = 
GsonUtils.GSON.fromJson(GsonUtils.GSON.toJson(journaled),
+                AlterUserOperationLog.class);
+        Assertions.assertTrue(reloaded.isDiscardOldPassword());
+        Assertions.assertEquals(AlterUserOpType.SET_PASSWORD_POLICY, 
reloaded.getOp());
+
+        // a CURRENT binary replaying the entry discards the secondary
+        UserIdentity follower = createUser("dsc2");
+        auth.setPassword(follower, MysqlPassword.makeScrambledPassword("p1"));
+        auth.setPasswordInternal(follower, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        
auth.replayAlterUser(AlterUserOperationLog.discardOldPassword(follower));
+        Assertions.assertTrue(canLogin("dsc2", "p2"));
+        Assertions.assertFalse(canLogin("dsc2", "p1"));
+    }
+
+    @Test
+    public void testDiscardReplayLeavesPasswordPolicyUntouched() throws 
Exception {
+        // The exact concern behind the carrier choice: replaying the DISCARD
+        // entry must leave the password policy state alone on BOTH a current
+        // binary and a pre-feature one (history entries, creation time).
+        UserIdentity user = createUser("pol");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        // an expire policy makes the creation time live (0 = never refreshed)
+        auth.getPasswdPolicyManager().updatePolicy(user, null, new 
PasswordOptions(
+                86400 /* expire */, 3 /* history */, PasswordOptions.UNSET, 
PasswordOptions.UNSET,
+                PasswordOptions.UNSET, PasswordOptions.UNSET));
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        PasswordPolicy policy = policyOf(user);
+        // a sentinel a refresh would overwrite (recent enough not to expire 
the password)
+        long sentinel = System.currentTimeMillis() - 12_345L;
+        policy.getExpirePolicy().passwordCreateTime = sentinel;
+        List<List<String>> before = 
auth.getPasswdPolicyManager().getPolicyInfo(user);
+        int historySize = historySizeOf(user);
+
+        // the pre-feature binary's view of the entry: the same carrier fields
+        // with the marker dropped (this IS the pre-feature replay code path:
+        // alterUserInternal(SET_PASSWORD_POLICY) is unchanged)
+        AlterUserOperationLog journaled = 
AlterUserOperationLog.discardOldPassword(user);
+        auth.replayAlterUser(new AlterUserOperationLog(journaled.getOp(), 
journaled.getUserIdent(),
+                journaled.getPassword(), journaled.getRole(), 
journaled.getPasswordOptions(),
+                journaled.getComment()));
+        Assertions.assertTrue(canLogin("pol", "p2"));
+        Assertions.assertTrue(canLogin("pol", "p1")); // a pre-feature binary 
keeps the secondary
+        Assertions.assertEquals(historySize, historySizeOf(user));
+        Assertions.assertEquals(sentinel, 
policy.getExpirePolicy().passwordCreateTime);
+        Assertions.assertEquals(before, 
auth.getPasswdPolicyManager().getPolicyInfo(user));
+
+        // the current binary's replay: the secondary goes, the policy stays
+        auth.replayAlterUser(journaled);
+        Assertions.assertTrue(canLogin("pol", "p2"));
+        Assertions.assertFalse(canLogin("pol", "p1"));
+        Assertions.assertEquals(historySize, historySizeOf(user));
+        Assertions.assertEquals(sentinel, 
policy.getExpirePolicy().passwordCreateTime);
+        Assertions.assertEquals(before, 
auth.getPasswdPolicyManager().getPolicyInfo(user));
+
+        // the contrast that ruled out an OP_SET_PASSWORD carrier: a plain
+        // set-password replay of the unchanged primary (what a pre-feature
+        // binary would have run) appends to the history and refreshes the
+        // creation time
+        auth.replaySetPassword(new PrivInfo(user, null, 
MysqlPassword.makeScrambledPassword("p2"), null, null));
+        Assertions.assertEquals(historySize + 1, historySizeOf(user));
+        Assertions.assertNotEquals(sentinel, 
policy.getExpirePolicy().passwordCreateTime);
+    }
+
+    private PasswordPolicy policyOf(UserIdentity user) throws Exception {
+        Field field = 
PasswordPolicyManager.class.getDeclaredField("policyMap");
+        field.setAccessible(true);
+        @SuppressWarnings("unchecked")
+        Map<UserIdentity, PasswordPolicy> policyMap = (Map<UserIdentity, 
PasswordPolicy>) field.get(
+                auth.getPasswdPolicyManager());
+        return policyMap.get(user);
+    }
+
+    private int historySizeOf(UserIdentity user) throws Exception {
+        Field field = PasswordPolicy.class.getDeclaredField("historyPolicy");
+        field.setAccessible(true);
+        return ((PasswordPolicy.HistoryPolicy) 
field.get(policyOf(user))).historyPasswords.size();
+    }
+
+    @Test
+    public void testSecondaryPasswordSubjectToAccountLock() throws Exception {
+        // account lock/expiration policy dominates the secondary slot: a
+        // locked account must reject BOTH passwords, and the secondary-auth
+        // success telemetry (log + metric) must NOT fire for a rejected
+        // attempt — it is emitted only after the policy check passes (see
+        // UserManager.reportSecondaryPasswordAuth)
+        boolean oldIsInit = MetricRepo.isInit;
+        LongCounterMetric oldCounter = 
MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH;
+        MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH = new 
LongCounterMetric("secondary_password_auth_total",
+                MetricUnit.REQUESTS, "test");
+        MetricRepo.isInit = true;
+        try {
+            UserIdentity admin = createUser("adm3");
+            UserIdentity user = createUser("lockacc");
+            auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+            auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                    true, false, true /* retain */, false);
+            Assertions.assertTrue(canLogin("lockacc", "p1"));
+            // an accepted secondary-slot authentication counts
+            Assertions.assertEquals(Long.valueOf(1L), 
MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH.getValue());
+
+            ConnectContext ctx = ctxFor(admin);
+            grantPriv(true);
+            NereidsParser parser = new NereidsParser();
+            AlterUserCommand policy = (AlterUserCommand) parser.parseSingle(
+                    "ALTER USER 'lockacc'@'%' FAILED_LOGIN_ATTEMPTS 1 
PASSWORD_LOCK_TIME 1 DAY");
+            policy.doRun(ctx, null);
+
+            // one failed attempt locks the account
+            Assertions.assertFalse(canLogin("lockacc", "wrong"));
+            // both slots now reject: the retained password does not bypass 
policy
+            Assertions.assertFalse(canLogin("lockacc", "p2"));
+            Assertions.assertFalse(canLogin("lockacc", "p1"));
+            // ... and the REJECTED secondary attempt did not count as a
+            // successful secondary authentication
+            Assertions.assertEquals(Long.valueOf(1L), 
MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH.getValue());
+        } finally {
+            MetricRepo.isInit = oldIsInit;
+            MetricRepo.COUNTER_SECONDARY_PASSWORD_AUTH = oldCounter;
+        }
+    }
+
+    @Test
+    public void testDomainResolverRefreshCarriesSecondary() throws Exception {
+        // resolver-materialized IP users must carry BOTH password slots:
+        // rebuilding them from the primary alone would evict the retained
+        // password on the next resolver refresh after a rotation
+        UserIdentity domainIdent = new UserIdentity("domuser", 
"mydomain.example", true);
+        domainIdent.setIsAnalyzed();
+        CreateUserCommand create = new CreateUserCommand(new 
CreateUserInfo(new UserDesc(domainIdent)));
+        auth.createUser(create.getInfo());
+        auth.setPassword(domainIdent, 
MysqlPassword.makeScrambledPassword("p1"));
+
+        auth.refreshUserPrivEntriesByResovledIPs(
+                ImmutableMap.of("mydomain.example", 
Sets.newHashSet("192.168.1.1")));
+        Assertions.assertTrue(canLogin("domuser", "p1"));
+
+        // rotate the domain user with RETAIN, then refresh (what the
+        // DomainResolver does periodically)
+        auth.setPasswordInternal(domainIdent, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        auth.refreshUserPrivEntriesByResovledIPs(
+                ImmutableMap.of("mydomain.example", 
Sets.newHashSet("192.168.1.1")));
+
+        Assertions.assertTrue(canLogin("domuser", "p2"));
+        // the retained password survives the refresh
+        Assertions.assertTrue(canLogin("domuser", "p1"));
+        Assertions.assertFalse(canLogin("domuser", "p0"));
+    }
+
+    @Test
+    public void testShowGrantsPasswordColumnTellsRetainedApart() throws 
DdlException {
+        // the auditing half of the privilege gate on the clauses: an
+        // administrator can list the accounts whose previous password still
+        // authenticates, instead of reading the audit log for RETAIN clauses
+        UserIdentity user = createUser("col");
+        ctxFor(user);
+        Assertions.assertEquals("No", passwordColumnOf(user));
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        Assertions.assertEquals("Yes", passwordColumnOf(user));
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertEquals("Yes (dual)", passwordColumnOf(user));
+        // a plain change keeps the secondary, and with it the marker
+        auth.setPasswordInternal(user, 
MysqlPassword.makeScrambledPassword("p3"), null,
+                true, false, false /* no retain */, false);
+        Assertions.assertEquals("Yes (dual)", passwordColumnOf(user));
+        auth.replayAlterUser(AlterUserOperationLog.discardOldPassword(user));
+        Assertions.assertEquals("Yes", passwordColumnOf(user));
+    }
+
+    @Test
+    public void testBindingTransitionDiscardsRetainedPassword() throws 
Exception {
+        // MySQL discards the secondary password when the authentication
+        // plugin changes. Here the bound-user guard refuses native logins only
+        // WHILE the account is bound, so a password retained before the
+        // binding would otherwise come back to life, beside the new one, when
+        // the account returns to native authentication.
+        createIntegration("bound");
+        UserIdentity admin = createUser("adm4");
+        UserIdentity user = createUser("rebound");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p2"), true 
/* retain */);
+        ConnectContext ctx = ctxFor(admin);
+        grantPriv(true);
+        Assertions.assertTrue(canLogin("rebound", "p1"));
+        Assertions.assertEquals("Yes (dual)", passwordColumnOf(user));
+
+        // into the binding: the retained password is dropped, not parked
+        alterUser(ctx, "ALTER USER 'rebound'@'%' IDENTIFIED WITH 
AUTHENTICATION INTEGRATION bound AS 'external'");
+        Assertions.assertTrue(userOf(user).isAuthenticationBound());
+        
Assertions.assertFalse(userOf(user).getPassword().hasSecondaryPassword());
+        Assertions.assertFalse(canLogin("rebound", "p1"));
+        Assertions.assertFalse(canLogin("rebound", "p2"));
+
+        // out of the binding: only the new password authenticates
+        alterUser(ctx, "ALTER USER 'rebound'@'%' IDENTIFIED BY 'p3'");
+        Assertions.assertFalse(userOf(user).isAuthenticationBound());
+        Assertions.assertTrue(canLogin("rebound", "p3"));
+        Assertions.assertFalse(canLogin("rebound", "p1"));
+        Assertions.assertFalse(canLogin("rebound", "p2"));
+        Assertions.assertEquals("Yes", passwordColumnOf(user));
+    }
+
+    @Test
+    public void testRetainIsRefusedAcrossBindingTransitions() throws Exception 
{
+        // the "current password" of a bound account is a generated placeholder
+        // nobody holds: nothing to retain on the way out of a binding, nothing
+        // worth keeping on the way in
+        createIntegration("bound");
+        UserIdentity admin = createUser("adm5");
+        UserIdentity user = createUser("placeholder");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        ConnectContext ctx = ctxFor(admin);
+        grantPriv(true);
+
+        // into a binding: RETAIN needs a password change (rejected at 
validation)
+        Assertions.assertThrows(AnalysisException.class, () -> alterUser(ctx,
+                "ALTER USER 'placeholder'@'%' IDENTIFIED WITH AUTHENTICATION 
INTEGRATION bound"
+                        + " RETAIN CURRENT PASSWORD"));
+        Assertions.assertFalse(userOf(user).isAuthenticationBound());
+        Assertions.assertTrue(canLogin("placeholder", "p1"));
+
+        // out of a binding: the placeholder is not a credential to keep
+        alterUser(ctx, "ALTER USER 'placeholder'@'%' IDENTIFIED WITH 
AUTHENTICATION INTEGRATION bound");
+        Assertions.assertThrows(DdlException.class, () -> alterUser(ctx,
+                "ALTER USER 'placeholder'@'%' IDENTIFIED BY 'p2' RETAIN 
CURRENT PASSWORD"));
+        Assertions.assertTrue(userOf(user).isAuthenticationBound());
+        Assertions.assertFalse(canLogin("placeholder", "p2"));
+        Assertions.assertFalse(canLogin("placeholder", "p1"));
+    }
+
+    @Test
+    public void testBindingTransitionReplayDiscardsRetainedPassword() throws 
Exception {
+        // a follower replays the bind and the unbind from their journals and
+        // must reach the same single-password state as the master
+        UserIdentity user = createUser("rebound_replay");
+        auth.setPassword(user, MysqlPassword.makeScrambledPassword("p1"));
+        auth.replaySetPassword(new PrivInfo(user, null,
+                MysqlPassword.makeScrambledPassword("p2"), null, null, true /* 
retain */));
+        Assertions.assertTrue(canLogin("rebound_replay", "p1"));
+
+        // the bind journals the generated placeholder plus the binding
+        PrivInfo bind = new PrivInfo(user, null, 
MysqlPassword.makeScrambledPassword("placeholder"), null, null);
+        bind.setAuthenticationBinding("bound", "external");
+        auth.replaySetPassword(bind);
+        Assertions.assertTrue(userOf(user).isAuthenticationBound());
+        
Assertions.assertFalse(userOf(user).getPassword().hasSecondaryPassword());
+
+        // the unbind journals a plain password change without a binding
+        auth.replaySetPassword(new PrivInfo(user, null, 
MysqlPassword.makeScrambledPassword("p3"), null, null));
+        Assertions.assertFalse(userOf(user).isAuthenticationBound());
+        Assertions.assertTrue(canLogin("rebound_replay", "p3"));
+        Assertions.assertFalse(canLogin("rebound_replay", "p1"));
+        Assertions.assertFalse(canLogin("rebound_replay", "p2"));
+    }
+
+    @Test
+    public void testDomainRetainAuthenticatesBothSlotsBeforeTheResolverTick() 
throws Exception {
+        // the resolved-IP entries of a domain account are rebuilt at once by
+        // UserManager.refreshAuthenticationBinding, long before the
+        // DomainResolver's periodic pass: that copy must carry both slots too,
+        // or the retained password is refused for up to a resolver tick right
+        // after the rotation (and again after an ACCOUNT_UNLOCK or REQUIRE
+        // change)
+        UserIdentity admin = createUser("adm6");
+        UserIdentity domainIdent = new UserIdentity("domuser2", 
"mydomain.example", true);
+        domainIdent.setIsAnalyzed();
+        auth.createUser(new CreateUserCommand(new CreateUserInfo(new 
UserDesc(domainIdent))).getInfo());
+        auth.setPassword(domainIdent, 
MysqlPassword.makeScrambledPassword("p1"));
+        auth.refreshUserPrivEntriesByResovledIPs(
+                ImmutableMap.of("mydomain.example", 
Sets.newHashSet("192.168.1.1")));
+        Assertions.assertTrue(canLogin("domuser2", "p1"));
+
+        // rotate with RETAIN and check at once: no periodic refresh in between
+        auth.setPasswordInternal(domainIdent, 
MysqlPassword.makeScrambledPassword("p2"), null,
+                true, false, true /* retain */, false);
+        Assertions.assertTrue(canLogin("domuser2", "p2"));
+        Assertions.assertTrue(canLogin("domuser2", "p1"));
+
+        // the same immediate refresh runs on ACCOUNT_UNLOCK and REQUIRE 
changes
+        ConnectContext ctx = ctxFor(admin);
+        grantPriv(true);
+        alterUser(ctx, "ALTER USER 'domuser2'@('mydomain.example') 
ACCOUNT_UNLOCK");
+        Assertions.assertTrue(canLogin("domuser2", "p1"));
+        alterUser(ctx, "ALTER USER 'domuser2'@('mydomain.example') REQUIRE 
NONE");
+        Assertions.assertTrue(canLogin("domuser2", "p2"));
+        Assertions.assertTrue(canLogin("domuser2", "p1"));
+        Assertions.assertFalse(canLogin("domuser2", "p0"));
+    }
+
+    @Test
+    public void testDomainDiscardRevokesSecondaryBeforeTheResolverTick() 
throws Exception {
+        UserIdentity admin = createUser("domain_discard_admin");
+        UserIdentity domainIdent = new UserIdentity("domain_discard", 
"mydomain.example", true);
+        domainIdent.setIsAnalyzed();
+        auth.createUser(new CreateUserCommand(new CreateUserInfo(new 
UserDesc(domainIdent))).getInfo());
+        auth.setPassword(domainIdent, 
MysqlPassword.makeScrambledPassword("p1"));
+        auth.refreshUserPrivEntriesByResovledIPs(
+                ImmutableMap.of("mydomain.example", 
Sets.newHashSet("192.168.1.1")));
+        Assertions.assertTrue(canLogin("domain_discard", "p1"));
+
+        ConnectContext ctx = ctxFor(admin);
+        grantPriv(true);
+        alterUser(ctx, "ALTER USER 'domain_discard'@('mydomain.example')"
+                + " IDENTIFIED BY 'p2' RETAIN CURRENT PASSWORD");
+        Assertions.assertTrue(canLogin("domain_discard", "p2"));
+        Assertions.assertTrue(canLogin("domain_discard", "p1"));
+
+        // No periodic resolver refresh between the rotation, DISCARD and 
login checks.
+        Mockito.clearInvocations(editLog);
+        alterUser(ctx, "ALTER USER 'domain_discard'@('mydomain.example') 
DISCARD OLD PASSWORD");
+        Assertions.assertFalse(canLogin("domain_discard", "p1"));
+        Assertions.assertTrue(canLogin("domain_discard", "p2"));
+        Mockito.verify(editLog, 
Mockito.times(1)).logAlterUser(Mockito.any(AlterUserOperationLog.class));
+        Mockito.verify(editLog, 
Mockito.never()).logSetPassword(Mockito.any(PrivInfo.class));
+
+        // Repeating DISCARD without a secondary keeps the primary usable.
+        alterUser(ctx, "ALTER USER 'domain_discard'@('mydomain.example') 
DISCARD OLD PASSWORD");
+        Assertions.assertFalse(canLogin("domain_discard", "p1"));
+        Assertions.assertTrue(canLogin("domain_discard", "p2"));
+    }
+
+    @Test
+    public void testDomainDiscardReplayRevokesSecondaryBeforeTheResolverTick() 
throws Exception {
+        UserIdentity domainIdent = new UserIdentity("domain_discard_replay", 
"mydomain.example", true);
+        domainIdent.setIsAnalyzed();
+        auth.createUser(new CreateUserCommand(new CreateUserInfo(new 
UserDesc(domainIdent))).getInfo());
+        auth.setPassword(domainIdent, 
MysqlPassword.makeScrambledPassword("p1"));
+        auth.refreshUserPrivEntriesByResovledIPs(
+                ImmutableMap.of("mydomain.example", 
Sets.newHashSet("192.168.1.1")));
+        auth.replaySetPassword(new PrivInfo(domainIdent, null,
+                MysqlPassword.makeScrambledPassword("p2"), null, null, true));
+        Assertions.assertTrue(canLogin("domain_discard_replay", "p2"));
+        Assertions.assertTrue(canLogin("domain_discard_replay", "p1"));
+
+        AlterUserOperationLog journaled = 
AlterUserOperationLog.discardOldPassword(domainIdent);
+        AlterUserOperationLog reloaded = 
GsonUtils.GSON.fromJson(GsonUtils.GSON.toJson(journaled),
+                AlterUserOperationLog.class);
+        Mockito.clearInvocations(editLog);
+        auth.replayAlterUser(reloaded);
+        // Replay must revoke the resolved entry immediately, without a 
resolver tick or a new journal.
+        Assertions.assertFalse(canLogin("domain_discard_replay", "p1"));
+        Assertions.assertTrue(canLogin("domain_discard_replay", "p2"));
+        Mockito.verify(editLog, 
Mockito.never()).logAlterUser(Mockito.any(AlterUserOperationLog.class));
+        Mockito.verify(editLog, 
Mockito.never()).logSetPassword(Mockito.any(PrivInfo.class));
+    }
+
+    private String passwordColumnOf(UserIdentity user) {
+        List<List<String>> rows = auth.getAuthInfo(user);
+        Assertions.assertEquals(1, rows.size());
+        return rows.get(0).get(AuthProcDir.TITLE_NAMES.indexOf("Password"));
+    }
+}
diff --git 
a/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4 
b/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
index f23c812d449..091803a9072 100644
--- a/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
+++ b/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
@@ -208,6 +208,7 @@ DIAGNOSE: 'DIAGNOSE';
 DIAGNOSIS: 'DIAGNOSIS';
 DICTIONARIES: 'DICTIONARIES';
 DICTIONARY: 'DICTIONARY';
+DISCARD: 'DISCARD';
 DISK: 'DISK';
 DISTINCT: 'DISTINCT';
 DISTINCTPC: 'DISTINCTPC';
@@ -415,6 +416,7 @@ NULLS: 'NULLS';
 OBSERVER: 'OBSERVER';
 OF: 'OF';
 OFFSET: 'OFFSET';
+OLD: 'OLD';
 ON: 'ON';
 OFF: 'OFF';
 ONLY: 'ONLY';
diff --git 
a/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 
b/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
index 33d0115ebfc..380d614c6bc 100644
--- a/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
+++ b/fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
@@ -549,6 +549,7 @@ alterStatement
     | ALTER COLOCATE GROUP name=multipartIdentifier
         SET LEFT_PAREN propertyItemList RIGHT_PAREN                            
             #alterColocateGroup
     | ALTER USER (IF EXISTS)? grantUserIdentify
+        (retainCurrent=RETAIN CURRENT PASSWORD | discardOld=DISCARD OLD 
PASSWORD)?
         passwordOption requireClause? commentSpec?                             
             #alterUser
     ;
 
@@ -1238,7 +1239,8 @@ optionWithoutType
     | NAMES (charsetName=identifierOrText | DEFAULT)
         (COLLATE collateName=identifierOrText | DEFAULT)?               
#setCollate
     | PASSWORD (FOR userIdentify)? EQ (pwd=STRING_LITERAL
-        | (isPlain=PASSWORD LEFT_PAREN pwd=STRING_LITERAL RIGHT_PAREN)) 
#setPassword
+        | (isPlain=PASSWORD LEFT_PAREN pwd=STRING_LITERAL RIGHT_PAREN))
+        (retainCurrent=RETAIN CURRENT PASSWORD)?                        
#setPassword
     | LDAP_ADMIN_PASSWORD EQ (pwd=STRING_LITERAL
         | (PASSWORD LEFT_PAREN pwd=STRING_LITERAL RIGHT_PAREN))         
#setLdapAdminPassword
     | variable                                                          
#setVariableWithoutType
@@ -2375,6 +2377,7 @@ nonReserved
     | DIAGNOSIS
     | DICTIONARIES
     | DICTIONARY
+    | DISCARD
     | DISTINCTPC
     | DISTINCTPCSA
     | DO
@@ -2515,6 +2518,7 @@ nonReserved
     | OF
     | OFF
     | OFFSET
+    | OLD
     | ONLY
     | OPEN
     | OPTIMIZE
diff --git a/regression-test/suites/account_p0/test_dual_password.groovy 
b/regression-test/suites/account_p0/test_dual_password.groovy
new file mode 100644
index 00000000000..119017d1154
--- /dev/null
+++ b/regression-test/suites/account_p0/test_dual_password.groovy
@@ -0,0 +1,198 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// MySQL-compatible dual password: RETAIN CURRENT PASSWORD keeps the previous
+// password valid as a secondary password until the next retaining change or
+// an explicit DISCARD OLD PASSWORD. Covers rotation, eviction, discard, the
+// empty-password rules, the privilege gate on the clause, and the
+// interaction with the password history / expiration policies.
+suite("test_dual_password", "account,nonConcurrent") {
+    def user = "test_dual_password_user"
+    def tokens = context.config.jdbcUrl.split('/')
+    def url = tokens[0] + "//" + tokens[2] + "/" + "information_schema" + "?"
+
+    def canLogin = { String password ->
+        try {
+            connect(user, password, url) {
+                sql "SELECT 1"
+            }
+            return true
+        } catch (Exception e) {
+            logger.info("login of ${user} with '${password}' refused: " + 
e.getMessage())
+            assertTrue(e.getMessage().contains("Access denied") || 
e.getMessage().contains("authentication failed")
+                    || e.getMessage().contains("password has expired"), 
e.getMessage())
+            return false
+        }
+    }
+
+    def grantClusterUsage = {
+        if (isCloudMode()) {
+            def clusters = sql "SHOW CLUSTERS"
+            assertTrue(!clusters.isEmpty())
+            sql """GRANT USAGE_PRIV ON CLUSTER `${clusters[0][0]}` TO 
'${user}'@'%'"""
+        }
+    }
+
+    try_sql "DROP USER IF EXISTS '${user}'@'%'"
+    sql "CREATE USER '${user}'@'%' IDENTIFIED BY 'p1'"
+    grantClusterUsage()
+    assertTrue(canLogin("p1"))
+    assertFalse(canLogin("p2"))
+
+    // 1. rotation with RETAIN: both the new primary and the retained
+    //    secondary authenticate, anything else does not
+    sql "SET PASSWORD FOR '${user}'@'%' = PASSWORD('p2') RETAIN CURRENT 
PASSWORD"
+    assertTrue(canLogin("p2"))
+    assertTrue(canLogin("p1"))
+    assertFalse(canLogin("p3"))
+
+    // 2. a second RETAIN evicts the older secondary (one secondary slot)
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'p3' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin("p3"))
+    assertTrue(canLogin("p2"))
+    assertFalse(canLogin("p1"))
+
+    // 3. a change WITHOUT retain replaces the primary and leaves the
+    //    secondary unchanged (MySQL semantics)
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'p4'"
+    assertTrue(canLogin("p4"))
+    assertFalse(canLogin("p3"))
+    assertTrue(canLogin("p2"))
+
+    // 4. DISCARD OLD PASSWORD drops the secondary; repeating it with no
+    //    secondary present is a silent no-op
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertTrue(canLogin("p4"))
+    assertFalse(canLogin("p2"))
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertTrue(canLogin("p4"))
+
+    // 5. the clause is privileged even on one's own account: a plain
+    //    self-service SET PASSWORD works, RETAIN CURRENT PASSWORD does not
+    connect(user, "p4", url) {
+        sql "SET PASSWORD = PASSWORD('p5')"
+        test {
+            sql "SET PASSWORD = PASSWORD('p6') RETAIN CURRENT PASSWORD"
+            exception "Access denied"
+        }
+    }
+    assertTrue(canLogin("p5"))
+    assertFalse(canLogin("p4"))
+    assertFalse(canLogin("p6"))
+
+    // 6. RETAIN cannot be combined with an empty new password in a way that
+    //    keeps a secondary: an empty new password empties the secondary too
+    sql "SET PASSWORD FOR '${user}'@'%' = PASSWORD('p7') RETAIN CURRENT 
PASSWORD"
+    assertTrue(canLogin("p5"))
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY '' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin(""))
+    assertFalse(canLogin("p7"))
+    assertFalse(canLogin("p5"))
+
+    // 7. RETAIN on an account whose primary password is empty fails
+    test {
+        sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'p8' RETAIN CURRENT 
PASSWORD"
+        exception "cannot be retained"
+    }
+    assertTrue(canLogin(""))
+    assertFalse(canLogin("p8"))
+
+    // 8. RETAIN without a password change is rejected
+    test {
+        sql "ALTER USER '${user}'@'%' RETAIN CURRENT PASSWORD"
+        exception "RETAIN CURRENT PASSWORD requires a password change"
+    }
+
+    // 9. password history: a retaining change is still a password change,
+    //    so the new password must not contradict the history
+    sql "ALTER USER '${user}'@'%' PASSWORD_HISTORY 2"
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'h1'"
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'h2' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin("h2"))
+    assertTrue(canLogin("h1"))
+    test {
+        sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'h1' RETAIN CURRENT 
PASSWORD"
+        exception "contradict the password history policy"
+    }
+    // DISCARD is not a password change: the history is left as it was, so
+    // the discarded secondary still contradicts it and a fresh value passes
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertFalse(canLogin("h1"))
+    test {
+        sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'h1'"
+        exception "contradict the password history policy"
+    }
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'h3' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin("h3"))
+    assertTrue(canLogin("h2"))
+    sql "ALTER USER '${user}'@'%' PASSWORD_HISTORY 0"
+
+    // 10. password expiration: a retaining change restarts the expiry
+    //     clock (it is a password change); DISCARD does not touch it
+    sql "ALTER USER '${user}'@'%' PASSWORD_EXPIRE INTERVAL 16 SECOND"
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'e1' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin("e1"))
+    assertTrue(canLogin("h3"))
+    sleep(10000)
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertTrue(canLogin("e1"))
+    assertFalse(canLogin("h3"))
+    sleep(8000)
+    // >16s since the last password change: expired, although the discard
+    // happened only 8s ago
+    assertFalse(canLogin("e1"))
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'e2' RETAIN CURRENT PASSWORD"
+    assertTrue(canLogin("e2"))
+    assertTrue(canLogin("e1"))
+    sql "ALTER USER '${user}'@'%' PASSWORD_EXPIRE NEVER"
+
+    // 11. SHOW CREATE USER round-trips without the transient clauses
+    def created = sql "SHOW CREATE USER '${user}'@'%'"
+    assertEquals(1, created.size())
+    def createStmt = created[0].toString().toUpperCase()
+    assertFalse(createStmt.contains("RETAIN"))
+    assertFalse(createStmt.contains("DISCARD"))
+
+    // 12. the Password column of SHOW GRANTS tells an account that holds a
+    //     retained secondary apart ("Yes (dual)"), so an administrator can
+    //     find every account whose previous password still authenticates
+    def passwordColumn = {
+        def grants = sql "SHOW GRANTS FOR '${user}'@'%'"
+        assertEquals(1, grants.size())
+        return grants[0][2] // UserIdentity, Comment, Password, ...
+    }
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertEquals("Yes", passwordColumn())
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'c1' RETAIN CURRENT PASSWORD"
+    assertEquals("Yes (dual)", passwordColumn())
+    sql "ALTER USER '${user}'@'%' IDENTIFIED BY 'c2'"
+    assertEquals("Yes (dual)", passwordColumn())
+    sql "ALTER USER '${user}'@'%' DISCARD OLD PASSWORD"
+    assertEquals("Yes", passwordColumn())
+
+    // 13. DISCARD and OLD stay usable as identifiers
+    sql "DROP TABLE IF EXISTS test_dual_password_tbl"
+    sql """CREATE TABLE test_dual_password_tbl (old INT, discard INT) 
DISTRIBUTED BY HASH(old) BUCKETS 1
+            PROPERTIES ("replication_num" = "1")"""
+    sql "INSERT INTO test_dual_password_tbl VALUES (1, 2)"
+    def rows = sql "SELECT old, discard FROM test_dual_password_tbl"
+    assertEquals(1, rows[0][0])
+    assertEquals(2, rows[0][1])
+    sql "DROP TABLE IF EXISTS test_dual_password_tbl"
+
+    sql "DROP USER IF EXISTS '${user}'@'%'"
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to