Skip to content

fix: EXPOSED-644 Can't use Instant.DISTANT_FUTURE as default value#2832

Open
Chantal Loncle (bog-walk) wants to merge 1 commit into
mainfrom
bog-walk/cover-instant-distant-future
Open

fix: EXPOSED-644 Can't use Instant.DISTANT_FUTURE as default value#2832
Chantal Loncle (bog-walk) wants to merge 1 commit into
mainfrom
bog-walk/cover-instant-distant-future

Conversation

@bog-walk

Copy link
Copy Markdown
Member

Description

Summary of the change: timestamp() columns now handle Instant.DISTANT_FUTURE passed as default value for databases that allow storing very large datetime values.

Detailed description:

  • Why: Instant.DISTANT_FUTURE is represented as a very large value that starts with '+' -> +100000-01-01T00:00:00Z. The databases that allow storing a value greater than 9999 are either unable to parse this type of string or incorrectly assume the value following '+' is part of a timezone, leading to syntax errors.

  • What: Basic .format() is replaced by a version that also trims unneeded '+' from LocalDateTime. Databases that don't allow large values continue to fail with "value out-of-range" errors, while databases that do allow large values, now accepts and returns this constant.


Type of Change

Please mark the relevant options with an "X":

  • Bug fix

Affected databases:

  • All

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

EXPOSED_644

Instant.DISTANT_FUTURE is represented as a very large value that starts with '+'.
Most databases are unable to parse this type of string or incorrectly assume following
values are part of timezone, leading to syntax errors.

This fix ensures any '+' character is trimmed before being passed as default value or
in statements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant