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

Parsing error/warning caused by AUTO_INCREMENT after PRIMARY KEY on a column #7378

Closed
mcronce opened this issue Jan 25, 2021 · 1 comment · Fixed by #7459
Closed

Parsing error/warning caused by AUTO_INCREMENT after PRIMARY KEY on a column #7378

mcronce opened this issue Jan 25, 2021 · 1 comment · Fixed by #7459

Comments

@mcronce
Copy link

mcronce commented Jan 25, 2021

Overview of the Issue

vttestserver logs a warning ("ignored error") when issuing a CREATE TABLE statement when PRIMARY KEY precedes AUTO_INCREMENT:

W0125 21:31:36.388462     708 parser.go:90] ignoring error parsing DDL 'CREATE TABLE pkai (id INT PRIMARY KEY AUTO_INCREMENT)': syntax error at position 53 near 'AUTO_INCREMENT'

This was found while testing the Diesel ORM in Rust

Reproduction Steps

CREATE TABLE pkai (id INT PRIMARY KEY AUTO_INCREMENT); -- This prints a warning
CREATE TABLE aipk (id INT AUTO_INCREMENT PRIMARY KEY); -- This does not print a warning

Binary version

Using vttestserver, which doesn't support -version, but here's output from vtcombo in the same container:

$ /vt/bin/vtcombo -version
ERROR: logging before flag.Parse: E0125 18:43:12.741403     754 syslogger.go:149] can't connect to syslog
Version: acb3b4e1d (Git branch 'master') built on Mon Jan 25 16:57:11 UTC 2021 by vitess@6c41847a305c using go1.15.6 linux/amd64

Operating system and Environment details

Inside the vttestserver container:

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
vitess@3e5d5c6a960a:/$ uname -sr 
Linux 5.10.2-2-MANJARO
vitess@3e5d5c6a960a:/$ uname -m
x86_64

Log Fragments

W0125 21:31:36.388462     708 parser.go:90] ignoring error parsing DDL 'CREATE TABLE pkai (id INT PRIMARY KEY AUTO_INCREMENT)': syntax error at position 53 near 'AUTO_INCREMENT'
I0125 21:31:36.429290     708 engine.go:367] schema engine created [pkai], altered [], dropped []
@mcronce
Copy link
Author

mcronce commented Feb 10, 2021

🎉 :)

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

Successfully merging a pull request may close this issue.

3 participants