@@ -80,26 +80,28 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar,
80
80
aliasMap [* rv .Alias .Aliasname ] = fqn
81
81
}
82
82
}
83
- for _ , f := range qc .fromClauses {
84
- catCols := make ([]* catalog.Column , 0 , len (f .Columns ))
85
- for _ , col := range f .Columns {
86
- catCols = append (catCols , & catalog.Column {
87
- Name : col .Name ,
88
- Type : ast.TypeName {Name : col .DataType },
89
- IsNotNull : col .NotNull ,
90
- IsUnsigned : col .Unsigned ,
91
- IsArray : col .IsArray ,
92
- ArrayDims : col .ArrayDims ,
93
- Comment : col .Comment ,
94
- Length : col .Length ,
95
- })
96
- }
83
+ if qc != nil {
84
+ for _ , f := range qc .fromClauses {
85
+ catCols := make ([]* catalog.Column , 0 , len (f .Columns ))
86
+ for _ , col := range f .Columns {
87
+ catCols = append (catCols , & catalog.Column {
88
+ Name : col .Name ,
89
+ Type : ast.TypeName {Name : col .DataType },
90
+ IsNotNull : col .NotNull ,
91
+ IsUnsigned : col .Unsigned ,
92
+ IsArray : col .IsArray ,
93
+ ArrayDims : col .ArrayDims ,
94
+ Comment : col .Comment ,
95
+ Length : col .Length ,
96
+ })
97
+ }
97
98
98
- if err := indexTable (catalog.Table {
99
- Rel : f .Rel ,
100
- Columns : catCols ,
101
- }); err != nil {
102
- return nil , err
99
+ if err := indexTable (catalog.Table {
100
+ Rel : f .Rel ,
101
+ Columns : catCols ,
102
+ }); err != nil {
103
+ return nil , err
104
+ }
103
105
}
104
106
}
105
107
0 commit comments