Different types accepted by CAST() and COLUMN_CREATE()

Bug #778935 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Confirmed
Low
Michael Widenius

Bug Description

The dynamic columns documentation at

http://kb.askmonty.org/v/dynamic-columns

provides a list of data types GET_COLUMN() accepts, as well as the note "Type here can be one of the same ones that you would use in CAST or CONVERT:". However, in practice, the allowed types for CAST and for GET_COLUMN are different and are different from what is specified in the dynamic columns manual.

GET_COLUMN() accepts DOUBLE while CAST does not
GET_COLUMN() does not accept SIGNED, UNSIGNED, BINARY and CHAR(N)

Tags: dyncol
Changed in maria:
milestone: none → 5.3
assignee: nobody → Michael Widenius (monty)
Revision history for this message
Michael Widenius (monty) wrote :

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.

Changed in maria:
status: New → Invalid
importance: Undecided → Low
Revision history for this message
Philip Stoev (pstoev-askmonty) wrote :

If there is a part that is "scheduled to be fixed", then this bug remains on the table.

summary: - Different types accepted by CAST() and COLUMN_GET()
+ Different types accepted by CAST() and COLUMN_CREATE()
Changed in maria:
status: Invalid → Confirmed
Michael Widenius (monty)
Changed in maria:
milestone: 5.3 → 5.5
Revision history for this message
Elena Stepanova (elenst) wrote :

Also filed in JIRA as MDEV-196

Elena Stepanova (elenst)
tags: added: dyncol
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.