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

Item_param does not preserve exact field type in EXECUTE IMMEDIATE 'CREATE TABLE AS SELECT ?' USING POINT(1,1)

    XMLWordPrintable

    Details

      Description

      This script:

      DROP TABLE IF EXISTS t1;
      EXECUTE IMMEDIATE 'CREATE TABLE t1 AS SELECT ?' USING POINT(1,1);
      SHOW CREATE TABLE t1;
      

      creates a column of a wrong type:

      +-------+-----------------------------------------------------------------------------------------+
      | Table | Create Table                                                                            |
      +-------+-----------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `?` varbinary(25) NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+-----------------------------------------------------------------------------------------+
      

      The expected type should be POINT.

      The same problem is repeatable in:

      DROP TABLE IF EXISTS t1;
      PREPARE stmt FROM 'CREATE OR REPLACE TABLE t1 AS SELECT ?';
      EXECUTE stmt USING POINT(1,1);
      SHOW CREATE TABLE t1;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: