Bugfix: switch back to normal cursor after failed database operation.

Issue #180 doesn't seem to reproduce anymore, not here anyway.
This commit is contained in:
rosenfield.albert
2008-08-08 00:08:45 +00:00
parent 071e68c598
commit ae87769f9c

View File

@ -1511,6 +1511,7 @@ begin
OldCursor := Screen.Cursor;
Screen.Cursor := crHourGlass;
MainForm.ShowStatus('Fetching tables from "' + db + '" ...');
try
if (mysql_version >= 32300) and (not prefPreferShowTables) then begin
ds := GetResults('SHOW TABLE STATUS FROM ' + mask(db), false, false);
end else begin
@ -1521,9 +1522,11 @@ begin
// SELECT COUNT(*), but that would potentially be rather slow.
end;
CachedTableLists.AddObject(db, ds);
finally
MainForm.ShowStatus(STATUS_MSG_READY);
Screen.Cursor := OldCursor;
end;
end;
Result := TDataSet(CachedTableLists.Objects[CachedTableLists.IndexOf(db)]);
Result.First;
end;
@ -1729,10 +1732,10 @@ begin
SetVTSelection(ListTables, SelectedCaptions);
Mainform.showstatus(db + ': ' + IntToStr(ListTables.RootNodeCount) +' table(s)', 0);
tabDatabase.Caption := sstr('Database: ' + db, 30);
// Ensure tree db node displays its chidren initialized
DBtree.ReinitChildren(FindDBNode(db), False);
MainForm.ShowStatus(STATUS_MSG_READY);
Screen.Cursor := crDefault;
// Ensure tree db node displays its chidren initialized
DBtree.ReinitChildren(FindDBNode(db), False);
end;
end;
@ -5076,6 +5079,7 @@ begin
0: begin
Screen.Cursor := crSQLWait;
mainform.Showstatus( 'Reading Databases...' );
try
Databases := TStringList.Create;
if DatabasesWanted.Count = 0 then begin
ds := GetResults( 'SHOW DATABASES' );
@ -5103,13 +5107,22 @@ begin
// TODO: Is this right? Adding "<db name>.<table name>" seems to make more sense..
SynSQLSyn1.TableNames.AddStrings( Databases );
SynSQLSyn1.TableNames.EndUpdate;
finally
MainForm.ShowStatus( STATUS_MSG_READY );
Screen.Cursor := crDefault;
end;
end;
// DB node expanding
1: begin
Screen.Cursor := crSQLWait;
mainform.Showstatus( 'Reading Tables...' );
try
ds := FetchDbTableList(Databases[Node.Index]);
ChildCount := ds.RecordCount;
finally
MainForm.ShowStatus( STATUS_MSG_READY );
Screen.Cursor := crDefault;
end;
end;
else Exit;
end;