[MCOL-5197] ColumnStore table does not exist after a rename Created: 2022-08-15  Updated: 2023-02-07

Status: Open
Project: MariaDB ColumnStore
Component/s: DDLProc, MDB Plugin
Affects Version/s: 6.4.2
Fix Version/s: 23.10

Type: Bug Priority: Major
Reporter: Majdi Bsoul Assignee: Roman
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Centos 7
MariaDB 10.6.8
ColumnStore 6



 Description   

I had a simple ColumnStore table like shown below with simple 2 rows.
I ran the ALTER TABLE statement to rename the table and move the table from one database to another database. It ran successfully.
When I run count or any query on the new db.name it return an error like below.
I can see the .frm file has moved from dw_db to ds_db. Also, "show tables" list the table in ds_db.

CREATE TABLE dw_db.orders_test_cs (
orderkey INTEGER,
customer VARCHAR(45)
) ENGINE=ColumnStore;
INSERT INTO dw_db.orders_test_cs (orderkey, customer) VALUES
(12, 'JohnSmith'),
(13, 'John Public');

ALTER TABLE dw_db.orders_test_cs RENAME TO ds_db.orders_test_cs2;

select count from ds.orders_test_cs2;
ERROR 1815 (HY000): Internal error: MCS-2006: 'ds_db.orders_test_cs2' does not exist in Columnstore.



 Comments   
Comment by Roman [ 2022-08-16 ]

Hi mbsoul.
Looks like a fully legitimate bug on our side so we are moving this issue into Columnstore queue called MCOL.
There is a workaround that is a low-level update of a system catalog tables so they are in-sync with MariaDB frm files placement.
Here is the example for your case:

update calpontsys.syscolumn set `schema`='ds_db' where `schema`='dw_db';
update calpontsys.systable set `schema`='ds_db' where `schema`='dw_db';

Comment by Roman [ 2022-08-16 ]

toddstoffel Why not. develop-6?

Comment by alexey vorovich (Inactive) [ 2022-08-16 ]

toddstoffelMy point is : why do we need to fix it in both releases and not in the highest release only ?

we cannot forever maintain old releases.

Comment by Majdi Bsoul [ 2022-08-16 ]

Hi Roman, the workaround you mentioned above should be done after the 'alter' command to take care of the .frm file correct?

(actually I tried that when I found the issue, but my update statement kept being rejected because I did not use accents around `schema`. I thought it is a readonly table.)

Thanks

Comment by Roman [ 2022-08-17 ]

mbsoul Right, after MDB takes care of .frm.
Thx for letting us know about the bug so we can fix it.

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