-
Notifications
You must be signed in to change notification settings - Fork 240
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
Comments
Table is a reserved word. Either wrap it in backtics or use a different
name for your table.
…On Fri, 10 Sep 2021, 12:58 am xinlushi, ***@***.***> wrote:
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'stmt :
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#68>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHG4YUIQS3UPWCFL6U2B3UBG3A3ANCNFSM5DYZCVUA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Please replace the example, this is the code of the example |
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
func main() {
sql := "SELECT * FROM table WHERE a = 'abc'"
stmt, err := sqlparser.Parse(sql)
if err != nil {
fmt.Printf("%s",err.Error())
}
}
result err: syntax error at position 20 near 'table'
The text was updated successfully, but these errors were encountered: