Planet phpMyAdmin

July 29, 2014

Edward Cheng

[CONSOLE]WEEK 10 STATUS REPORTS

Key accomplishments last week

  • Working on unit test branch
  • Fixed some bugs

Key tasks that stalled

none

Tasks in the upcoming weeks

(The Schedule is changed)

  • Bug fix
  • Write unit test

by edward at July 29, 2014 08:30 AM

Dhananjay Nakrani

Week-12: php Error Reporting (GSoC’14 project)

12th week of my GSoC project is over now. The objective of this week’s work was to finish remaining tasks from previous weeks.

Tasks Completed this Week:

The project was estimated to finish in 12 weeks in the proposed schedule for this project. Since couple of the things are still remaining from the proposed tasks, I am extending the project to one more week. This week, that is Week#13, will be the last week for this project. The remaining task, task#4.3, will be completed this week only.

One more task, namely issue#43, was assigned to me by my mentor, Michal. Since it is not part of GSoC it is excluded from the current schedule. I will work on it as a volunteer after completion of this project.

Week#13 Tasks:

Objective:
⇒ Give Final Touch to the developed Code.
⇒ Complete Stalled Tasks.
    ⇒ Correct redirection after user logs in.


by dhananjay92 at July 29, 2014 05:45 AM

July 28, 2014

Bimal Yashodha

GSoC 2014 week 10

Under re-formatting and OOPing the code, I did some changes to the pmd_general.php file. Now the functions and HTML codes are separated. HTML codes have moved to another file, and all the logic are in the pmd_general.php file.

Also I'm currently developing designer as a separate component, and will post more details about it in another blog post.

by Bimal Yashodha (noreply@blogger.com) at July 28, 2014 07:27 PM

Chirayu Chiripal

GSoC 2014 Week #11: Navigation state lost on reload

Week #11 Task:  RFE #1426 Navigation state lost on reload
Scheduled Deadline: July 28, 2014
Completed On: July 26, 2014 (to be reviewed)

How it was done: The idea to implement this was to save the current navigation tree state in sessionStorage and then restore the navigation tree from that on page load. Also, as most of the operations in phpMyAdmin are now AJAXified, many operations changed the state of navigation tree, so there was need to update the navigation tree state in sessionStorage in such situations. To achieve this following ideas came to my mind:

  1. Listen to DOM (HTML structure) changes in the navigation tree div and update the state in sessionStorage. After googling a bit to find out if such event exists or not, I found something called Mutation Observers. This seemed to be perfect solution at first sight but after probing it little further, I found that this was not supported by some of the old versions of the browsers (not that old) [MutationObserver compatibility table from caniuse.com]. So this idea was dropped.
  2. Listen for event which gets fired before page reload and update state in sessionStorage before actual reloads happen. That event was onbeforeunload/onunload but the behavior of this event was not consistent across different browsers (browsers impose some restrictions on the code which can be used inside event handler for this event and this restrictions varied from browser to browser). The reason for such restriction was the misuse of this feature to stop a user from navigating away and throwing annoying popups. So, I kept this idea aside for a while.
  3. Call update function to save state in sessionStorage at those places where we update the navigation tree and restore from it whenever page loads. I prefered this method to implement this feature.
  • The browser compatibilty table for web storage (sessionStorage & localStorage) from Caniuse.
  • To check whether your browser supports web storage and to know its storage limit visit here.

Code: https://github.com/phpmyadmin/phpmyadmin/pull/1302
Key accomplishments last week: RFE #1426 Navigation state lost on reload
Key tasks that stalled: None.
Tasks in the upcoming week: Improved notification when attempting to insert invalid data.


Filed under: GSoC 2014

by chirayu45 at July 28, 2014 12:51 PM

Ashutosh Dhundhara

GSoC 2014: Week 10

10th week of my GSoC 2014 project is over.

Key Accomplishments last week : Finalized UI for RFE #919
Key tasks that stalled        : RFE #919
Code                          : NONE
Tasks in upcoming week        : RFE #919,RFE #1491

Last week I went on a discussion with my mentor and finalized UI for RFE #919. Below is the screenshot for the same.

rfe_919_2

I have almost finished the front-end part of this feature. I will try to finish this feature as soon as possible and start working on the next task (RFE #1491) before the starting of next week.


by ashutoshdhundhara at July 28, 2014 09:17 AM

July 27, 2014

Smita Kumari

GSoC'14 week 10 - 11

Time flies so quick. now that 10th week of the project is also over, just 2 weeks left to finish up the project.

Every week I used to write two blog posts, one with my accomplishment last week and other with the list of tasks to accomplish for the coming week but this time I chose to write just a single post for both the purpose as I don't have much to write about my 10th week accomplishment. This week I didn't work much. As tomorrow I'm leaving for college, this was the last week home this summer so most of time went in meeting friends and families. But yeah, I have finalized the work flow for 3NF on my end which doesn't differ a lot from 2NF though.  so I can start coding for 3NF immediately in the coming week as soon as I reach college and should not take much time to finish.

I hope, I'll  finish the coding of 3NF and get reviewed in this coming week which is 11th week of the project.

After that I'll have 1 more week remaining, in that I will write unit tests for 3NF and thinking to ask for reviews from phpMyAdmin members for any improvement or fix I can do in the code written during the summer.
Wish me luck! :-)

by Smita Kumari (noreply@blogger.com) at July 27, 2014 09:18 PM

Madhura Jayaratne

Retrospect

It was the year 2010 and I was into a 6 month internship which was a part of my Bachelor’s Degree. Somebody reminded me that the year’s GSoC program has been announced. Before I tell you anything more, I think I need to tell you about how GSoC was viewed by us at University of Moratuwa.

To us at University of Moratuwa, the GSoC was a big deal. By 2010, the University has topped in terms of the number of proposals accepted for a couple of consecutive years and everybody was so excited about the program. There was a strong motivation inside the university towards contributing to FOSS which encouraged students to apply for GSoC while the GSoC itself made people more aware about the FOSS world, creating a spiral effect. So all in all, winning a GSoC was something to be proud of at Mora.

So, determined to win a GSoC project I started exploring the project ideas. Let alone the project list, the organization list was so long. However, I found this interesting project idea in phpMyAdmin’s idea list which was about adding charts to phpMyAdmin. This was somewhat related to what I was doing at my internship. But I did not have any experience with FOSS communities. Communicating in mailing lists, going through code and documentation to understand the architecture, submitting patches was all new to me. But I did not have any choice; I communicated my interest on dev mailing list and started exploring the code. phpMyAdmin had a strict selection process where the students were required to submit patches to show their familiarity with the code. So the next logical step was to chose a bug from the bug tracker and submit a patch, which would have been little easier if I were more familiar with GIT, the version control system phpMyAdmin was using. phpMyAdmin wiki and other documentation was my savior, providing much valued insight into the project; I read every page of them.

It was very fascinating to see some of my patches getting accepted. Some patches received feedback from developers on how to improve and not so lucky patches got rejected. All in all it was quite interesting to contribute with phpMyAdmin project. I was enjoying the process very much. Then came the accepted list of GSoC projects for the year. Nope, you guessed it wrong, my project was not there! Someone else probably submitted a superior proposal. Was I sad? May be. But I was already enjoying contributing to FOSS.

After a couple of months, my internship had ended and I was back in the University. It was those days where you have more than enough time to do whatever you like. So why not fix a couple of bugs in phpMyAdmin! More interactions on dev mailing lists, more patches, more feedback and I was enjoying working with phpMyAdmin. Then came a surprise, an email from one of the project admins of phpMyAdmin asking whether I am interested in joining the phpMyAdmin team. I was over the moon, happily surprised, sent a reply saying yes. That is how my FOSS life began with phpMyAdmin.

To be continued …

by Madhura (noreply@blogger.com) at July 27, 2014 05:45 PM

July 23, 2014

Edward Cheng

[CONSOLE]WEEK 9 STATUS REPORTS

Key accomplishments last week

  • Bug fix:
    • XHR JSON data transfer don’t contain query string
    • Codemirror wrong font-size under Firefox
    • Updated bookmarks not highlighted
    • Options card input elements value bug
  • Features:
    • Global ajax callback
  • Learning unit test

Key tasks that stalled

  • Learning unit test

Tasks in the upcoming weeks

(The Schedule is changed)

  • Bug fix
  • Write unit test

by edward at July 23, 2014 09:52 AM

July 22, 2014

Bimal Yashodha

GSoC 2014 week 8 and 9

Over the last two weeks I have done several things (I couldn't put my last week's post because I had to attend to a family matter, so I could work much on the project as planned).

First I completed the 3rd task, which was to enable the user to use designer, even though the designer related tables are not created. For this task, I used browser storage mechanism, this is Indexed DB. So now the user doesn't have to configure the php myadmin to use the designer, instead using a Indexed DB supported browser, user can use the designer similar to all other functions. Even the pdf exporting has been enable for those scenarios.

From the planned tasks,  "reducing huge duplication of code in schema handling" and  "OOP"ing the code are remaining. But as long as these two are going hand-in-hand, I started to do thse two tasks at the same time.


by Bimal Yashodha (noreply@blogger.com) at July 22, 2014 07:05 PM

July 21, 2014

Smita Kumari

GSoC'14 coding week 9: Writting unit tests

Week 9 of my GSoC project has been over. By week 8, coding for automated normalization to 1NF and 2NF was finished, So this week I wrote the unit tests for 1NF and 2NF. I wrote these unit tests using Test doubles Mock objects mechanism of PHPUnit, which provide a function getMock to automatically generate an object that can act as a test double for the specified original class. So within PhpMyadmin, I tried to Mock the DatabaseInterface, Thanks to Marc and Michal for the suggestion. Its an amazing concept to write the tests for the code block that have some components which cannot be used in the test environment for example database interactions in our case. Best part to writing unit tests is to get to see the increase in coverage reported by Coveralls :-). After this normalization unit tests patch the total coverage increment of PhpMyAdmin codebase reported was 0.8% and my code for 1NF and 2NF in normalization.lib.php shown to be covered 90%.

After done with writing test for 1NF and 2NF, I rewrote the unit tests for central list of columns code as well. Last time, I had written the test for only code segment which doesn't interact with database resulting the file central_columns.lib.php was being shown covered just around 37%. So I decided to improve those tests using Mock objects mechanism. It also resulted in overall increase in coverage by 0.52% and the file central_columns.lib.php is now covered 91% :-).

