|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58082 Prepare error on sql with DATETIME construct
Submitted: 2008-03-05 09:29 UTC Modified: 2009-03-03 04:10 UTC
From: eromero at sitrack dot com Assigned:
Status: Closed Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.1 OS: LINUX
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: eromero at sitrack dot com
New email:
PHP Version: OS:


 [2008-03-05 09:29 UTC] eromero at sitrack dot com
I get an error when trying to execute an SQL with an DATETIME constructor:

select DATETIME (00:00) HOUR TO MINUTE from test

This equal SQL works perfectly on SQL EDITOR (informix).

Reproduce code:
print "connecting \n";

catch (PDOException $e)
echo 'Error message: ' . $e->getMessage();
$db->exec("create table test (fechaid serial not null,fecha datetime year to second,text CHAR(50),primary key (fechaid))");
insert into test VALUES (0,'2008-03-05 00:00:00','text one');
insert into test VALUES (0,'2008-03-05 00:00:10','text two');
insert into test VALUES (0,'2008-03-05 00:05:02','text three');");
$db->query("select DATETIME (00:00) HOUR TO MINUTE from test");

Expected result:
array(3) {
  string(5) "00000"
  string(24) " ((null)[0] at (null):0)"

Actual result:
array(3) {
  string(5) "42000"
  string(158) "[Informix][Informix ODBC Driver][Informix]A syntax error has occurred. (SQLPrepare[4294967095] at /tmp/pear/download/PDO_INFORMIX-1.1.0/informix_driver.c:131)"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-03 04:10 UTC] abhargav at in dot ibm dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

Defect is fixed in 1.2.6 version.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 01:01:27 2023 UTC