public void execute() throws DdlException {
        Map<String, UserVariable> clonedUserVars = new ConcurrentHashMap<>();
        boolean hasUserVar = stmt.getSetListItems().stream().anyMatch(var -> var instanceof UserVariable);
        boolean executeSuccess = true;
        if (hasUserVar) {
            clonedUserVars.putAll(ctx.getUserVariables());
            ctx.modifyUserVariablesCopyInWrite(clonedUserVars);
        }
        try {
            for (SetListItem var : stmt.getSetListItems()) {
                setVariablesOfAllType(var);
            }
        } catch (Throwable e) {
            if (hasUserVar) {
                executeSuccess = false;
            }
            throw e;
        } finally {
            //If the set sql contains more than one user variable,
            //the atomicity of the modification of this set of variables must be ensured.
            if (hasUserVar) {
                ctx.resetUserVariableCopyInWrite();
                if (executeSuccess) {
                    ctx.modifyUserVariables(clonedUserVars);
                }
            }
        }
    }
@Test
    public void testNormal() throws UserException {
        List<SetListItem> vars = Lists.newArrayList();
        vars.add(new SetPassVar(new UserIdentity("testUser", "%"),
                "*88EEBA7D913688E7278E2AD071FDB5E76D76D34B"));
        vars.add(new SetNamesVar("utf8"));
        vars.add(new SystemVariable("query_timeout", new IntLiteral(10L)));

        SetStmt stmt = new SetStmt(vars);
        ctxToTestUser();
        com.starrocks.sql.analyzer.Analyzer.analyze(stmt, starRocksAssert.getCtx());
        SetExecutor executor = new SetExecutor(starRocksAssert.getCtx(), stmt);

        executor.execute();
    }