releaseStatement returns a single Statement to its pool. This is the central dispatch used by both ReleaseAST and ReleaseStatements.
(stmt Statement)
| 501 | // releaseStatement returns a single Statement to its pool. |
| 502 | // This is the central dispatch used by both ReleaseAST and ReleaseStatements. |
| 503 | func releaseStatement(stmt Statement) { |
| 504 | if stmt == nil { |
| 505 | return |
| 506 | } |
| 507 | switch s := stmt.(type) { |
| 508 | case *SelectStatement: |
| 509 | PutSelectStatement(s) |
| 510 | case *InsertStatement: |
| 511 | PutInsertStatement(s) |
| 512 | case *UpdateStatement: |
| 513 | PutUpdateStatement(s) |
| 514 | case *DeleteStatement: |
| 515 | PutDeleteStatement(s) |
| 516 | case *CreateTableStatement: |
| 517 | PutCreateTableStatement(s) |
| 518 | case *AlterTableStatement: |
| 519 | PutAlterTableStatement(s) |
| 520 | case *CreateIndexStatement: |
| 521 | PutCreateIndexStatement(s) |
| 522 | case *MergeStatement: |
| 523 | PutMergeStatement(s) |
| 524 | case *CreateViewStatement: |
| 525 | PutCreateViewStatement(s) |
| 526 | case *CreateMaterializedViewStatement: |
| 527 | PutCreateMaterializedViewStatement(s) |
| 528 | case *RefreshMaterializedViewStatement: |
| 529 | PutRefreshMaterializedViewStatement(s) |
| 530 | case *DropStatement: |
| 531 | PutDropStatement(s) |
| 532 | case *TruncateStatement: |
| 533 | PutTruncateStatement(s) |
| 534 | case *ShowStatement: |
| 535 | PutShowStatement(s) |
| 536 | case *DescribeStatement: |
| 537 | PutDescribeStatement(s) |
| 538 | case *ReplaceStatement: |
| 539 | PutReplaceStatement(s) |
| 540 | case *AlterStatement: |
| 541 | PutAlterStatement(s) |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | // GetInsertStatement gets an InsertStatement from the pool |
| 546 | func GetInsertStatement() *InsertStatement { |
no test coverage detected