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

Alias in a view on a table with virtual column avoid index creation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 10.5.10
    • Fix Version/s: N/A
    • Component/s: N/A
    • Labels:
      None

      Description

      This sequence has a failure on CREATE INDEX (Unknown column '.`r`.`DELETED`' in 'GENERATED ALWAYS')

      CREATE TABLE `RULE` (
         `DELETED` BIT(1),
         `UNIQ_CODE` VARCHAR(255) GENERATED ALWAYS AS (CASE DELETED WHEN 0 THEN 1 end) PERSISTENT
      );
       
      CREATE OR REPLACE VIEW `V_RULE` AS SELECT DELETED FROM RULE r;
       
      CREATE INDEX `RULE_IDX01` ON `RULE` (DELETED);
      

      If I remove the alias ('r') in the view, everything works well.
      Both scenarios works well in 10.5.9

      I can't find in MariaDB 10.5.10 release notes what could cause this issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              antoine.lange Antoine Lange
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration