@@ -30,9 +30,6 @@ import (
3030 "sync/atomic"
3131 "time"
3232
33- "github.com/tidwall/btree"
34- "golang.org/x/sync/errgroup"
35-
3633 "github.com/matrixorigin/matrixone/pkg/catalog"
3734 "github.com/matrixorigin/matrixone/pkg/clusterservice"
3835 "github.com/matrixorigin/matrixone/pkg/common/moerr"
@@ -49,12 +46,12 @@ import (
4946 "github.com/matrixorigin/matrixone/pkg/pb/query"
5047 "github.com/matrixorigin/matrixone/pkg/pb/task"
5148 "github.com/matrixorigin/matrixone/pkg/queryservice"
49+ "github.com/matrixorigin/matrixone/pkg/sql/function"
5250 "github.com/matrixorigin/matrixone/pkg/sql/parsers"
5351 "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect"
5452 "github.com/matrixorigin/matrixone/pkg/sql/parsers/dialect/mysql"
5553 "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree"
56- plan2 "github.com/matrixorigin/matrixone/pkg/sql/plan"
57- "github.com/matrixorigin/matrixone/pkg/sql/plan/function"
54+ "github.com/matrixorigin/matrixone/pkg/sql/planner"
5855 "github.com/matrixorigin/matrixone/pkg/sql/util"
5956 "github.com/matrixorigin/matrixone/pkg/stage"
6057 "github.com/matrixorigin/matrixone/pkg/stage/stageutil"
@@ -65,6 +62,8 @@ import (
6562 "github.com/matrixorigin/matrixone/pkg/util/trace"
6663 "github.com/matrixorigin/matrixone/pkg/util/trace/impl/motrace"
6764 "github.com/matrixorigin/matrixone/pkg/util/trace/impl/motrace/statistic"
65+ "github.com/tidwall/btree"
66+ "golang.org/x/sync/errgroup"
6867)
6968
7069type TenantInfo struct {
@@ -4559,7 +4558,7 @@ func doDropFunction(ctx context.Context, ses *Session, df *tree.DropFunction, rm
45594558 if execResultArrayHasData (erArray ) {
45604559 receivedArgsType := make ([]string , len (df .Args ))
45614560 for i , arg := range df .Args {
4562- typ , err := plan2 .GetFunctionArgTypeStrFromAst (arg )
4561+ typ , err := planner .GetFunctionArgTypeStrFromAst (arg )
45634562 if err != nil {
45644563 return err
45654564 }
@@ -6043,7 +6042,7 @@ func (pota privilegeTipsArray) String() string {
60436042}
60446043
60456044// extractPrivilegeTipsFromPlan extracts the privilege tips from the plan
6046- func extractPrivilegeTipsFromPlan (p * plan2 .Plan ) privilegeTipsArray {
6045+ func extractPrivilegeTipsFromPlan (p * plan .Plan ) privilegeTipsArray {
60476046 //NOTE: the pts may be nil when the plan does operate any table.
60486047 var pts privilegeTipsArray
60496048 appendPt := func (pt privilegeTips ) {
@@ -7167,7 +7166,7 @@ func checkRoleWhetherDatabaseOwner(ctx context.Context, ses *Session, dbName str
71677166func authenticateUserCanExecuteStatementWithObjectTypeDatabaseAndTable (ctx context.Context ,
71687167 ses * Session ,
71697168 stmt tree.Statement ,
7170- p * plan2 .Plan ) (bool , statistic.StatsArray , error ) {
7169+ p * plan .Plan ) (bool , statistic.StatsArray , error ) {
71717170 var stats statistic.StatsArray
71727171 stats .Reset ()
71737172
@@ -8718,7 +8717,7 @@ func InitFunction(ses *Session, execCtx *ExecCtx, tenant *TenantInfo, cf *tree.C
87188717
87198718 // format return type
87208719 fmtctx = tree .NewFmtCtx (dialect .MYSQL , tree .WithQuoteString (true ))
8721- retTypeStr , err = plan2 .GetFunctionTypeStrFromAst (cf .ReturnType .Type )
8720+ retTypeStr , err = planner .GetFunctionTypeStrFromAst (cf .ReturnType .Type )
87228721 if err != nil {
87238722 return err
87248723 }
@@ -8730,7 +8729,7 @@ func InitFunction(ses *Session, execCtx *ExecCtx, tenant *TenantInfo, cf *tree.C
87308729 argList [i ] = & function.Arg {}
87318730 argList [i ].Name = cf .Args [i ].GetName (fmtctx )
87328731 fmtctx .Reset ()
8733- typ , err := plan2 .GetFunctionArgTypeStrFromAst (cf .Args [i ])
8732+ typ , err := planner .GetFunctionArgTypeStrFromAst (cf .Args [i ])
87348733 if err != nil {
87358734 return err
87368735 }
@@ -8924,14 +8923,14 @@ func InitProcedure(ctx context.Context, ses *Session, tenant *TenantInfo, cp *tr
89248923 }
89258924 initMoProcedure = fmt .Sprintf (updateMoStoredProcedureFormat ,
89268925 string (argsJson ),
8927- cp .Lang , plan2 .EscapeFormat (cp .Body ), dbName ,
8926+ cp .Lang , planner .EscapeFormat (cp .Body ), dbName ,
89288927 tenant .GetUser (), types .CurrentTimestamp ().String2 (time .UTC , 0 ), "PROCEDURE" , "DEFINER" , "" , "utf8mb4" , "utf8mb4_0900_ai_ci" , "utf8mb4_0900_ai_ci" ,
89298928 int32 (id ))
89308929 } else {
89318930 initMoProcedure = fmt .Sprintf (initMoStoredProcedureFormat ,
89328931 string (cp .Name .Name .ObjectName ),
89338932 string (argsJson ),
8934- cp .Lang , plan2 .EscapeFormat (cp .Body ), dbName ,
8933+ cp .Lang , planner .EscapeFormat (cp .Body ), dbName ,
89358934 tenant .GetUser (), types .CurrentTimestamp ().String2 (time .UTC , 0 ), types .CurrentTimestamp ().String2 (time .UTC , 0 ), "PROCEDURE" , "DEFINER" , "" , "utf8mb4" , "utf8mb4_0900_ai_ci" , "utf8mb4_0900_ai_ci" )
89368935 }
89378936 err = bh .Exec (ctx , initMoProcedure )
0 commit comments