#009031: PersistentObject in-memory cache code causes warnings

Description:

In lib/ezdb/classes/ezmysqldb.php:


if ( stristr( $sql, "update" ) )
{
    $queryParts = preg_match( "/(update[\s]*)(low_priority[\s*])?(ignore[\s*])?([\s\w,]*)([\s]set[\s].*)/",
                                                  strtolower( $sql ),
                                                  $matches );
    foreach( explode( ",", $matches[4] ) as $tableName )
    {
                            eZPersistentObject::clearObjectCache( $tableName );
    }

stristr and the regular expression will will also match any field values of a SQL INSERT query (e.g. the default subtree notification mails that mention the word "update"), and then there will be a warning:

Warning: (PHP)
Undefined offset:  4 in /srv/ezpublish/sites/projects/lib/ezdb/classes/ezmysqldb.php on line 485

The same counts for the detection of insert and delete queries.


Environment:

Version: trunk (pre 3.9alpha1)
PHP Version:
Webserver:
Database:


- Attachments

No attachments for this issue.


- Comments

Thanks for the bug report.

#249720 by Kåre Køhler Høvik on September 19th, 2006 [Permanent Link]

Fixed in trunk
rev. 16913

#249721 by Kåre Køhler Høvik on September 27th, 2006 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Misc
Affects Unknown
Fix Version -
Reporter Kristof Coomans
Responsible Kåre Køhler Høvik
Status 0 Closed
Resolution Fixed
Created September 19th, 2006
Updated September 27th, 2006
Resolved September 27th, 2006
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #019127
  DB Deadlocks on ezcontentobject_tree when updating subnode