diff --git a/pkg/sql/plan/function/stage_util.go b/pkg/sql/plan/function/stage_util.go index fed5b9c5bdbd..f9c2b6e52c31 100644 --- a/pkg/sql/plan/function/stage_util.go +++ b/pkg/sql/plan/function/stage_util.go @@ -172,7 +172,7 @@ func runSql(proc *process.Process, sql string) (executor.Result, error) { WithDatabase(proc.GetSessionInfo().Database). WithTimeZone(proc.GetSessionInfo().TimeZone). WithAccountID(proc.GetSessionInfo().AccountId) - return exec.Exec(proc.Ctx, sql, opts) + return exec.Exec(proc.GetTopContext(), sql, opts) } func credentialsToMap(cred string) (map[string]string, error) {