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

Fail to start with SQL store with MySQL server 8.0.2 #536

Closed
kozlovic opened this issue Mar 30, 2018 · 0 comments
Closed

Fail to start with SQL store with MySQL server 8.0.2 #536

kozlovic opened this issue Mar 30, 2018 · 0 comments
Assignees
Labels

Comments

@kozlovic
Copy link
Member

@camsjams Reported this issue in #533

MySQL 8.0.2, (docker image - mysql:8.0.2)
Nats 0.9.0 ( docker image - nats-streaming:0.9.0)

2018/03/29 19:39:22.709350 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.9.0
2018/03/29 19:39:22.709553 [INF] STREAM: ServerID: dutqmYYUX3kNfne308YBqk
2018/03/29 19:39:22.709566 [INF] STREAM: Go version: go1.9.4
2018/03/29 19:39:22.721593 [INF] STREAM: Shutting down.
2018/03/29 19:39:22.721640 [FTL] STREAM: Failed to start: unable to prepare statement "INSERT INTO SubsPending (subid, row, seq) VALUES (?, ?, ?)": Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'row, seq) VALUES (?, ?, ?)' at line 1

As he reported, we may need to change the following:

"INSERT INTO SubsPending (subid, row, seq) VALUES (?, ?, ?)", // sqlSubAddPending
"INSERT INTO SubsPending (subid, row, lastsent, pending, acks) VALUES (?, ?, ?, ?, ?)", // sqlSubAddPendingRow
"DELETE FROM SubsPending WHERE subid=? AND seq=?", // sqlSubDeletePending
"DELETE FROM SubsPending WHERE subid=? AND row=?", // sqlSubDeletePendingRow

Need to check the effect of Postgres driver.

@kozlovic kozlovic self-assigned this Mar 30, 2018
@kozlovic kozlovic added the bug label Mar 30, 2018
kozlovic added a commit that referenced this issue Mar 30, 2018
This is due to the use of a now reserved word. Need to be escaped
with the "`" character. This character is used only for mysql
driver, not postgres (otherwise, it would break).

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

No branches or pull requests

1 participant