[MDEV-25676] Alias in a view on a table with virtual column avoid index creation Created: 2021-05-14  Updated: 2021-05-20  Resolved: 2021-05-14

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.5.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Antoine Lange Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-25672 table alias from previous statement i... Closed

 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.



 Comments   
Comment by Alice Sherepa [ 2021-05-14 ]

Thank you for the report and the test case, I will add it into MDEV-25672, let's track the issue there.

Generated at Thu Feb 08 09:39:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.