Skip to content

Commit 017ff36

Browse files
re-try
1 parent 9ba5095 commit 017ff36

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

internal/stackql/router/parameter_router.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ func (pr *standardParameterRouter) route(
531531
}
532532
t, ok := pr.tablesAliasMap[alias]
533533
if !ok {
534-
return nil, fmt.Errorf("alias '%s' does not map to any table expression", alias)
534+
// Skip params from parent queries whose alias is not in the current scope.
535+
// This occurs when indirections (views, subqueries) inherit parent WHERE params.
536+
continue
535537
}
536538
if t == tb {
537539
ref, ok := pr.colRefs[k]
@@ -549,7 +551,8 @@ func (pr *standardParameterRouter) route(
549551
}
550552
t, ok := pr.tablesAliasMap[alias]
551553
if !ok {
552-
return nil, fmt.Errorf("alias '%s' does not map to any table expression", alias)
554+
// Skip params from parent queries whose alias is not in the current scope.
555+
continue
553556
}
554557
if t == tb {
555558
ref, ok := pr.colRefs[k]

test/robot/functional/stackql_mocked_from_cmd_line.robot

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9479,20 +9479,6 @@ Left Outer Join Positive LHS Inline
94799479
... stdout=${CURDIR}/tmp/Left-Outer-Join-Positive-LHS-Inline.tmp
94809480
... stderr=${CURDIR}/tmp/Left-Outer-Join-Positive-LHS-Inline-stderr.tmp
94819481

9482-
View Depth Limitation Error Message Shows Correct Max
9483-
Should Stackql Exec Inline Contain Stderr
9484-
... ${STACKQL_EXE}
9485-
... ${OKTA_SECRET_STR}
9486-
... ${GITHUB_SECRET_STR}
9487-
... ${K8S_SECRET_STR}
9488-
... ${REGISTRY_NO_VERIFY_CFG_STR}
9489-
... ${AUTH_CFG_STR}
9490-
... ${SQL_BACKEND_CFG_STR_CANONICAL}
9491-
... create view zz1 as select name from stackql_repositories; create view zz2 as select name from zz1; create view zz3 as select name from zz2; create view zz4 as select name from zz3; create view zz5 as select name from zz4; select * from zz5;
9492-
... indirection chain length 6 > 5
9493-
... stdout=${CURDIR}/tmp/View-Depth-Limitation-Error-Message-Shows-Correct-Max-stdout.tmp
9494-
... stderr=${CURDIR}/tmp/View-Depth-Limitation-Error-Message-Shows-Correct-Max-stderr.tmp
9495-
94969482
View JOIN View Returns Results
94979483
${inputStr} = Catenate
94989484
... create or replace view vw_repos_name as select name from stackql_repositories;
@@ -9528,6 +9514,21 @@ View JOIN Provider Table Returns Results
95289514
... stdout=${CURDIR}/tmp/View-JOIN-Provider-Table-Returns-Results-stdout.tmp
95299515
... stderr=${CURDIR}/tmp/View-JOIN-Provider-Table-Returns-Results-stderr.tmp
95309516

9517+
View Depth Limitation Error Message Shows Correct Max
9518+
Should Stackql Exec Inline Contain Stderr
9519+
... ${STACKQL_EXE}
9520+
... ${OKTA_SECRET_STR}
9521+
... ${GITHUB_SECRET_STR}
9522+
... ${K8S_SECRET_STR}
9523+
... ${REGISTRY_NO_VERIFY_CFG_STR}
9524+
... ${AUTH_CFG_STR}
9525+
... ${SQL_BACKEND_CFG_STR_CANONICAL}
9526+
... create view zz1 as select name from stackql_repositories; create view zz2 as select name from zz1; create view zz3 as select name from zz2; create view zz4 as select name from zz3; create view zz5 as select name from zz4; select * from zz5;
9527+
... indirection chain length 6 > 5
9528+
... stdout=${CURDIR}/tmp/View-Depth-Limitation-Error-Message-Shows-Correct-Max-stdout.tmp
9529+
... stderr=${CURDIR}/tmp/View-Depth-Limitation-Error-Message-Shows-Correct-Max-stderr.tmp
9530+
9531+
95319532
Subquery JOIN Subquery Returns Results
95329533
${inputStr} = Catenate
95339534
... select a.name from (select name from stackql_repositories) a inner join (select name, url from stackql_repositories) b on a.name = b.name;

0 commit comments

Comments
 (0)