mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Fix a bug in threaded queries: The query thread sometimes didn't call SetThreadResult. (with a good hint from rosenfield).
Fixes at least two things: - Rely on getting an exception when calling ExecUpdateQuery with erroneous SQL (fx the field editor does that sometimes when you update a TIMESTAMP field - Executing queries from the query editor, receiving "Cannot perform this operation on a closed dataset"
This commit is contained in:
@ -159,9 +159,13 @@ end;
|
|||||||
procedure TMysqlQueryThread.NotifyStatus(AEvent: Integer);
|
procedure TMysqlQueryThread.NotifyStatus(AEvent: Integer);
|
||||||
var
|
var
|
||||||
h : THandle;
|
h : THandle;
|
||||||
|
qr : TThreadResult;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
if AEvent = MQE_FINISHED then begin
|
if AEvent = MQE_FINISHED then begin
|
||||||
|
debug(Format('qry: Setting result', [AEvent]));
|
||||||
|
qr := AssembleResult();
|
||||||
|
TMysqlQuery(FOwner).SetThreadResult(qr);
|
||||||
// trigger query finished event
|
// trigger query finished event
|
||||||
h := OpenEvent (EVENT_MODIFY_STATE,False,PChar(TMysqlQuery(FOwner).EventName));
|
h := OpenEvent (EVENT_MODIFY_STATE,False,PChar(TMysqlQuery(FOwner).EventName));
|
||||||
debug('qry: Signalling completion via event.');
|
debug('qry: Signalling completion via event.');
|
||||||
@ -191,13 +195,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMysqlQueryThread.NotifyStatusViaWinMessage(AEvent: Integer);
|
procedure TMysqlQueryThread.NotifyStatusViaWinMessage(AEvent: Integer);
|
||||||
var
|
|
||||||
qr : TThreadResult;
|
|
||||||
begin
|
begin
|
||||||
debug(Format('qry: Setting result and posting status %d via WM_MYSQL_THREAD_NOTIFY message', [AEvent]));
|
|
||||||
qr := AssembleResult();
|
|
||||||
TMysqlQuery(FOwner).SetThreadResult(qr);
|
|
||||||
debug('qry: Signalling completion via message.');
|
debug('qry: Signalling completion via message.');
|
||||||
|
debug(Format('qry: Posting status %d via WM_MYSQL_THREAD_NOTIFY message', [AEvent]));
|
||||||
PostMessage(FNotifyWndHandle,WM_MYSQL_THREAD_NOTIFY,Integer(FOwner),AEvent);
|
PostMessage(FNotifyWndHandle,WM_MYSQL_THREAD_NOTIFY,Integer(FOwner),AEvent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user