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

LP:612530 - 'Unknown column' when re-executing a prepared query optimized with materialization

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      When the following query:

      SELECT table1 .`col_varchar_key`
      FROM (
      SELECT *
      FROM BB ) table1 STRAIGHT_JOIN B ON ( 'd' , 'f' ) IN (
      SELECT `col_varchar_nokey` SUBQUERY2_field1 , `col_varchar_nokey`
      FROM view_B )

      is executed with subquery cache by preparing it and running it twice, the server returns the following error:

      1054: 'Unknown column 'materialized subselect.SUBQUERY2_field1' in 'order clause'

      The main problem aside, it may not be wise to output optimizer-internal information in error messages. A generic "internal optimizer error" or a direct assertion may be less confusing than a message about a table or a column the user never created herself.

      Attachments

        Activity

          People

            timour Timour Katchaounov (Inactive)
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.