mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Exceptions are caught in TMySQLConnection.GetAllDatabases, no need to catch them again in TMainForm.DBtreeInitChildren. Also, log an error message if both SHOW DATABASES and the alternative did not work.
This commit is contained in:
@@ -1700,8 +1700,11 @@ begin
|
||||
except on E:EDatabaseError do
|
||||
try
|
||||
FAllDatabases := GetCol('SELECT '+QuoteIdent('SCHEMA_NAME')+' FROM '+QuoteIdent(DBNAME_INFORMATION_SCHEMA)+'.'+QuoteIdent('SCHEMATA')+' ORDER BY '+QuoteIdent('SCHEMA_NAME'));
|
||||
except on E:EDatabaseError do
|
||||
FAllDatabases := TStringList.Create;
|
||||
except
|
||||
on E:EDatabaseError do begin
|
||||
FAllDatabases := TStringList.Create;
|
||||
Log(lcError, 'Database names not available due to missing privileges for user '+CurrentUserHostCombination+'.');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Result := FAllDatabases;
|
||||
|
||||
@@ -6710,12 +6710,8 @@ begin
|
||||
lntNone: begin
|
||||
Screen.Cursor := crHourglass;
|
||||
ShowStatusMsg('Reading Databases...');
|
||||
if Sender.Tag = VTREE_NOTLOADED_PURGECACHE then try
|
||||
if Sender.Tag = VTREE_NOTLOADED_PURGECACHE then
|
||||
DBObj.Connection.RefreshAllDatabases;
|
||||
except
|
||||
on E:EDatabaseError do
|
||||
MessageDlg(E.Message+CRLF+CRLF+'You have no privilege to execute SHOW DATABASES. Please specify one or more databases in your session settings, if you want to see any.', mtError, [mbOK], 0);
|
||||
end;
|
||||
ShowStatusMsg;
|
||||
Sender.Tag := VTREE_LOADED;
|
||||
InvalidateVT(ListDatabases, VTREE_NOTLOADED, True);
|
||||
|
||||
Reference in New Issue
Block a user