Skip to content

Invalid parsing of the ANALYZE statement with [NO_WRITE_TO_BINLOG | LOCAL] #49235

@ub-3

Description

@ub-3

Bug Report

1. Minimal reproduce step (Required)

package main

import (
	"fmt"
	"log"

	"github.com/pingcap/tidb/pkg/parser"
	"github.com/pingcap/tidb/pkg/parser/ast"
	_ "github.com/pingcap/tidb/pkg/types/parser_driver"
)

func main() {
	p := parser.New()
	stmt, warn, err := p.ParseSQL("analyze NO_WRITE_TO_BINLOG table t")
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println(ast.GetStmtLabel(stmt[0]), warn)
}

2. What did you expect to see? (Required)

ub-3@local:~$ go run test.go 
AnalyzeTable []

3. What did you see instead (Required)

ub-3@local:~$ go run test.go 
2023/12/09 16:15:57 line 1 column 26 near "NO_WRITE_TO_BINLOG table t" 
exit status 1

4. What is your TiDB version? (Required)

github.com/pingcap/tidb v1.1.0-beta.0.20231208120617-d23e1c379a52
github.com/pingcap/tidb/pkg/parser v0.0.0-20231208120617-d23e1c379a52

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions