Bug #28007 Wrong default value for I_S.PARTITIONS.PARTITION_COMMENT
Submitted: 22 Apr 2007 0:10 Modified: 15 Jun 2007 10:14
Reporter: Jon Stephens Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.1.18-bk OS:Linux
Assigned to: Sergey Glukhov
Tags: information_schema, partitioning

[22 Apr 2007 0:10] Jon Stephens
Description:
According to http://dev.mysql.com/doc/refman/5.1/en/partitions-table.html:

"PARTITION_COMMENT: This column contains the text of any comment made for the partition. ... The default value for this column is an empty string."

However, the default value is actually the string "default".

How to repeat:
mysql> CREATE TABLE p1 (c1 INT)
    -> PARTITION BY RANGE (c1)
    -> (
    ->   PARTITION p0 VALUES LESS THAN (1),
    ->   PARTITION p1 VALUES LESS THAN MAXVALUE
    -> );
Query OK, 0 rows affected (0.04 sec)

mysql> SELECT * FROM INFORMATION_SCHEMA.PARTITIONS 
     > WHERE TABLE_SCHEMA='test' AND TABLE_NAME='p1'\G
*************************** 1. row ***************************
                TABLE_CATALOG: NULL
                 TABLE_SCHEMA: test
                   TABLE_NAME: p1
               PARTITION_NAME: p0
            SUBPARTITION_NAME: NULL
   PARTITION_ORDINAL_POSITION: 1
SUBPARTITION_ORDINAL_POSITION: NULL
             PARTITION_METHOD: RANGE
          SUBPARTITION_METHOD: NULL
         PARTITION_EXPRESSION: c1
      SUBPARTITION_EXPRESSION: NULL
        PARTITION_DESCRIPTION: 1
                   TABLE_ROWS: 0
               AVG_ROW_LENGTH: 0
                  DATA_LENGTH: 0
              MAX_DATA_LENGTH: 1970324836974591
                 INDEX_LENGTH: 1024
                    DATA_FREE: 0
                  CREATE_TIME: 2007-04-22 10:17:09
                  UPDATE_TIME: 2007-04-22 10:17:09
                   CHECK_TIME: NULL
                     CHECKSUM: NULL
            PARTITION_COMMENT: default
                    NODEGROUP: default
              TABLESPACE_NAME: NULL
*************************** 2. row ***************************
                TABLE_CATALOG: NULL
                 TABLE_SCHEMA: test
                   TABLE_NAME: p1
               PARTITION_NAME: p1
            SUBPARTITION_NAME: NULL
   PARTITION_ORDINAL_POSITION: 2
SUBPARTITION_ORDINAL_POSITION: NULL
             PARTITION_METHOD: RANGE
          SUBPARTITION_METHOD: NULL
         PARTITION_EXPRESSION: c1
      SUBPARTITION_EXPRESSION: NULL
        PARTITION_DESCRIPTION: MAXVALUE
                   TABLE_ROWS: 0
               AVG_ROW_LENGTH: 0
                  DATA_LENGTH: 0
              MAX_DATA_LENGTH: 1970324836974591
                 INDEX_LENGTH: 1024
                    DATA_FREE: 0
                  CREATE_TIME: 2007-04-22 10:17:09
                  UPDATE_TIME: 2007-04-22 10:17:09
                   CHECK_TIME: NULL
                     CHECKSUM: NULL
            PARTITION_COMMENT: default
                    NODEGROUP: default
              TABLESPACE_NAME: NULL
2 rows in set (0.01 sec)

mysql>

Suggested fix:
Make sure that the value of the PARTITION_COMMENT column is an empty string if there is no partition comment.
[23 Apr 2007 4:13] Valerii Kravchuk
Thank you for a bug report. Verified as described.
[4 May 2007 9:03] 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/commits/26074

ChangeSet@1.2507, 2007-05-04 14:01:06+05:00, gluh@mysql.com +2 -0
  Bug#28007 Wrong default value for I_S.PARTITIONS.PARTITION_COMMENT
  The value of the PARTITION_COMMENT column is an empty string if there is no partition comment.
[6 Jun 2007 12:49] 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/commits/28196

ChangeSet@1.2550, 2007-06-06 17:47:02+05:00, gluh@mysql.com +5 -0
  Bug#28007 Wrong default value for I_S.PARTITIONS.PARTITION_COMMENT
  The value of the PARTITION_COMMENT column is an empty string if there is no partition comment.
[14 Jun 2007 19:01] Bugs System
Pushed into 5.1.20-beta
[15 Jun 2007 10:14] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.20 changelog.