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

    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

              shulga Dmitry Shulga
              pimbroekhof Pim Broekhof
              Dmitry Shulga Dmitry Shulga
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.25d
                  0.25d

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.