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

ROW_NUMBER is wrong and differs from error message upon ER_CUT_VALUE_GROUP_CONCAT

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • 10.11
    • Server
    • None

    Description

      set group_concat_max_len = 1024;
      create or replace table t (f varchar(400));
      insert into t values (repeat('a',400)),(repeat('b',400)),(repeat('c',400)),(repeat('d',400));
      select group_concat(f order by 1) as ff from t;
      get diagnostics condition 1 @n = row_number, @m = message_text;
      select @n, @m;
       
      # Cleanup
      drop table t;
      

      bb-10.7-row_number c27f04ede

      +------+---------------------------------+
      | @n   | @m                              |
      +------+---------------------------------+
      |    5 | Row 3 was cut by GROUP_CONCAT() |
      +------+---------------------------------+
      1 row in set (0.000 sec)
      

      So, ROW_NUMBER not only differs from the error message, but is also greater than the total number of rows in the table.

      For the record, the error message isn't always accurate either.
      For example, here

      set group_concat_max_len = 1024;
      create or replace table t (f text);
      insert into t values (repeat('a',65535)),(repeat('b',65535)),(repeat('c',65535));
      select group_concat(f order by 1) as ff from t;
      get diagnostics condition 1 @n = row_number, @m = message_text;
      select @n, @m;
       
      # Cleanup
      drop table t;
      

      The result is

      +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | f                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
      +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
      +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set, 1 warning (0.003 sec)
       
      +------+---------------------------------+
      | @n   | @m                              |
      +------+---------------------------------+
      |    4 | Row 2 was cut by GROUP_CONCAT() |
      +------+---------------------------------+
      1 row in set (0.000 sec)
      

      Clearly, the 1st row was already cut there, so the error message isn't right, but the ROW_NUMBER is even "wronger".

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value

            As SELECT, it can be out of the scope of MDEV-10075, but the difference between the value and the message makes it a visible one. It's a borderline situation, feel free to demote/remove from the must-do list.

            elenst Elena Stepanova added a comment - As SELECT, it can be out of the scope of MDEV-10075 , but the difference between the value and the message makes it a visible one. It's a borderline situation, feel free to demote/remove from the must-do list.
            serg Sergei Golubchik made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 126316 ] MariaDB v4 [ 143260 ]
            rucha174 Rucha Deodhar made changes -
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.7 [ 24805 ]
            rucha174 Rucha Deodhar made changes -
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.8 [ 26121 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.11 [ 27614 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.9 [ 26905 ]

            People

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

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.