Fix two unrelated version issues by JohnMcPMS · Pull Request #5719 · microsoft/winget-cli

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