System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2015-07-22
18:39 Ticket [a4d9c7ee94] "Contains" function returns no records if column type is Guid status still Closed with 3 other changes artifact: b00f77680a user: mistachkin
11:49 Ticket [a4d9c7ee94]: 3 changes artifact: 0a1ce82b05 user: anonymous
2015-04-21
15:19 Ticket [a4d9c7ee94]: 3 changes artifact: 003ba69cd4 user: mistachkin
2015-04-20
14:29 Ticket [a4d9c7ee94]: 3 changes artifact: 15c78910ee user: anonymous
2015-03-29
06:55 Closed ticket [a4d9c7ee94]. artifact: fa3deb6969 user: mistachkin
2015-03-27
15:31 Ticket [a4d9c7ee94]: 3 changes artifact: 1d1f051e86 user: anonymous
2015-03-26
21:56 Ticket [a4d9c7ee94]: 3 changes artifact: 462741dbe9 user: mistachkin
21:55
When BinaryGUID handling is off, transform the LINQ paramter types as well. Fix for [a4d9c7ee94]. check-in: 87b4244129 user: mistachkin tags: trunk
21:42 Pending ticket [a4d9c7ee94]: "Contains" function returns no records if column type is Guid plus 5 other changes artifact: 760a031cb8 user: mistachkin
20:04 Ticket [a4d9c7ee94]: 3 changes artifact: 8c6d18d660 user: mistachkin
18:30 Ticket [a4d9c7ee94]: 3 changes artifact: 68635a8a75 user: mistachkin
07:58 Ticket [a4d9c7ee94]: 3 changes artifact: 58afd40c18 user: anonymous
2015-03-24
22:11 Closed ticket [a4d9c7ee94]. artifact: add49c924e user: mistachkin
10:05 Ticket [a4d9c7ee94]: 3 changes artifact: de15892cf6 user: anonymous
2015-03-23
17:44 Ticket [a4d9c7ee94]: 7 changes artifact: 93075caded user: mistachkin
14:51 New ticket [a4d9c7ee94]. artifact: 93929d4e60 user: anonymous

Ticket Hash: a4d9c7ee94e10b5b16252e30d11bf005a56cfe4d
Title: "Contains" function returns no records if column type is Guid
Status: Closed Type: Code_Defect
Severity: Important Priority: Medium
Subsystem: LINQ Resolution: Fixed
Last Modified: 2015-07-22 18:39:43
Version Found In: 1.0.96.0.
User Comments:
anonymous added on 2015-03-23 14:51:18:
I have table with column "Guid" of type guid.

Following code returns no record:
Guid g = new Guid("60C00100-3F07-4ADD-A3C6-0CA138CD7CA7");
Guid[] guidArray = new Guid[1]{g};
PDETag result = DBContext.PDETags.Where(x => guidArray.Contains(x.Guid)).FirstOrDefault();

This code returns right record:
PDETag result2 = DBContext.PDETags.Where(x => x.Guid == g).FirstOrDefault();

mistachkin added on 2015-03-23 17:44:51:
Have you tried using the BinaryGUID connection string property?

anonymous added on 2015-03-24 10:05:05:
I am using BinaryGUID=True. With BinaryGUID=False it works. But only with new database. It is not compatible with my existing databases.

mistachkin added on 2015-03-24 22:11:12:
Well, that setting impacts how the GUIDs are treated by the conversion routines.
It appears things are working as designed.

anonymous added on 2015-03-26 07:58:52:
Unfortunately, I can't change existing databases. Is there some way to make "Contains" function working with BinaryGUID=True?

mistachkin added on 2015-03-26 18:30:36:
I'll look into it.

mistachkin added on 2015-03-26 20:04:06:
Further research reveals that the BinaryGUID setting is working as designed in
this context.

Are you unable to change this connection string property for some other reason?

mistachkin added on 2015-03-26 21:42:03:
On second thought, this does seem like an issue with the LINQ assembly not fully
honoring the BinaryGUID setting.  I'm working on a fix.

mistachkin added on 2015-03-26 21:56:25:
This should be fixed on trunk, via check-in [87b4244129].  Please let us know if
this fix works for you.

anonymous added on 2015-03-27 15:31:42:
Thank you. 

The other reason for binary guid is performance. I have all primary keys as guid and "string guids" makes it slower. Also file size increase is complication.

anonymous added on 2015-04-20 14:29:50:
I tested check-in [87b4244129]. But it is not working for me. I also found out, that I am not able to simple search record by guid. Following code is not workig now:
PDETag result2 = DBContext.PDETags.Where(x => x.Guid == g).FirstOrDefault();
With version 1.0.96.0 is it working fine.

I tested your function "BinaryGuidTest2". I saw, that you sets BinaryGuid with following code:
Environment.SetEnvironmentVariable("AppendManifestToken_SQLiteProviderManifest", String.Format(";BinaryGUID={0};", binaryGuid));
I am using only connection string: "... BinaryGUID=True; ..."
I thing, you sets also SQLiteProviderManifest._binaryGuid and I only SQLiteConnection._binaryGuid. What is the right way to set BinaryGuid? 
In my case is SQLiteProviderManifest._binaryGuid = false and SQLiteConnection._binaryGuid = true. This can be reason of problems.

I tested my application with "Environment.SetEnvironmentVariable("AppendManifestToken_SQLiteProviderManifest", String.Format(";BinaryGUID={0};", binaryGuid));" and it is working fine.

mistachkin added on 2015-04-21 15:19:22:
The new environment variable is used to influence the provider manifest token.
This is not exactly the same as the connection string, even though it is now
parsed similarly.  It's important to set the property for the LINQ provider
itself, because that is what controls the GUID handling in this case.

anonymous added on 2015-07-22 11:49:34:
what if I have to open 2 or more connections at the same time from the very same thread with different binaryguid settings?

mistachkin added on 2015-07-22 18:39:43:
If you change the ProviderManifestToken in the EDMX file appropriately, it should
also work.