[MDEV-28535] View is created with wrong column name if there are more than one same column name or column name is empty Created: 2022-05-11 Updated: 2023-03-03 Resolved: 2022-12-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Lena Startseva | Assignee: | Oleksandr Byelkin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | view-protocol | ||
| Issue Links: |
|
||||||||
| Description |
|
According standard "If a <view column list> is" not "specified ... the <column name>s of the view are the <column name>s of the table specified by the <query expression>" In simple select is everything good:
But if column name is NULL and there are more than one such column name in select for creating view, than columns have names like "My_exp_NULL", "My_exp_1_NULL" and etc. Test:
Actual result:
Expected result:
============================================================================================================================= The same problem is with aggregate functions: Test 2:
Actual result 2:
|
| Comments |
| Comment by Lena Startseva [ 2022-05-30 ] | |||||||
|
Test 3:
Actual result:
Expected result:
| |||||||
| Comment by Oleksandr Byelkin [ 2022-12-01 ] | |||||||
|
It is well known problem, sending results allows the same name of columns, view (as any table) do not allow columns with the same name, so it uses generated names. |