forcedotcom / phoenix

BSD 3-Clause "New" or "Revised" License
558 stars 227 forks source link

Disallow array type to be used in primary key constraint #649

Closed jtaylor-sfdc closed 10 years ago

jtaylor-sfdc commented 10 years ago

We currently have no check that disallows an ARRAY type be used in the primary key constraint. For example, the following statements should both fail with a SQLException:

CREATE TABLE foo (col1 INTEGER ARRAY[10] NOT NULL PRIMARY KEY); CREATE TABLE foo (col1 VARCHAR, col2 INTEGER ARRAY[10] CONSTRAINT pk PRIMARY KEY (col1, col2));

This check should be done in MetaDataClient.createTable, where we loop through the ColumnDef list and create the PK. Negative tests should be added in QueryCompileTest.

jtaylor-sfdc commented 10 years ago

Fixed by @srau. Thanks for the contribution!