(pos Pos)
| 34 | } |
| 35 | |
| 36 | func (p *Parser) parseSystemFlushExpr(pos Pos) (*SystemFlushExpr, error) { |
| 37 | if err := p.expectKeyword(KeywordFlush); err != nil { |
| 38 | return nil, err |
| 39 | } |
| 40 | |
| 41 | switch { |
| 42 | case p.matchKeyword(KeywordLogs): |
| 43 | lastToken := p.last() |
| 44 | _ = p.lexer.consumeToken() |
| 45 | return &SystemFlushExpr{ |
| 46 | FlushPos: pos, |
| 47 | StatementEnd: lastToken.End, |
| 48 | Logs: true, |
| 49 | }, nil |
| 50 | case p.tryConsumeKeywords(KeywordDistributed): |
| 51 | distributed, err := p.parseTableIdentifier(p.Pos()) |
| 52 | if err != nil { |
| 53 | return nil, err |
| 54 | } |
| 55 | return &SystemFlushExpr{ |
| 56 | FlushPos: pos, |
| 57 | StatementEnd: distributed.End(), |
| 58 | Distributed: distributed, |
| 59 | }, nil |
| 60 | default: |
| 61 | return nil, fmt.Errorf("expected LOGS|DISTRIBUTED") |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func (p *Parser) parseSystemReloadExpr(pos Pos) (*SystemReloadExpr, error) { |
| 66 | if err := p.expectKeyword(KeywordReload); err != nil { |
no test coverage detected