Apart from writing Unit tests, this week I also completed the pending task from last week, that was to add a new step in 1NF normalization. It allows user to move the repeating group of columns to new table. Repeating group is group of two or more columns which are closely related and and are all repeating the same attributes. for example, table storing phone1, phone2, phone3 forms repeating group which needs to be moved to another table that have original table's primary key columns and a new column phoneNumber in order to make the original table in 1NF.

That's all done for the week. In the coming weeks, I'll be working on automated normalization to 3NF.

by Smita Kumari (noreply@blogger.com) at July 21, 2014 12:46 PM

Chirayu Chiripal

GSoC 2014 Week #10: User privilege tab not shown in all relevant cases (Contd.)

Week #10 Task: RFE #1488 User privilege tab not shown in all relevant cases
Scheduled Deadline: July 14, 2014
Completed On: July 17, 2014 (to be reviewed)

How it was done: This week I continued the pending task from last week.

  • Added two variables is_createuser, is_grantuser. These denotes whether the logged in user has CREATE USER & GRANT OPTION privilege respectively. To check whether user has those privilege, I have used INFORMATION_SCHEMA.USER_PRIVILEGES table.
  • Now a user is shown, “Users” tab if (s)he is one of the following:
    1. is_superuser
    2. is_createuser
    3. is_grantuser
  • If a user doesn’t have SELECT privilege on mysql.user table then currently it is not possible to see list of users and their privileges even if a user has ALL privileges on particular database. So, in such cases we can’t provide them UI for changing the user privileges. But, if user has CREATE USER privilege then (s)he can still create new user but will be shown a message that (s)he doesn’t have enough privilege to view users.

    User having CREATE USER privilege but no SELECT privilege on mysql.user table.

    User having CREATE USER privilege but no SELECT privilege on mysql.user table.

  • Also, added a notice for the user, when they are changing the privileges of the account through which they are logged in.
    Notice for the user changing his own privilege.

    Notice for the user changing his own privilege.

    No notice when changing some other user privilege.

    No notice when changing some other user privilege.

  • Refactored few functions in order to remove duplicated code fragments from them.

Code: https://github.com/phpmyadmin/phpmyadmin/pull/1289
Key accomplishments last week: RFE #1488 User privilege tab not shown in all relevant cases.
Key tasks that stalled: None.
Tasks in the upcoming week: RFE #1426 Navigation state lost on reload


Filed under: GSoC 2014

by chirayu45 at July 21, 2014 12:46 PM

Smita Kumari

GSoC'14 week 10: List of tasks to accomplish

10th week of my GSoC project has started today, only 3 weeks left to finish the project now and I have 3NF automated normalization to finish up. As coding and writing unit tests for 1NF and 2NF is complete So this week, I'll start working on automated normalization to 3NF.
The main task this week will be to decide the steps involved in 3NF and finalized the questions to ask from user in order to generate the transitive dependencies needed to convert the relation to Third normal form.

by Smita Kumari (noreply@blogger.com) at July 21, 2014 12:38 PM

Ashutosh Dhundhara

GSoC 2014: Week 9

Ninth week of my GSoC 2014 project is over.

Key Accomplishments last week : RFE #908 (to be reviewed)
Key tasks that stalled        : NONE
Code                          : rfe_908
Tasks in upcoming week        : RFE #919

Last week I worked on RFE #908. The work is still under review.

rfe_908

 

This week I am going to work on RFE #919 (Multiple-column foreign key relation). Before starting any development, I will discuss this feature on mailing list.


by ashutoshdhundhara at July 21, 2014 11:55 AM

Dhananjay Nakrani

Week-11: php Error Reporting (GSoC’14 project)

11th week of my GSoC project is over now. The objective of this week’s work was to correct the redirection after user logs in.

Tasks Completed this Week:

  • Add Mass Action feature for Notifications. See 56367c1.
    ⇒ Now user can select multiple Notifications and mark them as read. It is implemented such that the feature of Mass Action on Notifications can be extended further for other actions too.
  • Add Cron Action to delete older Notifications. See df83964.
    ⇒ With this cron action, older notifications will be deleted. Currently the period is kept for 60 days (approx. two months), i.e. Notifications older than sixty days will be removed.
    ⇒ To do that, add following command to cron jobs.

    # Command to execute the Cron action
    # <php cli parser> app/webroot/cron_dispatcher.php <Relative URL of Cron Action>
    php app/webroot/cron_dispatcher.php /notifications/clean_old_notifs
    
    
  • Add Mass Action for Reports.
    STATUS: Incomplete.
    ⇒After adding one more column of check-boxes into the data tables, searching and sorting functionalities were affected. They’re being corrected currently. Commits will be pushed soon.

Week#12 Tasks:

Objective:
⇒ Write Final Tests & Give Final Touch to the developed Code.
⇒ Complete Stalled Tasks.

  • Fix the Sorting & Seraching functionalities in Mass Action for Reports.
  • Write test cases for Notifications Model & Controller.
  • Correct redirection after user logs in.

As per the project schedule, just one week(week#12) remaining in completion of my Google Summer of Code Project’14.
Hoping to complete the project in this week only. :-)


by dhananjay92 at July 21, 2014 04:22 AM

July 15, 2014

Michal Čihař

New UI for Weblate

For quite some time, I'm working on new UI for Weblate. As the time is always limited, the progress is not that fast as I would like to see, but I think it's time to show the current status to wider audience.

Almost all pages have been rewritten, the major missing parts are zen mode and source strings review. So it's time to play with it on our demo server. The UI is responsive, so it works more or less on different screen sizes, though I really don't expect people to translate on mobile phone, so not much tweaking was done for small resolutions.

Anyway I'd like to hear as much feedback as possible :-).

Filed under: English phpMyAdmin SUSE Weblate | 2 comments | Flattr this!

by Michal Čihař (michal@cihar.com) at July 15, 2014 04:00 PM

July 14, 2014

Edward Cheng

[CONSOLE]WEEK 8 STATUS REPORTS

Key accomplishments last week

  • Some Reconstructions
  • Bug fix
  • Learning unit test

Key tasks that stalled

  • None

Tasks in the upcoming weeks

(The Schedule is changed)

  • Continue improve, finish some little features
  • Global ajax callback
  • Do some reconstructions
  • Continue learn PHP unit test

by edward at July 14, 2014 01:36 PM

Ashutosh Dhundhara

GSoC 2014: Week 8

Eighth week of my GSoC 2014 project is over.

Key Accomplishments last week : Unit Tests for new code upto mid-term
Key tasks that stalled        : RFE #908
Code                          : unit_tests
Tasks in upcoming week        : RFE #908

Last week I wrote some automated unit tests for the new code upto mid-term. My target for last week was RFE #908. So I went on a discussion with my mentor (Marc Delisle) on the mailing  list and finalized the implementation details of this feature which are as follows:

(This is in context with the ‘Create table’ page when user hasn’t submitted the form )

  • Display a dialog when user selects PRIMARY, UNIQUE and INDEX for more than one columns.
  • The above dialog contains two options: ‘Create single-column index’ and ‘Create composite index’.
  • As the labels suggest, first option will create a single column index and when user will choose the second option, he will get a list of already created (temporary) indexes. Now he can choose any index (column combinations) from that list and add a column to that index to create a composite index.
  • When user will select any index from the list in case of  ‘composite’ index, he will get a option to re-order the columns in that index.
  • The user can add/remove any column from any index at any moment before submitting the form.
  • In case of PRIMARY index, the user will see only the ‘re-order’ part of the dialog.
  • This information about indexes is temporarily help in JS variables. So nothing is committed yet.

I have already started working on this and almost completed the front-end part. Soon I will share a image demonstration of the same.


by ashutoshdhundhara at July 14, 2014 12:02 PM

Chirayu Chiripal

GSoC 2014 Week #9: User privilege tab not shown in all relevant cases

Week #9 Task: RFE #1488 User privilege tab not shown in all relevant cases
Scheduled Deadline: July 14, 2014
Completed On: Not yet completed.

Follow up on RFE #637 Custom Field Handlers:
Few problems were encountered in my last week’s task i.e. RFE #637 Custom Field Handlers. My mentor, Isaac Bennetch, was having trouble with the auto-upgrade functionality. For him, the upgrade was not happening and the failure was not being detected also. I tried reproducing this problem but was unable to reproduce this on my machine.

So, we moved this discussion to the mailing list to find a solution. After discussing this on the developer mailing list, we found that the reason was the behaviour of the tryMultiQuery(), which actually returns the result of the first statement of the script and not the status of the whole script. We first thought that it was wrong but it was later found to be correct. So, we had to loop over the results of each statement being executed to detect whether whole script was executed or not. Thanks to Hugues for giving a code snippet which helped a lot in solving this problem. It was the case of half upgrade script being executed and then failing at some statement later which was not being detected by the patch and instead of disabling the transformation feature and reporting the problem to the user it bypassed silently. We were now able to detect failure but the problem was now that what to do in the case of half script gets executed and how to rollback it and how to confirm that rollback was done properly or not as it may also fail. As the upgrade script was not idempotent (Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application. [Courtesy: Wikipedia]), it was not safe to execute it multiple times as it may lead to unstable condition of the pma__column_info table making it unusable. But I noticed that by modifying the upgrade script we can make it idempotent and fail-safe. So, this was also done. After improving the patch, the failure in upgrade resulted in disabled transformation and same was reported to the user.

For my mentor, it was still not upgrading automatically but it was detecting the upgrade failure and suggested to do a manual upgrade. It was later found that the his control user was not having the enough permissions to alter the structure of phpmyadmin database and it was not his fault too, as we had earlier suggested to grant only SELECT, INSERT, DELETE, UPDATE on phpmyadmin database (grant query in examples/create_tables.sql) and this permission problem will be faced by many of our users. But after granting this permission, auto-upgrade worked fine.

Thanks to my mentor for reporting this though it was the problem with permissions but it helped in detection of a case of half executed script which would have otherwise gone unnoticed and might have troubled our users later.

RFE #1488 User privilege tab not shown in all relevant cases:
As far as this feature is concerned, a user having GRANT_OPTION or CREATE USER privilege only should also be shown the user tab. Actually, such users are not of much use in practical and providing the GUI for them to manage user permissions is also not possible because to read the list of other users & their permission, a user need to have SELECT privilege on mysql database (See mysql documentation on SHOW GRANTS) and that’s how we identify a superuser.

Even if a user is having ALL Privileges on a specific database, he still need to have SELECT access to mysql database to read list of other users & their permissions. But we can still provide them access to create user interface as it does not require any SELECT privilege on mysql database though we are internally using SELECT statements on mysql database for “Add user” page for some tasks such as to detect whether user already exists or not. This is something that has to be managed in this task. We will display them a message that they do not have enough privileges to see list of users and on the other side, giving them access to create user page if they have privilege to do so. So, they will be having partial access to Users tab.

I have started to implement this and have managed to do this at Server > Users tab. However, the code is not yet ready for review also.

Users tab for user with CREATE USER privilege.

Users tab for user with CREATE USER privilege.

Code: https://github.com/D-storm/phpmyadmin/tree/FR-1488
Key accomplishments last week: Robust auto-upgrade failure detection for RFE #637 Custom Field Handlers.
Key tasks that stalled: RFE #1488 User privilege tab not shown in all relevant cases.
Tasks in the upcoming week: RFE #1488 User privilege tab not shown in all relevant cases (Contd.).


Filed under: GSoC 2014

by chirayu45 at July 14, 2014 11:17 AM

Smita Kumari

GSoC'14 week 9: List of tasks to accomplish

Last week, I almost finished the coding for conversion of a relation to second normal form which is under review. So during this week, a day or two may go in fixing the issues if came across any. Also I have a pending task to finish from last week that adds a new step to 1NF which moves the repeating group of columns to a new table.
And a new task that need to be finished during this week is writing Unit tests for 2NF. So that last 3 weeks, I can give completely to 3NF conversion.

So the list of tasks to accomplish includes:
  • Fixing issues for 2NF conversion if came across any.
  • Improve 1NF : add a step to move related repeating group of columns to another table eg columns like phoneNumber1, phoneNumber2, phoneNumber3 and so on can be moved to another table(primary_key, phoneNumber)
  • Write Unit tests for 2NF and if time permits improve Unit tests for 1NF as well.

by Smita Kumari (noreply@blogger.com) at July 14, 2014 10:03 AM

GSoC'14 coding week 8: Automated normalization to 2NF

In this post, I'm going to write down about my work during the week 8 of the project.
During week 7, I spent most of time in making the partial dependency list which continued to this week 8 as well. I improved the same a little during first 2 days of this week by first adding an option to use partial dependencies from automated generated dependencies where if user picks a dependency, it auto check the corresponding determinants for the columns, a nice suggestion from my mentor and then worked on fixing some coding related issues, improving performance etc.

On Wednesday evening, I have been to my grandparents place where I stayed till half day Saturday so couldn't give enough time to the project during the time, Also there I didn't have good internet access. After I came back on Saturday, I decided to finish at least conversion to 2NF. So rest of the Saturday and whole Sunday, I spent working on the next task to find out the new table structures that need to be formed for putting the relation in 2NF and creating/altering those tables. By Sunday late evening, I was able to finish these and have put for review. With the list of partial dependencies, we also show the new tables structures that needs to have to put the table in 2NF as per the marked dependencies, there user also have options to edit the new table names. By default, I have kept the first table name same as the original table name and other table names as 'table2', 'table3' and so on which user can edit.

On click of Go, new tables get created that make the relation in to second normal form. Also, If original table have data then new tables gets the unique data rows as well that belongs to its corresponding columns.
But one task that I had kept for this week as mentioned in my last blog that adds a new step to 1NF as an improvement, remains pending. During week 9 starting today, I'll finish this improvement to 1NF with priority.

by Smita Kumari (noreply@blogger.com) at July 14, 2014 09:46 AM

Dhananjay Nakrani

Week-10: php Error Reporting (GSoC’14 project)

10th week of my GSoC project is over now. The objective of this week’s work was to complete the implementation of Issue#31, Issue#34 and suppress error reporting in case @ is used.

Tasks Completed this Week:

  • In phpMyAdmin, stop collecting errors in case @ is used. That is stop collecting errors wherever failure handling is done explicitly.
    ⇒ This issue was pointed out by Marc Delisle. Thank you Marc. :-)
    ⇒ Function error_reporting() was used here. It’s an inbuilt function that returns the level of error reporting. Whenever @ is used, it returns zero (0). So I added a simple check in the PMA_Error_Handler::handleError() to just ignore that error whenever it returns zero (0).
    ⇒ See Pull#1278.
  • Complete Issue#31: Provide notifications for each new Error Report.
    ⇒ Fixed failing tests issues and clean up some codes. Rest was done last week only.
    ⇒ See Pull#56 for more details.

Stalled tasks this Week:

  • Implementation of Issue#34: Mass action feature.
  • Show correct ticket creator.

Week#11 Tasks:

Objectives:
⇒ Redirect User to appropriate page after he logs in. [Proposal#4.3]
⇒ Complete Stalled tasks of Week#10.


by dhananjay92 at July 14, 2014 05:31 AM

July 08, 2014

Edward Cheng

[CONSOLE]WEEK 7 STATUS REPORTS

Key accomplishments last week

  • New bookmark tab finished
  • Bookmark delete feature finished
  • Selection queries Explain and Profiling
  • Rollback query execution support
  • XSS security issue fixed
  • Support disable code mirror
  • Little bugs fix

Key tasks that stalled

  • PHP unit test, not start yet…

Tasks in the upcoming weeks

(The Schedule is changed)

  • Finish some little features, continue improve
  • Learn PHP unit test, and start write it

by edward at July 08, 2014 04:12 AM

July 07, 2014

Chirayu Chiripal

GSoC 2014 Week #8: Custom Field Handlers (Contd.)

Week #8 Task: RFE #637 Custom Field Handlers (Contd.)
Scheduled Deadline: July 07, 2014
Completed On: July 07, 2014 (to be reviewed)

How it was done: After a bit of planning and extending the base class TransformationsPlugin to IOTransformationsPlugin to support input oriented transformation system last week, this week’s task was to implement the plan. Here is the list of steps in brief:

  • Added 2 new columns input_transformation and input_transformation_options to pma__column_info table and added the input fields for the same in create table and edit table structure forms.
  • Created separate directories for transformation plugins as discussed last week and moved the current output transformations plugins, except few plugins which could be used as it is for input transformation plugins also without any modifications. See current directory tree here: http://pastebin.com/pEu86t1i
  • Called input transformation plugin methods at appropriate positions as discussed in last week plan.
  • Added 3 new input oriented transformation plugins: Text/Plain Regex Validation, Text/Plain File Upload, Image/JPEG Upload.
  • Removed some backward compatibility code with this feature because after this feature is merged then an update is required to pma__column_info table and hence it was going to cause a BC (Backward compatibility) break. Those backward compatible code were:
    • Replacement of ‘class.php’ to ‘inc.php’ in the transformation name.
    • Replacement of ‘__’ in the place of last ‘_’ in the transformation name.
    • Replacement of ‘octetstream’ with ‘octet-stream’ in mimetype.
  • To make previous transformations to work with this changes, I created one SQL script (upgrade_column_info_4_3_0+.sql) to update the table and fix the BC break.
  • To further improve the user experience, added logic to detect outdated pma__column_info and apply these changes automatically for the user.

Example 1 – Regex Validation Plugin:

Settinp up Regex Validation transformation on column

Settinp up Regex Validation transformation on column


Validation failure display error message and aborts insert operation.

Validation failure display error message and aborts insert operation.

Example 2 – Image Upload Plugin:

Setting up Image Upload transformation on a column

Setting up Image Upload transformation on a column


Insert Form w/ Image Upload transformation on a column

Insert Form w/ Image Upload transformation on a column


Code: https://github.com/phpmyadmin/phpmyadmin/pull/1276
Key accomplishments last week: Implemented RFE #637 Custom Field Handlers.
Key tasks that stalled: None.
Tasks in the upcoming week: RFE #1488 User privilege tab not shown in all relevant cases.


Filed under: GSoC 2014

by chirayu45 at July 07, 2014 09:08 PM

Bimal Yashodha

GSoC 2014 week 7

During the previous week, I was working on the task: "enhancing the usability of the designer", by which implementing a client side database to carry out the "designer" funcationalities.

After analyzing all available client side data store mechanisms, I decided to go ahead with Indexed database, as it's much faster than WebSQL and It is the recommended data storage mechanism by W3C.

According to the new work-flow, the "Designer" tab will be always shown. Earlier it was shown only if the "table_coords" and "pdf_pages" tables are available.

Now the system works as follows:
First it checks whether the relevant tables exist in the database.
If not, It will create client side data store and start working with that.

by Bimal Yashodha (noreply@blogger.com) at July 07, 2014 06:29 PM

Ashutosh Dhundhara

GSoC 2014: Week 7

Seventh week of my GSoC 2014 project is over.

Key Accomplishments last week : NONE
Key tasks that stalled        : NONE
Code                          : NONE
Tasks in upcoming week        : RFE #908

Last week I was supposed to complete RFE #856. I attempted to implement this feature as discussed in my last post. Same can be seen in this Pull Request. But my mentor, Marc Delisle, pointed out that this approach won’t scale up for big exports which is very much true. So I tried to find a different solution. I also tried asking on stackoverflow.com but failed to find a solution to this. So I am moving to my next task RFE #908. I am having quite a few ideas regarding this feature but I will discuss those on the mailing list first and update this post very soon.


by ashutoshdhundhara at July 07, 2014 01:55 PM

Smita Kumari

GSoC'14 week 8: List of tasks to accomplish

Last week I worked mostly on creation of partial dependency list in case table has composite primary key, which is going to be used for converting the table in second normal form. So the priority this week will be to convert the relation to 2NF by making new tables if needed as per partial dependencies.

List of tasks to accomplish:
  • Work on the suggestions if any in creating the partial dependency list.
  • Convert the table to second normal form.
  • If time permits, Improve 1NF : add a step to move related repeating group of columns to another table eg columns like phoneNumber1, phoneNumber2, phoneNumber3 and so on can be moved to another table(primary_key, phoneNumber)

by Smita Kumari (noreply@blogger.com) at July 07, 2014 08:12 AM

GSoC'14 coding week 7: Making partial dependency list

The week 7 of my project is over and in this post I'm going to summarize what all I done in this 7th week of the project.
The week started with improving 1NF where previously I was looking for unique column to be present but since for 2NF we need to have primary key so in 1NF we decided to force primary key itself.
Then I learnt to set up the selenium server and run the phpUnit selenium tests, thanks to this post from phpMyAdmin wiki. It's an amazing technology, it perform automated testing using system browser. Tests run directly in the specified browser just as real users do. It makes testing the behaviour of the system/program easy and makes sure the expected behaviour is not breaking.
I wrote the selenium test for normalization to 1NF that automatically test the expected behaviour for converting a relation to 1NF. Though it needs some improvements in the sense currently I have asserted the texts of various steps for validation but texts might change so I'll try to improve the tests as much as possible to assert the elements class/name/id instead.

Then the main task for the week started, Making partial dependency list (in case relation has composite primary key ) for converting the relation to 2NF. That is the first step towards conversion to 2NF.
If the primary key of the table is not composite then at first step of 2NF itself, It says "Table is already in second normal form".  Another case where primary key is composite but all columns of the table is part of primary key then also it says "Table is already in second normal form" as there exists no Non-primary column(s) to have partial dependencies.
Then it comes to the case where table has composite primary key and there exist some non-primary columns. Here we need to find the partial dependencies if any.
To find the partial dependencies,  for each non-primary columns of the table I have given users the option to choose minimal set from primary keys whose values are sufficient to determine the value of the column. I'm not sure, how much clear is this question to users, but  couldn't find any better way. Your suggestions are most welcome if have any better ways to know the partial dependencies. Though this part is under review, If it's not good enough then I'm sure my mentor will have some nice suggestions as always :-).

