Syntax: ALTER TABLE DROP partitionClause
(pos Pos)
| 462 | |
| 463 | // Syntax: ALTER TABLE DROP partitionClause |
| 464 | func (p *Parser) parseAlterTableDropPartition(pos Pos) (AlterTableClause, error) { |
| 465 | var hasDetached bool |
| 466 | if p.matchKeyword(KeywordDetached) { |
| 467 | _ = p.lexer.consumeToken() |
| 468 | hasDetached = true |
| 469 | } |
| 470 | partitionPos := p.Pos() |
| 471 | if err := p.expectKeyword(KeywordPartition); err != nil { |
| 472 | return nil, err |
| 473 | } |
| 474 | partition := &PartitionClause{ |
| 475 | PartitionPos: partitionPos, |
| 476 | } |
| 477 | expr, err := p.parseExpr(p.Pos()) |
| 478 | if err != nil { |
| 479 | return nil, err |
| 480 | } |
| 481 | partition.Expr = expr |
| 482 | |
| 483 | settings, err := p.tryParseSettingsClause(p.Pos()) |
| 484 | if err != nil { |
| 485 | return nil, err |
| 486 | } |
| 487 | |
| 488 | return &AlterTableDropPartition{ |
| 489 | DropPos: pos, |
| 490 | Partition: partition, |
| 491 | HasDetached: hasDetached, |
| 492 | Settings: settings, |
| 493 | }, nil |
| 494 | } |
| 495 | |
| 496 | func (p *Parser) parseAlterTableFreezePartition(pos Pos) (AlterTableClause, error) { |
| 497 | if err := p.expectKeyword(KeywordFreeze); err != nil { |
no test coverage detected