forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CREATE TABLE now supports columns with
ENUM[]
types. (duckdb#14102)
This PR fixes duckdb#14099 I also noticed that `catalog.schema.user_type` and `schema.user_type` don't support this, and attempted to fix this here directly, but the issue appears to be at the parser level so for now I've just added a test so we're aware of this limitation. I created another method to deal with all of the base_type logic, letting the arrayBounds be processed in the outer layer, removing a bunch of if/else chains and cleaning up the code because of that.
- Loading branch information
Showing
3 changed files
with
137 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# name: test/sql/create/create_table_with_arraybounds.test | ||
# group: [create] | ||
|
||
require noforcestorage | ||
|
||
# Create a table with an ENUM[] type | ||
statement ok | ||
create table T ( | ||
vis enum ('hide', 'visible')[] | ||
); | ||
|
||
query I | ||
select column_type from (describe T); | ||
---- | ||
ENUM('hide', 'visible')[] | ||
|
||
statement ok | ||
attach ':memory:' as db2; | ||
|
||
statement ok | ||
create schema schema2; | ||
|
||
statement ok | ||
create schema db2.schema3; | ||
|
||
statement ok | ||
create type schema2.foo as VARCHAR; | ||
|
||
statement ok | ||
create type db2.schema3.bar as BOOL; | ||
|
||
# Create a table with a USER[] type qualified with a schema | ||
statement error | ||
create table B ( | ||
vis schema2.foo[] | ||
); | ||
---- | ||
syntax error at or near | ||
|
||
# Create a table with a USER[] type qualified with a schema and a catalog | ||
statement error | ||
create table B ( | ||
vis db2.schema3.bar[] | ||
); | ||
---- | ||
syntax error at or near |