Skip to content

Commit 9da8a80

Browse files
committed
enhance: rephrase warning message displayed when a grid edit/delete did not affect any row
Refs #2568
1 parent 6727efc commit 9da8a80

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

extra/locale/heidisql.po

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6863,3 +6863,9 @@ msgstr "Empty password after plugin change!"
68636863

68646864
msgid "You changed the authentication plugin. This will reset the password, so please specify a new one."
68656865
msgstr "You changed the authentication plugin. This will reset the password, so please specify a new one."
6866+
6867+
msgid "The UPDATE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row."
6868+
msgstr "The UPDATE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row."
6869+
6870+
msgid "The DELETE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row."
6871+
msgstr "The DELETE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row."

source/dbconnection.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9448,7 +9448,7 @@ procedure TDBQuery.DeleteRow;
94489448
TempRowsAffected := Connection.RowsAffected;
94499449
Connection.ShowWarnings;
94509450
if TempRowsAffected = 0 then
9451-
raise EDbError.Create(FormatNumber(TempRowsAffected)+' rows deleted when that should have been 1.');
9451+
raise EDbError.Create(f_('The DELETE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row.', [FormatNumber(TempRowsAffected)]));
94529452
end;
94539453
if Assigned(FCurrentUpdateRow) then begin
94549454
FUpdateData.Remove(FCurrentUpdateRow);
@@ -9714,7 +9714,7 @@ function TDBQuery.SaveModifications: Boolean;
97149714
TempRowsAffected := Connection.RowsAffected;
97159715
Connection.ShowWarnings;
97169716
if TempRowsAffected = 0 then begin
9717-
raise EDbError.Create(FormatNumber(TempRowsAffected)+' rows updated when that should have been 1.');
9717+
raise EDbError.Create(f_('The UPDATE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row.', [FormatNumber(TempRowsAffected)]));
97189718
Result := False;
97199719
end;
97209720
end;

0 commit comments

Comments
 (0)