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

Prepare statement with only placeholders in Table Value Constructor discards values silently

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.11, 11.1(EOL), 11.2, 11.0.4, 11.2.3, 10.4(EOL), 11.0(EOL), 11.3(EOL)
    • 10.5, 10.6, 10.11, 11.2
    • None

    Description

      Executing a prepared statement with only placeholders in a Table Value Constructor expression silently returns an empty string instead of the actual value.

      EXECUTE IMMEDIATE 'SELECT * FROM (VALUES (?)) test' USING 'a';
      

      Expected output:

      ?
      a

      Got output:

      ?
       

      It does work if any of the values in the TVC is not a placeholder:

      EXECUTE IMMEDIATE 'SELECT * FROM (VALUES (?, "b")) test' USING 'a';
      

      Got output:

      ?
      a
      b

      These types of TVC expressions would commonly be used in combination with a CTE to get named columns.

      Does work as expected on 11.0.3.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              pimbroekhof Pim Broekhof
              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.