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

ROW_NUMBER is not set and differs from the message upon ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row

Details

    Description

      create or replace table t (a int);
      insert into t values (1,2),(3);
       
      get diagnostics condition 1 @n= row_number, @m= message_text;
      select @n, @m;
      

      bb-10.7-row_number cb9002bee

      MariaDB [test]> select @n, @m;
      +------+-------------------------------------------------+
      | @n   | @m                                              |
      +------+-------------------------------------------------+
      |    0 | Column count doesn't match value count at row 1 |
      +------+-------------------------------------------------+
      1 row in set (0.001 sec)
      

      If, however, the error occurs on the 2nd or further rows, ROW_NUMBER is set all right:

      MariaDB [test]> insert into t values (1),(2,3);
      ERROR 1136 (21S01): Column count doesn't match value count at row 2
      MariaDB [test]> get diagnostics condition 1 @n= row_number, @m= message_text;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select @n, @m;
      +------+-------------------------------------------------+
      | @n   | @m                                              |
      +------+-------------------------------------------------+
      |    2 | Column count doesn't match value count at row 2 |
      +------+-------------------------------------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            rucha174 Rucha Deodhar added a comment - - edited Patch: https://github.com/MariaDB/server/commit/a1e5bdf87f50cd1f03c889a4be61ecef2da8f526

            a1e5bdf87f50cd1f03c889a4be61ecef2da8f526 is good,
            but please add a second test case. You've added reset_current_row_for_warning(1 in two places. Make sure they're both tested.
            Then ok to push

            serg Sergei Golubchik added a comment - a1e5bdf87f50cd1f03c889a4be61ecef2da8f526 is good, but please add a second test case. You've added reset_current_row_for_warning(1 in two places. Make sure they're both tested. Then ok to push
            rucha174 Rucha Deodhar added a comment -

            Added test and pushed to bb-10.7-row_number

            rucha174 Rucha Deodhar added a comment - Added test and pushed to bb-10.7-row_number

            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.