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

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
    • Fix Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
    • Component/s: Server
    • Labels:
      None

      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

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

                Dates

                Created:
                Updated:

                  Git Integration