Closed tokikanno closed 3 years ago
Make column names quoted here may solve this problem.
After some tests, I realized that actually vitess/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go
will quote reserved keywords properly in generated insert statements.
The root cause of this issue is that rank
wasn't in the reserved keyword list, so it won't be quoted properly and cause the move table process to fail.
I've made a simple fix (https://github.com/vitessio/vitess/pull/7944) and tested it with the failed move table case in this issue. It can now run the move table case with no problem.
Overview of the Issue
MoveTables operation will fail if any moved table has a reserved keyword in its column name.
Reproduction Steps
Having a table with the following schema
insert some random rows and execute MoveTables workflow on it
It will fail while copy insert into the new KeySpace because the auto-generated insert SQL statement didn't quote the reserved keyword in the column name (
rank
).Can also see following slack link for more detail: https://vitess.slack.com/archives/C0PQY0PTK/p1615454636258200
Ref: MySQL keyword list https://dev.mysql.com/doc/refman/8.0/en/keywords.html
Binary version
Docker image:
vitess/lite:mysql80 00485232f586
(built from Vitess source with git commitd508d333632e59838310af6d356c0f62a0809002
)Operating system and Environment details
OS, Architecture, and any other information you can provide about the environment.
cat /etc/os-release
):uname -sr
):Linux 4.15.0-136-generic
uname -m
):x86_64
Log Fragments