|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58043 Bad Error Info
Submitted: 2008-02-13 12:59 UTC Modified: 2008-04-01 07:50 UTC
From: eromero at sitrack dot com Assigned:
Status: Closed Package: PDO_INFORMIX (PECL)
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2008-02-13 12:59 UTC] eromero at sitrack dot com
Trying to insert a reg with an existent index get an wrong error with NO error code (errorcode=null) and the next description:
: (SQLExecute[0] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_statement.c:720) 

This work perfectly in Windows.

Reproduce code:
execute an insert in pdo with an existent key as the value of the index.

$pdo->query("INSERT INTO table (tableid,tablename) VALUES (2,'somename'");

Where tableid=2 already exists.

Expected result:
DESCRIPTION:[Informix][Informix ODBC Driver][Informix]Missing key in referenced table for referential constraint (root.r175_955). (SQLExecute[-691] at ..\pecl\pdo_informix\informix_statement.c:725)

Actual result:
DESCRIPTION:(SQLExecute[0] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_statement.c:720)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-04 06:12 UTC] eromero at sitrack dot com
Additional info to reproduce:


$connection = new PDO("; service=turbo; database=database; server=infserver; protocol=onsoctcp; EnableScrollableCursors=1; Client_Locale=en_US.819;Db_Locale=en_US.819","user","password");

$result = $connection->query("INSERT INTO data (dataid,datatime) VALUES (1,'2008-02-29 12:30:54')");
// The sql executes ok
// the query returns the result object
$result = $connection->query("INSERT INTO data (dataid,datatime) VALUES (1,'2008-02-29 12:30:54')");
// Returns false
$errorinfo = $connection->errorInfo();
echo "<pre>";
echo "</pre>";
// It returns a null error code and the description:
// array(3) {
//  [0]=>
//  string(0) ""
//  [1]=>
//  int(0)
//  [2]=>
//  string(82) " (SQLExecute[0] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_statement.c:720)"

This issue is only present in LINUX, I test it on a windows machine and the error message is:
[Informix][Dynamic Server 2000][database] SQL Error (-268) : Unique constraint (root.u353_571) violated. [ ISAM error -100 : ISAM error:  duplicate value for a record with unique key. ]

I'm sorry I paste the wrong error description in the Expected result.

Hope this help a bit.
 [2008-04-01 07:50 UTC] eromero at sitrack dot com
The problem was solved with version 1.2.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 02:01:29 2024 UTC