Move database filter again from mainform to session manager, so people without privilege to run SHOW DATABASE are not stuck. Fixes issue #1485. Also, allow to see available databases when user does a dropdown. Also, simplify logic for refreshing database list in mainform.

This commit is contained in:
Ansgar Becker
2010-04-22 15:16:27 +00:00
parent 9b786c81e0
commit 97f01a175b
13 changed files with 205 additions and 309 deletions

View File

@ -106,7 +106,7 @@ procedure TfrmSelectDBObject.FormShow(Sender: TObject);
begin
TreeDBO.Clear;
TreeDBO.RootNodeCount := Mainform.DBtree.RootNodeCount;
SetLength(FColumns, Mainform.Databases.Count);
SetLength(FColumns, Mainform.AllDatabases.Count);
// TreeDBO.OnFocusChanged(TreeDBO, TreeDBO.FocusedNode, 0);
editDB.Clear;
editTable.Clear;
@ -186,9 +186,9 @@ begin
case Sender.GetNodeLevel(Node) of
1: SetLength(FColumns[Node.Index], ChildCount);
2: begin // Table expanding
DBObjects := Mainform.Connection.GetDBObjects(Mainform.Databases[Node.Parent.Index]);
DBObjects := Mainform.Connection.GetDBObjects(Mainform.AllDatabases[Node.Parent.Index]);
cols := Mainform.Connection.GetCol('SHOW COLUMNS FROM '
+ Mainform.mask(Mainform.Databases[Node.Parent.Index])+'.'
+ Mainform.mask(Mainform.AllDatabases[Node.Parent.Index])+'.'
+ Mainform.Mask(DBObjects[Node.Index].Name));
FColumns[Node.Parent.Index][Node.Index] := cols;
ChildCount := cols.Count;