Skip to content

Add Firebird 4 dialect #3166

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

Merged
merged 11 commits into from
Jan 23, 2023
Merged

Add Firebird 4 dialect #3166

merged 11 commits into from
Jan 23, 2023

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented Sep 26, 2022

TODO:

  • Fix tests
  • Run both Firebird 3 and Firebird 4

Fixes #3165

@hazzik hazzik changed the title WIP: Test using Firebird 4 WIP Test using Firebird 4 Sep 26, 2022
@hazzik
Copy link
Member Author

hazzik commented Sep 27, 2022

21 (+19 async) tests currently fail

Changes of CURRENT_TIMESTAMP:

LOCALTIMESTAMP was introduced in Firebird 3.0.4 and Firebird 2.5.9 as a synonym of CURRENT_TIMESTAMP. In Firebird 4.0, CURRENT_TIMESTAMP returns a TIMESTAMP WITH TIME ZONE instead of a TIMESTAMP [WITHOUT TIME ZONE], while LOCALTIMESTAMP returns TIMESTAMP [WITHOUT TIME ZONE]. It is recommended to use LOCALTIMESTAMP when you do not need time zone information.

https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref40/fblangref40-contextvars-localtimestamp.html

Failing tests:

  • NHibernate.Test.DialectTest.DialectFixture.CurrentTimestampSelection
  • NHibernate.Test.DialectTest.MsSqlDialectFixture.CurrentTimestampSelection
  • NHibernate.Test.Hql.HQLFunctions.Current_TimeStamp
  • NHibernate.Test.Linq.PreEvaluationTests(False,False).CanSelectDateTimeNow
  • NHibernate.Test.Linq.PreEvaluationTests(False,True).CanSelectDateTimeNow

Other tests are failing because of INT128 type. Mainly in scenarios where the type get extended from INT/BIGINT.

@hazzik
Copy link
Member Author

hazzik commented Sep 27, 2022

@fredericDelaporte, @bahusoid should we just register CURRENT_TIMESTAMP as LOCALTIMESTAMP and CURRENT_TIMESTAMP_OFFSET as CURRENT_TIMESTAMP? In other words, do we want to keep compatibility with FB3 < 3.0.2 and FB2 < 2.5.9?

Or we create Firebird4Dialect with this mapping?

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Sep 28, 2022

It sounds safer to me to create a Firebird4Dialect overriding these. No risk of breaking changes for applications running on an older Firebird, and a quite natural way to fix these types for those having upgraded to Firebird4.

@bahusoid

This comment was marked as resolved.

@hazzik hazzik changed the title WIP Test using Firebird 4 WIP Firebird 4 Support Jan 18, 2023
@hazzik hazzik changed the title WIP Firebird 4 Support Add Firebird 4 dialect Jan 20, 2023
bahusoid
bahusoid previously approved these changes Jan 21, 2023
Copy link
Member

@bahusoid bahusoid left a comment

Choose a reason for hiding this comment

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

Looks good except:

This branch has conflicts that must be resolved

@hazzik
Copy link
Member Author

hazzik commented Jan 22, 2023

Resolved

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

Successfully merging this pull request may close these issues.

Add support for Firebird 4
3 participants