Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #16508 mdb2-2.5.0b1 not working with PHP 5.3.0
Submitted: 2009-08-10 20:45 UTC
From: wkaiser Assigned: quipo
Status: Closed Package: MDB2 (version 2.5.0b2)
PHP Version: 5.3.0 OS: Solaris 10 SPARC
Roadmaps: 2.5.0b4    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 - 29 = ?

 
 [2009-08-10 20:45 UTC] wkaiser (Wulf Kaiser)
Description: ------------ Hi, mdb2-2.5.0b1 beta does not seem to work with PHP 5.3.0: [Mon Aug 10 14:57:17 2009] [error] [client 1.2.3.4] PHP Deprecated: Assigning the return value of new by reference is deprecated in /local/lib/php/MDB2.php on line 2613 Is there any way to fix this? It's working perfectly well with 5.2.9. Best, - Wulf Kaiser

Comments

 [2009-08-18 20:01 UTC] rix0r (Rico Huijbers)
The following patch has been added/updated: Patch Name: mdb2-no-assign-ref Revision: 1250607693 URL: http://pear.php.net/bugs/patch-display.php?bug=16508&patch=mdb2-no-assign-ref&revision=1250607693&display=1
 [2009-08-18 20:02 UTC] rix0r (Rico Huijbers)
The above patch fixes the issue mentioned for MDB2 2.4.1 and the MySQL driver.
 [2009-08-18 21:59 UTC] rix0r (Rico Huijbers)
The following patch has been added/updated: Patch Name: mdb2-no-assign-ref Revision: 1250614752 URL: http://pear.php.net/bugs/patch-display.php?bug=16508&patch=mdb2-no-assign-ref&revision=1250614752&display=1
 [2009-08-18 22:00 UTC] rix0r (Rico Huijbers)
The second version of the patch also fixed a nasty aliasing bug wrt. the result source in a result object, which caused the library to fail in PHP 5.3.
 [2009-08-27 15:02 UTC] wkaiser (Wulf Kaiser)
Hi, thanks for the help so far. I started by upgrading both mdb2-2.5.0b1 and mdb2_driver_mysql-1.5.0b1 to "..b2"; then i applied the patch posted here (e. g. i changed the marked lines in mysql.php and mdb2.php). But that did not help - the application using it (unattended) still raises the error(s): 2009-08-25 10:23:40: 8192 : Assigning the return value of new by reference is deprecated in /local/lib/php/MDB2/Driver/mysql.php on line 1409
 [2009-08-27 15:10 UTC] wkaiser (Wulf Kaiser)
As additional information from the 'unattended' system logs: BACKTRACE: [0] in function MDB2::loadClass in /local/lib/php/MDB2.php on line 333 BACKTRACE: [1] in function MDB2::loadClass in /local/lib/php/MDB2.php on line 388 BACKTRACE: [2] in function MDB2::factory in /local/lib/php/MDB2.php on line 436 - Wulf Kaiser
 [2009-08-27 15:37 UTC] cweiske (Christian Weiske)
1) assign-by-ref deprecated is no error per se, it's a warning. It is required for php4 compatibility. 2) it should not cause any errors, except of course the double-usage of $result that's fixed by using $result_resource. wkaiser: Does the patch make the application itself work again - apart from the deprecation warning?
 [2009-09-14 19:13 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Feedback
 [2009-11-03 08:47 UTC] jeffwhansen (Jeff Hansen)
I am having problems with 5.3 on MDB2 as well. In my case, the queries for update / insert that are not autoPrepared correctly. The array of field values does not appear to properly imploded into a string, result in mysql query that has all literal '?' in the field values rather than the data in the array. $res = $this->dbg->autoExecute($thisTable, $fields_values, MDB2_AUTOQUERY_INSERT); Resulting query is: INSERT INTO customers (`id`, `fname`, `lname`) VALUES (?, ?, ?); That query is what is actually ran by mysql. $fields_values is an associative array with $field => $value <b>Standard Message:</b> MDB2 Error: unknown error<br /><b>Standard Code:</b> -1<br /><b>DBMS/Debug Message:</b> _execute: [Error message: Unable to execute statement] I am running on on OSX 10.6 (Snow Leopard). This code has not changed in ages and works in 5.2.x
 [2009-11-20 02:59 UTC] fuhrysteve (Stephen J. Fuhry)
Got the later patch in production here on PHP 5.3. Have not experienced any problems.
 [2009-12-28 03:38 UTC] quipo (Lorenzo Alberton)
-Assigned To: +Assigned To: quipo
Thanks, I committed the patch to SVN, and tested the code with PHP 5.3. @jeffwhansen: can you post a full test case for your issue? Thanks
 [2010-01-26 18:15 UTC] alec (Aleksander Machniak)
PHP-5.3 + mysqli driver also was requested by Roundcube users. http://trac.roundcube.net/ticket/1486279
 [2010-03-02 15:38 UTC] doconnor (Daniel O'Connor)
-Status: Feedback +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Marking as fixed as per Lorenzo's comments
 [2010-05-21 20:57 UTC] dobedani (Steven Hoek)
Hi there! I'm new to PHP but not new to scripting. In the past weeks I have migrated a web app based on MySQL to one based on Oracle. I also introduced MDB2. On my own Windows XP machine, things were working well. PHP version there is: 5.2.13.13 ;-) I got into trouble when I moved to the server - running Windows 2003 Server. When I deployed my app there, I was getting Deprecated warnings. PHP version there is 5.3.0 :-( To get rid of the warnings, I replaced '=&' with '=' on lines 390, 1885, 2572, 2595 and 2940. I understood that that was what the patch was about. However, afterwards fetchRow was only returning empty rows! For the mean time, I'm using HTML begin and end comment tags to stop those warning from appearing on my webpages. I don't know how to suppress them in another way. My php-error log is filling up though and I'll need a better solution. However, it appears to me that the patch is causing many more problems than it is solving. HTH Kind regards, Steven aka Dobedani
 [2010-08-25 01:38 UTC] slane00 (Steve Lane)
Unfortunately, I am still getting this problem with: MDB2 2.5.0b2 beta MDB2_Driver_mysql 1.5.0b2 beta Changing all =& to = in MDB2.php removes the error, but it may be the wrong thing to do. PHP 5.3.2, Apache 2, Mac OS 10.6.4.
 [2010-08-29 16:45 UTC] quipo (Lorenzo Alberton)
MDB2 2.5.0b3 beta released.
 [2011-12-20 09:40 UTC] danielc (Daniel Convissor)
Note, these changes had side effects (bug #16508, bug #18978, and bug #19148). Those problems have now been addressed.