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

Assertion failure when executing prepared statement with ? in IN list

    XMLWordPrintable

    Details

      Description

      With one of the last updates, a bug in mariadb server got introduced which returns unexpected behavior. The last tested version without this bug is 10.5.13/10.6.5.

      When executing a "where in" query with more than 1000 values in a prepared statement, the query will always return an empty result set. This only occurs in prepared statements, not if queried directly. We have attached a test case below.

      Steps to reproduce:
      1. Create a test table with a "val" column.
      2. Add two or more rows:

      INSERT INTO `test` (`id`, `val`) VALUES (1, 1), (2, 2), (3, 3);
      

      3. Create a prepared statement:

      PREPARE stmt1 FROM 'select * from test where val in (?,[more than 999 entries]...)';
      

      4. Execute the prepared statement with 999+ values. Exclude one or more rows to expect a non-empty result set:

      EXECUTE stmt1 USING 2, 3, ...;
      

      Expected results:
      A proper result with one or more entries, depending on the query. Or, alternatively, a proper error message stating why this is no longer possible.

      Actual results:
      No error message is returned, just an empty result set.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igor Igor Babaev
              Reporter:
              kgeigerGD Karim Geiger
              Votes:
              0 Vote for this issue
              Watchers:
              13 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.