(pos Pos)
| 359 | } |
| 360 | |
| 361 | func (p *Parser) parsePartitionClause(pos Pos) (*PartitionClause, error) { |
| 362 | if err := p.expectKeyword(KeywordPartition); err != nil { |
| 363 | return nil, err |
| 364 | } |
| 365 | |
| 366 | partition := &PartitionClause{ |
| 367 | PartitionPos: pos, |
| 368 | } |
| 369 | if p.tryConsumeKeywords(KeywordId) { |
| 370 | id, err := p.parseString(p.Pos()) |
| 371 | if err != nil { |
| 372 | return nil, err |
| 373 | } |
| 374 | partition.ID = id |
| 375 | } else if p.tryConsumeKeywords(KeywordAll) { |
| 376 | partition.All = true |
| 377 | } else { |
| 378 | expr, err := p.parseExpr(p.Pos()) |
| 379 | if err != nil { |
| 380 | return nil, err |
| 381 | } |
| 382 | partition.Expr = expr |
| 383 | } |
| 384 | return partition, nil |
| 385 | } |
| 386 | |
| 387 | // Syntax: ALTER TABLE ATTACH partitionClause (FROM tableIdentifier)? |
| 388 | func (p *Parser) parseAlterTableAttachPartition(pos Pos) (AlterTableClause, error) { |
no test coverage detected