[MDEV-12917] Wrong data type for CREATE..SELECT year_sp_variable Created: 2017-05-25  Updated: 2017-05-25  Resolved: 2017-05-25

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.3.1

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Duplicate
duplicates MDEV-12876 Wrong data type for CREATE..SELECT sp... Closed

 Description   

DROP PROCEDURE IF EXISTS p1;
DELIMITER $$
CREATE PROCEDURE p1()
BEGIN
  DECLARE a YEAR;
  CREATE OR REPLACE TABLE t1 AS SELECT a;
  SHOW CREATE TABLE t1;
  DROP TABLE t1;
END;
$$
DELIMITER ;
CALL p1;

+-------+-----------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                  |
+-------+-----------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(4) unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------------+

The data type for t1.a is wrong. The expected type is YEAR.


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