Keep EXPLAIN link disabled if selected process is a SHOW command or even has an empty SQL. Fixes issue #1717.

This commit is contained in:
Ansgar Becker
2010-02-24 18:46:37 +00:00
parent 06333f36bf
commit c9950e1c51

View File

@ -5903,7 +5903,6 @@ begin
enableSQLView := Assigned(Node);
SynMemoProcessView.Enabled := enableSQLView;
pnlProcessView.Enabled := enableSQLView;
lblExplainProcess.Enabled := enableSQLView;
if enableSQLView then begin
NodeData := ListProcesses.GetNodeData(Node);
SynMemoProcessView.Highlighter := SynSQLSyn1;
@ -5914,6 +5913,9 @@ begin
SynMemoProcessView.Text := 'Please select a process in the above list.';
SynMemoProcessView.Color := clBtnFace;
end;
lblExplainProcess.Enabled := enableSQLView
and (UpperCase(GetFirstWord(SynMemoProcessView.Text)) <> 'SHOW')
and (SynMemoProcessView.GetTextLen > 0);
end;