8000 `alter table <table> add column` with multiple columns not supported · Issue #236 · dolthub/vitess · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
alter table <table> add column with multiple columns not supported #236
Open
@nicktobey

Description

@nicktobey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0