Opened 15 years ago

Closed 15 years ago

#454 closed defect (fixed)

Insert commands seriously messed up when null values are omitted

Reported by: jng Owned by: traianstanev
Priority: critical Milestone: 3.4.0
Component: SQLite Provider Version: 3.4.0
Severity: 1 Keywords:
Cc: External ID:


When inserting features with the SQLite provider, if you only include properties with values (ignoring any null values), the insert command does not insert the actual property values into their expected positions.

I have attached the source of a simple C# console application that illustrates this problem.

Attachments (1)

Program.cs (7.2 KB ) - added by jng 15 years ago.
.net test console application source code

Download all attachments as: .zip

Change History (4)

by jng, 15 years ago

Attachment: Program.cs added

.net test console application source code

comment:1 by traianstanev, 15 years ago

Priority: blockercritical
Status: newassigned

Yes, this is a defect because of the way reusing of the same Insert command is internally optimized for bulk insert. However, it is not a blocker, since there are multiple workarounds -- you can either include all the properties in the property value collection from the start and set the right ones to null, or you can create a new insert command when the set of properties changes. I'll look into what can be done without compromising the bulk insert optimizations.

comment:2 by traianstanev, 15 years ago

Here are more details on the problem... If you change the contents of the property value collection of the insert command, after having executed the insert command once, you are asking for trouble, because the provider caches a pre-compiled parametrized SQL statement based on the state of the property value collection during the first time you Execute(). Note that you can change the actual values, just not the set of property values in the collection. The two workarounds described in the previous note will avoid that problem.

comment:3 by traianstanev, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.