Bug #111070 View query failure
Submitted: 18 May 2023 8:52 Modified: 18 May 2023 9:34
Reporter: linfeng chen Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any

[18 May 2023 8:52] linfeng chen
Description:
View query failure
mysql>  create table t1 (a int);
Query OK, 0 rows affected (0.61 sec)

mysql> insert into t1 values(1),(2);
Query OK, 2 rows affected (0.09 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql>  create view v1  as select a, length(a), count(*) from t1 group by a with ROLLUP;
Query OK, 0 rows affected (0.12 sec)

mysql> select * from v1;
+------+-----------+----------+
| a    | length(a) | count(*) |
+------+-----------+----------+
|    1 |         1 |        1 |
|    2 |         1 |        1 |
| NULL |      NULL |        2 |
+------+-----------+----------+
3 rows in set (0.00 sec)

mysql> alter table t1 secondary_engine = test;
Query OK, 0 rows affected (0.20 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> select * from v1;
ERROR 1356 (HY000): View 'testdb.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
mysql>

How to repeat:
create table t1 (a int);
insert into t1 values(1),(2);
create view v1  as select a, length(a), count(*) from t1 group by a with ROLLUP;
select * from v1;
alter table t1 secondary_engine = test;
select * from v1;
[18 May 2023 9:34] MySQL Verification Team
Hello linfeng chen,

Thank you for the report and test case.
I quickly checked in 8.0.33 build but not seeing any issues and most likely this issue is fixed. Could you please confirm? 

regards,
Umesh