[MCOL-4787] ALTER TABLE ADD COLUMN returns internal error Created: 2021-07-01  Updated: 2021-10-28  Resolved: 2021-10-28

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 5.6.1
Fix Version/s: 6.2.1

Type: Bug Priority: Major
Reporter: Roman Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None

Sprint: 2021-9, 2021-10, 2021-11, 2021-12, 2021-13, 2021-14

 Description   

ALTER TABLE ADD COLUMN returns internal error for DDL given in the first comment.
It is important to tell that ALTER TABLE ADD COLUMN adds the column.
debug.log contains an error that points to the fact that MDB uses offline ALTER proto under the hood first creating tmp table, replacing the original table and removing the obsolete table later. However MCS alters the table adding column in-place so MCS doesn't follow the protocol MDB expects. The error produced presumably produced by the DROP TABLE statement for the temp table created previously.



 Comments   
Comment by David Hall (Inactive) [ 2021-10-28 ]

I tried this on columnstore 5.6 and 6.2:

alter table region add column (r_code int default 0);
Query OK, 0 rows affected (0.297 sec)              
Records: 0  Duplicates: 0  Warnings: 0

This is the log. It's the same for both versions:

Oct 28 13:54:52 srvhall04 ddlpackageproc[2815]: 52.312052 |3|44739|0| D 23 CAL0041: Start SQL statement: alter table region add column (r_code int default 0);|dhall|
Oct 28 13:54:52 srvhall04 ExeMgr[2766]: 52.341108 |2147483651|44739|0| D 16 CAL0041: Start SQL statement: select objectid,columnlength,datatype,dictobjectid,listobjectid,treeobjectid,columnposition,scale,prec,defaultvalue from syscolumn where schema='dhall' and tablename='region' and columnname='r_code' --lookupOID/FE; ||
Oct 28 13:54:52 srvhall04 ExeMgr[2766]: 52.405421 |2147483651|44739|0| D 16 CAL0042: End SQL statement
Oct 28 13:54:52 srvhall04 ddlpackageproc[2815]: 52.591369 |3|44739|0| D 23 CAL0042: End SQL statement

I don't see the warning or error spoken about in the original post.

Perhaps there's a DDL statement that causes an error, but without further information, I'm closing this as can't reproduce.

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