Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-25672

table alias from previous statement interferes later commands

Details

    Description

      When an Update Statement happens with an alias. The alias seems to replace the table name.

      See below an example Query to reproduce the failure:

      DROP TABLE IF EXISTS `test_table`;
       
      CREATE TABLE `test_table` (
        `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
        `order_date` datetime NOT NULL,
        `language_id` BINARY(16) NULL 
      );
       
      ALTER TABLE `test_table` CHANGE `order_date` `order_date_time` DATETIME(3) NOT NULL;
       
      ALTER TABLE `test_table` ADD COLUMN `order_date` DATE GENERATED ALWAYS AS (CONVERT(`order_date_time`, DATE)) STORED AFTER `order_date_time`;
       
      UPDATE `test_table` as `x` SET order_date = NULL;
       
      ALTER TABLE `test_table` MODIFY COLUMN `language_id` BINARY(16) NOT NULL;
      

      Results in the following error on the ALTER TABLE statement:

      Unknown column '`test`.`x`.`order_date_time`' in 'GENERATED ALWAYS'
      

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Aleksey Midenkov made transition -
            Open In Progress
            11d 2h 23m 1
            Aleksey Midenkov made transition -
            In Progress In Review
            6d 3h 5m 1
            Sergei Golubchik made transition -
            In Review Stalled
            1d 23h 27m 1
            Aleksey Midenkov made transition -
            Stalled In Review
            1h 51m 1
            Sergei Golubchik made transition -
            In Review Closed
            17h 38m 1

            People

              serg Sergei Golubchik
              shyim Soner Sayakci
              Votes:
              0 Vote for this issue
              Watchers:
              11 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.