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

Large IN expression may fail with 'duplicate column name'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.10
    • Fix Version/s: 10.3.11
    • Component/s: Optimizer
    • Labels:
      None

      Description

      The following query will return all records from the table. It will work just fine. However, once the IN's haystack becomes sufficiently large (e.g. >500 items), then an error message is given "#1060 - Duplicate column name 'aaaaa'". I suppose MariaDB creates a temporary internally and uses the searched expressions as column names. As we can see, this may fail.

      SELECT ALL * FROM `test_table_schema`.`test_table`
      WHERE
      (
      (
      'aaaaa',
      'aaaaa'
      )
      )
      IN
      (
      (
      'aaaaa',
      'aaaaa'
      ),
      (
      'aaaaa',
      'aaaaa'
      )
      )

        Attachments

          Activity

            People

            Assignee:
            alice Alice Sherepa
            Reporter:
            user2180613 Remy Fox
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: