Do not fetch database objects from information_schema, which has gotten extremely slow on servers with many databases and triggers, since we support triggers.

* Instead, use separate SHOW commands for tables, functions, procedures and triggers
* Catch this chance to move these methods from main unit to mysql_connection, so they're accessible in a more generic way
* Additionally, introduce new classes TDBObject and TDBObjectList which provide a more generic way than TMySQLQuery to access these database objects.
Fixes issue #1529
This commit is contained in:
Ansgar Becker
2009-12-19 11:40:28 +00:00
parent dfa981232c
commit 35e8bbb304
12 changed files with 509 additions and 536 deletions

View File

@ -1964,10 +1964,11 @@ var
VT: TVirtualStringTree;
EnumEditor: TEnumEditorLink;
SetEditor: TSetEditorLink;
Results: TMySQLQuery;
DBObjects: TDBObjectList;
Key: TForeignKey;
ColNode: PVirtualNode;
Col: PTableColumn;
i: Integer;
begin
// Init grid editor in foreign key list
VT := Sender as TVirtualStringTree;
@ -1986,11 +1987,9 @@ begin
2: begin
EnumEditor := TEnumEditorLink.Create(VT);
EnumEditor.AllowCustomText := True;
Results := Mainform.FetchActiveDbTableList;
while not Results.Eof do begin
EnumEditor.ValueList.Add(Results.Col(DBO_NAME));
Results.Next;
end;
DBObjects := Mainform.Connection.GetDBObjects(Mainform.ActiveDatabase);
for i:=0 to DBObjects.Count-1 do
EnumEditor.ValueList.Add(DBObjects[i].Name);
EditLink := EnumEditor;
end;
3: begin