A yes/no message dialog may also return mrCancel, when the user clicks the X button to close it. Handle this case as if the user clicked "no", when HeidiSQL detects an unsafe query. See http://www.heidisql.com/forum.php?t=19697

This commit is contained in:
Ansgar Becker
2015-10-30 18:41:35 +00:00
parent b546e9186b
commit c259410ded

View File

@ -2492,12 +2492,7 @@ begin
if ContainsUnsafeQueries then begin
Screen.Cursor := crDefault;
msg := _('Your query contains UPDATEs and/or DELETEs without a WHERE clause. Please confirm that you know what you''re doing.');
case MessageDialog(_('Unsafe queries found'), msg, mtConfirmation, [mbYes, mbNo], asWarnUnsafeUpdates) of
mrYes:
DoExecute := True; // Proceed to query execution below
mrNo:
DoExecute := False;
end;
DoExecute := MessageDialog(_('Unsafe queries found'), msg, mtConfirmation, [mbYes, mbNo], asWarnUnsafeUpdates) = mrYes;
end;
end;