From c259410dedcf105b32f8e35b49d2e302eff0e6e3 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 30 Oct 2015 18:41:35 +0000 Subject: [PATCH] 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 --- source/main.pas | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source/main.pas b/source/main.pas index e4b21bbc..6fd0f78c 100644 --- a/source/main.pas +++ b/source/main.pas @@ -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;