-
Notifications
You must be signed in to change notification settings - Fork 88
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
MS SQL: failure when inserting row if a column has a foreign key constraint #744
Comments
I don't think so. I think there must be something else going on. |
(Perhaps a table definition isn't being dropped correctly between tests?) |
If I run only
The first warnings are expected I think, given the DB is empty. Then the test setup looks OK:
|
This is surely the real reason. |
Oh, sorry, my bad, no, it's not the reason. |
I really have no clue. I'm sure it's not the case that SQL Server foreign keys are Have you tried executing the same SQL from the GUI client to check that what I'm saying is true? |
No. I will try that
… |
It works when I ran this from
So you're right, it's not related to constraint definition. |
@tsegismont, when debugging That exception seems to get eaten, and instead a I'm also seeing the same sort of issue when debugging some other tests as well using Vert.x 4.1.0-SNAPSHOT. |
@gbadner you need the changes I shared in DavideD#13 (in particular, the |
I'm going to create a branch upstream to keep track of the progress with sql server, so that I can rebase it to the latest main and we can have a reference branch with all changes. |
@tsegismont what is the status of this? (Whatever the problem is, I don't think the issue description captures it.) |
@gavinking I haven't been able to investigate yet |
@gavinking I have found that changing the dialect implementation resolves the issue:
I don't know why but it seems the server creates non-nullable columns if not explicitly specified as nullable (like Sybase). Does that ring a bell? |
I mean, that dialect is the one used in Hibernate ORM for years and years, so it's hard to see how it could be wrong (unless the SQL server JDBC drivers do something weird). |
Here's something I found https://social.msdn.microsoft.com/Forums/sqlserver/en-US/16c39868-96b1-457c-a3a5-f291ba75d635/whether-a-column-is-nullable-by-default It seems there are some settings that can affect this behavior. But they're supposed to do the right thing by default. |
Perhaps you should try doing that. |
@gavinking let me check if this is due to the server config or something the JDBC driver does which the Reactive Client doesn't. In this case I'll create an issue upstream and we can close this one. |
@gavinking this didn't have any effect. I filed eclipse-vertx/vertx-sql-client#963 to track the issue upstream. Feel free to close this one. Otherwise, we can close it later when the upstream issue is resolved. |
OK thanks. I don't think the issue belongs here, so I'm closing this one. |
There are many tests in the HR suite using parent/child data. For example:
EagerTest
.With MS SQL, these tests fail with:
I suspect this is due to the column definition:
Perhaps it should be explicitly declared as
NULL
The text was updated successfully, but these errors were encountered: