-
Notifications
You must be signed in to change notification settings - Fork 96
MSSQL Schema update and validation #970
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
MSSQL Schema update and validation #970
Conversation
I'm not sure how it could be passing?!? I'm looking into it... |
@DavideD, take a look at the standard output for the SQL Server test: The
Later in the output, you'll see that the Later in the test, you'll see that Apparently, the Using a local ORM 5.6.0-SNAPSHOT, these messages are gone, and the drop/create sequence statements succeed. |
Thanks @gbadner, makes sense. |
Supersedes #967. |
We need to wait for hibernate/hibernate-orm#4235 to get merged and released before this PR can be merged. |
To clarify, after publishing the hibernate-core jar from hibernate/hibernate-orm#4235 (which is not merged yet) to a local repository, and setting gradle.properties to use that jar, the drop/create sequence statements succeed. |
Pushed a commit to fix inconsistent test arguments. |
@DavideD, is the DB2 test failure expected? |
I will restart the job... not sure why it failed |
@DavideD, I pulled your commit, confirmed the tests fail using 5.6.0.Beta2, and confirmed the tests pass using hibernate/hibernate-orm#4235. FWIW, specifying the catalog when creating a sequence on ORM worked fine. Vert.x throws an exception when the catalog is specified. SQL Server documentation of the |
c33cbd2
to
3b80f9c
Compare
Thanks @gbadner, I've updated the comment |
hibernate-reactive-core/src/test/java/org/hibernate/reactive/SchemaUpdateSqlServerTestBase.java
Outdated
Show resolved
Hide resolved
5a78810
to
dca6ad6
Compare
tested successfully locally with default ORM 5.6.0.Beta2 as well as my local 5.6.0-SNAPSHOT |
@davide, I agree that what you did will make the test pass. I'm not sure if it will always be correct though. The problem is that ORM doesn't have a way to find out the catalog name (which is the database name) unless Hibernate Reactive provides it. I think it would be fine to deal with the catalog name separately. |
@DavideD, I have some ideas about how the catalog name might be resolved. Should I go ahead and create the follow-on issue for catalog, or would like to do that? |
Yes, please. Create a separate issue. I've tried to play a bit with it but could figure out what to do. |
Sure but I see this as a separate issue. If I'm not mistaken, everything will work for users that don't set the catalog name |
@DavideD, I'm really not sure if it will always work. SQL Server's default catalog name is "master". I've read that it is possible to change it. I am not sure if/how that would impact what gets returned by information_schema views. I have not figured out how to change it with |
We can just test with the default name and make sure that it works with that |
Your change will make the queries not take the catalog name into account at all. If it is possible for information_schema to have more than one catalog, then query results that ORM relies on might not be correct. This may not be an issue; I don't know... |
What I mean is that the issue with the catalog is not just for schema validation/update. It's something that won't work in other cases as well. I would expect this test to pass with MSSQL: DavideD@5b979c2 |
@DavideD, I think it really only matters for SchemaMigrator and SchemaValidator. |
Yes, the catalog name will be used if provided for SchemaExport, but it is not needed SchemaExport. |
I suppose it might be needed if the catalog is a non-default, but honestly, I don't know. This is not an issue for ORM because ORM can get the information it needs. |
I've refactored the code and added back the test with the default catalog name.
|
private String anotherString; | ||
} | ||
|
||
public static class AOtherId implements Serializable { |
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.
@gbadner I've just noticed this class but I don't think we are using it. Is it necessary for the test or is this a leftover?
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.
@DavideD, yes, it is needed. It is an IdClass
used by AOther
.
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.
Ah yes, sorry
3e3ea79
to
79b1938
Compare
Remove SqlServerReactiveInformationExtractorImpl#getDatabaseSchemaColumnName
Change test arguments that are inconsistent with their function
79b1938
to
c5f48c0
Compare
Merged! |
Excellent! |
Fixes #912
A test for the following pr: #967
I've rebased it to the latest changes and it's using the available HIbernate ORM (5.6.0.Beta2)
Waiting for this PR to be merged and released