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

ER_BAD_FIELD_ERROR (Unknown column in where clause) on the 2nd execution of PS

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
    • 10.5, 10.6
    • Prepared Statements
    • None

    Description

      The problem was introduced in 5.5 tree with the following revision:

      revno: 4030
      revision-id: monty@askmonty.org-20140124125018-qwln430o4bu3pued
      parent: monty@askmonty.org-20140124123019-2ts6q2ip6076gmqg
      committer: Michael Widenius <monty@askmonty.org>
      branch nick: maria-5.5
      timestamp: Fri 2014-01-24 14:50:18 +0200
      message:
        Fix for MDEV-5531: double call procedure in one session - hard shutdown the server
        Main fix was to not cache derivied tables as they may be temporary tables that are deleted before the next query.
        This was a bit tricky as Item_field::fix_fields depended on cached_tables to be set to resolve some columns.

      CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
      CREATE TABLE t2 (c INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1,1),(2,2);
      INSERT INTO t2 VALUES (3),(4);
       
      PREPARE stmt FROM 'SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE a IN ( SELECT c FROM t2 WHERE c <= sq.b )';
      EXECUTE stmt;
      EXECUTE stmt;

      query 'EXECUTE stmt' failed: 1054: Unknown column 'sq.b' in 'where clause'

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.