[MDEV-12858] Out-of-range error for CREATE..SELECT unsigned_int_column+1 Created: 2017-05-21  Updated: 2018-01-10  Resolved: 2017-05-22

Status: Closed
Project: MariaDB Server
Component/s: OTHER
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: Fixed Votes: 0
Labels: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-12854 Synchronize CREATE..SELECT data type ... Closed
relates to MDEV-12857 Out-of-range errors on CREATE..SELECT... Closed
relates to MDEV-12859 Out-of-range error for CREATE..SELECT... Closed
relates to MDEV-12860 Out-of-range error on CREATE..SELECT ... Closed
relates to MDEV-14910 Unexpected "BIGINT UNSIGNED value is ... Open

 Description   

SET sql_mode=STRICT_ALL_TABLES;
CREATE OR REPLACE  TABLE t1 (a INT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (0xFFFFFFFF);
CREATE OR REPLACE TABLE t2 AS SELECT a+1 FROM t1;

ERROR 1264 (22003): Out of range value for column 'a+1' at row 1

Adding LIMIT 0 shows that an INT(11) instead of a BITINT(11) column is created:

CREATE OR REPLACE TABLE t2 AS SELECT a+1 FROM t1 LIMIT 0;
DESCRIBE t2;

+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| a+1   | int(11) unsigned | NO   |     | 0       |       |
+-------+------------------+------+-----+---------+-------+



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

Pushed into bb-10.2-ext

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