Skip to content

Commit

Permalink
Add tables suggestion for ALTER, INSERT, UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
tzzed committed Aug 26, 2020
1 parent 051eb5e commit 3766f80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sql/parser/alter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ func (p *Parser) parseAlterStatement() (query.AlterStmt, error) {
// Parse table name.
stmt.TableName, err = p.parseIdent()
if err != nil {
return stmt, err
pErr := err.(*ParseError)
pErr.Expected = []string{"table_name"}
return stmt, pErr
}

// Parse "RENAME".
Expand Down
4 changes: 3 additions & 1 deletion sql/parser/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ func (p *Parser) parseInsertStatement() (query.InsertStmt, error) {
// Parse table name
stmt.TableName, err = p.parseIdent()
if err != nil {
return stmt, err
pErr := err.(*ParseError)
pErr.Expected = []string{"table_name"}
return stmt, pErr
}

valueParser := p.parseParamOrDocument
Expand Down
4 changes: 3 additions & 1 deletion sql/parser/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ func (p *Parser) parseUpdateStatement() (*planner.Tree, error) {
// Parse table name
cfg.TableName, err = p.parseIdent()
if err != nil {
return nil, err
pErr := err.(*ParseError)
pErr.Expected = []string{"table_name"}
return nil, pErr
}

// Parse clause: SET or UNSET.
Expand Down

0 comments on commit 3766f80

Please sign in to comment.