Skip to content

alter table error #17

Answered by shlomi-noach
YunshuaiPeng asked this question in Q&A
May 19, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Thank you for submitting this issue! The issue seems to be with the syntax, which is acceptable to MySQL but should not be:

add primary key `sessions_id_primary`(`id`))

The name of the PRIMARY KEY is always "PRIMARY". The statement you or your php code ran tries to give a different name to the primary key. This shouldn't be allowed, but then again, MySQL does allow it. By the way, the name sessions_id_primary is completely discarded by MySQL, as you'll be able to see if you SHOW CREATE TABLE sessions.

Having said that, we want to be compatible with MySQL even if it allows something it shouldn't. We're looking into this and will follow up shortly. Thanks again!

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by hallaroo
Comment options

You must be logged in to vote
2 replies
@shlomi-noach
Comment options

@wgb-256
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants