php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57561 Valid insert query results in an error
Submitted: 2007-03-06 08:46 UTC Modified: 2021-08-11 14:51 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: vlads at krediidiinfo dot ee Assigned:
Status: Open Package: PDO_INFORMIX (PECL)
PHP Version: 5.2.1 OS: SUSE Linux 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vlads at krediidiinfo dot ee
New email:
PHP Version: OS:

 

 [2007-03-06 08:46 UTC] vlads at krediidiinfo dot ee
Description:
------------
Trying to insert a date into a table using TO_DATE function returns an error if attribute PDO::ATTR_ORACLE_NULLS is set to PDO::NULL_TO_STRING and no rows are inserted. 
If this attribute is not set, no error is returned and no rows are inserted also.

Reproduce code:
---------------
/*
create table test_pdo
(
name char(10) not null,
some_d date not null
)
*/

$ifx = new PDO('informix:host=db.kisise;service=1526;database=krediit;server=db_krediit;protocol=onsoctcp; EnableScrollableCursors=0','someuser','somepass');
$ifx->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING);

$istmt = $ifx->prepare('insert into test_pdo (name, some_d) values(:n, TO_DATE(:d,"%d.%m.%Y"))');
$istmt->execute(array('n' => 'test', 'd' => '02.02.2002'));


Expected result:
----------------
The row is inserted into a table

Actual result:
--------------
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[]: <<Unknown error>>: 0  (SQLExecute[0] at /root/php/PDO_INFORMIX-1.1.0/informix_statement.c:720)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-10 11:31 UTC] swepatel at us dot ibm dot com
Are you still facing an issue with this? Please let us know.
 [2007-12-11 04:20 UTC] vlads at krediidiinfo dot ee
yes, we are still facing an issue with this.
 [2007-12-12 15:18 UTC] opendev at us dot ibm dot com
Someone on our development team is investigating this issue and should have an update or fix soon.

I apologize for the delay.

Thanks.
 [2008-02-05 05:34 UTC] matthias dot djihangiroff at persona dot de
The error went away if only one parameter ist given to the prepare statement.

Ive facing this issue with the PDO-INFORMIX Version 1.1.0
In version 1.0.0 all is running fine.
 [2008-03-11 11:55 UTC] opendev at us dot ibm dot com
An internal defect is opened to track this problem.
 [2021-08-11 14:51 UTC] cmb@php.net
> An internal defect is opened to track this problem.

Great!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 22:01:28 2024 UTC