System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2015-10-15
19:39 Closed ticket [2556655d1b]: SQLiteFunction.RegisterFunction ArgumentException plus 4 other changes artifact: 52d1f361f4 user: mistachkin
19:38
Permit an existing registered function to be replaced. Fix for [2556655d1b]. check-in: cb9c3d67aa user: mistachkin tags: trunk
19:19 Ticket [2556655d1b] SQLiteFunction.RegisterFunction ArgumentException status still Open with 4 other changes artifact: 017ffb36d0 user: mistachkin
17:24 Ticket [2556655d1b]: 5 changes artifact: 1d501b4058 user: mistachkin
17:20 Ticket [2556655d1b]: 6 changes artifact: 357d23d7cc user: mistachkin
15:45 New ticket [2556655d1b]. artifact: 3dc5b79ef7 user: anonymous

Ticket Hash: 2556655d1b6ecc05912cc9447073d449a33e03e9
Title: SQLiteFunction.RegisterFunction ArgumentException
Status: Closed Type: Code_Defect
Severity: Important Priority: Medium
Subsystem: None Resolution: Fixed
Last Modified: 2015-10-15 19:39:17
Version Found In: 1.0.98.0
User Comments:
anonymous added on 2015-10-15 15:45:42:
When upgrading to version 1.0.98.0 from version 1.0.96.0, previously working code using SQLiteFunction.RegisterFunction on the desktop Framework (x64 4.0) started to throw ArgumentException when manually registering SQLiteFunction types.

It seems there has been a change of behavior which I have not found documented in the release notes (feel free to point it out though). From what I understand, I can no longer manually add types with SQLiteFunction.RegisterFunction because the SQLite framework would already have loaded them, but I cannot find a way to check if a type has already been registered before adding it. 

This proves to be an issue for me since I have some dynamic assembly loading and share some code base between the regular .NET Framework and the Compact Framework. I can use custom defines to avoid the problem, but I'd rather understand why it's not working anymore.

Could you document the change which occurred in this function, and maybe provide a new helper function like SQLiteFunction.IsRegistered(Type type)?

mistachkin added on 2015-10-15 17:20:00:
The exception is caused by the changes from check-in [187e8cb03dd8b88f], which
occurred between 1.0.97.0 and 1.0.98.0.

mistachkin added on 2015-10-15 17:24:01:
Previously, if you added the same type again, the most recent definition would
"win".  This was due to how the registered functions were tracked internally.

The correct fix here is probably to restore the previous behavior as much as
possible.  The semantic change here was not intentional.

mistachkin added on 2015-10-15 19:19:43:
I've reproduced the issue locally.  Working on fix.

mistachkin added on 2015-10-15 19:39:17:
Fixed on trunk via check-in [cb9c3d67aa3a32d7].