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

ROW_NUMBER is wrong upon INSERT into Federated table

    XMLWordPrintable

    Details

      Description

      --source suite/federated/have_federatedx.inc
       
      create table t (pk int primary key);
      --eval create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t'
      --error ER_DUP_KEY
      insert into tfed values (1),(2),(1);
      get diagnostics condition 1 @val = error_index;
      select @val;
       
      # Cleanup
      drop table tfed, t;
      

      10.7 225564993

      MariaDB [test]> insert into tfed values (1),(2),(1);
      ERROR 1022 (23000): Can't write; duplicate key in table 'tfed'
      MariaDB [test]> get diagnostics condition 1 @val = error_index;
      Query OK, 0 rows affected (0.001 sec)
       
      MariaDB [test]> select @val;
      +------+
      | @val |
      +------+
      |    4 |
      +------+
      1 row in set (0.001 sec)
      

      The expected result is obviously 3.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration