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.

Week #1

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

Details:

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 RANGE or by LIST can be accomplished using the ALTER TABLE statement with a DROP PARTITION clause

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 [3], [4].

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: [5]

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.

Screenshots :

Coalesce Partition

Coalesce Partition

 

Drop_Partition

Drop_Partition

 

 

Links :

[1] : https://dev.mysql.com/doc/refman/5.6/en/partitioning-management-range-list.html
[2] : https://dev.mysql.com/doc/refman/5.6/en/partitioning-management-hash-key.html
[3] : https://github.com/phpmyadmin/phpmyadmin/commit/cbedcdc3f6ab0a191f027410a1df3af6cb20080d
[4] : https://github.com/phpmyadmin/phpmyadmin/commit/99c126873c0b5d697e1003da48cd3c486d6f7402
[5] : https://github.com/phpmyadmin/phpmyadmin/commit/697fd7825feeac6d27ec67853db3d446733a1ba8

Task(s) in Upcoming weeks: RFE # 657 : Alter privileges when renaming database/table/fields

Advertisements

About Deven Bansod

I am a final year undergraduate student pursuing B.E.(Hons.) Computer Science Engg. + M.Sc.(Hons.) Economics(Dual Degree) at BITS Pilani, Pilani (India). I am interested in and have been contributing to development of PHP-based Open Source organisations. More recently, I have been contributing to phpMyAdmin, a web interface to MySQL, written in PHP.

Posted on May 18, 2015, in GSoC 2015, phpMyAdmin, Weekly Reports and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: