Skip to content
  • Nischal Tonthanahal's avatar
    02eae6c4
    BUG#31100205 WL#13588: MISLEADING ERROR MSGS W/R/T PARTITION KEY PREFIXES · 02eae6c4
    Nischal Tonthanahal authored
    DESCRIPTION:
    ------------
    
     1) When attempting to create a table partitioned by key,
        using only prefixed columns used as part of the
        primary/unique key, the user gets a confusing error
        message.
    
        eg: mysql> CREATE TABLE `t1` (
            ->         `a` VARCHAR(100),
            ->         `b` VARCHAR(25),
            ->         PRIMARY KEY (a(10), b(2))
            ->     ) PARTITION BY KEY() PARTITIONS 2;
        ERROR 1503 (HY000): A PRIMARY KEY must include all
        columns in the table's partitioning function
    
     2) The partitioning function has always ignored prefixed
        columns in the PRIMARY/UNIQUE KEY, for its partition
        calculations. The warning message added for the
        deprecation of this syntax in WL#13588 could be improved
        to make this clear.
    
        eg: mysql> CREATE TABLE `t2` (
            ->         `a` VARCHAR(100),
            ->         `b` VARCHAR(25),
            ->         PRIMARY KEY (a(10), b)
            ->     ) PARTITION BY KEY() PARTITIONS 2;
        Warning 1681: Usage of column 'test.t2.a' having prefix
        key part 'a(10)' in the PARTITION BY KEY() clause is
        deprecated and will be removed in a future release.
    
    FIX:
    ----
    
     1) The error message ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF is
        changed to be inclusive of this case to avoid confusion.
    
        eg: ERROR 1503 (HY000): A PRIMARY KEY must include all
        columns in the table's partitioning function (prefixed
        columns are not considered).
    
     2) The warning message in
        ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY and
        ER_WARN_LOG_DEPRECATED_PARTITION_PREFIX_KEY is improved.
    
        eg: Warning 1681: Column 'test.t2.a' having prefix key
        part 'a(10)' is ignored by the partitioning function.
        Use of prefixed columns in the PARTITION BY KEY() clause
        is deprecated and will be removed in a future release.
    
    Change-Id: Iedaa4bca503c4f76b65705aa16fd2c9d7ff979c0
    02eae6c4
    BUG#31100205 WL#13588: MISLEADING ERROR MSGS W/R/T PARTITION KEY PREFIXES
    Nischal Tonthanahal authored
    DESCRIPTION:
    ------------
    
     1) When attempting to create a table partitioned by key,
        using only prefixed columns used as part of the
        primary/unique key, the user gets a confusing error
        message.
    
        eg: mysql> CREATE TABLE `t1` (
            ->         `a` VARCHAR(100),
            ->         `b` VARCHAR(25),
            ->         PRIMARY KEY (a(10), b(2))
            ->     ) PARTITION BY KEY() PARTITIONS 2;
        ERROR 1503 (HY000): A PRIMARY KEY must include all
        columns in the table's partitioning function
    
     2) The partitioning function has always ignored prefixed
        columns in the PRIMARY/UNIQUE KEY, for its partition
        calculations. The warning message added for the
        deprecation of this syntax in WL#13588 could be improved
        to make this clear.
    
        eg: mysql> CREATE TABLE `t2` (
            ->         `a` VARCHAR(100),
            ->         `b` VARCHAR(25),
            ->         PRIMARY KEY (a(10), b)
            ->     ) PARTITION BY KEY() PARTITIONS 2;
        Warning 1681: Usage of column 'test.t2.a' having prefix
        key part 'a(10)' in the PARTITION BY KEY() clause is
        deprecated and will be removed in a future release.
    
    FIX:
    ----
    
     1) The error message ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF is
        changed to be inclusive of this case to avoid confusion.
    
        eg: ERROR 1503 (HY000): A PRIMARY KEY must include all
        columns in the table's partitioning function (prefixed
        columns are not considered).
    
     2) The warning message in
        ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY and
        ER_WARN_LOG_DEPRECATED_PARTITION_PREFIX_KEY is improved.
    
        eg: Warning 1681: Column 'test.t2.a' having prefix key
        part 'a(10)' is ignored by the partitioning function.
        Use of prefixed columns in the PARTITION BY KEY() clause
        is deprecated and will be removed in a future release.
    
    Change-Id: Iedaa4bca503c4f76b65705aa16fd2c9d7ff979c0
Loading