mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Move code from TDBObjectEditor.GetDefiners to new TDBConnection.AllUserHostCombinations
This commit is contained in:
@ -29,7 +29,6 @@ type
|
||||
TDBObjectEditor = class(TFrame)
|
||||
private
|
||||
FModified: Boolean;
|
||||
FDefiners: TStringList;
|
||||
procedure SetModified(Value: Boolean);
|
||||
protected
|
||||
public
|
||||
@ -38,7 +37,6 @@ type
|
||||
destructor Destroy; override;
|
||||
procedure Init(Obj: TDBObject); virtual;
|
||||
function DeInit: TModalResult;
|
||||
function GetDefiners: TStringList;
|
||||
property Modified: Boolean read FModified write SetModified;
|
||||
function ApplyModifications: TModalResult; virtual; abstract;
|
||||
end;
|
||||
@ -1976,25 +1974,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TDBObjectEditor.GetDefiners: TStringList;
|
||||
function q(s: String): String;
|
||||
begin
|
||||
Result := DBObject.Connection.QuoteIdent(s);
|
||||
end;
|
||||
begin
|
||||
// For populating combobox items
|
||||
if not Assigned(FDefiners) then begin
|
||||
try
|
||||
FDefiners := DBObject.Connection.GetCol('SELECT CONCAT('+q('User')+', '+esc('@')+', '+q('Host')+') FROM '+
|
||||
q('mysql')+'.'+q('user')+' WHERE '+q('User')+'!='+esc('')+' ORDER BY '+q('User')+', '+q('Host'));
|
||||
except on E:EDbError do
|
||||
FDefiners := TStringList.Create;
|
||||
end;
|
||||
end;
|
||||
Result := FDefiners;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
// Following code taken from OneInst.pas, http://assarbad.net/de/stuff/!import/nico.old/
|
||||
|
Reference in New Issue
Block a user