|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: simonslaws at googlemail dot com
New email:
PHP Version: OS:


 [2006-06-12 15:54 UTC] simonslaws at googlemail dot com
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

$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-09 07:14 UTC] simonslaws at googlemail dot com
Fixed in 1.0.3
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 15:04:44 2023 UTC