-
Notifications
You must be signed in to change notification settings - Fork 934
NH-3921 - Sequence support for Ingres9 #529
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
NH-3921 - Sequence support for Ingres9 #529
Conversation
For 5.0 since it might change behaviour. |
The failing test is DialectSupportingSequencesMustFullfillSequenceContract(). |
Dialect is missing implementations for |
@oskarb shall we install Ingres on a build agent? |
@hazzik I think the main concern about testing on Ingres or not is how much we should care about test failures, particularly in new test cases which are not specifically about Ingres. It does slow us down to fix failures for specific dialects, given that often it's not really a problem in NHibernate itself but rather that the test (accidentally) tries to use something not supported in a specific dialect or database engine, or there is something silly like a rounding difference. On the other hand, it does obviously lead to better quality if the dialects are tested and problems fixed immediately. What's the state of Ingres? With regards to what we test on today, it seems we are more likely to have cumbersome failures on platforms with a limited feature set (quite naturally). |
e01b553
to
1ad67c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Hibernate side, they have put the sequence support on the base class IngresDialect
, not on the Ingres9Dialect
. On Actian site, I do not find documentation for a version prior to the 10, so I have not checked Hibernate is right assuming Ingres supports sequence even before its 9 version.
Maybe should we anyway align on Hibernate for this.
QuerySequencesString
is not overridden though seems documented as required if sequences are supported (formulated the other way round indeed: "The select command; or null if sequences are not supported.")
Hibernate implementation for this is on IngresDialect return "select seq_name from iisequence";
, overridden again on Ingres9Dialect for appending a s
: return "select seq_name from iisequences";
. Ingres11 documents the former as a system catalog, and the later as a standard catalog
Beginning with Ingres9, Hibernate declares it supports pooled sequences. We should override SupportsPooledSequences
in Ingres9 dialect then. (No need to override GetCreateSequenceString(string, int, int)
overload, its default implementation is suitable according to Ingres11 documentation and Hibernate implementation.
public override string GetSelectSequenceNextValString(string sequenceName) | ||
{ | ||
return "next value for " + sequenceName; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For information, Hibernate use the alternate syntax: sequenceName + ".nextval"
. No indication in Ingres 11 documentation (nor in 10) if one of these syntaxes is supported since longer.
I am not sure Hibernate is a good source for this case though, since their GetSequenceNextValString
syntax is not even documented in previous links (they do not call GetSelectSequenceNextValString
, they return "select nextval for " + sequenceName
The way Ingres documentation is written let me think the "main" syntax is the one currently in this PR.
So for me, the syntax in this PR is good.
public override string GetDropSequenceString(string sequenceName) | ||
{ | ||
return "drop sequence " + sequenceName; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hibernate add after sequenceName
the keyword restrict
. Though documented only for other types of objects, it would be there for ignoring the drop if the sequence is referenced by another object in the database.
A bit conservative I think, and not done for other dialects, so I think above syntax is ok as currently is.
c4c3b96
to
98231b9
Compare
Rebased, and added a commit with my proposed minimal changes. |
I realize a bit late this one should have been re-planed for 6.0, not 5.1, because it changes the So either we revert this on master, or we accept this possible breaking change. |
It's not possible to undo mince. I'm voting to the option of overriding |
It is still doable with a revert PR, but adding noise in history. I was thinking about this option.
Ok, will do. |
Cleaned up version of PR #439.
https://nhibernate.jira.com/browse/NH-3921
Fixes #768