Enable EXPLAIN links and menu items also when relevant query does not start with SELECT.., as there may be a comment at the beginning. This leaves the responsibility for error messages to the server. Fixes issue #2986.

This commit is contained in:
Ansgar Becker
2012-10-19 14:55:19 +00:00
parent 015de362f1
commit d2fb5733e0

View File

@ -2485,8 +2485,7 @@ var
begin
// Sub menu with EXPLAIN items pops up
SQL := GetCurrentQuery(ActiveQueryTab);
actExplainCurrentQuery.Enabled := (UpperCase(GetFirstWord(SQL)) = 'SELECT')
and (ActiveConnection.Parameters.NetTypeGroup = ngMySQL);
actExplainCurrentQuery.Enabled := ActiveConnection.Parameters.NetTypeGroup = ngMySQL;
actExplainAnalyzeCurrentQuery.Enabled := actExplainCurrentQuery.Enabled;
end;
@ -6574,7 +6573,6 @@ begin
SynMemoProcessView.Color := clBtnFace;
end;
lblExplainProcess.Enabled := enableSQLView
and (UpperCase(GetFirstWord(SynMemoProcessView.Text)) = 'SELECT')
and (ActiveConnection.Parameters.NetTypeGroup = ngMySQL);
menuExplainProcess.Enabled := lblExplainProcess.Enabled;
lblExplainProcessAnalyzer.Enabled := lblExplainProcess.Enabled;