As comments above suggest, COLUMN_GET was fixed, but COLUMN_CREATE still differs.
Here are differences (full test is below):
Nothing allows DOUBLE(N) – it's not a valid type, just a typo in documentation which says DOUBLE[(M[,D])], should be DOUBLE[(M,D)]
COLUMN_CREATE doesn't allow
BINARY
BINARY(N)
CHAR(N)
DOUBLE(M,D)
SIGNED
SIGNED INTEGER
UNSIGNED
Test (I removed DOUBLE(M) part):
--disable_abort_on_error
SELECT COLUMN_CREATE(1,0 AS BINARY);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS BINARY);
SELECT CAST(0 AS BINARY), CONVERT(0, BINARY);
SELECT COLUMN_CREATE(1,0 AS BINARY(8));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS BINARY(8));
SELECT CAST(0 AS BINARY(8)), CONVERT(0, BINARY(8));
SELECT COLUMN_CREATE(1,0 AS CHAR);
SELECT COLUMN_GET(COLUMN_CREATE(1,1), 1 AS CHAR);
SELECT CAST(0 AS CHAR), CONVERT(0, CHAR);
SELECT COLUMN_CREATE(1,0 AS CHAR(8));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS CHAR(8));
SELECT CAST(0 AS CHAR(8)), CONVERT(0, CHAR(8));
SELECT COLUMN_CREATE(1,0 AS DATE);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DATE);
SELECT CAST(0 AS DATE), CONVERT(0, DATE);
SELECT COLUMN_CREATE(1,0 AS DATETIME);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DATETIME);
SELECT CAST(0 AS DATETIME), CONVERT(0, DATETIME);
SELECT COLUMN_CREATE(1,0 AS DATETIME(6));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DATETIME(6));
SELECT CAST(0 AS DATETIME(6)), CONVERT(0, DATETIME(6));
SELECT COLUMN_CREATE(1,0 AS DECIMAL);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DECIMAL);
SELECT CAST(0 AS DECIMAL), CONVERT(0, DECIMAL);
SELECT COLUMN_CREATE(1,0 AS DECIMAL(6));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DECIMAL(6));
SELECT CAST(0 AS DECIMAL(6)), CONVERT(0, DECIMAL(6));
SELECT COLUMN_CREATE(1,0 AS DECIMAL(6,2));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DECIMAL(6,2));
SELECT CAST(0 AS DECIMAL(6,2)), CONVERT(0, DECIMAL(6,2));
SELECT COLUMN_CREATE(1,0 AS DOUBLE);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DOUBLE);
SELECT CAST(0 AS DOUBLE), CONVERT(0, DOUBLE);
SELECT COLUMN_CREATE(1,0 AS DOUBLE(6,2));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS DOUBLE(6,2));
SELECT CAST(0 AS DOUBLE(6,2)), CONVERT(0, DOUBLE(6,2));
SELECT COLUMN_CREATE(1,0 AS INTEGER);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS INTEGER);
SELECT CAST(0 AS INTEGER), CONVERT(0, INTEGER);
SELECT COLUMN_CREATE(1,0 AS SIGNED);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS SIGNED);
SELECT CAST(0 AS SIGNED), CONVERT(0, SIGNED);
SELECT COLUMN_CREATE(1,0 AS SIGNED INTEGER);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS SIGNED INTEGER);
SELECT CAST(0 AS SIGNED INTEGER), CONVERT(0, SIGNED INTEGER);
SELECT COLUMN_CREATE(1,0 AS TIME);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS TIME);
SELECT CAST(0 AS TIME), CONVERT(0, TIME);
SELECT COLUMN_CREATE(1,0 AS TIME(6));
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS TIME(6));
SELECT CAST(0 AS TIME(6)), CONVERT(0, TIME(6));
SELECT COLUMN_CREATE(1,0 AS UNSIGNED);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS UNSIGNED);
SELECT CAST(0 AS UNSIGNED), CONVERT(0, UNSIGNED);
SELECT COLUMN_CREATE(1,0 AS UNSIGNED INTEGER);
SELECT COLUMN_GET(COLUMN_CREATE(1,0), 1 AS UNSIGNED INTEGER);
SELECT CAST(0 AS UNSIGNED INTEGER), CONVERT(0, UNSIGNED INTEGER);
Re: Different types accepted by CAST() and COLUMN_GET()
select cast(1 as double) works in 5.3-mwl tree; It was added as part of this worklog.
select column_get(column_create(1, 2), 1 as signed) worked for me. All the other versions should also work as the parsing code in sql_yacc.yy is identical for CAST and COLUMN_GET().
COLUMN_CREATE is still 'different' but is scheduled to be fixed.
I tested the following commands and they worked correctly in 5.3-mwl:
column_get(column_create(1, 2), 1 as signed)
select column_get(column_create(1, 2), 1 as unsigned)
select column_get(column_create(1, 2), 1 as CHAR(5))
select column_get(column_create(1, 2), 1 as BINARY(5));
select column_get(column_create(1, 2), 1 as BINARY)`
I have now updated the documentation about this.