[MDEV-597] LP:778935 - Different types accepted by CAST() and COLUMN_CREATE() Created: 2011-05-07 Updated: 2022-01-25 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data types, Dynamic Columns |
| Affects Version/s: | 10.0.1, 5.5.29, 5.3.11, 5.5, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| 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 |
| Comments |
| Comment by Michael Widenius [ 2011-05-10 ] |
|
Re: Different types accepted by CAST() and COLUMN_GET() I tested the following commands and they worked correctly in 5.3-mwl: column_get(column_create(1, 2), 1 as signed) I have now updated the documentation about this. |
| Comment by Philip Stoev (Inactive) [ 2011-05-11 ] |
|
Re: Different types accepted by CAST() and COLUMN_CREATE() |
| Comment by Elena Stepanova [ 2012-03-21 ] |
|
Re: Different types accepted by CAST() and COLUMN_CREATE() |
| Comment by Rasmus Johansson (Inactive) [ 2012-03-29 ] |
|
Launchpad bug id: 778935 |
| Comment by Sergei Golubchik [ 2013-01-08 ] |
|
Elena, could you please re-verify that? Looking at the parser code I see that it uses the same rule for the type value in COLUMN_GET, in CAST, and in CONVERT. So, I don't see how any discrepancies could be possible here. |
| Comment by Elena Stepanova [ 2013-01-08 ] |
|
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 Test (I removed DOUBLE(M) part): --disable_abort_on_error SELECT COLUMN_CREATE(1,0 AS BINARY); SELECT COLUMN_CREATE(1,0 AS BINARY(8)); SELECT COLUMN_CREATE(1,0 AS CHAR); SELECT COLUMN_CREATE(1,0 AS CHAR(8)); SELECT COLUMN_CREATE(1,0 AS DATE); SELECT COLUMN_CREATE(1,0 AS DATETIME); SELECT COLUMN_CREATE(1,0 AS DATETIME(6)); SELECT COLUMN_CREATE(1,0 AS DECIMAL); SELECT COLUMN_CREATE(1,0 AS DECIMAL(6)); SELECT COLUMN_CREATE(1,0 AS DECIMAL(6,2)); SELECT COLUMN_CREATE(1,0 AS DOUBLE); SELECT COLUMN_CREATE(1,0 AS DOUBLE(6,2)); SELECT COLUMN_CREATE(1,0 AS INTEGER); SELECT COLUMN_CREATE(1,0 AS SIGNED); SELECT COLUMN_CREATE(1,0 AS SIGNED INTEGER); SELECT COLUMN_CREATE(1,0 AS TIME); SELECT COLUMN_CREATE(1,0 AS TIME(6)); SELECT COLUMN_CREATE(1,0 AS UNSIGNED); SELECT COLUMN_CREATE(1,0 AS UNSIGNED INTEGER); |