morrySnow opened a new pull request, #64366:
URL: https://github.com/apache/doris/pull/64366

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   FE constant folding evaluated each `now()` expression independently, so 
multiple `now()` calls in one query could produce different timestamps.
   
   This change records the query start timestamp in `StatementContext` and uses 
that value when folding `now()` and its aliases. It also propagates the 
timestamp through asynchronous materialized view analysis, rewrite, retry, and 
partition execution contexts. Server-side prepared statements reset the 
timestamp for each execution.
   
   ### Release note
   
   Ensure `now()` and its aliases return a consistent value within one query 
execution.
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - `./run-fe-ut.sh --run 
org.apache.doris.nereids.rules.expression.FoldConstantTest`
       - `./run-fe-ut.sh --run 
org.apache.doris.mtmv.MTMVPlanUtilTest,org.apache.doris.mtmv.MTMVTaskTest`
       - `cd fe && mvn checkstyle:check -pl fe-core`
   - Behavior changed: Yes. All `now()` calls within one execution use the same 
timestamp.
   - Does this need documentation: No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to