Skip to content
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
8 changes: 7 additions & 1 deletion compiler/semantic/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,13 @@ func (t *translator) semOp(o ast.Op, seq sem.Seq, inType super.Type) (sem.Seq, s
case *ast.SQLOp:
seq, sch := t.sqlQueryBody(o.Body, nil, seq, inType)
seq, scope := sch.endScope(o.Body, seq)
return seq, scope.typ
var typ super.Type
if scope != badTable {
typ = scope.typ
} else {
typ = t.checker.unknown
}
return seq, typ
case *ast.FileScan:
format := t.env.ReaderOpts.Format
fuser := t.checker.newFuser()
Expand Down
21 changes: 21 additions & 0 deletions compiler/ztests/sql/fork-type-check-err.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
script: |
! super -dynamic -s -I query.spq

inputs:
- name: query.spq
data: |
SELECT *
FROM a.sup
| fork
( pass )
( SELECT 1 )
- name: a.sup
data: |
{a:1}

outputs:
- name: stderr
data: |
the all-columns (*) pattern cannot be used for dynamic inputs in query.spq at line 1, column 8:
SELECT *
~