once now() is called in a statement, it forever returns the same value
Describe the bug A clear and concise description of what the bug is.
select now();
-- ... 3 days later ...
select now(); -- returns same old value
It's correctly caching now() so it returns the same value when used multiple times in the same query, but it shouldn't be caching the value past statement execution, correct?
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Would expect now() to return the same value for all instances in the same query, but a new value for a new statement in the same runtime context.
Additional context Add any other context about the problem here.
It's correctly caching now() so it returns the same value when used multiple times in the same query, but it shouldn't be caching the value past statement execution, correct?
You are right. This is a bug.
looks like now() is using the query_execution_start_time in session state which only created once per SessionContext
Agree -- now() should update between each statement but stay the same within a statement