[5.0.1] RevEng: Ignore column store index #23421
Merged
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.
Since all the columns are considered included columns
Resolves #23378
Description
All the columns in the columnstore index in SqlServer appears as included columns for the index. When we started identifying included columns as separate and started skipping them over, the columnstore indexes were left without any columns in the index causing error when generating model out of it.
Customer Impact
Customer will see an exception when scaffolding a database which has a columnstore index without any details why it failed. It has only been reported by a single customer so far, but we believe more people will hit this given that it also reproduces when scaffolding from the WideWorldImporters sample database, which is commonly used in SQL Server samples.
How found
Customer reported on 5.0.
Test coverage
Added test to skip column store index. As I mentioned in another issue, we have identified scaffolding (a.k.a. reverse engineering) as an area where we are lacking test coverage and are beginning to address this. One of the things we have already done is to reverse engineer four standard sample databases (Northwind, Pubs, AdventureWorks, and WideWorldImporters) which together cover many SQL Server features. This issue is reproduced on WideWorldImporters; we have not found any further issues from these databases.
Regression?
Yes, in 3.1 these indexes were scaffolded as regular index, which was wrong but not harmful. In 5.0 RTM it throws exception. With this fix they will be ignored. Ignoring them will allow us to add support for them fully in future.
Risk
Low. We would skip an index only if it does not have any columns. And indexes without any columns will throw later anyway. Also added quirk to go back to previous behavior.