[MCOL-3391] columnstore_upgrade failed from 1.2.2 to 1.2.4 when database including multibyte table name Created: 2019-06-24  Updated: 2020-08-25  Resolved: 2019-07-05

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.2.4
Fix Version/s: 1.2.5

Type: Bug Priority: Major
Reporter: Nilnandan Joshi Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2019-06

 Description   

Upgrade from columnstore 1.2.2 to 1.2.4 failed.
columnstore_upgrade function error occurred.

call columnstore_info.columnstore_upgrade();
ERROR 1146 (42S02): Table 'db.????????' doesn't exist

??????? is multibyte character set table name.

As a workaround we can manually do `alter table NAME comment = ''` on tables.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2019-06-25 ]

Fix the procedure to work with utf8 table names. For customers who hit this in 1.2.4:

use columnstore_info;
drop procedure columnstore_upgrade();
create procedure columnstore_upgrade()
DELIMITER //
`columnstore_upgrade`: BEGIN
    DECLARE done INTEGER DEFAULT 0;
    DECLARE schema_table VARCHAR(100) CHARACTER SET utf8 DEFAULT "";
    DECLARE table_list CURSOR FOR select concat('`', table_schema,'`.`',table_name,'`') from information_schema.tables where engine='columnstore';
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
    OPEN table_list;
    tlist: LOOP
        FETCH table_list INTO schema_table;
        IF done = 1 THEN LEAVE tlist;
        END IF;
        SET @sql_query = concat('ALTER TABLE ', schema_table, ' COMMENT=\'\'');
        PREPARE stmt FROM @sql_query;
        EXECUTE stmt;
        DEALLOCATE PREPARE stmt;
    END LOOP;
END //
 
DELIMITER ;
call columnstore_upgrade();

Comment by Daniel Lee (Inactive) [ 2019-07-05 ]

Build verified: 1.2.5-1 nightly

erver commit:
f44f7d9
engine commit:
4e477ab

Reproduced issue in 1.2.4-1

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