[MDEV-12798] Item_param does not preserve exact field type in EXECUTE IMMEDIATE 'CREATE TABLE AS SELECT ?' USING POINT(1,1) Created: 2017-05-15  Updated: 2017-05-15  Resolved: 2017-05-15

Status: Closed
Project: MariaDB Server
Component/s: GIS, Prepared Statements
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.3.1

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE ... Closed

 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;



 Comments   
Comment by Alexander Barkov [ 2017-05-15 ]

Pushed to bb-10.2-ext

Generated at Thu Feb 08 08:00:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.