PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #8270

Nested transaction raise an error with the MySQL and Schema module

Details

Submitted2006-07-23 21:02 UTC
Fromchristian_rocher at hotmail dot com
StatusNo Feedback
PackageMDB2
PHP Version5.1.4
OSWinXP
Roadmaps(Not assigned)

Comments

[2006-07-23 21:02 UTC] christian_rocher at hotmail dot com

Description:
------------
I use the Schema module to create/upgrate my databse schema. Since this version of MDB2 I get an error:

".\pear\MDB2.php line 1801 - Call to undefined function: MDB2_Driver_mysql::beginNestedTransaction()."

My workarround is to force the support of transactions to false as soon as I'm connected:

$Schema->connect( $DBConnection);
$Schema->db->supported[transactions] = false;

Test script:
---------------
$DBConnection =& MDB2::factory( $DSN, $DSN_Options);
$Schema =& $DBConnection->loadModule( 'Schema', null, true);
if ( PEAR::isError( $Schema))
{
return $Schema;
}
$Schema->connect( $DBConnection);

Expected result:
----------------
Successful connected

Actual result:
--------------
".\pear\MDB2.php line 1801 - Call to undefined function: MDB2_Driver_mysql::beginNestedTransaction()."

[2006-07-30 17:27 UTC] christian_rocher at hotmail dot com

Hi,

This is my mistake, I tried to reduce the code I added in this bug. You're right, my sample is not valid. To be sure I tried with your code and the behaviour is unchanged (error):

MDB2::loadFile('Schema');
$schema =& new MDB2_Schema::factory($dsn, $options);
if ( PEAR::isError( $Schema))return $Schema;

$Result = $Schema->updateDatabase( $Database);
$Result = $Schema->updateDatabase( $Database1);
$Result = $Schema->updateDatabase( $Database2);

I have three variables to define my schema, I divided it by logical modules. I found that the first call to updateDatabase works fine, but the next raise the error. Thus, I merge all my dictionaries runtime to call updateDatabase only one time.

[2006-09-08 01:38 UTC] anderson at tsci dot com dot br

I'm having the same error whith ibase driver, it was working fine with MDB, but I just updated my OS(Fedora 5) with PHP5.1.4-1 and MDB2. At first, the funtion fetchInto() was not working, then i found something saing that it was replaced by fetchRow(), but the error is the same:

"PHP Fatal error: Call to undefined function: MDB2_Driver_ibase::fetchRow(). in /usr/share/pear/MDB2.php on line 1917"

here is my code(the line where the problem is I guess):

$result = $this->db->query($sql);
while ($row = $this->db->fetchRow($result,MDB2_FETCHMODE_ASSOC) ) {

in MDB this line look like this:

$result = $this->db->query($sql);
while ($row = $this->$db->fetchInto(MDB_FETCHMODE_ASSOC,$result)) {

I'm almost rewriting this site from the start...

any ideas?

P.s.: Sorry my english.