August 21, 2012 in General
Last week I somewhat improved my implementation of jqplot porting for status tab. Earlier the page could hold only one chart at a time, means that if a user switched among tabs on the status page while a live chart was on progress, when switching back to the same tab the chart was no more there. It had to be, as jqplot should know the dimensions of the target div to plot the chart, which became unavailable on switching to some other tab. Now after I did a chart replot on tab showing up again, the chart starts again. So multiple charts can now resume on switching tabs.
Also, I started migrating the status => monitor tab to jqplot.
August 14, 2012 in phpMyAdmin
This week I continued working on highcharts to jqplot migration of Status page charts. Main ask accomplished was the migration of live traffic chart and live connections/processes chart to jqplot. Live Queries chart was already migrated to jqplot in the last week.
The new jqplot live charts like highcharts, are customizable for refresh rate, also I have added a customization for the number of data points visible at one time using select list.
Under Status page, there are several tabs of which Server and Traffic have charts plotted using jqplot. In an event of switching between these tabs when the live charts are running under both tabs, I noticed some misbehaviour and jqplot seemed to shorten the width of the charts to half their original width. So, the next task is to make multiple charts work properly at the same time.
August 6, 2012 in PHP, phpMyAdmin
This week I started working on highcharts to jqplot migration of live query statistics chart (Status => Query Statistics => Live Query Chart). Initially, we were facing a problem with jqplot’s dateAxisRenderer plugin, that it crashed when plotting a chart with very small time intervals. But a fix provided on  solved the problem, though the fix is not a part of official jqplot release yet.
The next problem was to make the live chart move to left with time, initially I tried to make that work by shifting the data values in the array provided as data to jqplot as in . It produced the moving effect to some extent but was not as seamless as highcharts. Also the number of data points on x-axis kept fluctuating making it hard to read the chart.
So in  I tried moving the chart to left by tweaking the min/max values of charts’ x-axis on every replot. Now the live chart seems to be more viewable, also it gets easily re-adjusted on refresh-rate change.
July 23, 2012 in GSoC, phpMyAdmin
This week I continued refactoring in db_qbe.php. A new class PMA_DbQbe was created to accommodate the db_qbe functionality, and db_qbe.php now creates a new instance of PMA_DbQbe to execute all qbe related operations. About functionality, it seems almost unaltered to me as of now, after fixing a few introduced bugs reported by Marc. I am happy that the refactoring on schedule is complete except testing, and I will continue testing the refactored code to fix any other bugs.
As of now, database qbe search only supports ‘PMA internal relations‘ for creating LEFT JOINS automatically in case of related tables. I plan to introduce InnoDB relations into QBE search as suggested by Marc. The InnoDB relations data is already available but the main task is to use it in relation.lib.php(PMA_getRelatives) to somehow create LEFT JOINS out of it.
July 16, 2012 in GSoC, phpMyAdmin
This week I continued refactoring in db_qbe.php. The remaining code was mainly responsible for SQL query generation using the inputs provided by user. The code was converted into functions involving the LEFT JOIN generation code. The following new functions were formed:-
- PMA_dbQbeGetSelectClause // Provides SELECT clause for the query
- PMA_dbQbeGetWhereClause // Provides WHERE clause for the query
- PMA_dbQbeGetOrderByClause // Provides ORDER BY clause for the query
- PMA_dbQbeGetInsDelAndOrCell // Provides options to add/del criteria rows
- PMA_dbQbeGetInputboxRow // Provides criteria inputbox row
- PMA_dbQbeGetInsDelAndOrCriteriaRows // Provides criteria inputbox row
- PMA_dbQbeGetLeftJoinColumnCandidates // Provides columns for LEFT JOIN
- PMA_dbQbeGetIndexes // Provides UNIQUE AND INDEX columns
- PMA_dbQbeGetMasterTable // Provides master table
- getWhereClauseTablesAndColumns // Provides tables and columns containing valid WHERE clause
- PMA_dbQbeGetFromClause // Provides FROM clause
Apart from that the mid-term assessments were also scheduled during this week and I passed through mid-term to continue the remaining project. I have moved the new functions to a new library file libraries/db_qbe.php. Next I plan to work out some InnoDB foreign key support issues in db_qbe search with Marc.
July 9, 2012 in GSoC, phpMyAdmin
This week I started working on db_qbe.php. The script is responsible for providing ‘Query By Example‘ search on a database. The user can visually form a query using this feature and execute it with minor manual modifications. As about refactoring, the script contained a lot of HTML-PHP mix used to display the ‘qbe‘ form. So I have formed several functions to display the search form.
The following new functions provide different <tr> elements for the search form:-
- PMA_dbQbegetColumnNamesRow // Provides Column Names Select Options
- PMA_dbQbegetSortRow // Provides Sorting options
- PMA_dbQbegetShowRow // Provides Show checkboxes
- PMA_dbQbegetCriteriaInputboxRow // Provides Input boxes
- PMA_dbQbeGetAndOrColCell // Provides And/Or modification options
- PMA_dbQbeGetFootersOptions // Provides Footer modification options
- PMA_dbQbeGetTableFooters // Provides search form’s footer
- PMA_dbQbeGetTablesList // Provides tables select list
- PMA_dbQbeGetModifyColumnsRow // Provides columns ins/del options
Also, by the end of this week I converted database search to object oriented style. Now, db_search.php uses libraries/DbSearch.class.php as its class file. All the already set criteria variables for db_search.php are now being initialized in setCriteriaParams() and a new instance of PMA_DbSearch is created in db_search.php to conduct database search operations.
By the mid of the upcoming week, I plan to convert QBE search to OOP style, which would almost finish the scheduled refactoring work of my project. After that I plan to work on PMA’s ‘highcharts‘ to ‘jqplot‘ migration with Marc apart from minor improvements in the refactoring done so far.
July 2, 2012 in GSoC, phpMyAdmin
This week, I started with further improvements in db_search.php. The HTML-PHP mix responsible for displaying the search results was cleaned and replaced with a function PMA_dbSearchGetSearchResults()
Going ahead, a new function PMA_dbSearchGetResultsRow() was formed out of PMA_dbSearchGetSearchResults(). PMA_dbSearchGetResultsRow() is used to fetch results row for each criteria table containing browse/delete links if the results count for that table is more than zero.
Another new function PMA_dbSearchGetWhereClause was formed out of PMA_getSearchSqls(), the new function is used for generating where clause for all criteria tables. All the functions have been now moved to a separate library file libraries/db_search.lib.php. Apart from that, some variable name improvements were also made The improvements in db_search.php are almost complete and next week I plan to start with db_qbe.php.