mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Display parameters of stored routines in "Cols" tab of query helpers when a procedure or function is selected. Fixes issue #1702.
This commit is contained in:
@ -24,7 +24,7 @@ const
|
|||||||
REGPATH = '\Software\' + APPNAME + '\';
|
REGPATH = '\Software\' + APPNAME + '\';
|
||||||
REGKEY_SESSIONS = 'Servers\';
|
REGKEY_SESSIONS = 'Servers\';
|
||||||
// Some unique char, used to separate e.g. selected columns in registry
|
// Some unique char, used to separate e.g. selected columns in registry
|
||||||
REGDELIM = '|';
|
DELIM = '|';
|
||||||
STATUS_MSG_READY = 'Ready.';
|
STATUS_MSG_READY = 'Ready.';
|
||||||
STR_NOTSUPPORTED = 'Not supported by this server';
|
STR_NOTSUPPORTED = 'Not supported by this server';
|
||||||
|
|
||||||
|
@ -5087,6 +5087,7 @@ var
|
|||||||
SnippetsAccessible : Boolean;
|
SnippetsAccessible : Boolean;
|
||||||
Files: TStringList;
|
Files: TStringList;
|
||||||
Col: TTableColumn;
|
Col: TTableColumn;
|
||||||
|
Param: String;
|
||||||
begin
|
begin
|
||||||
ActiveQueryHelpers.Items.BeginUpdate;
|
ActiveQueryHelpers.Items.BeginUpdate;
|
||||||
ActiveQueryHelpers.Items.Clear;
|
ActiveQueryHelpers.Items.Clear;
|
||||||
@ -5108,12 +5109,22 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Keep native order of columns
|
// Keep native order of columns
|
||||||
ActiveQueryHelpers.Sorted := False;
|
ActiveQueryHelpers.Sorted := False;
|
||||||
menuQueryHelpersGenerateInsert.Enabled := True;
|
case SelectedTable.NodeType of
|
||||||
menuQueryHelpersGenerateUpdate.Enabled := True;
|
lntTable: begin
|
||||||
menuQueryHelpersGenerateDelete.Enabled := True;
|
menuQueryHelpersGenerateInsert.Enabled := True;
|
||||||
for i:=0 to SelectedTableColumns.Count-1 do begin
|
menuQueryHelpersGenerateUpdate.Enabled := True;
|
||||||
Col := TTableColumn(SelectedTableColumns[i]);
|
menuQueryHelpersGenerateDelete.Enabled := True;
|
||||||
ActiveQueryHelpers.Items.Add(Col.Name);
|
for i:=0 to SelectedTableColumns.Count-1 do begin
|
||||||
|
Col := TTableColumn(SelectedTableColumns[i]);
|
||||||
|
ActiveQueryHelpers.Items.Add(Col.Name);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
lntFunction, lntProcedure: if Assigned(RoutineEditor) then begin
|
||||||
|
for i:=0 to RoutineEditor.Parameters.Count-1 do begin
|
||||||
|
Param := Copy(RoutineEditor.Parameters[i], 1, Pos(DELIM, RoutineEditor.Parameters[i])-1);
|
||||||
|
ActiveQueryHelpers.Items.Add(Param);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -7637,7 +7648,7 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
// Save current attributes if grid gets refreshed
|
// Save current attributes if grid gets refreshed
|
||||||
HiddenCols := TStringList.Create;
|
HiddenCols := TStringList.Create;
|
||||||
HiddenCols.Delimiter := REGDELIM;
|
HiddenCols.Delimiter := DELIM;
|
||||||
HiddenCols.StrictDelimiter := True;
|
HiddenCols.StrictDelimiter := True;
|
||||||
if FDataGridSelect.Count > 0 then for i:=0 to SelectedTableColumns.Count-1 do begin
|
if FDataGridSelect.Count > 0 then for i:=0 to SelectedTableColumns.Count-1 do begin
|
||||||
Col := TTableColumn(SelectedTableColumns[i]);
|
Col := TTableColumn(SelectedTableColumns[i]);
|
||||||
@ -7656,7 +7667,7 @@ begin
|
|||||||
MainReg.DeleteValue(REGNAME_FILTER);
|
MainReg.DeleteValue(REGNAME_FILTER);
|
||||||
|
|
||||||
for i := 0 to High(FDataGridSort) do
|
for i := 0 to High(FDataGridSort) do
|
||||||
Sort := Sort + IntToStr(FDataGridSort[i].SortDirection) + '_' + FDataGridSort[i].ColumnName + REGDELIM;
|
Sort := Sort + IntToStr(FDataGridSort[i].SortDirection) + '_' + FDataGridSort[i].ColumnName + DELIM;
|
||||||
if Sort <> '' then
|
if Sort <> '' then
|
||||||
MainReg.WriteString(REGNAME_SORT, Sort)
|
MainReg.WriteString(REGNAME_SORT, Sort)
|
||||||
else if MainReg.ValueExists(REGNAME_SORT) then
|
else if MainReg.ValueExists(REGNAME_SORT) then
|
||||||
@ -7683,7 +7694,7 @@ begin
|
|||||||
// Columns
|
// Columns
|
||||||
if MainReg.ValueExists(REGNAME_HIDDENCOLUMNS) then begin
|
if MainReg.ValueExists(REGNAME_HIDDENCOLUMNS) then begin
|
||||||
HiddenCols := TStringList.Create;
|
HiddenCols := TStringList.Create;
|
||||||
HiddenCols.Delimiter := REGDELIM;
|
HiddenCols.Delimiter := DELIM;
|
||||||
HiddenCols.StrictDelimiter := True;
|
HiddenCols.StrictDelimiter := True;
|
||||||
HiddenCols.DelimitedText := MainReg.ReadString(REGNAME_HIDDENCOLUMNS);
|
HiddenCols.DelimitedText := MainReg.ReadString(REGNAME_HIDDENCOLUMNS);
|
||||||
FDataGridSelect.Clear;
|
FDataGridSelect.Clear;
|
||||||
@ -7706,7 +7717,7 @@ begin
|
|||||||
if MainReg.ValueExists(REGNAME_SORT) then begin
|
if MainReg.ValueExists(REGNAME_SORT) then begin
|
||||||
SetLength(FDataGridSort, 0);
|
SetLength(FDataGridSort, 0);
|
||||||
rx := TRegExpr.Create;
|
rx := TRegExpr.Create;
|
||||||
rx.Expression := '\b(\d)_(.+)\'+REGDELIM;
|
rx.Expression := '\b(\d)_(.+)\'+DELIM;
|
||||||
rx.ModifierG := False;
|
rx.ModifierG := False;
|
||||||
if rx.Exec(MainReg.ReadString(REGNAME_SORT)) then while true do begin
|
if rx.Exec(MainReg.ReadString(REGNAME_SORT)) then while true do begin
|
||||||
idx := Length(FDataGridSort);
|
idx := Length(FDataGridSort);
|
||||||
@ -7732,7 +7743,7 @@ function TMainForm.GetRegKeyTable: String;
|
|||||||
begin
|
begin
|
||||||
// Return the slightly complex registry path to \Servers\ThisServer\curdb|curtable
|
// Return the slightly complex registry path to \Servers\ThisServer\curdb|curtable
|
||||||
Result := REGPATH + REGKEY_SESSIONS + SessionName + '\' +
|
Result := REGPATH + REGKEY_SESSIONS + SessionName + '\' +
|
||||||
ActiveDatabase + REGDELIM + SelectedTable.Name;
|
ActiveDatabase + DELIM + SelectedTable.Name;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,10 +67,10 @@ type
|
|||||||
procedure btnDiscardClick(Sender: TObject);
|
procedure btnDiscardClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
Parameters: TStringList;
|
|
||||||
FAlterRoutineType: String;
|
FAlterRoutineType: String;
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
|
Parameters: TStringList;
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Init(ObjectName: String=''; ObjectType: TListNodeType=lntNone); override;
|
procedure Init(ObjectName: String=''; ObjectType: TListNodeType=lntNone); override;
|
||||||
@ -84,9 +84,6 @@ uses main, mysql_structures, grideditlinks;
|
|||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
const
|
|
||||||
DELIM = '|';
|
|
||||||
|
|
||||||
|
|
||||||
constructor TfrmRoutineEditor.Create(AOwner: TComponent);
|
constructor TfrmRoutineEditor.Create(AOwner: TComponent);
|
||||||
var
|
var
|
||||||
|
Reference in New Issue
Block a user