Skip to content

Commit 7823e32

Browse files
authored
fix another bug with badTable (#6567)
1 parent 6ba9469 commit 7823e32

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

compiler/semantic/op.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,13 @@ func (t *translator) semOp(o ast.Op, seq sem.Seq, inType super.Type) (sem.Seq, s
586586
case *ast.SQLOp:
587587
seq, sch := t.sqlQueryBody(o.Body, nil, seq, inType)
588588
seq, scope := sch.endScope(o.Body, seq)
589-
return seq, scope.typ
589+
var typ super.Type
590+
if scope != badTable {
591+
typ = scope.typ
592+
} else {
593+
typ = t.checker.unknown
594+
}
595+
return seq, typ
590596
case *ast.FileScan:
591597
format := t.env.ReaderOpts.Format
592598
fuser := t.checker.newFuser()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
script: |
2+
! super -dynamic -s -I query.spq
3+
4+
inputs:
5+
- name: query.spq
6+
data: |
7+
SELECT *
8+
FROM a.sup
9+
| fork
10+
( pass )
11+
( SELECT 1 )
12+
- name: a.sup
13+
data: |
14+
{a:1}
15+
16+
outputs:
17+
- name: stderr
18+
data: |
19+
the all-columns (*) pattern cannot be used for dynamic inputs in query.spq at line 1, column 8:
20+
SELECT *
21+
~

0 commit comments

Comments
 (0)