Home » Database » MDB2 » Bug #5889
Error in updateDatabase
Details
| Submitted | 2005-11-07 21:09 UTC |
|---|---|
| From | richtl at arscognita dot com |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 5.1.0 |
| OS | Mandriva Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-11-07 21:09 UTC] richtl at arscognita dot com
Description:
------------
updateDatabase() gives a fatal error when I try to create or update a database. I've tried both the mysql and mysqli drivers.
Test script:
---------------
<?PHP
require_once 'MDB2.php';
require_once 'MDB2/Schema.php';
$file = 'test.xml';
$dsn = "mysqli://root@localhost";
$schema = &MDB2_Schema::factory( $dsn );
$result = &$schema->updateDatabase( $file, $file . '.backup' );
}
test.xml is
<?xml version="1.0" ?>
<database>
<description>Mindmeld Database Schema</description>
<comment>Ver: 2.0</comment>
<name>mdbtest</name>
<create>1</create>
<table>
<name>Decision</name>
<declaration>
<field>
<name>queryId</name>
<type>integer</type>
</field>
</declaration>
</table>
</database>
Expected result:
----------------
Newly created database.
Actual result:
--------------
Fatal error: Call to undefined function: MDB2_Driver_mysqli::_convertEmptyArrayValuesToNull(). in /usr/share/pear/MDB2.php on line 1642
Call Stack:
0.0010 43552 1. {main}() /home/richtl/workspace/libmindmeld/install/makedb.php:0
0.1811 1865544 2. MDB2_Schema->updateDatabase() /home/richtl/workspace/libmindmeld/install/makedb.php:18
0.2120 2197816 3. MDB2_Driver_Manager_mysqli->listDatabases() /usr/share/pear/MDB2/Schema.php:1888
0.2121 2197816 4. MDB2_Driver_Common->queryCol() /usr/share/pear/MDB2/Driver/Manager/mysqli.php:413
0.2350 2198656 5. MDB2_Result_Common->fetchCol() /usr/share/pear/MDB2.php:2509
0.2351 2198656 6. MDB2_Result_mysqli->fetchRow() /usr/share/pear/MDB2.php:2696
0.2352 2198760 7. MDB2_Driver_mysqli->_convertEmptyArrayValuesToNull() /usr/share/pear/MDB2/Driver/mysqli.php:758
0.2352 2198944 8. MDB2_Driver_Common->__call() /usr/share/pear/MDB2.php:758
0.2356 2199576 9. trigger_error() /usr/share/pear/MDB2.php:1642
[2005-11-08 17:49 UTC] richtl at arscognita dot com
Installed MDB2 and MDB2_Schema from CVS. Same problem.
What version of the mysql/mysqli driver do I need? Are you referring to the mysqli php extension? If so, I'm using php-mysqli-5.1.0.
[2005-11-09 11:39 UTC] richtl at arscognita dot com
I'm using MDB2 2.0.0b7. The version in the mysqli.php driver file says 1.15.
[2005-11-09 12:10 UTC] richtl at arscognita dot com
I built the package from what the CVS repository listed on http://oss.backendmedia.com/index.php?area=MDB2.
I was using the pear installer current version when I originally reported the problem. Will revert and retest.
[2005-11-10 13:37 UTC] richtl at arscognita dot com
Finally managed to get all the right parts upgraded and it all works.