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

Prepared statement column metadata can be wrong with UNION

    XMLWordPrintable

Details

    Description

      SELECT 1 UNION SELECT 'abc'

      on Prepare, Protocol::send_result_set_metadata() sends type INT to user

      on subsequent execution , it sends STRING in metadata.

      And a more complicated case

      CREATE TABLE t1(i INT);
      ​SELECT i FROM t1 GROUP BY i WITH ROLLUP UNION ALL SELECT ELT(FOUND_ROWS(), 1) f FROM t1 GROUP BY f WITH ROLLUP;
      In this, SELECT the type 3 (MYSQL_TYPE_LONG) changes to type 253 (MYSQL_TYPE_VAR_STRING) from prepare to execute.

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.