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

Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with CHECK violation

    XMLWordPrintable

Details

    Description

      create or replace table t (a int, check(a>0));
      insert ignore into t values (1),(0),(2),(0);
      get diagnostics condition 1 @n= row_number;
      select @n;
      get diagnostics condition 2 @n= row_number;
      select @n;
       
      # Cleanup
      drop table t;
      

      bb-10.7-row_number cb9002bee

      MariaDB [test]> get diagnostics condition 1 @n= row_number;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select @n;
      +------+
      | @n   |
      +------+
      |    2 |
      +------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> get diagnostics condition 2 @n= row_number;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select @n;
      +------+
      | @n   |
      +------+
      |    3 |
      +------+
      1 row in set (0.000 sec)
      

      The second one is wrong, the expected result is 4.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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