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

Multi-row scalar subquery in BETWEEN clause crashes server instead of returning error 1242

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Description

      Using a subquery that returns more than one row as the upper bound of a BETWEEN predicate causes the server to crash (lost connection) instead of returning ERROR 1242 "Subquery returns more than 1 row".

      Version

      MariaDB Columnstore 25.10.4 (stable-23.10)

      Reproducer

      SELECT cidx, CDECIMAL5
      FROM datatypetestm
      WHERE CDECIMAL5 BETWEEN -9999999 AND (SELECT 1 UNION ALL SELECT 2)
        AND CDECIMAL5+2.4/5 <> 0;

      Also reproduces with other column types (CDECIMAL18, CINTEGER) and in DML context:

      -- variant: integer column
      SELECT cidx, CINTEGER FROM datatypetestm
      WHERE CINTEGER BETWEEN -9999999 AND (SELECT 128 UNION ALL SELECT 'a');
       
      -- variant: DML
      UPDATE cs4 SET d1=12345678901234567890
      WHERE d1 >= (SELECT 1 UNION ALL SELECT 2) OR d2 >= -128;

      Expected

      ERROR 1242 (21000): Subquery returns more than 1 row

      Actual

      ERROR 2013 (HY000): Lost connection to server during query

      Notes

      Tested on InnoDB — same queries correctly return ERROR 1242. The crash is Columnstore-specific.

      Attachments

        Activity

          People

            Unassigned Unassigned
            abukhalov Aleksei Bukhalov
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.