Bug #12777 Different size shown for VARCHAR(n) columns (with n > 64) in INFORMATION_SCHEMA

Submitted: 24 Aug 2005 7:43 Modified: 25 Aug 2005 19:41
Reporter: Carsten Segieth Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.11 OS:Windows (Windows XP)
Assigned to: Jim Winstead CPU Architecture:Any

[24 Aug 2005 7:43] Carsten Segieth
Description:
The shown CHARACTER_MAXIMUM_LENGTH for 'long' VARCHAR(n) columns (n > 64) in the INFORMATION_SCHEMA differs between Windows and Linux. 

Tested on Windows with 5.0.11-beta the result is VARCHAR(512) for some columns in the INFORMATION_SCHEMA ...

mysql> Select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH AS 'CML', COLUMN_TYPE from information_schema.columns where table_name = 'triggers' and
 data_type = 'varchar' and CHARACTER_MAXIMUM_LENGTH > 63;
+----------------------------+-----------+------+--------------+
| COLUMN_NAME                | DATA_TYPE | CML  | COLUMN_TYPE  |
+----------------------------+-----------+------+--------------+
| TRIGGER_CATALOG            | varchar   |  512 | varchar(512) |
| TRIGGER_SCHEMA             | varchar   |   64 | varchar(64)  |
| TRIGGER_NAME               | varchar   |   64 | varchar(64)  |
| EVENT_OBJECT_CATALOG       | varchar   |  512 | varchar(512) |
| EVENT_OBJECT_SCHEMA        | varchar   |   64 | varchar(64)  |
| EVENT_OBJECT_TABLE         | varchar   |   64 | varchar(64)  |
| ACTION_REFERENCE_OLD_TABLE | varchar   |   64 | varchar(64)  |
| ACTION_REFERENCE_NEW_TABLE | varchar   |   64 | varchar(64)  |
+----------------------------+-----------+------+--------------+
8 rows in set (0.03 sec)

... but looking on Linux (pulled + compiled 23.08.2005) the result is VARCHAR(4096) for the same columns:

COLUMN_NAME	DATA_TYPE	CML	COLUMN_TYPE
TRIGGER_CATALOG	varchar	4096	varchar(4096)
TRIGGER_SCHEMA	varchar	64	varchar(64)
TRIGGER_NAME	varchar	64	varchar(64)
EVENT_OBJECT_CATALOG	varchar	4096	varchar(4096)
EVENT_OBJECT_SCHEMA varchar 64 varchar(64)
EVENT_OBJECT_TABLE varchar 64 varchar(64)
ACTION_REFERENCE_OLD_TABLE varchar 64 varchar(64)
ACTION_REFERENCE_NEW_TABLE varchar 64 varchar(64)

How to repeat:
run the SELECT statement shown above on a Windows and on a Linux machine

Suggested fix:
set the shown size to the same value on all systems
[25 Aug 2005 19:41] Jim Winstead
this is not a bug -- the possible size of these fields depends on PATH_MAX on the system.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.