[MDEV-23745] CHAR(36) columns are unconditionally regarded as GUID Created: 2020-09-17  Updated: 2020-09-17  Resolved: 2020-09-17

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table
Affects Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Olivier Bertrand Assignee: Olivier Bertrand
Resolution: Not a Bug Votes: 0
Labels: need_feedback
Environment:

Any



 Description   

For example:

CREATE TABLE tbs (id INT, bs CHAR(36));
INSERT INTO tbs VALUES(1,'anything');    -- Ok
SELECT * FROM tbs;   -- Error

This raised an error message saying:

Guid must contain 32 digits and 4 dashes
(xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx)

This is not documented and may occur unexpectedly when column definitions are made via Discovery.

Note: This does not occur when using VARCHAR(36).



 Comments   
Comment by Sergei Golubchik [ 2020-09-17 ]

I cannot repeat it. There must be something you've omitted.

MariaDB [test]> CREATE TABLE tbs (id INT, bs CHAR(36));
Query OK, 0 rows affected (0.013 sec)
 
MariaDB [test]> INSERT INTO tbs VALUES(1,'anything');    -- Ok
Query OK, 1 row affected (0.002 sec)
 
MariaDB [test]> SELECT * FROM tbs;   -- Error
+------+----------+
| id   | bs       |
+------+----------+
|    1 | anything |
+------+----------+
1 row in set (0.001 sec)

and

$ grep 'Guid must contain' -r .
$

this error is not present anywhere in MariaDB 10.5 sources.

Comment by Olivier Bertrand [ 2020-09-17 ]

This message was not issued by MariaDB but by the client program I was using.

Generated at Thu Feb 08 09:24:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.