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

ALTER Column varchar | Not Supported

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 23.02.8
    • 23.10.3
    • DDLProc
    • None
    • 2024-2

    Description

      Currently Columnstore allows altering the column name and COMMENT on INT, but not char, varchar

      Reproduction:

      CREATE TABLE `t1` (
        `id` int(11) DEFAULT NULL,
        `name1` char(10) DEFAULT NULL COMMENT 'test name',
        `name2` varchar(100) DEFAULT NULL COMMENT 'test name'
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
       
      # Works
      ALTER TABLE t1 CHANGE COLUMN id id1 INT;
      ALTER TABLE t1 CHANGE COLUMN id1 id INT COMMENT 'new comment';
       
      # Fails
      ALTER TABLE t1 CHANGE COLUMN name1 firstname char(10);
      ALTER TABLE t1 CHANGE COLUMN firstname firstname char(10) COMMENT 'new comment';
       
      # Fails
      ALTER TABLE t1 CHANGE COLUMN name2 lastname char(10);
      ALTER TABLE t1 CHANGE COLUMN lastname lastname  char(10) COMMENT 'new comment';
      

      Error:

      ERROR 1815 (HY000): Internal error: CAL0001: Alter table Failed:  Changing the datatype of a column is not supported
      

      Workaround:
      Create a new table with the desired column names and comments and migrate the data

      Attachments

        Issue Links

          Activity

            People

              leonid.fedorov Leonid Fedorov
              allen.herrera Allen Herrera
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.