php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57082 Improve error meesage in SDO_DAS_Relational_DatabaseHelper:executeStatement
Submitted: 2006-06-12 15:54 UTC Modified: 2006-10-30 06:34 UTC
From: simonslaws at googlemail dot com Assigned: slaws (profile)
Status: Closed Package: SCA_SDO (PECL)
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
 [2006-06-12 15:54 UTC] simonslaws at googlemail dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-09 07:14 UTC] simonslaws at googlemail dot com
Fixed in 1.0.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC