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

Various crashes upon stored procedure querying view with concat/group_concat

Details

    Description

      We are experiencing a crash in MariaDB (version 10.6.21) on both Rocky Linux (release 9.4) and Amazon Linux 2
      in a scenario involving views and stored procedures.
      While the original query is much more complex, we are providing a simplified use case that can reliably reproduce the issue.

      It appears that the crash occurs when:
      a VIEW uses a CONCAT() or GROUP_CONCAT() function on a column definition, and
      a STORED PROCEDURE queries this VIEW using a LIKE condition on the same column having that function.

      This issue does not occur with the previously used version 10.6.16 — it only started happening after the upgrade to 10.6.21.

      The crash can be consistently reproduced under these conditions:

      create or replace table table_task ( id int auto_increment primary key, col1 int, col2 int, col3 int);
      insert into table_task select null,round(rand()*100),round(rand()*100),round(rand()*100) from seq_1_to_1000;
       
      create or replace view v_t_task as
      select col1 as taskcid, sum(col3) as suc3,
      group_concat('-',case when `col3` is not null then `col2` else '' end,'-' separator ',') AS `listc2`
      from table_task
      group by col1;
       
      delimiter //
      CREATE or replace PROCEDURE `spmona`(IN `IN_listc2` VARCHAR(1000), IN `IN_limitfrom` INT, IN `IN_limitto` INT)
      BEGIN
      SELECT *
      FROM
       v_t_task `t`
      WHERE
       CASE WHEN IN_listc2 IS NOT NULL THEN `t`.`listc2` LIKE CONCAT("%", IN_listc2, "%") ELSE TRUE END
      LIMIT
        IN_limitfrom,
        IN_limitto;
      END //
      delimiter ;
       
      CALL spmona(null,0,25);
      

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            andrea.ponzo Andrea Ponzo
            Votes:
            2 Vote for this issue
            Watchers:
            7 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.