Monday, August 6, 2012

GSoC 2012 - 11th Week Progress

             This is my 11th week of GSoC 2012 project. Its one more week to active work in code level. Last week I did some improvements on showing syntax highlighted SQL statement in PROCESSLIST table in information_schema database and introduce some links inside mysql database related to displaying data fields.

            This week as the first task I introduce some links inside information_schema database. In previous week I implement same kind of thing but in more specific way to that task. So I change the previous implementation where it can be used to my new task. I changed the structure of the global variable $GLOBALS['mysql_schema_relation'] and renamed it as $GLOBALS['special_schema_links'] and renamed the file as special_schema_links.lib.php. The new structure of the array can be represented by following snippet.

$GLOBALS['special_schema_links'] = array( 
    // Database name is the major element
    'mysql' => array(
        // Table name
        'db' => array(
            // Column name
            'user' => array(
                // Main url param (can be an array where represent sql)
                'link_param' => 'username',
                // Other url params
                'link_dependancy_params' => array(
                    0 => array(
                        // URL parameter name
                        // (can be array where url param has static value)
                        'param_info' => 'hostname',
                        // Column name related to url param
                        'column_name' => 'host'                        
                    )
                ),
                // Page to link
                'default_page' => 'server_privileges.php'
            )
        )
    )
);

By using this array, links can be generated where needed specially inside schema like mysql, information_schema etc.

          Next I moved into implement feature request for support MIME transformations in query results. Some of the query results which show only field with transformation and large data (blob fields etc) were not displayed their expected transformation in results. PMA has avoided that kind large data comparisons for SQL queries. So that, $where_clause parameter is not generating properly. So, assuming the length of the data fields will not same, I used the length of the data field to generate proper $where_clause and compare inside SQL query. Now query results display the expected out put with their transformations if any.

            Then I moved into give the support for transformed data for VIEWs. In PMA the columns with any transformation are stored inside column_info table of phpmyadmin database. But the problem was these information were not stored in column_info table while creating VIEWs. So I did some changes to store needed details of transformations in VIEWs whie creating them by the link (create view) in browse mode of a result set. A new file called tbl_views.lib.php was introduce to place related functions.

        As well when deleting a column, table, view or database the related information on transformations were not deleted from the column_info table. So I implement a function to delete relevant entries and placed the necessary places to do the work.

In my next week I intend to implement the feature request on simple sort for server_processlist.php.


No comments:

Post a Comment