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

alter table <table> add column with multiple columns not supported #236

Open
nicktobey opened this issue May 8, 2023 · 0 comments
Open

Comments

@nicktobey
Copy link

Example query:

create table t (pk int primary key);
alter table t add column (col1 int, col2 int);
desc t;

MySql output:

Field	Type	Null	Key	Default	Extra
pk	int	NO	PRI	NULL	
col1	int	YES		NULL	
col2	int	YES		NULL	

Our output:

Error parsing SQL
syntax error at position 36 near 'int'
alter table t add column (col1 int, col2 int)
                                    ^

The offending rule in sql.y:

alter_table_statement_part:
  ADD column_opt '(' column_definition ')'

Vitess parses the parentheses but expects only a single element within them.

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

No branches or pull requests

1 participant