[MDEV-4838] Wrong metadata for DATE_ADD('string', INVERVAL) Created: 2013-08-02  Updated: 2013-12-19  Resolved: 2013-12-19

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.4
Fix Version/s: None

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


 Description   

CREATE TABLE t1 AS SELECT DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE) AS a;
SHOW COLUMNS FROM t1;

correctly reports a VARCHAR column:

+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| a     | varchar(26) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+

But "mysql --column-type-info" reports a wrong result:

$ mysql --column-type-info
 
MariaDB [(none)]> SELECT DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE);
Field   1:  `DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE)`
Type:       STRING
Collation:  binary (63)
Length:     26
Max_length: 19
Decimals:   31
Flags:      BINARY 
+----------------------------------------------------+
| DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE) |
+----------------------------------------------------+
| 2011-01-02 12:14:14                                |
+----------------------------------------------------+

Notice, collation binary(63), which implies a VARBINARY column type,
and which is wrong.

MySQL-5.6 in the same scenario returns "Collation: utf8_general_ci (33)",
which looks correct and corresponds to the connection character set ut8.



 Comments   
Comment by Alexander Barkov [ 2013-12-19 ]

The problem seems to be fixed by some earlier change
and is not reproducible any longer.
Only adding a test case into func_time.test.

Generated at Thu Feb 08 06:59:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.