8000 use StarExpr in FUNC(*) by tbg · Pull Request #1815 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

use StarExpr in FUNC(*) #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sql/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (p *planner) Delete(n *parser.Delete) (planNode, error) {
// deleting.
node, err := p.Select(&parser.Select{
Exprs: parser.SelectExprs{
&parser.StarExpr{TableName: parser.Name(tableDesc.Name)},
&parser.StarExpr{TableName: parser.QualifiedName{tableDesc.Name}},
},
From: parser.TableExprs{n.Table},
Where: n.Where,
Expand Down
5 changes: 3 additions & 2 deletions sql/parser/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ func (*NonStarExpr) selectExpr() {}
// TODO(tschottdorf): needs work, see #1810. TableName is never even referenced
// in the grammar so far.
type StarExpr struct {
TableName Name
Expr
TableName QualifiedName
}

func (node *StarExpr) String() string {
var buf bytes.Buffer
if node.TableName != "" {
if len(node.TableName) != 0 {
fmt.Fprintf(&buf, "%s.", node.TableName)
}
fmt.Fprintf(&buf, "*")
Expand Down
2 changes: 1 addition & 1 deletion sql/parser/sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ func_application:
}
| func_name '(' '*' ')'
{
$$ = &FuncExpr{Name: $1, Exprs: Exprs{QualifiedName{"*"}}}
$$ = &FuncExpr{Name: $1, Exprs: Exprs{&StarExpr{}}}
}

// func_expr and its cousin func_expr_windowless are split out from c_expr just
Expand Down
0