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

parse error #68

Open
xinlushi opened this issue Sep 10, 2021 · 3 comments
Open

parse error #68

xinlushi opened this issue Sep 10, 2021 · 3 comments

Comments

@xinlushi
Copy link

xinlushi commented Sep 10, 2021

func main() {
sql := "SELECT * FROM table WHERE a = 'abc'"
stmt, err := sqlparser.Parse(sql)
if err != nil {
fmt.Printf("%s",err.Error())
}

// Otherwise do something with stmt
switch stmt := stmt.(type) {
case *sqlparser.Select:
	_ = stmt
case *sqlparser.Insert:
}

fmt.Printf("stmt :%v", stmt)

}

result err: syntax error at position 20 near 'table'

@bramp
Copy link
Collaborator

bramp commented Sep 10, 2021 via email

@xinlushi
Copy link
Author

Please replace the example, this is the code of the example

@Mrsandman327
Copy link

There is a table in the database ‘information_schema’ as ‘tables’, this problem causes this table to be accessed abnormally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants