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

Use Oracle date/timestamp literals instead of functions #2957

Merged
merged 2 commits into from
Apr 17, 2021

Conversation

jods4
Copy link
Contributor

@jods4 jods4 commented Apr 15, 2021

Oracle supports ANSI SQL dates literal, as well as timestamp literals, which are shorter and more readable then calling parsing functions:

  • DATE '2020-01-01'
  • TIMESTAMP '2020-01-01 10:30:00.1234567 +00:00'

Sadly, there's no such literal for dates with times, so this has to stay as TO_DATE('2020-01-01 10:00:00', 'YYYY-MON-DD HH24:MIN-SS')

@jods4
Copy link
Contributor Author

jods4 commented Apr 15, 2021

Do you know if this is covered by regression tests?

@sdanyliv
Copy link
Member

It should be. But I think you may broke lower Oracle versions.

@jods4
Copy link
Contributor Author

jods4 commented Apr 15, 2021

How low do we go? AFAIK it's at least supported in Oracle 10+ , which is really old and out of support.

@jods4
Copy link
Contributor Author

jods4 commented Apr 15, 2021

/azp run test-oracle

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jods4
Copy link
Contributor Author

jods4 commented Apr 15, 2021

There are regression tests for sure... they failed! 😄

They actually failed because they assert the presence of a specific literal expansion, which I've changed, so I need to update the tests accordingly.
Will do later.

@jods4
Copy link
Contributor Author

jods4 commented Apr 16, 2021

Interestingly I found out that the literal syntax was already used in some tests, see OracleTests.TestDateTimeOffset.

@jods4
Copy link
Contributor Author

jods4 commented Apr 16, 2021

/azp run test-oracle

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@linq2dbot
Copy link

Test baselines changed by this PR. Don't forget to merge/close baselines PR after this pr merged/closed.

@MaceWindu MaceWindu added this to the 3.4.0 milestone Apr 16, 2021
@jods4
Copy link
Contributor Author

jods4 commented Apr 16, 2021

Everything is green, only failure is Mac tests that were cancelled

Copy link
Contributor

@MaceWindu MaceWindu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@MaceWindu MaceWindu merged commit 8143110 into master Apr 17, 2021
@MaceWindu MaceWindu deleted the oracle-literal branch April 17, 2021 09:02
MaceWindu pushed a commit to linq2db/linq2db.baselines that referenced this pull request Apr 17, 2021
* [Linux / NETCOREAPP2.1 / Oracle 11g XE] baselines

* [Linux / NETCOREAPP2.1 / Oracle 12c] baselines

Co-authored-by: Azure Pipelines Bot <azp@linq2db.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants