github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/select_name_resolution.go (about) 1 // Copyright 2016 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 // 11 // This file implements the select code that deals with column references 12 // and resolving column names in expressions. 13 14 package sql 15 16 import ( 17 "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" 18 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" 19 ) 20 21 // resolveNames walks the provided expression and resolves all names 22 // using the tableInfo and iVarHelper. 23 func (p *planner) resolveNames( 24 expr tree.Expr, source *sqlbase.DataSourceInfo, ivarHelper tree.IndexedVarHelper, 25 ) (tree.Expr, error) { 26 if expr == nil { 27 return nil, nil 28 } 29 return sqlbase.ResolveNamesUsingVisitor(&p.nameResolutionVisitor, expr, source, ivarHelper, p.SessionData().SearchPath) 30 }