[MDEV-6365] ALTER VIEW Needs Fix to Handle RESTRICT/CASCADE Options Created: 2014-06-19 Updated: 2014-10-29 Due: 2014-10-28 Resolved: 2014-10-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 5.5.38 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | James Briggs | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
sql_view.cc comments indicate that CASCADE/RESTRICT options are parsed but ignored:
There's at least 4 problems I can see:
http://dev.mysql.com/doc/refman/5.5/en/create-view.html: "In a WITH CHECK OPTION clause for an updatable view, the LOCAL and CASCADED keywords determine the scope of check testing when the view is defined in terms of another view. The LOCAL keyword restricts the CHECK OPTION only to the view being defined. CASCADED causes the checks for underlying views to be evaluated as well. When neither keyword is given, the default is CASCADED. " |
| Comments |
| Comment by Elena Stepanova [ 2014-10-14 ] |
|
I'm not sure I understand the nature of the complaint, could you please elaborate on it? In particular,
This is an odd way to determine whether the options work or not. The manual page that you quoted also gives a link to another page which explains in more detail what the option means:
It also gives examples which are easy to verify. The option seems to work as described in the manual.
What ambiguous statements, how will they diverge in behavior, and what needs to be implemented to make it happen? Please provide examples.
Regardless the particular change we are talking about, it always happens whenever new functionality is implemented – the old slave is bound to fail when the new master uses new features, that's why NM=>OS replication is not guaranteed, even though there are continuous efforts to make it break as little as possible.
The comments are internal, and they don't say that they suggest the exact syntax; besides, how do you know that they refer to the "WITH CHECK OPTION"? 10 years ago people could think about lots of things when they wrote those comments, for example they could be planning to extend foreign keys syntax (which does have CASCADE/RESTRICT) onto views. We can try to ask them and see if they remember what the comments were about, if you insist it's important. |
| Comment by James Briggs [ 2014-10-14 ] |
|
Elena: There's no MariaDB code to implement the feature above, just a comment saying "TODO." But because the feature was documented in the manual, users have been relying on the syntax. Is that more clear? James Briggs. |
| Comment by Elena Stepanova [ 2014-10-14 ] |
No, it's not. Once again – while reading the code is an admirable skill, sometimes it's worth taking a simple route, I don't understand why you're refusing to do it. Please do actually start the server and try the example from http://dev.mysql.com/doc/refman/5.5/en/view-updatability.html, it works exactly as described in the manual. Maybe then you'll be able to debug and find the code you've missed. Please note that the manual does not mention any checks on DDL statements, only on INSERT/UPDATE. |
| Comment by James Briggs [ 2014-10-25 ] |
|
Hi Elena. Thanks, you're right - the comment refers to ALTER. The functionality I was concerned about exists, which makes me happy. ( The code is in function sql/table.cc:TABLE_LIST::prep_check_option().) However, likely the ALTER should be implemented, so either this JIRA should remain open, or reopened with a different title. Thanks, James. |
| Comment by Elena Stepanova [ 2014-10-25 ] |
|
Hi James,
and yet again, did you actually try it with ALTER? Thanks. |
| Comment by Elena Stepanova [ 2014-10-29 ] |
|
Closing as "Can't reproduce" for now, if you have more information, please comment to re-open. |