If the table that is being normalized to 2NF have some pre-populated data then I have given user an option to check the possible partial dependency list based on data in the table. For this, in the backend I check for all the subset of columns in primary key if they seems to determine any of the non-primary column(s), and display the result to user which can help user to know some of the partial dependencies and can be helpful in answering the question.

This  process for automated generation of partial dependency list based on data is not very efficient if the table have primary key composed of more than 5 columns as it check for all possible combinations (of length 1 to length-1) of primary columns with all other non primary columns of the table.

After selecting the partial dependencies, user comes to another screen which ask to confirm the partial dependencies marked by user, from this screen can go back and edit their selection as well.

That's all I did for this week, more for next week where priority will be to convert the relation to 2NF by making new tables if needed as per partial dependencies.

by Smita Kumari (noreply@blogger.com) at July 07, 2014 07:03 AM

Dhananjay Nakrani

Week-9: php Error Reporting (GSoC’14 project)

9th week of my GSoC project is over now. This post describes the progress in my GSoC’14 project during that week. The objective of this week’s work was to implement solutions of Issue#31 and Issue34.

Tasks Completed this Week:

  • Issue#31: Provide notifications for each new Error Report.
    Commits List: Compare 05a80cf…8921188
    Current Status: Tests needs to be fixed.
    ⇒ Now users are notified whenever a new Error Report is received. This helps the developers in keeping track of newly reported Error Reports.
    ⇒ A new element Notification was added to the existing code base of error-reporting-server. Each Notification associates a Developer and a Report, that is each Notification belongs to one Report and one Developer. Each Developer has a set of Notification.
    ⇒ Model of Notification is simple and can be explained by following ER Diagram. Links represent the foreign key relations. Note that I’ve omitted not-so-required fields by putting dots (...) there.
    Notifications Schema

    Notifications Schema

    ⇒ A New Notification for each developer is created every time a new Error Report is received.
    ⇒ Count of pending notifications is displayed on the navigation panel of the each page.
    Screenshot Notification Count

    Screenshot Pending Notification Count


    ⇒ The Notification page shows all the pending notifications (new reports actually) in a list view. Right now the check-boxes are put in front of every row but they do not do any work. They will be useful in Issue#34:Mass Action. Similar to Reports page, here also jQuery datatables plugin is used to display the table of notifications.
    Screenshot Notification Page

    Screenshot Notification Page


    ⇒ Whenever user visits the newly added error report, corresponding notification is removed. That essentially means that the Error Report is marked read and since we want to prevent our notifications table from clogging up, we don’t store read entries. I will also be implementing a cron action under Notifications Controller which will remove entries older than a specific time X from Notification table. That also, as you may have correctly suspected, is to prevent database from getting clogged up. The notifications policy can be stated as the “error-reporting-server remembers notifications up to X time only“!

Stalled tasks this Week:

  • Fix remaining test failures in implementation of Issue#31.
    ⇒ Currently in the PHPUnit tests, Notification::addNotifications() is not able to save notifications into the table!! And that’s why it logs the error message at L#178 @ Incident.php
    ⇒ Please suggest me if you know the solution to it. :-)
  • Implementation of Issue#34: Mass Action feature on Reports.

Week#10 Tasks:

Objectives:
⇒ Display Correct ticket Creator. See Section#4.2 of proposal for more details.
⇒ Complete Stalled tasks of Week#9.
⇒ In phpMyAdmin, stop collecting errors in case @ is used. That is stop collecting errors wherever failure handling is done explicitly.


by dhananjay92 at July 07, 2014 04:50 AM

July 01, 2014

Edward Cheng

[CONSOLE]WEEK 6 STATUS REPORTS

Key accomplishments last week

  • Fix bugs, some improvements, first PR(console basic) have been merged

Key tasks that stalled

none

Tasks in the upcoming weeks

(The Schedule is changed)

  • Finish some little features, continue improve
  • Learn PHP unit test, and start write it

by edward at July 01, 2014 01:56 PM

June 30, 2014

Bimal Yashodha

GSoC 2014 week 6

First, I was really glad to received the email saying that I got through the mid-term evaluation. I need to thank my mentor Madhura Jayarathne for the guidance provided and all others, supported through the mailing list, to achieve this milestone.

During the mid evaluation period, I did some more improvements in the exporting functionality based on the review comments. Also in the show/hide tables in the designer view.

The major task for this few weeks is to enhance the usability of the designer. That is, to use the designer, users need to do some configurations explicitly, which, most of the time, will not be done by the users, hence these funcationalities will never be used.

So the main goal of this task is to provide a mechanism in such a way that, users will not need to configure anything, but still should be able to use the designer. For that "Client side databases" will be used.

After analyzing currently available technologies:
  • Web storage
  • Web Sql database
  • Indexed database
are the most commonly used. Web storage uses a "key-value" pair method to store objects in the browser. Although it's a simple mechanism, It's performance decreases as the data become large and complex. Web Sql database is a normal "SQL" - relational database, and has good performance even for the large data sets. But because of low agility and being deprecated, users are moving away from that.

On the other hand Indexed database is made up by combining all the strengths of both web-storage and Web Sql databases. So its more powerful than any of the above two. Also its browser compatibility is increasing.



by Bimal Yashodha (noreply@blogger.com) at June 30, 2014 07:21 PM

Ashutosh Dhundhara

GSoC 2014: Week 6

Sixth week of my GSoC 2014 project is over. I am glad to tell that I passed the mid term evaluations :-)

Key Accomplishments last week : RFE #654
Key tasks that stalled        : NONE
Code                          : rfe_654
Tasks in upcoming week        : RFE #856

Last week I successfully added ‘Range search capability on Search page.’

rfe_654

This week I am going to work on RFE #856.
Currently any MySQL error encountered during export gets printed into the target export file. So user isn’t aware of any error until the export is completed.

I will try to achieve this by:

  1. First generating the whole export content and catch all MySQL errors during the process.
  2. If there is no error while generating the export, the start the file download at the client, else display the error and abort the export process.

by ashutoshdhundhara at June 30, 2014 03:25 PM

Smita Kumari

GSoC'14 week 7: List of tasks to accomplish

This week and onwards, I'll be working on making the functional dependency list which will help to convert the table structure in 2NF and 3NF.
For 2NF, we just need to ask users about if any of the non-key columns can be derived using part of the primary key in case the primary key is composite (consist of more than one columns) . Also for 1NF as I wrote in my last blog, I have checked for unique columns (Unique index or primary key) but for 2NF we will need to have primary key. so first thing I'll need to do is to make sure primary key exist, if not ask user to convert unique index to primary key. Another thing, we may do is to check for just primary key during 1NF not unique index. I need suggestion from phpMyAdmin members on this.
So the list of tasks of this week:
  • Improve the 1NF conversion and fix glitches if comes across any.
  • Write phpUnit tests for 1NF. I'll try to learn to setup and write the selenium test as well so that the functions consisting the database connection can also be covered, As most of the codes written for normalization is interacting with database.
  • Make the functional dependency list needed to convert the table to 2NF.

by Smita Kumari (noreply@blogger.com) at June 30, 2014 12:11 PM

GSoC'14 coding week 6 : Automated normalization to 1NF

The 6th week of my GSoC project has been over and this week I tried to finish the automated normalization to 1NF. And that is complete from my side but may have little glitches that I will be solving in coming weeks with 2NF and 3NF during that flow for normalization will become more clear.
The week started with having reviews on work flow of 1NF, I got some good suggestions from my mentor. Then I started working on implementation part. First I started with making model dialog to do normalization procedure but then I realize that won't look good as we'll have lot of text to display which may look cluttered on small screen space and may need to open another dialog for some purpose at later stage. So then I created a separate page that takes user through various steps of 1NF. The starting link that says "Improve table structure", is kept on tbl_structure page which takes user to initial screen.
There user gets radio options to choose up to what levels they want to normalize the relation.

For now, only choosing 1NF works, choosing the other two options takes to a coming soon page.
So normalizing to first normal form actually start here. First step (1.1) is to make all the the columns atomic. This step let user split the columns into more than one column. The split option is available to only column types which falls under string category these are columns of type char,varchar, text, binary, blob, enum and set.  As I thought the other columns which fall under numeric category (int, decimal, float etc) or date and time category can't be split, they are atomic by itself. Please correct me if I'm wrong.

This steps repeats till user chooses the option "No such column".
Then the process goes to step 1.2, where we check if the unique column exist. if there is any primary key or unique index exist on some columns then the process move to step 1.3. If no such column exist then the step 1.2 let user create a primary key or unique index on existing columns. As well as an option to add a new column to the table as primary key if it's not possible to make existing columns as unique.


The next and final step 1.3 for 1NF, lets user to remove any redundant column from the table. Where user get option to select one or more columns to remove from the table. or user may choose not to remove anything.

After processing this step, it finishes the 1NF and system shows the message that the Table is in 1NF now.
Please checkout my next blog for the task to accomplish for the week 7.

by Smita Kumari (noreply@blogger.com) at June 30, 2014 11:56 AM

Chirayu Chiripal

GSoC 2014 Week #7: Custom Field Handlers

Week #7 Task: RFE #637 Custom Field Handlers
Scheduled Deadline: July 07, 2014
Completed On: Not yet completed

Functional requirements:

  • REQ #1: Mechanism to allow users to manipulate the data before inserting into database.
  • REQ #2: Mechanism to allow users to validate input data before insertion and abort the insertion if validation fails.
  • REQ #3: Mechanism to change the current input/textarea fields to something else such as image tag with file upload button (as soon as image is selected it would display the image) on insert/edit page.

Requirements – Solution mapping: To fulfil the requirements mentioned above I have defined one abstract class IOTransformationsPlugin which extends TransformationsPlugin used currently. The class definition is like this:

abstract class IOTransformationsPlugin extends TransformationsPlugin
{   /**
     * REQ #1 will be satisfied by applyTransformation() defined 
     * in TransformationsPlugin.
     * By calling applyTransformation() before insertion we can 
     * manipulate the data and also set success variable for REQ #2
     */

    // specifies whether transformation was successful or not
    // for REQ #2 to fail the insertion.
    protected $success = true;

    // to store the error message in case of failed transformations
    // for REQ #2, in case of failed insertion it will store the error message.
    protected $error = '';

    /**
     * for REQ #3,
     * Returns the html for input field to override default textarea.
     * Note: Return empty string if default textarea is required.
     *
     * @param array $options column name & id
     *
     * @return string the html for input field
     */
    public function getInputHtml($options)
    {
        return '';
    }

    /**
     * for REQ #3, it may be possible that plugin needs to initialize
     * and handle or validate the field using javascript, then this
     * method will be useful. For e.g. replacing textarea with codemirror
     * and initialization of it using javascript.
     *
     * Returns the array of scripts (filename) required for plugin
     * initialization and handling
     *
     * @return array javascripts to be included
     */
    public function getScripts()
    {
        return array();
    }

    /**
     * for REQ #2, if isSuccess() returns false
     * then this method will be used to get the
     * error information.
     *
     * Returns the error message
     *
     * @return string error
     */
    public function getError()
    {
        return $this->error;
    }

    /**
     * for REQ #2, after calling applyTransformation()
     * this method will be called to check whether
     * transformation was successful or not.
     * If it was successful then it will proceed with
     * insert operation otherwise it will abort it 
     * displaying the error message returned by getError()
     *
     * Returns the success status
     *
     * @return bool
     */
    public function isSuccess()
    {
        return $this->success;
    }
}
  • This class can be used to create both Browser & Input transformation plugins however if Browser transformation plugin is required then TransformationsPlugin class can also be used.
  • To distinguish whether plugin is for Browser or Input transformations we can do something like this:
    • Input specific transformation plugins are saved into libraries/plugins/transformations/input/ directory.
    • Browser/Output specific transformation plugins are saved into libraries/plugins/transformations/output/ directory.
    • A plugin can be used for both Browser & Input transformations, in such cases they are saved into libraries/plugins/transformations/ directory.

Code: https://github.com/D-storm/phpmyadmin/tree/FR-637
Key accomplishments last week: Analysis of RFE #637 & some coding.
Key tasks that stalled: None.
Tasks in the upcoming week: RFE #637 Custom Field Handlers (contd.)


Filed under: GSoC 2014

by chirayu45 at June 30, 2014 11:13 AM

June 29, 2014

Dhananjay Nakrani

Week-8: php Error Reporting (GSoC’14 project)

8th week of my GSoC project is over now. The objective of this week’s work was to add the feature of ‘changing Error Report Status upon change in Associated Bug Ticket of SourceForge.’

Tasks Completed this Week:

  • Change Error Report status upon change in associated bug ticket on sourceforge.net. See Pull#53.
    ⇒ A cron job is set up to perform this action periodically. More about setting up the cron job is described at the end of this post.
    ⇒ For this purpose Sourceforge’s Allura API was used.
  • UnLink Error reports with existing bug ticket. See Pull#54.
    ⇒ I realized that sometimes it may be required to unlink the error report (already linked with bug ticket on SF.net). So this feature was added. This was not proposed as a part of my GSoC project.
  • Solve Issue#42 : Assign milestone from the PMA version automatically while creating bug ticket on SF. See Pull#55.
    ⇒ In PMA’s error-reporting-server there’s a feature of creating a bug ticket (on SourceForge bug tracker) from error report. In that, milestone of the new bug ticket should be assigned from PMA’s version.

Week#9 Tasks:

Objective:
⇒ Implement Issue#34 & Issue#31


Cron Jobs in CakePHP App:

⇒ In this week’s work I learned a technique of running cron jobs in CakePHP applications without breaking MVC architecture. Here’s how it can be done.

  1. Create a Cron Dispatcher:
    ⇒ Copy app/webroot/index.php file in the same directory i.e. app/webroot/.
    ⇒ Now modify that newly copied script to dispatch the cron actions. Original that script does some Core CakePHP initializations and dispatches to the appropriate action. In newly copied script, change that to take command line arguments instead. That script should also do some logging so that debugging in case of failures becomes easy.
  2. Create Cron Actions:
    ⇒ Create actions under desired Controller which is to be executed as a cron job. See SourceForgeController::sync_ticket_statuses()
    ⇒ Now if you want to execute that action under cron job only then you should put a check in it. Simply define a constant in the cron job dispatcher script (before dispatching) and check if that same constant is defined or not. If it’s not defined then that means the action is called somewhere other than cron job, like directly from user. In my code see constant CRON_DISPATCHER which determines whether the action is dispatched from cron dispatcher or not.
  3. Execute Cron Job:
    Now run the cron job as a command. It will be as follows.

    # <php cli parser> app/webroot/cron_dispatcher.php <relative URL of cron action>
    # For our case the command will be
    php app/webroot/cron_dispatcher.php /source_forge/sync_ticket_statuses
    

⇒ This way any action can be executed in CakePHP application without breaking its MVC architecture. Slick, isn’t it?!

Feel free to give your valuable suggestions. :-)


by dhananjay92 at June 29, 2014 06:10 AM

June 28, 2014

Dhananjay Nakrani

GSoC Midterm Evaluations

It’s 28th June, the declaration day of Midterm evaluations results.
I’m proud to say, I’ve passed it. Yes, now it’s time for one more paycheck from Google.  Haha!! 8-)
More importantly I’m glad because I could perform as per my mentor’s expectations.

One more thing. Google announces 1 year free ACM Student Membership to all GSoC Students. Well, that was completely unexpected. Yeaayy, another Happy moment. That membership will be very helpful during my Masters studies. :-)

Two tasks from my post midterm evaluation schedule have already been completed.
I will be posting this week’s progress in a couple of days. Keep following. ;-)


by dhananjay92 at June 28, 2014 06:52 AM

June 23, 2014

Bimal Yashodha

GSoC 2014 week 5

As the project has now come to the mid-term evaluation, I've almost completed my first two tasks, as I planned initially. Still I'm getting some feed-backs for the changes I did, but in overall, I've successfully covered all tasks.

Now with the new designer page, a user can:

  • create new pages 
  • edit a page
  • delete a page
  • save changes to a new page or an existing page
  • export pages in various formats.
With these changes done, we can remove the existing "Edit or export relational schema" functionality from the phpmyadmin.


by Bimal Yashodha (noreply@blogger.com) at June 23, 2014 06:05 PM

Ashutosh Dhundhara

GSoC 2014: Week 5

Fifth week of my GSoC 2014 project is over.

Key Accomplishments last week : RFE #861, RFE #869
Key tasks that stalled        : NONE
Code                          : rfe_861, rfe_869
Tasks in upcoming week        : RFE #654

 

Last week I decided to implement RFE #861 (Simulate UPDATE queries.). But then I realized that I may fall behind my schedule. So by putting a little extra effort I also implemented RFE #869 (Run SQL query: Allow rollback for Transactional tables.)

 

rfe_861

 

The above picture shows “Simulation of UPDATE/DELETE queries”.

 

rfe_869rfe_869_1

 

The above two pictures shows “Rollback support for DML queries for Transactional tables”.

This week I am going to work on RFE #654. The aim behind this feature is to provide user with a option to select a range of values for a column while performing search operation. It becomes quite handy while searching in numeric and date type columns.

I will try to achieve this by:

  1. Binding a click event on ‘BETWEEN’ and ‘NOT BETWEEN’ keywords in ‘operator’ select list.
  2. Opening a dialog box on the click event which will provide an interface to select minimum and maximum value for a particular column.

Since this feature scheduled before mid term evaluations, so I will try to finish this before 27th.


by ashutoshdhundhara at June 23, 2014 02:49 PM

Edward Cheng

[CONSOLE]WEEK 5 STATUS REPORTS

Key accomplishments last week

  • Query history with corrent browsing query
  • Improve console bookmarks
  • Other improves

Key tasks that stalled

none

Tasks in the upcoming week

(The Schedule is changed)

  • Continue improve and fix bugs, get ready for mid-term

by edward at June 23, 2014 02:02 PM

Chirayu Chiripal

GSoC 2014 Week #6: Dynamic process list

Week #6 Task: RFE #1490 Dynamic process list
Scheduled Deadline: June 23, 2014
Completed On: June 22, 2014 (to be reviewed)

How it was done:

  • Created a separate tab(Server > Status > Processes) by adding “Processes” in the Status tab menu. Earlier processes were shown in Server > Status > Server tab.
  • Created separate files server_status_processes.php and server_status_processes.lib.php.
  • Moved code related to processes table from server_status.php and server_status.lib.php to server_status_processes.php and server_status_processes.lib.php respectively.
    Server > Status > Processes

    Server > Status > Processes

  • Now, to dynamically refresh the process list with configurable refresh rate, added a “Start auto refresh” button and a refresh rate select dropdown box.
  • As, every time we had to execute “Show [full] processlist” or “Select” it from “information_schema” to update the process list, it may cause heavy traffic if queries are made frequently.
  • So, added a notice to the page “Note: Enabling the auto refresh here might cause heavy traffic between the web server and the MySQL server.”
  • Added a JS file server_status_processes.js which handles the refreshing of the processlist by making AJAX requests to server_status_processes.php at regular intervals specified by refresh rate and update the table if auto refresh is enabled otherwise it stays static and no AJAX requests are made.
  • Tested the code with persistent and non-persistent database connections and it seemed fine.
  • To check the amount of traffic this page generated at different refresh rates, I used the Server > Status > Monitor tab opened in one browser tab and processes tab in another browser tab and enabled the auto refresh and noticed the traffic graph patterns for different conditions (refresh rates and start/stop state).

Effect of dynamic process list on network traffic

Effect of dynamic process list on network traffic


Effect of dynamic process list on traffic with different refresh rate

Effect of dynamic process list on traffic with different refresh rate


Code: https://github.com/phpmyadmin/phpmyadmin/pull/1246
Key accomplishments last week: Implemented RFE #1490 Dynamic Process List
Key tasks that stalled: None.
Tasks in the upcoming week: RFE #637 Custom Field Handlers


Filed under: GSoC 2014

by chirayu45 at June 23, 2014 11:43 AM

Smita Kumari

GSoC'14 week 6: List of tasks to accomplish

Last week I fell short on what I needed to complete, So this week I have lot more to finish up. Till now I should have at least finalize the work for converting a relation to 1NF and start working on it. But couldn't make it. I apologize for the same, But I try to make up it in this week.
Here is the list of tasks to complete during the week:
  • Finalize the work flow for normalizing to 1NF with help of my mentor and other phpMyAdmin members.
  • Complete the coding for normalizing a relation to 1NF and get reviewed.
  • Start working on the work flow for making the dependency list.
Hoping to finish these up during the week. Wish me luck! :-)

by Smita Kumari (noreply@blogger.com) at June 23, 2014 04:02 AM

GSoC'14 coding week 5: Automated normalization to 1NF

Week 5 of my GSoC project is over and as per my last blog, this week I started working with automated normalization. As per my project proposal, Week 5, 6, 7 is for automated normalization to 1NF and making dependency list for further normalizations.
This was the first week for automated normalization so I spent most of the time in doing background reading on automated normalization, I didn't do any development work. I'll start the development work from today. During the week I went through many published paper on automated normalization some of the good ones are:
 1. Amir Hassan Bahmani, Mahmoud Naghibzadeh,Behnam Bahmani "An Automatic Database Normalization – Primary Key Generation"
2. RadhaKrishna, Rajuvelpula,v. sravya,"A web based relational database design tool to perform normalization"
3. Akehurst, Bordbar, Rodgers "Automatic normalization via meta modeling"

After that, next thing that i did was to try to come up with a work flow for converting the relation to 1NF. For user interface, I'm thinking to keep options on db_operations and tbl_operations page.The options will have 1. Normalize to 1NF, 2. Normalize to 2NF (1NF + 2NF), 3. Normalize to 3NF (1NF+2NF+3NF). On select of an option, user shall be presented a dialogue which will assist in normalizing the relation.
So what all to test for 1NF:
1. Having nonatomic attributes eg address
2. Having no primary key
3. Having redundant columns eg full_name if first_name and last_name exists

Here I'm including the work flow that I have made for converting a relation to 1NF.

This work flow is not final. I need feedback on this from my Mentor and other phpMyAdmin members to finalize the same.
Feel free to leave a comment if any.

by Smita Kumari (noreply@blogger.com) at June 23, 2014 03:48 AM

June 22, 2014

Dhananjay Nakrani

Week-7: php Error Reporting (GSoC’14 project)

Seventh week of my GSoC project is over now. The objective of this week’s work was to add the feature of linking error report to existing bug ticket on sourceforge.

Tasks Completed this Week:

  • Link Error reports with existing bug ticket. See Pull#47.
    ⇒ For this purpose Sourceforge’s Allura API was used.
    ⇒ See the below screenshot. Error report now displays the form via which the user can link it to existing bug report. User has to just provide the bug ticket number.

    Link Error Report with Existing Bug Ticket

    ⇒ Upon submission, it posts a comment on that bug ticket. See the below screenshot.

    Comment on Bug Ticket

  • Solve [Issue#46] : Display Exception Type on list view of Reports. See Pull#48.
    Now, it shows the type of exception (php or js) in the last column. See below screenshot.
    Last column: Exception Type

    Last column: Exception Type

  • Solve [Issue#50] : Refactor duplicate codes in Incient::createIncidentFromBugReport(). See Pull#51.

Week#8 Tasks:

Objective:

⇒ Change Error Report Status upon change in Associated Bug Ticket of SourceForge. [See proposal]

  • Complete Stalled Tasks:
    • Incorporate suggestions from Michal.
      ⇒ Share the code of Sourceforge Response handler. See Discussion.
  • Change Error Report Status upon change in Associated Bug Ticket of SourceForge.

As it always have been, suggestions are always welcome. ;-)


by dhananjay92 at June 22, 2014 04:44 AM

June 17, 2014

Chirayu Chiripal

GSoC 2014 Week #5: Export with table/column name changes

Week #5 Task: RFE #755: Export with table/column name changes
Scheduled Deadline: June 16, 2014
Completed On: June 16, 2014
As this feature was closely related to RFE #759 which was the previous task, the base of this feature was already created and few things were to be done such as designing UI, adding support for substituting alias in procedures, functions and views. So, I spent this doing few bug fixes and improved RFE #1518 along with this feature request.

How it was done:

  • Added a method PMA_mergeAliases() to merge two aliases array, which could be useful when someone is exporting a SQL query as well as specifying the aliases through interface. In case of collisions, when there is a alias for column in query as well as some other alias is specified through interface then the latter one is considered.
  • Added a method PMA_getHtmlForAliasModalDialog() which returns the html for the dialog box which is shown when user clicks on “Rename exported databases/tables/columns” checkbox.
  • Added javascript functions to handle the operations of Dialog box
  • The Dialog box looks like this:

    Alias dialog box

    Alias Modal Dialog

Code: https://github.com/phpmyadmin/phpmyadmin/commit/3ea7d2b52d8a48a9fdb2b59afb5c97f998a2ccd5
Key accomplishments last week: RFE #755: Export with table/column name changes
Key tasks that stalled: None.
Tasks in the upcoming week:


Filed under: GSoC 2014

by chirayu45 at June 17, 2014 08:57 AM

June 16, 2014

Bimal Yashodha

GSoC 2014 week 4

During the last week, I did more changes to my first task to make it more user-friendly and functionality-rich.

Following is how the new tool bar of the designer looks like:

"Edit pages" button was removed and added two new buttons, "Open Page" and "Delete Page", which will have the "Edit Page" and "Delete Page" functionalities respectively. Besides these two buttons, one more "New Page" button was introduced, So that the user will not get confused, while trying to create a new pdf page.

For the current task, which is to integrate the exporting functionality of the schema editor into the designer, a new "Export Page" button was introduced.



Similar to the exporting functionality of the schema editor, this new export pages functionality will use the same classes.


by Bimal Yashodha (noreply@blogger.com) at June 16, 2014 06:33 PM

Ashutosh Dhundhara

GSoC 2014: Week 4

Fourth week of my GSoC 2014 project is over.

Key Accomplishments last week : RFE #1145
Key tasks that stalled        : NONE
Code                          : rfe_1145
Tasks in upcoming week        : RFE #861

Last week I successfully implemented RFE #1145.

rfe_1145

 

This week I am going to work upon RFE #861. Many a time it happens that we need know the number of rows ‘affected’ by an `UPDATE` query before executing it. This helps us to know the relative success of the query. This is somewhat tricky to implement.

One way is to envelop the query into TRANSACTION then execute it and ROLLBACK the results. But only InnoDB tables support TRANSACTIONs. So another way is to find the ‘affected’ rows using `SELECT` statement.

So I will try to build a generic algorithm which will convert the UPDATE query into SELECT statement and fetch the desired results.


by ashutoshdhundhara at June 16, 2014 12:45 PM

Smita Kumari

GSOC'14 coding week 4: wrapping up the central list of columns

Week 4 of my GSoC project is over and as discussed in my last blog this was concluding week for the feature Central list of Columns. So this week, I solved some of the security issues and written unit tests to cover the codes written so far.
Starting 3 days of the week, I spent most of the time in reading about security issues and the ways to handle them.
For next three days, I read about PHPUnit which is a testing framework for PHP and is also used in PhpMyAdmin to write the unit tests. I learnt to set up the PHPUnit on my system and to write the unit tests. I learnt about all the assertions that are applied in order to test the functions output and believe me it was interesting.  After using it, I realized how important it is to cover your code with unit tests if your code is a small part of a big project. It is very useful to verify the application's behaviour. This is important to ensure, among others, that your changes don't break existing functionality. So then for the first time, i wrote unit tests and it was not that difficult as it sounds. Here is a screenshot that shows the result of the unit tests written by me.

Apart from these two, as listed on my last blog, I added the support to add the user defined column in the central list from Central columns page. User can add their own column which may not exist in any of the existing tables of that database as suggested by Marc. This will allow users to first add the desired columns in the central list and then use them while adding/changing columns to a table.


This was all I did for the week. And here Implementation of the Central list of columns feature comes to end. Feel free to test this feature out and report if come across any bug or suggestions. You can check it out from the phpmyadmin repository at github. Hoping phpMyAdmin users will find it useful and easy to use. Coming week I will start working on automated normalization of database.

by Smita Kumari (noreply@blogger.com) at June 16, 2014 10:46 AM

Dhananjay Nakrani

Week-6: php Error Reporting (GSoC’14 project)

Sixth week of my GSoC project is over now. The objective of this week’s work was to Write new test cases for added code and make the code ready for midterm evaluations.

Tasks Completed this Week:

⇒ To See list of commits for this week follow these links: phpMyAdmin commits & error-reporting-server commits

Week#7 Tasks:

Objectives:
⇒ Link Error Report with existing bug ticket. [Issue#26]
⇒ Get the code ready for midterm evaluations.

Hoping to pass mid-term evaluations. ;-)
And yes, as usual, all the suggestions are always welcome. :-)


