File tree Expand file tree Collapse file tree
testdata/00670_truncate_temporary_table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -692,6 +692,7 @@ const (
692692// TruncateQuery represents a TRUNCATE statement.
693693type TruncateQuery struct {
694694 Position token.Position `json:"-"`
695+ Temporary bool `json:"temporary,omitempty"`
695696 IfExists bool `json:"if_exists,omitempty"`
696697 Database string `json:"database,omitempty"`
697698 Table string `json:"table"`
Original file line number Diff line number Diff line change @@ -5849,6 +5849,12 @@ func (p *Parser) parseTruncate() *ast.TruncateQuery {
58495849
58505850 p .nextToken () // skip TRUNCATE
58515851
5852+ // Handle TEMPORARY keyword
5853+ if p .currentIs (token .TEMPORARY ) {
5854+ trunc .Temporary = true
5855+ p .nextToken ()
5856+ }
5857+
58525858 if p .currentIs (token .TABLE ) {
58535859 p .nextToken ()
58545860 }
Original file line number Diff line number Diff line change 1- {
2- "explain_todo" : {
3- "stmt7" : true
4- }
5- }
1+ {}
You can’t perform that action at this time.
0 commit comments