Bug #85413 Failing to rename a column involved in partition
Submitted: 10 Mar 2017 19:00 Modified: 1 May 2017 10:03
Reporter: Raghuram Vadapalli Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:Ver 14.14 Distrib 5.7.17, 5.5.54, 5.6.35, 5.7.17 OS:Ubuntu (16.04)
Assigned to: CPU Architecture:Any
Tags: partition, rename

[10 Mar 2017 19:00] Raghuram Vadapalli
Description:
Server throws an error while trying to rename a column which is involved in partitioning.

How to repeat:
Create a table.
Fill in some data.
Partition the table by some column.
Rename the column.

ERROR 1054 (42S22): Unknown column 'gh' in 'partition function'

Suggested fix:
Rename the column successfully.
[11 Mar 2017 0:02] MySQL Verification Team
Please provide a complete test case printing here the result you get using the mysql command client. Thanks.
[11 Mar 2017 4:38] Raghuram Vadapalli
CREATE DATABASE temp;
USE temp;

CREATE TABLE `random` (
  `ws` int(11) NOT NULL,
  `sd` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY HASH (ws)
(
PARTITION p0ENGINE,
PARTITION InnoDB,
PARTITION p1ENGINE,
PARTITION InnoDB
);

INSERT INTO `random` (`ws`, `sd`) VALUES
(1, 2),
(3, 4);

ALTER TABLE `random` CHANGE `ws` `rt` INT(11) NOT NULL;

Error:
#1054 - Unknown column 'ws' in 'partition function'
[13 Mar 2017 5:18] MySQL Verification Team
Hello Raghuram!

Thank you for the report and test case.

Thanks,
Umesh
[1 May 2017 10:03] Raghuram Vadapalli
Any update on this?