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

Incorrect row number upon INSERT .. SELECT from the same table: rows are counted twice

    XMLWordPrintable

Details

    Description

      When INSERT .. SELECT produces an error/warning which reports the number of the problematic row, this number is wrong when SELECT is performed from the same table.

      create or replace table t (a tinyint);
      insert into t values (1),(100);
      insert into t select a*2 from t;
      

      10.7 d552e092c9f3

      MariaDB [test]> insert into t select a*2 from t;
      ERROR 1264 (22003): Out of range value for column 'a' at row 4
      

      Consequently, ERROR_INDEX from MDEV-10075 is also wrong.

      If the the same values are insert-selected from a different table, the counter is correct:

      MariaDB [test]> create or replace table tmp select * from t;
      Query OK, 2 rows affected (0.044 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> insert into t select a*2 from tmp;
      ERROR 1264 (22003): Out of range value for column 'a' at row 2
      

      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.