Author: Frederik Holljen
Date: 2006-01-16 11:45:43 +0100 (Mon, 16 Jan 2006)
New Revision: 1913
Log:
- Fix for MySQL 5, and iterator tests failing because of PDOException being
thrown when executing a fetch()
Modified:
packages/PersistentObject/trunk/src/find_iterator.php
Modified: packages/PersistentObject/trunk/src/find_iterator.php
===================================================================
--- packages/PersistentObject/trunk/src/find_iterator.php 2006-01-16
10:43:31 UTC (rev 1912)
+++ packages/PersistentObject/trunk/src/find_iterator.php 2006-01-16
10:45:43 UTC (rev 1913)
@@ -108,7 +108,17 @@
*/
public function next()
{
- $row = $this->stmt->fetch( PDO::FETCH_ASSOC );
+ $row = false;
+ try
+ {
+ $row = $this->stmt->fetch( PDO::FETCH_ASSOC );
+ }
+ catch( PDOException $e ) // MySQL 5.0 throws this if the statement is
not executed.
+ {
+ $this->object = null;
+ return;
+ }
+
if( $row !== false )
{
if( $this->object == null ) // no object yet
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components