Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ub-3 opened this issue Dec 6, 2023 · 1 comment · Fixed by #49482
Closed

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

ub-3 opened this issue Dec 6, 2023 · 1 comment · Fixed by #49482
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@ub-3
Copy link
Contributor

ub-3 commented Dec 6, 2023

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
@ub-3 ub-3 added the type/bug This issue is a bug. label Dec 6, 2023
@ub-3 ub-3 changed the title Invalid parse the ANALYZE statement with [NO_WRITE_TO_BINLOG | LOCAL] Invalid parsing of the ANALYZE statement with [NO_WRITE_TO_BINLOG | LOCAL] Dec 6, 2023
@seiya-annie seiya-annie added the sig/sql-infra SIG: SQL Infra label Dec 7, 2023
@ub-3
Copy link
Contributor Author

ub-3 commented Dec 20, 2023

@bb7133 Hi, can you tell me if I missed something in the PR? Because the process with my PR went faster last time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants