Bug #9344 INFORMATION_SCHEMA, wrong content, numeric columns
Submitted: 22 Mar 2005 20:47 Modified: 5 Apr 2005 0:11
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Sergei Glukhov CPU Architecture:Any

[22 Mar 2005 20:47] Matthias Leich
Description:
The columns CHARACTER_MAXIMUM_LENGTH and CHARACTER_OCTET_LENGTH 
of INFORMATION_SCHEMA.COLUMNS must be NULL for numeric columns.

But MySQL reports for example(NIST test case):

CREATE TABLE BASE_WCOV (C1 INT);

columnname                           | NIST expectation |   MySQL
--------------------------------------------------------------------------
CHARACTER_MAXIMUM_LENGTH | IS NULL             |  11
CHARACTER_OCTET_LENGTH      | IS NULL             |  11

My environment:
   - Intel PC with Linux(SuSE 9.1)
   - MySQL compiled from source
        Version 5.0 ChangeSet@1.1840, 2005-03-22 

How to repeat:
set sql_mode='traditional';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1
( x_bigint BIGINT,
  x_integer INTEGER,
  x_smallint SMALLINT,
  x_decimal DECIMAL(5,3),
  x_numeric NUMERIC(5,3),
  x_real REAL,
  x_float FLOAT,
  x_double_precision DOUBLE PRECISION );
show create table t1;

SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME= 't1';
[31 Mar 2005 8:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23520
[31 Mar 2005 11:24] Alexander Barkov
ok to push
[4 Apr 2005 7:58] Sergei Glukhov
Fixed in 5.0.4
[5 Apr 2005 0:11] Paul DuBois
Noted in 5.0.4 changelog.