php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eromero at sitrack dot com
New email:
PHP Version: OS:

 

 [2008-02-13 12:59 UTC] eromero at sitrack dot com
Description:
------------
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.

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

Where tableid=2 already exists.

Expected result:
----------------
ERRORCODE:23000
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:
--------------
ERRORCODE: null
DESCRIPTION:(SQLExecute[0] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_statement.c:720)

Patches

Pull Requests

History

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

<?php

$connection = new PDO("informix:host=xxx.xxx.xxx.xxx; 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>";
var_dump($errorinfo);
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: Thu Oct 03 17:01:26 2024 UTC