Skip to content

Commit 7bfb2ee

Browse files
authored
fix(sql): Truncate unexpected columns during join
Merge pull request #1559 from qri-io/fix-join-extra-columns
2 parents 4f0e852 + 677b06a commit 7bfb2ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/qds/datasource.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ func (rs *RecordStream) Next(ctx context.Context) (*execution.Record, error) {
179179

180180
aliasedRecord := make(map[octosql.VariableName]octosql.Value)
181181
if rec, ok := ent.Value.([]interface{}); ok {
182-
for i, x := range rec {
182+
// TODO(dustmop): Add tests for sql command, especially for this line which
183+
// iterates over only a slice of the records.
184+
for i, x := range rec[:len(rs.aliasedFields)] {
183185
switch v := x.(type) {
184186
case string:
185187
aliasedRecord[rs.aliasedFields[i]] = octosql.MakeString(v)

0 commit comments

Comments
 (0)