mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
TDBQuery.GetWhereClause uses an empty string on a not yet fetched, inserted row. So a numerical cell which is part of a primary/unique key gets into the WHERE clause without any value. Fix that by using "0" as a default if it's an empty string. Avoid usage of UnformatNumber(), which I removed in r4047. Fixes issue #2867.
This commit is contained in:
@ -4469,9 +4469,14 @@ begin
|
||||
dtcInteger, dtcReal: begin
|
||||
if DataType(j).Index = dtBit then
|
||||
Result := Result + '=b' + Connection.EscapeString(ColVal)
|
||||
else
|
||||
else begin
|
||||
// Guess (!) the default value silently inserted by the server. This is likely
|
||||
// to be incomplete in cases where a UNIQUE key allows NULL here
|
||||
if ColVal='' then
|
||||
ColVal := '0';
|
||||
Result := Result + '=' + ColVal;
|
||||
end;
|
||||
end;
|
||||
dtcBinary:
|
||||
Result := Result + '=' + HexValue(ColVal);
|
||||
else
|
||||
|
Reference in New Issue
Block a user