Skip to content

Correct remaining SQLite schema metadata - #39219

Open
alaricd wants to merge 3 commits into
dotnet:mainfrom
pengdows:sqlite-schema-metadata-followup
Open

alaricd wants to merge 3 commits into
dotnet:mainfrom
pengdows:sqlite-schema-metadata-followup

Conversation

@alaricd

@alaricd alaricd commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #39188. This PR addresses the remaining metadata correctness issues identified during review.

  • Preserve Version.Revision in DataSourceInformation.DataSourceProductVersionNormalized, using a fixed-width zero revision when SQLite reports a three-part version.
  • Report REAL as variable-length because SQLite uses dynamic typing.
  • Report TEXT and BLOB IsUnsigned as DBNull.Value because signedness is not applicable to nonnumeric types.
  • Verify that collections advertising zero restrictions reject supplied restriction values rather than silently ignoring them.

Testing

  • Added version-normalization tests for three- and four-part versions.
  • Added DataTypes assertions for REAL, TEXT, and BLOB.
  • Added restriction behavior coverage for all schema collections advertising zero restrictions.
  • dotnet build src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj --no-restore passes with 0 warnings and 0 errors.
  • git diff --check passes.

The focused test project could not be restored in this environment because the configured NuGet feeds were unavailable.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The restriction theory still omits three collections advertised as accepting zero restrictions.

1 open finding
What changed in this PR

Corrects SQLite ADO.NET schema metadata and expands regression coverage.

Changes:

  • Preserves normalized version revisions.
  • Corrects REAL, TEXT, and BLOB metadata.
  • Expands zero-restriction collection tests.
File Description
src/​Microsoft.Data.Sqlite.Core/​SqliteConnection.cs Corrects normalized versions and type metadata.
test/​Microsoft.Data.Sqlite.Tests/​SqliteConnectionTest.cs Adds metadata and restriction tests.

🧠 Review effort: Balanced

Comment on lines +1592 to +1595
InlineData(nameof(DbMetaDataCollectionNames.ReservedWords), 0),
InlineData("Tables", 0),
InlineData("Columns", 0),
InlineData("Indexes", 0)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 390152ec98: the restriction theory now covers all eight collections advertising zero restrictions, including DataSourceInformation, DataTypes, and Restrictions. The core build and diff check pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants