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