Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5197

ColumnStore table does not exist after a rename

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 6.4.2
    • 23.10.2
    • DDLProc, MDB Plugin
    • None
    • 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.

      Attachments

        Activity

          drrtuy Roman added a comment -

          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';
          

          drrtuy Roman added a comment - 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';
          drrtuy Roman added a comment - - edited

          toddstoffel Why not. develop-6?

          drrtuy Roman added a comment - - edited toddstoffel Why not. develop-6?

          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.

          alexey.vorovich alexey vorovich (Inactive) added a comment - toddstoffel My 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.
          mbsoul Majdi Bsoul added a comment -

          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

          mbsoul Majdi Bsoul added a comment - 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
          drrtuy Roman added a comment -

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

          drrtuy Roman added a comment - mbsoul Right, after MDB takes care of .frm. Thx for letting us know about the bug so we can fix it.

          fixed with MCOL-4202

          leonid.fedorov Leonid Fedorov added a comment - fixed with MCOL-4202

          People

            drrtuy Roman
            mbsoul Majdi Bsoul
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.