by dhananjay92 at June 16, 2014 04:22 AM

June 15, 2014

Edward Cheng

[CONSOLE]WEEK 4 STATUS REPORTS

Key accomplishments last week

  • Query history
  • Improve bookmarks
  • Card of simple options

Snapshots:

pma-console-bookmarks

pma-console-history

PMA_console_snapshot

Key tasks that stalled

  • Show correct browsing page’s query

Tasks in the upcoming week

(The Schedule is changed)

  • Show correct browsing page’s query
  • Fix codemirror bugs
  • Continue improve new features

by edward at June 15, 2014 01:33 PM

June 09, 2014

Chirayu Chiripal

GSoC 2014 Week #4: Use aliases in SQL export for tables and columns (Contd.)

Week #4 Task: RFE #759 Use aliases in SQL export for tables and columns (Contd.)
Scheduled Deadline: June 09, 2014
Completed On: June 09, 2014

This week I continued with the RFE #759. It was the time to translate the analysis done in last week to working PHP code.

How it was done:
As this feature is directly related to the feature coming up next week (RFE #755), I did this keeping in mind the requirements for next task so that I can re-use the work done in this week. The main obstacle in implementing this feature was the behaviour of the PMA SQL Parser which was key component required to successfully complete this feature.

  • Added few missing reserved keywords from SQL Parser data. They were BEFORE, TRIGGER, EACH, ELSEIF, EXIT. These keywords were important from the point of view of triggers, procedures, etc. as they are used extensively in it.
  • Added ‘pos’ attribute values for many type of tokens such as quote_backticks, punctuations, identifiers in SQL Parser.
  • The ‘pos’ attribute values for tokens/elements was actually the position of last character of the token + 1 instead of starting position of the token. As, it is used in calculation of ‘section_before_limit’ i.e. to split the query around LIMIT clause, this behaviour was not changed. The starting position of the token can be easily calculated like this: pos – length(token)
  • Then, I thought over the way of storing the alias information in array and found this to be a good one:
    $aliases = array(
        [database_name_1] => array(
            'alias' => [database_alias_1],
            'tables' => array(
                [table_name_1] => array(
                    'alias' => [table_alias_1],
                    'columns' => array(
                        [column_name_1] => [column_alias_1],
                        [column_name_2] => [column_alias_2],
                        ...
                    )
                ),
                ...
            )
        ),
        ...
    );
    
  • Added $aliases/$alias parameters to the functions such as exportStructure(), exportTable(), etc. of ExportSQL.class.php and export.lib.php
  • Wrote functions to extract alias information from SELECT query and stored it in the form shown above and called them at appropriate locations, substituted that alias information if provided into queries such as CREATE TABLE, ALTER TABLE, INSERT, CREATE TRIGGER, DROP TABLE, etc.

While doing this, I was stuck at two places, both related to triggers. Literally took 2~3 hours each to notice that it was due to the unusual behaviour of the parser. Those issues were:

  1. Issue #1: The CREATE TRIGGER statement for a trigger is given by getTriggers() method of DatabaseInterface(dbi) class. I passed that create trigger statement to my method which substitutes the aliases at required places. Well, no substitution happened. The create query was returned by it as it is. Upon debugging for a while I noticed that it is not able to detect that it was infact a CREATE TRIGGER statement. Further investigation revealed that PMA_SQP_parse() is detecting identifiers, keywords such as ‘CREATE’, ‘TRIGGER’ as token of type ‘alpha’ not as ‘alpha_reservedWord’ which is used to detect the type of query by the function. Then I broke the query statements line by line and passed them to PMA_SQP_parse() one by one to see where is the problem. I started with first line, ‘CREATE TRIGGER…’, the keywords were being detected fine but not when whole query is passed. Similarly, tested for 2nd, 3rd, 4th line and so on and found that line containing the delimiter // was causing it to crash. // is the default delimiter used in getTriggers(). So, as a workaround I passed different delimiter $$ to it. Then it was able to detect and substitute the alias but this was not enough.
  2. Issue #2: The alias were being substituted were displaced by few positions. I thought my calculation to calculate pos is defective so tested it many times manually and it gave correct result everytime but not when I actually ran the code. I was testing it on my custom trigger. Wild thoughts started coming to my mind like maybe this is the problem with your custom trigger. Then, I tested it on sakila database and saw that it was substituting it correctly in each of the trigger. This strengthened my thought that it was some problem with my custom trigger while another thought in corner of my mind was how is this possible, I am doing something wrong here. I was really tired after the previous issue and no signs to solve this one and I felt asleep there itself. I woke up after few hours and started to look for solution again. This time suddenly a bug report (#4441) striked my mind. Maybe, because I have created this trigger using PMA interface, the trigger statement must be having \r\n line ending. Saw the code of PMA_SQP_parse() and noticed that it is converting the line endings to UNIX style \n before processing the query. Then it was crystal clear that PMA_SQP_parse() is working on query with line ending with \n and thus the pos attribute was according to it and actual query on which I am substituting the alias had line ending \r\n on which that pos attribute can not be used. So, I also replaced all line endings to \n in actually query and then did the substitution. The conclusion was, if someone wants to manipulate such query based on the pos values given by PMA_SQP_parse() it results in undesired behaviour because actual query and query parsed by it are different in terms of line endings and thus pos values are not applicable to actual query.

I have also submitted bug ticket related to these issues : Bug #4447

Code: https://github.com/phpmyadmin/phpmyadmin/commit/33dfef377f126e20a016bb3feb397c384bdd9910
Key accomplishments last week: Final year exams & RFE #759.
Key tasks that stalled: None.
Tasks in the upcoming week: RFE #755 export with table/column name changes


Filed under: GSoC 2014

by chirayu45 at June 09, 2014 08:52 PM

Bimal Yashodha

GSoC 2014 week 3

The last week was the final week for completing the first task of my project. As I've been describing in my previous posts, "save as" and "edit" options are introduced. Apart from that, functionality of the"save" button has been changed so that the changes will be saved into the "table_coords" table.

in coding perspective, the new functionalities are handled through the "pmd_general.php" file. Following is a screenshot of the code portion which handles all the new added features.


The functionality which handles the saving is changed to save data into the  "table_coords" table. Same functionality is used for the "save changes to existing page" option.


So now, in the designer, "designer_coords" table will not be used, in fact "pdf_pages" and "table_coords". So unlike the previous behavior, the designer will load page wise designs.

Possible TODOs: add option to delete tables from the pdf pages.
So the user has more flexibility over the pdf pages.

I'll put the details of the next task in a seperate blog post soon.


by Bimal Yashodha (noreply@blogger.com) at June 09, 2014 06:13 PM

Ashutosh Dhundhara

GSoC 2014: Week 3

Today marks the end of third week of my GSoC 2014 project.

Key Accomplishments last week : RFE #706
Key tasks that stalled        : NONE
Code                          : rfe_706
Tasks in upcoming week        : RFE #1145

Last week I successfully implemented RFE #706. As shown in the image below, now one can select multiple databases while adding privileges for a particular user. These selected databases will have the same privileges for the target user.

rfe_706

This week I am going to work upon RFE #1145. There are numerous places where phpMyAdmin automates SQL queries for us. We are provided with a very easy to use GUI where we input our data and submit it and rest of other tasks are taken care of by phpMyAdmin. That’s the beauty of this software. It acts as a Black-Box for us. But many a times we don’t need to execute the queries but save them for future references and usage. So with this RFE, the user will be able to “Preview SQL” queries instead of executing them.

I will try to accomplish this RFE by:

  1. Adding a “Preview SQL” button on the following pages and dialog boxes.
    1) Create table and Change table structure page.
    2) Insert/Edit table row(s) page.
    3) Relation view page.
    4) Add/Edit Index dialog.
  2. Displaying the SQL in a jQuery dialog using Ajax.

With this I’ll be one more step closer towards the completion of my project.


by ashutoshdhundhara at June 09, 2014 07:58 AM

Smita Kumari

GSOC'14 week 4: List of tasks to accomplish

This is concluding week for the feature central list of columns, on which I'm working for last 3 weeks. The feature is almost complete and can be used. Few things that I need to complete includes:
  • Bug fixing if comes across any.
  • On "Central columns" page, option to add a column which are not present in any tables.  This will let user to add his own columns with desired definition and use them later while adding a column to any table.
  • Write unit tests for the codes written so far.
Completing the above will complete the Central List of Columns feature, Then I'll start with automated normalization of database from next week onwards.

by Smita Kumari (noreply@blogger.com) at June 09, 2014 07:20 AM

GSOC'14 coding week 3: Using central list of columns

As in my last blog, the aim of this week was to provide users an interface to use the central list of columns. The user can use the central list in two ways:

1. While adding/editing a column:  The idea was to give users a way to pick a column from the list and all the attributes of the column will get automatically populated that is associated with chosen column. So first I came up with an idea of using a dropdown to select a column , But Marc suggested to use modal dialog as list of column may be very large in numbers. So below each row of column on tbl_structure page , I kept a link that says "Pick from central list" on click of that a model dialog opens with list of columns in the central list. User can pick a column from that model dialog. If we are changing columns of a existing table then this dialog doesn't show the columns already present in the current table.
Since column list can be very large so searching a column may be difficult so we kept a search box to search the columns from the list. Also for the same reason, we kept an option "See More" to load more columns as needed. On picking of a column, we auto fill all the fields.


2. Make a table consistent with central list: The idea was to let user make tables consistent with the central columns list. So if a column name in central list have different definition than that of a same named column of the chosen table then that column info will be updated as per definition in the central list. For that, I have kept a option on db_structure page in "With Selected:" that says "Make consistent with central list", this action check for same named columns in selected tables and central list, and for those columns it updates the definition as of corresponding central list column. This action doesn't change the definition of columns which are being referenced as foreign key.
Since this action can change the column definition, we prompt the user for confirmation.

Option to make consistent with central columns is still in review while option to pick a column from central list has been merged to PhpMyAdmin master branch. Feel free to check it out, as it almost completes the central list of columns feature.
Coming week, I'll be fixing on some of the bugs and will write unit tests for the codes written for this feature.

