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

ERROR_INDEX isn't intuitively clear

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.7.1
    • Component/s: Server
    • Labels:
      None

      Description

      can be discussed

      The initially suggested ROW_NUMBER was intuitively understandable, but ERROR_INDEX in the final implementation is not. It is not necessarily an error, and it is certainly not its index.

      MariaDB [test]> insert ignore into t1 (pk) values (1),(1);
      Query OK, 1 row affected, 1 warning (0.017 sec)
      Records: 2  Duplicates: 1  Warnings: 1
       
      MariaDB [test]> show warnings;
      +---------+------+---------------------------------------+
      | Level   | Code | Message                               |
      +---------+------+---------------------------------------+
      | Warning | 1062 | Duplicate entry '1' for key 'PRIMARY' |
      +---------+------+---------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]>  get diagnostics condition 1 @num = ERROR_INDEX, @msg = MESSAGE_TEXT; select @num, @msg;
      Query OK, 0 rows affected (0.000 sec)
       
      +------+---------------------------------------+
      | @num | @msg                                  |
      +------+---------------------------------------+
      |    2 | Duplicate entry '1' for key 'PRIMARY' |
      +------+---------------------------------------+
      1 row in set (0.000 sec)
      

      If something is an "index" here, it's the condition number (1), but the failing row number is 2. And it's a warning.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rucha174 Rucha Deodhar
              Reporter:
              serg Sergei Golubchik
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration