Skip to content

Commit 724c51d

Browse files
author
James Cor
committed
error changes
1 parent a7ebd3f commit 724c51d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sql/analyzer/stored_procedures.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ func applyProcedures(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scop
177177
}()
178178
}
179179

180+
esp, err := a.Catalog.ExternalStoredProcedure(ctx, call.Name, len(call.Params))
181+
if err != nil {
182+
return nil, transform.SameTree, err
183+
}
184+
if esp != nil {
185+
return call, transform.SameTree, nil
186+
}
187+
180188
if _, isStoredProcDb := call.Database().(sql.StoredProcedureDatabase); !isStoredProcDb {
181189
return nil, transform.SameTree, sql.ErrStoredProceduresNotSupported.New(call.Database().Name())
182190
}

sql/planbuilder/proc.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ func (b *Builder) buildCall(inScope *scope, c *ast.Call) (outScope *scope) {
310310
db = b.resolveDb(dbName)
311311
} else if b.ctx.GetCurrentDatabase() != "" {
312312
db = b.currentDb()
313-
} else {
314-
b.handleErr(sql.ErrDatabaseNotFound.New(c.ProcName.Qualifier.String()))
315313
}
316314

317315
var proc *plan.Procedure

0 commit comments

Comments
 (0)