The following shows the cause of the problem:
MariaDB [test]> show create view v1;
|
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
|
| View | Create View | character_set_client | collation_connection |
|
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
|
| v1 | CREATE ALGORITHM=UNDEFINED DEFINER=`` SQL SECURITY DEFINER VIEW `v1` AS with t as (values (2),(1))select `t`.`a` AS `a` from `t` | utf8 | utf8_general_ci |
|
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
|
So the internal representation of the view lacks the list of the column names.
It happens because With_element::print does not print this list.
The following shows the cause of the problem:
MariaDB [test]> show create view v1;
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| View | Create View | character_set_client | collation_connection |
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| v1 | CREATE ALGORITHM=UNDEFINED DEFINER=`` SQL SECURITY DEFINER VIEW `v1` AS with t as (values (2),(1))select `t`.`a` AS `a` from `t` | utf8 | utf8_general_ci |
+------+----------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
So the internal representation of the view lacks the list of the column names.
It happens because With_element::print does not print this list.