Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mssql] use unique constraint info from db to set field ConstraintUnique
- Loading branch information
Showing
3 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad17471
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.
hi @domi4484 when trying to run mssql provider tests, the
testUniqueConstraint()
test fails for me:vl.dataProvider().fieldConstraints(0)
does not return that the first column (primary key) has unique constraintinformation_schema.table_constraints.constraint_type
value for the primary key column isPRIMARY KEY
and notUNIQUE
which is what the SQL query looks forI am wondering what is wrong - if the SQL query should be fixed to include
constraint_type='PRIMARY KEY'
or the test is wrong and the primary key should not have "unique" constraint? I assume the former, but checking just to be sure...I am using MSSQL on linux from docker:
ad17471
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.
hi @wonder-sk , I was using a slightly different docker image
server:2019-CU11-ubuntu-20.04
.I think the test is correct and the primary key should have the unique constraint.
Probably when I implemented this I did not pay attention to the fact that the query of line 375 does not return the primary key because the constraint for that are set later at line 549:
Maybe is the detection of the primary key which is suddenly having some troubles?