GSoC 2015 : Weekly Report #1 : RFE #1485
Hi, as I had posted here, I have been selected for GSoC 2015 with phpMyAdmin and will be working on project ‘Feature Request Project Enhancments’ mentored by Isaac Bennetch.
The official GSoC 2015 timeline suggests that the project coding-up period starts on 25th May, but I had started to work on project on 6th May, 2015. This is first of my Weekly reports that I will be posting every Monday till the completion of my project.
Task assigned to be completed:
RFE #1485 : Adding Drop/ Coalesce Partition Option in Partition Maintenance
Scheduled Deadline: 31st May, 2015
Completed on: 11th May, 2015
Key tasks stalled: None
The RFE mentions about adding a DROP Partition option to Partition Maintenance which already has options like ‘Analyze’, ‘Check’, ‘Repair’ etc.
DROP partition is different from Removing the Partitioning altogether as DROP just drops one or more selected partitions.
The documentation mentions that DROP partition can only be used with Range and List Partitions.
Dropping a partition from a table that is partitioned by either
LISTcan be accomplished using the
ALTER TABLEstatement with a
The partitions of other partition types i.e. HASH, KEY, LINEAR HASH, LINEAR KEY can not be dropped in a similar way. They have to be truncated instead.
So the first, I added a method that fetches the Partition Type of the selected table from
`INFORMATION_SCHEMA`.`PARTITIONS` table, checks if the type is HASH or KEY adds the ‘COALESCE’ element to the $choices array, if true and ‘DROP’ otherwise.
Madhura then refactored this method to a static method getPartitionMethod in Partition.class.php which is called from operations.lib.php’s method PMA_getHtmlForPartitionMaintenance. It checks if the partition type is HASH or KEY to add ‘COALESCE’ and other wise ‘DROP’ option to the $choices array.
Later(on 18th May), while looking into the code while writing this post, I realized that checking for LINEAR KEY and LINEAR HASH partition types was missing and so changed the code appropriately and submitted a new PR#1681 to fix these issue.
Madhura later made some amendments to overall functioning of Partition Maintenance form later which can be found at , .
Thus, I completed the feature request #1485. Madhura’s commits helped me realize some small but very important things that were missing from patch. Hope I overcome such things in my next patches.
Implemented with: 
Overall workflow after implementation: User selects partition(s) that he/she wants to DROP (if RANGE or LIST type) or COALESCE (for other types), selects DROP/COALESCE radio button and clicks ‘Go’. On successful completion, appropriate notice printed out.
 : https://dev.mysql.com/doc/refman/5.6/en/partitioning-management-range-list.html
 : https://dev.mysql.com/doc/refman/5.6/en/partitioning-management-hash-key.html
 : https://github.com/phpmyadmin/phpmyadmin/commit/cbedcdc3f6ab0a191f027410a1df3af6cb20080d
 : https://github.com/phpmyadmin/phpmyadmin/commit/99c126873c0b5d697e1003da48cd3c486d6f7402
 : https://github.com/phpmyadmin/phpmyadmin/commit/697fd7825feeac6d27ec67853db3d446733a1ba8
Task(s) in Upcoming weeks: RFE # 657 : Alter privileges when renaming database/table/fields