Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optbuilder: fix recently introduced nil pointer in error case #121222

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/procedure
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ CALL first_value(1);
statement error pgcode 42809 addgeometrycolumn is not a procedure
CALL addgeometrycolumn(null, null, null, null, null);

let $funcOID
SELECT oid FROM pg_proc WHERE proname = 'count_rows';

statement error pgcode 42809 count_rows is not a procedure
CALL [ FUNCTION $funcOID ] ();

statement ok
CREATE PROCEDURE p_inner(OUT param INTEGER) AS $$ SELECT 1; $$ LANGUAGE SQL;

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/opt/optbuilder/routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (b *Builder) buildProcedure(c *tree.Call, inScope *scope) *scope {
f, ok := typedExpr.(*tree.FuncExpr)
if !ok {
panic(pgerror.Newf(pgcode.WrongObjectType,
"%s is not a procedure", c.Proc.Func.ReferenceByName.String(),
"%s is not a procedure", c.Proc.Func.String(),
))
}

Expand Down
Loading