[MCOL-4484] "Alter table modify column oldname newname datatype" fails with Error 1815: "Changing the datatype of a column is not supported" Created: 2020-12-30  Updated: 2023-11-17  Resolved: 2023-10-27

Status: Closed
Project: MariaDB ColumnStore
Component/s: DMLProc
Affects Version/s: 5.5.1, 6.1.1
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: Juan Assignee: Leonid Fedorov
Resolution: Won't Fix Votes: 2
Labels: triage
Environment:

CentOS 7
MariaDB-server 10.5.8_5-1


Issue Links:
Blocks
is blocked by MCOL-4931 Make cpimport charset aware Closed

 Description   

Happens when the datatype is left intact and the column is only renamed:

MariaDB [test]> create table testtext2 (
    -> myvalue varchar(100)
    -> )engine=Columnstore CHARSET=utf8;
Query OK, 0 rows affected (1.838 sec)
 
MariaDB [test]> show create table testtext2;
+-----------+------------------------------------------------------------------------------------------------------------+
| Table     | Create Table                                                                                               |
+-----------+------------------------------------------------------------------------------------------------------------+
| testtext2 | CREATE TABLE `testtext2` (
  `myvalue` varchar(100) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8 |
+-----------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
 
MariaDB [test]> alter table testtext2 change column myvalue myvalue_new varchar(100);
ERROR 1815 (HY000): Internal error: CAL0001: Alter table Failed:  Changing the datatype of a column is not supported
MariaDB [test]> alter table testtext2 change column myvalue myvalue_new varchar(300);
Query OK, 0 rows affected (0.372 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [test]> show create table testtext2;
+-----------+----------------------------------------------------------------------------------------------------------------+
| Table     | Create Table                                                                                                   |
+-----------+----------------------------------------------------------------------------------------------------------------+
| testtext2 | CREATE TABLE `testtext2` (
  `myvalue_new` varchar(300) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8 |
+-----------+----------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)



 Comments   
Comment by Chris Calender (Inactive) [ 2022-06-16 ]

Workaround: ALTER TABLE RENAME COLUMN ...

Generated at Thu Feb 08 02:50:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.