Add LIMIT 1 clause to grid UPDATE queries, to make these safer on tables without sufficient unique key. Fixes issue #2079.

This commit is contained in:
Ansgar Becker
2010-07-11 18:56:19 +00:00
parent f5a5ec4686
commit e7bfca41b4

View File

@ -2156,7 +2156,7 @@ begin
end; end;
end; end;
end else end else
Connection.Query('UPDATE '+QuotedDbAndTableName+' SET '+sqlUpdate+' WHERE '+GetWhereClause); Connection.Query('UPDATE '+QuotedDbAndTableName+' SET '+sqlUpdate+' WHERE '+GetWhereClause+' LIMIT 1');
// Reset modification flags // Reset modification flags
for i:=0 to ColumnCount-1 do begin for i:=0 to ColumnCount-1 do begin
Cell := Row[i]; Cell := Row[i];