Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject non-constant date/time/timestamp literals [CORE5717] #5983

Closed
firebird-automations opened this issue Jan 19, 2018 · 7 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

There is date, time and timestamp literals with this syntax:

DATE '2018-01-01'
TIME '10:00:00'
TIMESTAMP '2018-01-01 10:00:00'

They are parsed at compile time.

However, there are weird situation with some literals.

We may use things as DATE 'TODAY', DATE 'TOMORROW', DATE 'YESTERDAY', TIME 'NOW' and TIMESTAMP 'NOW'.

And different than these strings used in CAST, these are literais
(evaluated at compile time).

So if you create a procedure/function with them, they value are
refreshed every time you recompile (from SQL) the routine, but never
refreshed when you run it.

Also imagine a compiled statement cache (implementation detail), a
"select timestamp 'now' from rdb$database" will give stalled results.

These strings will not be accepted with the literals syntax anymore.

Commits: 75d34f8 e84f443

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Fixed in branch work/time-zone-support.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

doc\README.incompatibilities.3to4.txt *DEFINITELY* needs to be fulfilled with this incompatibility. IMO.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> doc\README.incompatibilities.3to4.txt *DEFINITELY* needs to be fulfilled with this incompatibility. IMO.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants