KEMBAR78
Fix two unrelated version issues by JohnMcPMS · Pull Request #5719 · microsoft/winget-cli · GitHub
Skip to content

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Sep 13, 2025

Fixes #4928
Fixes providing "1" for the version when the version is actually "1.0" and the like (there is probably an issue filed but I didn't find it after a quick search).

Issues

Due to SQLite helpfully not being picky about data types, the packages table in the v2 index was using INT64 for every column, when in reality they should mostly by strings (TEXT). When the version was parsable as a number, it would drop unnecessary portions (trailing 0s).

New code in the v2 index and the composite package changes were using string comparison instead of Version, requiring an exact string match rather than Version equality.

Changes

Use the data type that we already had set up rather than always INT64. This will require a service update to actually fix anything (but doesn't require a client update).

Use Version comparisons rather than string in the v2 index and composite package version selection.

Validation

Added new tests and confirmed via manual usage.

Microsoft Reviewers: Open in CodeFlow

@Trenly
Copy link
Contributor

Trenly commented Sep 13, 2025

Due to SQLite helpfully not being picky about data types

Should there be an issue filed for the SQLiteBuilder to support optionally adding STRICT onto the table creation SQLstatement ?

@JohnMcPMS JohnMcPMS merged commit fc36248 into microsoft:master Sep 15, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the v2-versions branch September 15, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Index V2 does not properly handle versions of <part>.0 or <part>.###0

4 participants