mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
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:
@ -89,15 +89,15 @@ end;
|
||||
{ Read tables from selected DB }
|
||||
procedure TfrmInsertFiles.ComboBoxDBsChange(Sender: TObject);
|
||||
var
|
||||
Results: TMySQLQuery;
|
||||
DBObjects: TDBObjectList;
|
||||
i: Integer;
|
||||
begin
|
||||
// read tables from db
|
||||
ComboBoxTables.Items.Clear;
|
||||
Results := Mainform.FetchDbTableList(ComboBoxDBs.Text);
|
||||
while not Results.Eof do begin
|
||||
if GetDBObjectType(Results) in [lntTable, lntView] then
|
||||
ComboBoxTables.Items.Add(Results.Col(DBO_NAME));
|
||||
Results.Next;
|
||||
DBObjects := Mainform.Connection.GetDBObjects(ComboBoxDBs.Text);
|
||||
for i:=0 to DBObjects.Count-1 do begin
|
||||
if DBObjects[i].NodeType in [lntTable, lntView] then
|
||||
ComboBoxTables.Items.Add(DBObjects[i].Name);
|
||||
end;
|
||||
if ComboBoxTables.Items.Count > 0 then
|
||||
ComboBoxTables.ItemIndex := 0;
|
||||
|
Reference in New Issue
Block a user