by Smita Kumari (noreply@blogger.com) at June 09, 2014 06:44 AM

Dhananjay Nakrani

Week-5: php Error Reporting (GSoC’14 project)

Fifth week of my GSoC project is over now. The objective of this week’s work was to fix all the failing PHPUnit tests of error reporting server and phpMyAdmin.

Tasks Completed this Week:

  • Add ‘Error Type’ field to individual view of error reports. [error-reporting-server. Commit: b590843]
  • Fix all the failing automated PHPUnit tests. [phpMyAdmin & error-reporting-server. Commits-{ 56ee831, 7d0501c }]
    ⇒This task involved modifying existing test cases and their data according to newly added code. Kindly see the automated builds at travis-ci/phpMyAdmin & travis-ci/error-reporting-server. Note that in error-reporting-server, still one test namely IncidentTest::testCreateIncidentFromBugReport() is to be fixed.
  • Stop false alarms of error reporting. [phpMyAdmin Commit: 0ec4a2d]
    ⇒ By false error reports, I mean, the errors raised by phpMyAdmin to warn user about missing some extensions or configuration parameters. Untill now phpMyAdmin used to report such false error incidents. Simply a check was put to differentiate between the actual and false errors.
  • Put the commits for review. Incorporate the suggestions.
    ⇒ See Pull#1207 for more details.
    ⇒ I was suggested by my mentor to move the error reporting code into a new function PMA_Error_Handler::reportError(). Up till now there was a separate script common_error_reporting.php which used to do all the error reporting relating to php. That file was intended to be included at the end of every other scripts. My mentor suggested that it was bad idea to do so. Instead the call to new function (PMA_Error_Handler::reportError()) should be hooked up in PMA_Footer::getErrorMessages(). PMA_Footer::getErrorMessages() is executed at the end (well, ‘almost’ end) of every script.

    ⇒ In case where sednErrorReport is set to 'always', current code of phpMyAdmin used to submit error reports synchronously. That was delaying the response back to web browser. Michal suggested that it should be asynchronous. So, I redid that part too. Have a look at the diagram given below. That shows how errors are reported in case of 'always'.

    Figure-1: Asynchronous Report Submission

    Figure-1: Asynchronous Report Submission

Problems/Issues faced this Week:

  • Learned that there was in fact a coding convention to be followed. Learned how to do code sniffing locally using PHP_CodeSniffer and do changes suggested by it.
    [Status: Resolved]
  • List view of all the error reports in generated by some default core code of CakePHP or some of its extension. Still figuring out what exactly generates the body of the table at Line#52 of /app/View/Reports/index.ctp .
    [Status: Unresolved]
  • Encountered ‘Object Mocking’ in PHPUnit. It’s used for automated testing of some parts of error reporting server. Still working on how to change behavior of a method to make it do initialization of the $this object itself. See email at this thread on sourceforge mailman.
    [Status: Unresolved]

NOTE: Suggestions are most welcome for all of the unresolved issues mentioned above. That would help me a lot. :-)

Tasks for Next week (Week#6):

Objectives:
⇒ Write new test cases for added code.
⇒ Get the code ready for midterm evaluations.

  • Complete Stalled Tasks:
    • Add error type field to list view of error reports with sorting functionality.
    • Fix error reporting server’s failing test IncidentTest::testCreateIncidentFromBugReport().
  • Automated Tests
    • Write test cases for newly added code of PMA & error reporting server.
    • Fix all the coding style issues.

Hoping to complete the work scheduled before midterm in the next week itself. ;-)


by dhananjay92 at June 09, 2014 06:22 AM

Edward Cheng

[CONSOLE]WEEK 3 STATUS REPORTS

Key accomplishments last week

  • Bookmarks and history browser-side code is done
  • “.card” elements(For opstions, bookmarks and other features)

Key tasks that stalled

None.

Tasks in the upcoming week

(The Schedule is changed)

  • Start write server-side ajax bookmarks code
  • Finish query history
  • Show correct browsing page’s query
  • Add a card for simple console options

by edward at June 09, 2014 03:50 AM

June 02, 2014

Bimal Yashodha

GSoC 2014 week 2

As shown in my last week flow diagram, I've almost completed the first task. The "save as" and "edit pages" functionalities are being introduced, by means of dialog boxes. Following are the screen shots of them:

Save as:

Edit pages:

Changes done in the code:

separate php files will handle the "save as" and "edit pages" functions (save_as_pages.php and edit_pages.php). According to the flow diagram, another file(pmd_page_loader.php) will handle the page loading function.

Now the designer will be loaded with data from "pma__table_coords" instead of "pma__designer_coords". So the system can load different pages upon user selection.

TODO:
do modifications to the "save" function when there are new/edit pages
modify the pmd_general.php file in such a way that, html will be moved to another files and retrieved by function calls.


by Bimal Yashodha (noreply@blogger.com) at June 02, 2014 03:50 PM

Edward Cheng

[CONSOLE]WEEK 2 STATUS REPORTS

Key accomplishments last week

  • Better console log: a new js object PMA_consoleMsg, for manage messages(logs)
  • Simple console options: options for each message(requery, redit), options for message_container
  • Add code comments

Key tasks that stalled

  • Costom AJAX part: design changed, cancelled

Tasks in the upcoming week

(The Schedule is changed)

  • Start write bookmark and history features
  • Continue make console options(or call them buttons?)

by edward at June 02, 2014 01:31 PM

Chirayu Chiripal

GSoC 2014 Week #3: Use aliases in SQL export for tables and columns

Week #3 Task: RFE #759 Use aliases in SQL export for tables and columns
Scheduled Deadline: June 09, 2014
Completed On: Not yet completed.

As my final year B.E. exams are going on, I am going a bit slow with this feature request but I am trying my best to complete the task as per schedule.

Analysis: For replacing table & column names with their respective aliases from SQL query we require the SQL parser to provide information about column & table names correctly. phpMyAdmin SQL parser library has following 2 major functions to do that:

  1. PMA_SQP_parse($sql_query) : returns array of tokens from $sql_query.
  2. PMA_SQP_analyze($token_array) : returns array, the analyzed SQL queries.

Consider an example of SQL query having aliases:

select inst.inst_name as `name`,inst_estb_year eyear from inst_master inst;

When this query is parsed and then analyzed using above two functions then the resultant array gives us the details about column & table names with aliases (You can see output here).

While exporting a table/query, it uses the table name and then generates create table statement using SHOW CREATE TABLE table_name. The output of show create table is like this:

CREATE TABLE IF NOT EXISTS inst_master (
inst_id tinyint(3) unsigned NOT NULL COMMENT 'Primary Key',
  inst_name varchar(255) COLLATE latin1_general_ci NOT NULL COMMENT 'Institute Name',
  inst_code varchar(10) COLLATE latin1_general_ci NOT NULL COMMENT 'Institute Code as per GTU',
  inst_estb_year smallint(4) DEFAULT NULL COMMENT 'Institute Established Year'
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci COMMENT='List of Institutes' AUTO_INCREMENT=5 ;

When this query is parsed and then analyzed we get the following output shown here. One thing to notice in the output is that in ‘create_table_fields’ index of the array, there is a key ‘latin1_general_ci’ which is not a column. It is the collation of the table. So, I think this a kind of a bug with parser (not yet confirmed that it is indeed a bug). Also, it does not give the table name anywhere which it should have.

A table maybe having triggers present, so while exporting a trigger even old column and table names have to be replaced by alias which is a bit problem here because current SQL parser does not provide information about columns and tables used in create trigger statement which may have variety of SQL statements such as SELECT, SET, INSERT, etc.

CREATE TRIGGER `BEFORE_inst_master_INSERT` BEFORE INSERT ON `inst_master`
 FOR EACH ROW BEGIN
SET @cnt=(SELECT count(*) FROM inst_master WHERE inst_name=NEW.inst_name OR inst_code=NEW.inst_code LIMIT 1);
IF @cnt<>0 THEN
SET NEW.inst_id=1;
END IF;
END

However, PMA_SQP_parse() returns a token array which can be useful here. The output of PMA_SQP_parse() for above query can be seen here. From the output we can see that many keywords such as ‘TRIGGER’, ‘BEFORE’ are considered as ‘alpha_identifier’ instead of ‘alpha_reservedWord’ which is wrong (List of MySQL Reserword Words). Also, the ‘pos’ key of many tokens is 0 which is also wrong in my opinion.

The general create trigger syntax is something like this (Source: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html):

CREATE
    [DEFINER = { user | CURRENT_USER }]
    TRIGGER trigger_name
    trigger_time trigger_event
    ON tbl_name FOR EACH ROW
    trigger_body

trigger_time: { BEFORE | AFTER }

trigger_event: { INSERT | UPDATE | DELETE }

From above syntax we can see that table name will always appear after ‘ON’ keyword. So, we can ignore the create trigger syntax till ‘ON’ keyword which is followed by table name which can be replaced by alias if required. Then, next is ‘FOR EACH ROW’ which can again be ignored. After that, is the trigger body where the actual problem starts as discussed in developer mailing list also.

Code: Not yet started.
Key accomplishments last week: Analysis of the RFE #759.
Key tasks that stalled: Replace column & table names with aliases in create trigger statements of export.
Tasks in the upcoming week: Little more analysis & Coding of RFE #759.


Filed under: GSoC 2014

by chirayu45 at June 02, 2014 12:31 PM

Ashutosh Dhundhara

GSoC 2014: Week 2

Second week of my GSoC 2014 project is over.

Key Accomplishments last week : RFE #1445
Key tasks that stalled        : NONE
Code                          : rfe_1445
Tasks in upcoming week        : RFE #706

 

Last week I successfully implemented RFE #1445. Now a user can easily see the “SHOW CREATE” query for a database or a view by simply selecting and clicking on “Show create” under “With selected:” select box on DB level view page.

This week I am going to work upon RFE #706.  As of now, while adding privileges for a user, we can select only a single database. But in general we need to apply certain level of privileges for a user on multiple databases. So this RFE demands a cure for this shortcoming in the current versions of phpMyAdmin.

Steps to implement:

  1. Changing the database list box under User level privileges section to a multiple value select box.
  2. Storing the selected databases into an array.
  3. Iterating through each database and updating the selected privileges on all databases.

by ashutoshdhundhara at June 02, 2014 11:39 AM