(n ast.Node, table string, path field.Path)
| 382 | } |
| 383 | |
| 384 | func (j *joinUsingScope) star(n ast.Node, table string, path field.Path) ([]*sem.ThisExpr, error) { |
| 385 | if table != "" { |
| 386 | // If this is a table.* match, then we don't need to worry about putting |
| 387 | // the USING columns on the left. Just let the underlying join do the work. |
| 388 | return j.joinScope.star(n, table, path) |
| 389 | } |
| 390 | // ANSI SQL says the USING columns are leftmost in the table, then the remaining. |
| 391 | var out []*sem.ThisExpr |
| 392 | for _, col := range j.columns { |
| 393 | left, _, err := j.left.resolveUnqualified(col) |
| 394 | if err != nil { |
| 395 | return nil, err |
| 396 | } |
| 397 | p := append(append(path, "left"), left...) |
| 398 | this := sem.NewThis(n, p) |
| 399 | out = append(out, this) |
| 400 | } |
| 401 | var err error |
| 402 | out, err = j.filterAppend(out, j.left, n, append(path, "left")) |
| 403 | if err != nil { |
| 404 | return nil, err |
| 405 | } |
| 406 | return j.filterAppend(out, j.right, n, append(path, "right")) |
| 407 | } |
| 408 | |
| 409 | func (j *joinUsingScope) filterAppend(out []*sem.ThisExpr, rs relScope, n ast.Node, path []string) ([]*sem.ThisExpr, error) { |
| 410 | exprs, err := rs.star(n, "", path) |
nothing calls this directly
no test coverage detected