php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59220 Binding a NULL value to a numeric column with a foreign key constraint fails
Submitted: 2010-05-18 09:14 UTC Modified: 2017-10-24 07:57 UTC
From: ethernet dot zero at gmail dot com Assigned:
Status: Open Package: OCI8 related
PHP Version: 5.3.1 OS: Debian GNU/Linux 5.04 "Lenny"
Private report: No CVE-ID: None
 [2010-05-18 09:14 UTC] ethernet dot zero at gmail dot com
Description:
------------
When using oci_bind_by_name to set the value of a field which has a foreign key constraint, the statement fails with a ORA-02291 error (foreign key constraint violation) if the field is of a numeric type and the parameter is given a NULL value.

Reproduce code:
---------------
Steps to reproduce: http://pastie.org/965413

The following patch solves the problem: http://pastie.org/965425

Expected result:
----------------
The field should be given a NULL value without violating the foreign key constraint.

Actual result:
--------------
The statement fails with a ORA-02291 error (integrity constraint ([constraint name]) violated - parent key not found).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-09 12:52 UTC] christopher dot jones at oracle dot com
The suggested patch breaks a bunch of other functionality.
 [2010-06-10 04:28 UTC] ethernet dot zero at gmail dot com
How is that so? The only thing the patch does is convert to long only non-NULL bound values.

Not that I'm getting defensive or anything, of course. I really would love to know if the patched driver, which we are using right now without any issues at all so far, is going to crash and burn when we least expect it. :-)
 [2011-11-09 23:46 UTC] sixd@php.net
-Package: oci8 +Package: OCI8 related
 [2017-10-24 07:57 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: sixd +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 07 11:01:28 2024 UTC