System.Data.SQLite

View Ticket
Login
Ticket Hash: e22d357a213a4cd450434a0130ee75421efb3946
Title: Parameter name is case-sensitivity doesn't match database behavior
Status: Closed Type: Code_Defect
Severity: Minor Priority: Medium
Subsystem: Statement Resolution: Fixed
Last Modified: 2023-05-31 19:31:00
Version Found In: 1.0.117.0
User Comments:
anonymous added on 2023-05-28 12:43:14:

I've discovered that System.Data.SQLite treats parameter name as case-insensitive which leads to lost(replaced) command parameter when command contains several parameters which differ just by case.

SQLite itself treats parameters as case-sensitive (and also works this way with Microsoft.Data.Sqlite).

Issue caused by use of StringComparison.OrdinalIgnoreCase instead of StringComparison.Ordinal in SQLiteParameterCollection.IndexOf method:

https://system.data.sqlite.org/index.html/file?name=System.Data.SQLite/SQLiteParameterCollection.cs


mistachkin added on 2023-05-29 23:32:15:

Thanks for the report.

After some research, it seems that the SQLiteStatement class needs a minor change as well.

I'll try to get this fix included in the 1.0.118.0 release.


mistachkin added on 2023-05-31 19:31:00:

Fixed on trunk, with tests.