Silence exception on old servers for users which don't have access to information_schema, where MySQL should say "Unknown database". Fixes issue #1421.

This commit is contained in:
Ansgar Becker
2009-10-29 22:18:26 +00:00
parent e3feb56242
commit cb1b7b0c21

View File

@ -3591,8 +3591,11 @@ begin
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
ShowStatus('Fetching tables from "' + db + '" ...'); ShowStatus('Fetching tables from "' + db + '" ...');
try try
if not Assigned(InformationSchemaTables) then if not Assigned(InformationSchemaTables) then try
InformationSchemaTables := Connection.GetCol('SHOW TABLES FROM '+mask(DBNAME_INFORMATION_SCHEMA)); InformationSchemaTables := Connection.GetCol('SHOW TABLES FROM '+mask(DBNAME_INFORMATION_SCHEMA));
except
InformationSchemaTables := TWideStringlist.Create;
end;
if InformationSchemaTables.IndexOf('TABLES') > -1 then begin if InformationSchemaTables.IndexOf('TABLES') > -1 then begin
Unions := TWideStringlist.Create; Unions := TWideStringlist.Create;