|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 00:00:01 2025 UTC |
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.