mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
This commit is contained in:
@ -162,7 +162,7 @@ begin
|
||||
lntProcedure: comboType.ItemIndex := 0;
|
||||
lntFunction: comboType.ItemIndex := 1;
|
||||
end;
|
||||
DBObject.Connection.ParseRoutineStructure(Obj.CreateCode, Parameters, Deterministic, Definer, Returns, DataAccess, Security, Comment, Body);
|
||||
DBObject.Connection.ParseRoutineStructure(Obj, Parameters, Deterministic, Definer, Returns, DataAccess, Security, Comment, Body);
|
||||
comboReturns.Text := Returns;
|
||||
chkDeterministic.Checked := Deterministic;
|
||||
if DataAccess <> '' then
|
||||
@ -173,16 +173,6 @@ begin
|
||||
comboDefiner.Text := Definer;
|
||||
// The whole CREATE CODE may be empty if the user is not allowed to view code in SHOW CREATE FUNCTION
|
||||
// => Disable the whole editor in this case.
|
||||
// Also, only the body may be empty, because ParseRoutineBody did not get a BEGIN..END block to see.
|
||||
// See http://www.heidisql.com/forum.php?t=12075
|
||||
// => Get the body from information_schema
|
||||
if Body = '' then begin
|
||||
Body := Obj.Connection.GetVar('SELECT '+Obj.Connection.QuoteIdent('ROUTINE_DEFINITION')+' FROM information_schema.'+Obj.Connection.QuoteIdent('ROUTINES')+
|
||||
' WHERE '+Obj.Connection.QuoteIdent('ROUTINE_SCHEMA')+'='+esc(Obj.Database)+
|
||||
' AND '+Obj.Connection.QuoteIdent('ROUTINE_NAME')+'='+esc(Obj.Name)+
|
||||
' AND '+Obj.Connection.QuoteIdent('ROUTINE_TYPE')+'='+esc(FAlterRoutineType)
|
||||
);
|
||||
end;
|
||||
SynMemoBody.Text := Body;
|
||||
lblDisabledWhy.Visible := Body = '';
|
||||
PageControlMain.Enabled := not lblDisabledWhy.Visible;
|
||||
|
Reference in New Issue
Block a user