|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-09 07:14 UTC] simonslaws at googlemail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ The error message reported if an executed statement fails allways suggests that the failure may have occured due to concurrent updates. This is missleading as many errors can cause the return count/return status to be zero Reproduce code: --------------- The code can be found in SDO/DAS/Relational/DatabaseHelper.php $pdo_stmt->execute($value_list); $rows_affected = $pdo_stmt->rowCount(); if ($rows_affected != 1) { $pdo_error_info = $pdo_stmt->errorInfo(); $msg = "\nSDO/DAS/Relational.php::applyChanges encountered an error when attempting to execute $stmt"; if ($rows_affected == 0) { $msg .= "\nPDO reported no rows affected by the SQL statement."; $msg .= "\nThis may happen if the data that was retrieved and updated has been changed by another processs in the database in the meantime."; } Expected result: ---------------- If the rows affected == 0 this may just be because some other SQL error has occured. This message leads you off looking for concurrency problems. The issue here is that the collision detection algorithm uses a "where" clause that returns $rows_affected == 0 if data on the database doesn't match data in an update. We should check that there are no SQLSTATE error s before writing this string Actual result: -------------- The error message as described