Improve SQL Server migration process #7292
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
Test SQL Server migration process and fix some minor issues.
Fix a variety of
SimpleFilterissues that arose during the cloning migration work. Add regression tests for these issues.IN (NULL)has been used in various places as a substitute forFALSE. This construct is problematic becauseNULLis considered an unknown value in SQL, which meansIN (NULL)evaluates to FALSE andNOT IN (NULL)also evaluates to FALSE, which can lead to surprising results. For LabKey,new InClause(fk, emptyList)selects no rows andnew NotClause(new InClause(fk, emptyList))also selects no rows.Changes
SQLClause.equals()DatabaseMigrationConfiguration.getColumnNameFilter(); each configuration'sgetTableSelector()method can filter columns, if needed.BasePostgreSqlDialectis common to Redshift and PostgreSQL; move PostgreSQL-specific methods from BasePostgreSqlDialect toPostgreSql92Dialect.SqlDialect.testLikeOperator()when scopes with different dialects are present. All configured scopes are tested, but the debug string used by the test was always generated assuming the LabKey scope.IN (NULL)to representFALSEwith0 = 1