[MDEV-29587] Allowing insert into a view with columns that are not part the table Created: 2022-09-21 Updated: 2024-01-23 Resolved: 2024-01-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 10.11 |
| Fix Version/s: | 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Michael Widenius | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Creating a view with some extra virtual/computed fields are not insertable
|
| Comments |
| Comment by Oleksandr Byelkin [ 2022-09-22 ] | |||||
|
| |||||
| Comment by Oleksandr Byelkin [ 2022-09-22 ] | |||||
|
It is check that fields are unique prevent inserting | |||||
| Comment by Oleksandr Byelkin [ 2022-09-22 ] | |||||
|
Probably we should check only fields we are inserting to... | |||||
| Comment by Oleksandr Byelkin [ 2022-09-22 ] | |||||
|
https://mariadb.com/kb/en/inserting-and-updating-with-views/#inserting-with-views the view above looks like do not contradict the conditions | |||||
| Comment by Sergei Golubchik [ 2022-09-22 ] | |||||
|
Note that view1 is not insertable-into in the SQL standard (2016). It says that
etc. and eventually
So MariaDB current behavior is what standard specifies and the requested feature is an extension of the standard. UPD: on a second thought, it seems that the above quote in bold should only cover cases like
making only these views not potentially updatable. | |||||
| Comment by Oleksandr Byelkin [ 2022-09-22 ] | |||||
|
So we decided to make it exactly as generated field (if there is the "same" fields in the view, as it is in the test case) second (by order) counted as generated). | |||||
| Comment by Michael Widenius [ 2024-01-23 ] | |||||
|
Review done, one comment removal requested. Ok to push |