Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23347

Embedded view's check option is not honoured in some cases.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1.45, 10.2.32, 10.3.23, 10.4.13, 10.5.3
    • 10.4, 10.5
    • Views
    • None

    Description

      If a view v1 is defined using WITH CHECK OPTION clause and is is used by another view v2 without such clause the check option is not honoured when updating view v2 or when inserting into v2.
      The following test case demonstrate the problem:

      create table t1 (a int) ; 
      insert into t1 values (3), (8), (7), (1);
      create view v1 as select * from t1 where a < 5 with check option;
      create view v2 as select * from v1 where a > 1;
      update v2 set a=9 where a=3;
      select * from t1;
      drop view v1;
      drop table t1;
      

      After update we have:

      MariaDB [test]> select * from t1;
      +------+
      | a    |
      +------+
      |    9 |
      |    8 |
      |    7 |
      |    1 |
      +------+
      

      and we see that the new row violates check option for view v1.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              igor Igor Babaev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.