I've turned on debugging, and this is (partially) the query that linq connect builds. I've removed null checks and sanitized the output to pinpoint the problematic area.
Code: Select all
UPDATE candidates SET Sex = :p1
WHERE CandidateId = :key1
AND ((Sex = :chk5))
-- p1: Input Char (Size = 1; DbType = AnsiStringFixedLength) [ ]
-- key1: Input Int (Size = 0; DbType = Int32) [166741]
-- chk5: Input Char (Size = 1; DbType = AnsiStringFixedLength) [?]
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3.0.10.0
The code above is trying to update the row and push updated values. The value in db for sex is 0x18, and the update is trying to write :p1 0x20 (space)
In the debugging, we see that :chk5 is set to a question mark, most likely because it's non-printable at this point (0x18).
The problem is that it appears that this question mark is also sent to the query itself, which will fail the WHERE clause to find the original data in the row of 0x18.
How to fix this? Is this a bug in the current version?