Export to GitHub

ruckusing - issue #9

MySQLAdapter->schema not working


Posted on Nov 10, 2008 by Swift Bird

The db:schema task gives no output. The problem is in the schema method of MySQLAdapter, which on row 152 expects a two element array as the result from a sql query when, instead, it should expect one row in the result and that row should in turn have two elements. Patch it using this:

Index: lib/classes/adapters/class.MySQLAdapter.php

======== --- lib/classes/adapters/class.MySQLAdapter.php (revision 77) +++ lib/classes/adapters/class.MySQLAdapter.php (working copy) @@ -149,8 +149,11 @@ $stmt = "SHOW CREATE TABLE $tbl"; $result = $this->query($stmt);

  • if(is_array($result) && count($result) == 2) {
  • $final .= $result['Create Table'] . ";\n\n";
  • if(is_array($result) && count($result) == 1) {
  • $row = $result[0];
  • if (count($row) == 2) {
  • $final .= $row['Create Table'] . ";\n\n";
  • } } } return $final;
Attachments

Comment #1

Posted on Nov 11, 2008 by Swift Giraffe

I applied your patch against trunk. I will make a new download shortly.

Thanks for the feedback + patch!

Status: Fixed

Labels:
Type-Defect Priority-Medium