Author Archive

Drizzle support for phpMyAdmin – week 13

August 22nd, 2011 No comments

My project was mostly complete by the time I posted my previous report, so during last week I concentrated on fixing bugs.

Things done this week:

  • I fixed the tracker functionality to work correctly with Drizzle. The only problem was that Drizzle has no SET type, so I had to emulate it with binary flags and an INT column. After making these changes to the PMA_Tracker class everything started working,
  • Advisor available on server’s Status tab works correctly with Drizzle, I had to add a few exceptions so that rules dependent on variables unavailable in Drizzle don’t fire,
  • bug fixes and some JavaScript optimizations.


Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 11

August 6th, 2011 No comments

During this week I worked on Database Synchronize feature. At first, I tested it with my MySQL server and found out that it suffered a lot from latest theme changes because it was using some Status page CSS classes. After fixing it and refactoring source and target table lists to actually be in one table, not in two placed next to each other, I followed to make necessary changes for it to work with Drizzle. Fortunately for me, it worked right away so I just disallowed connections with servers that use different protocol than the loaded database interface can, and added a few variables that can differentiate between regular MySQL and Drizzle in case any problems arise in the future.

This week I am going to a week-long vacation, and when I return I will have a week left to find and fix remaining bugs and maybe look whether Drizzle replication can be somehow supported.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 10

July 31st, 2011 No comments

Long story short – I decided to change my task for this week and write a database interface library working with Drizzle PHP module. After fighting with multiple segmentation faults and working around some of them I pushed working code to my repository. Longer version is below, maybe it will help someone to get started with Drizzle + PHP.

After some more thinking about my task for this week I decided to change it and implement database interface module for Drizzle, so I would have a lot of time to improve it and fix bugs while working on other features. So, I started googling for any information on Drizzle PHP extension and found out that there is currently no documentation available, but fortunately there is one old blog post on Zend Developer Zone (Getting started with Drizzle) and an example of usage provided with the extension itself (drizzle.php). Unfortunately getting the module to work on Windows would be too time consuming, so I had to compile it in my virtual machine (hint – broken build against drizzle PPA bug has information on how to quickly fix configure to work). After all the downloading, installing and compiling was done I could start working on my code.

At first I digged for more information on PHP module’s interface with the nice php --re drizzle command and some reflection code that I wrote:

function printMethod(ReflectionMethod $method) {
    if ($method->isStatic()) echo '<tt>static</tt> ';
    echo '<b>' . ($method->returnsReference() ? '&' : '') . $method->getName() . '</b>';
    echo ' ( ';
    foreach ($method->getParameters() as $par) {
        /* @var $par ReflectionParameter */
        if ($par->getPosition() > 0) echo ' , ';
        if ($par->isOptional()) echo '<u>';
        echo $par->getClass() . ' ';
        echo '<i>' . ($par->isPassedByReference() ? '&' : '') . '$' . $par->getName() . ($par->isArray() ? '[]' : '') . '</i>';
        if ($par->allowsNull()) {
            echo ' null ';
        if ($par->isDefaultValueAvailable()) {
            echo ' = ';
        if ($par->isOptional()) echo '</u>';
    echo ' ) ';

function printClass($c)
    $rf = new ReflectionClass($c);
    <?php foreach ((array)$rf->getConstants() as $v): ?>
        <li><?php print_r($v) ?></li>
    <?php endforeach; ?>
    <b>Default properties</b>
    <?php foreach ((array)$rf->getDefaultProperties() as $v): ?>
        <li><?php print_r($v) ?></li>
    <?php endforeach; ?>
    <?php foreach ((array)$rf->getProperties() as $v): ?>
        <li><?php print_r($v) ?></li>
    <?php endforeach; ?>
    <ul><li><?php printMethod($rf->getConstructor()) ?></li></ul>
    <?php foreach ((array)$rf->getMethods() as $v): ?>
        <li><?php printMethod($v); ?></li>
    <?php endforeach; ?>

echo '<hr />';

echo '<hr />';
echo '<hr />';
echo '<hr />';
echo '<hr />';

After a few hours I had some code for tests, and then the real trouble began – segmentation faults, in various places and configurations. I was able to get my code to work without crashing PHP in the middle of script processing, but I decided to ignore crashes which happen at shutdown and added some code which hides this problem (flushing on shutdown). While trying to get around it I gathered some information and use cases which later went to PHP module’s bugtracker, so hopefully someday it will get fixed.

The code is in my GIT repository and mostly works, but it’s not ready for use in stable version of phpMyAdmin due to instability of PHP module. For now the code crashes PHP on most pages and has a lot of logging which gives some insight into interaction with drizzle module.

During the next week I will go on with my work on database synchronize.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 9

July 25th, 2011 No comments

This week I worked on getting data import functions of phpMyAdmin to work with Drizzle. After making a few changes everything started to behave correctly, and I had some time for minor changes in master branch.

I didn’t have much time for coding as I was moving to a new flat, and of top of that my computer refused to cooperate and forced me to reinstall everything from scratch. Now I am mostly moved and finishing with my computer’s setup.

During the next week I plan to look at database synchronize feature which I should be able to make work with Drizzle. I am not sure about MySQL <> Drizzle scenario, but I hope to have Drizzle <> Drizzle setup working. I saw a few suspicious warnings from my IDE that concern files related to this feature, so it’s very likely that some changes will go to master too.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 8

July 17th, 2011 No comments

This week I looked at export plugins. At first, I started looking at code in master and changed all SHOW FIELDS queries to my new PMA_DBI_get_columns function. Aside from that, I fixed two bugs:

  • XML plugin couldn’t export any structure,
  • CodeGen couldn’t export table definitions,
  • JSON plugin generated invalid code when table was empty.

Having taken care of these, I improved CodeGen which now tries to convert column name to valid C# identifiers.

After merging these changes with my branch I took care of proper SQL export for Drizzle and took care of all remaining code that was incompatible with Drizzle. Other, smaller changes introduced during this week were:

  • ignore SkipLockedTables option for Drizzle,
  • remove SOUNDEX from supported functions – Drizzle documentation states that it is supported but apparently that’s a mistake,
  • some other small changes.

Drizzle bugs for this week:

During next week I plan to take a look at import plugins.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 7

July 10th, 2011 No comments

During this week I finished looking at table creation, column editing and row insertion forms – all of these should now work correctly with Drizzle. As I mentioned last week, I changed the way MySQL column types are defined so that I was able to add data for Drizzle in a clean way.

Aside from that I made a few fixes in master branch and added a new view for Drizzle Plugin list – now it has a nice list of plugins grouped by plugin type.

Next week I want to concentrate on database and table export.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 6

July 3rd, 2011 No comments

This week I finished checking Operations and Search tabs, so these should now work correctly with Drizzle. After getting that finished, I started looking into some MySQL specific configuration variables that contain MySQL column types and list of functions usable in Insert form. Some work on that is already committed, but I intend to revert this work and proceed with a more clean solution – at first reorganize some phpMyAdmin code in master branch and then proceed to add Drizzle-specific changes to my branch:

  1. move some settings out of config.default.php (AttributeTypes, Functions, RestrictColumnTypes, RestrictFunctions) into a separate file,
  2. load this file only on demand,
  3. introduce a separate data file for Drizzle.

1. and 2. will be committed to master branch while the last point will be done only in my drizzle branch.

Now, this week’s Drizzle bugs 🙂

During next week I want to finish refactoring phpMyAdmin code as I described above and take a look at table creation, column edition and data insert forms.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 5

June 27th, 2011 No comments

This week I was looking at Operations and Search tabs. I checked most functionality and added some Drizzle specific workarounds, so now the Operations page should be fully functional. Simple table searches seem to work fine, but I have yet to look through code responsible for that to make sure nothing strange happens under the hood. While working on that I also improved the original code by removing PERFORMANCE_SCHEMA engine from user-selectable lists and making sure that non-ASCII databases can be correctly renamed.

And now, yet another Drizzle bug 🙂

From the bugs I found it looks like Drizzle may be ready for data processing, but it’s metadata quality should be improved. I hope the next stable release will bring some improvements there.

During the next week I will be concentrating on search functionality and test it along with database and table operations.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 4

June 20th, 2011 No comments

During this week I finished looking through Structure views and data browsing, there should be no critical errors there. I removed featured that don’t work with Drizzle (eg. views, optimize/repair table). Some things, like Export link, will start working when I actually get to that part of phpMyAdmin code. Part of fixes in these areas was to replace all SHOW FIELDS and SHOW KEYS/INDEX queries with function call that generates proper query for MySQL or Drizzle. You can expect this to fix random parts of phpMyAdmin that I haven’t yet looked at.

This time I struck three Drizzle bugs that can’t be circumvented:

And one thing that fortunately I can do without:

Aside from working on my planned tasks, I also took a look at the new server Status tab and made it work correctly with Drizzle, and enhanced it a little:

  • categories for variables not available in Drizzle are hidden,
  • there’s a new category – “Other”, which shows variables not available through other filters.

For now live charts won’t work on demo server because the AJAX query that updates the chart is broken – I am waiting for a bugfix to be merged to master, so that I can use it in my branch.

Main tasks for next week are Search and Operations tabs.

Categories: phpMyAdmin, Summer of Code 2011 Tags:

Drizzle support for phpMyAdmin – week 3

June 12th, 2011 No comments

It’s time to use the time reserve I prepared when making my schedule – this week’s task will be finished by the end of next week. I got informed that if I hurry up I have a chance of finishing my master’s thesis and taking an exam a bit earlier than I anticipated, so I had to spend a lot of time on preparing for that and will have to spend a bit more in the following week.

I’ve done very little work on phpMyAdmin, but fortunately it doesn’t mean that nothing has changed:

  • I tracked down and fixed a bug that made some actions requiring a valid access_token to fail for me randomly – ‘server’ parameter for AJAX request that loads recent tables list was missing and making auth to fail and regenerate access_token.
  • PBMS detection on Drizzle works correctly.
  • MySQL-specific routine and event lists are no longer loaded when working with Drizzle.
  • PMA_DBI_get_tables_full would fail when reading data on tables in I_S and D_D due to letter case issues – it’s fixed.
  • Added an error on import for situations when no charset conversion library is available because in Drizzle we cannot fall back to “SET NAMES”

On a related note, two bugs in Drizzle that I reported are now fixed. Fortunately they could be circumvented and didn’t affect my work:

Some time ago I made a mistake of allowing phpMyAdmin to change connection collation for Drizzle – after re-checking I realized that this feature got removed due to some concurrency issues. It appears that now it can reimplemented so I filed an appropriate bug in their tracker – Add collation_server variable.

Categories: phpMyAdmin, Summer of Code 2011 Tags: