File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1442,6 +1442,24 @@ func (c *cc) convertCallStmt(n *pcast.CallStmt) ast.Node {
14421442 }
14431443}
14441444
1445+ func (c * cc ) convertProcedureInfo (n * pcast.ProcedureInfo ) ast.Node {
1446+ var params ast.List
1447+ for _ , sp := range n .ProcedureParam {
1448+ paramName := sp .ParamName
1449+ params .Items = append (params .Items , & ast.FuncParam {
1450+ Name : & paramName ,
1451+ Type : & ast.TypeName {Name : types .TypeToStr (sp .ParamType .GetType (), sp .ParamType .GetCharset ())},
1452+ })
1453+ }
1454+ return & ast.CreateFunctionStmt {
1455+ Params : & params ,
1456+ Func : & ast.FuncName {
1457+ Schema : n .ProcedureName .Schema .L ,
1458+ Name : n .ProcedureName .Name .L ,
1459+ },
1460+ }
1461+ }
1462+
14451463func (c * cc ) convert (node pcast.Node ) ast.Node {
14461464 switch n := node .(type ) {
14471465
@@ -1718,6 +1736,9 @@ func (c *cc) convert(node pcast.Node) ast.Node {
17181736 case * pcast.PrivElem :
17191737 return c .convertPrivElem (n )
17201738
1739+ case * pcast.ProcedureInfo :
1740+ return c .convertProcedureInfo (n )
1741+
17211742 case * pcast.RecoverTableStmt :
17221743 return c .convertRecoverTableStmt (n )
17231744
You can’t perform that action at this time.
0 commit comments