Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5704

Random columnstore error MCS-2035 with special SELECT structures

Details

    • 2024-1

    Description

      Hello,

      starting with mariadb version 10.6.16-11-MariaDB-enterpriese-log / Columnstore version 23.10.0 we have the following error with some sql SELECTs on columnstore tables:

      • SQL Error [1815]
      • Internal error: MCS-2035

      In our production server with mariadb version 10.6.14-9-MariaDB-enterprise-log / Columnstore version 23.02.4 we do not have that problem

      The errors occur with SELECT statements of the following structure:

      SELECT 
        CASE WHEN v.intcol = 12345 THEN 'GROUP01' ELSE 'REST' END AS t,
        JSON_OBJECT('s', COUNT(*)) AS v
      FROM testtable AS v 
      GROUP BY t
      

      The following was observed:

      • The problem seems to be caused by type conversions. If the THEN / ELSE values of the CASE expressions in column t are replaced with integer values the problem seems to vanish
      • The same in the second result column v. If just the COUNT aggregat integer value is returned without converting it to a JSON string the problem vanishes as well.
      • Any string conversion of aggregated integer or decimal values in the v column causes the problem like the following (what was used to do the same as JSON_OBJECT):

      CAST(CONCAT('{','"$0":',SUM(column1),',','"$1":',SUM(column2),'}') AS CHAR(100))
      

      • The problem was just observed when the two expressions in column t and v are combined in the same SELECT

      The worst thing is that the problem is not really reproducible. It seems to be dependent on the number of rows of the columnstore testtable. That
      prevented me from providing a simple test scenario. In my tests on our database server I have about the following probabilities:

      • 200.000 rows 10% failures
      • 60.000.000 rows 99% failures

      Innodb tables do not have that problem

      The tests to make the problem more reproducible were done on a very simple columnstore table with just one column:

      CREATE TABLE testtable (intcol int) 
      ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
      

      After filling it with different numbers of rows I saw that the error probality increased with the row number.

      Best regards
      Matthias

      Attachments

        Issue Links

          Activity

            to test I used:

            #echo "" | awk -v rows=10000000 '

            {for(i=1; i<=rows; i++)print i "|"}

            ' >> /tmp/1.tbl
            >load data infile '/tmp/1.tbl' into table testtable fields terminated by '|';
            6 or more times

            for 23.10.0 3 from first 6 runs of select had error:
            ERROR 1815 (HY000): Internal error: MCS-2035: An internal error occurred. Check the error log file & contact support.

            for current develop no error for 60M or even 240M rows during about 20 runs.

            kirill.perov@mariadb.com Kirill Perov (Inactive) added a comment - to test I used: #echo "" | awk -v rows=10000000 ' {for(i=1; i<=rows; i++)print i "|"} ' >> /tmp/1.tbl >load data infile '/tmp/1.tbl' into table testtable fields terminated by '|'; 6 or more times for 23.10.0 3 from first 6 runs of select had error: ERROR 1815 (HY000): Internal error: MCS-2035: An internal error occurred. Check the error log file & contact support. for current develop no error for 60M or even 240M rows during about 20 runs.

            verified fixed in develop 26 April 2024

            kirill.perov@mariadb.com Kirill Perov (Inactive) added a comment - verified fixed in develop 26 April 2024

            People

              kirill.perov@mariadb.com Kirill Perov (Inactive)
              mdg62 Matthias Dr. Döring
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.