|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ethernet dot zero at gmail dot com
New email:
PHP Version: OS:


 [2010-05-18 09:14 UTC] ethernet dot zero at gmail dot com
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:

The following patch solves the problem:

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).


Add a Patch

Pull Requests

Add a Pull Request


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]
-Package: oci8 +Package: OCI8 related
 [2017-10-24 07:57 UTC]
-Status: Assigned +Status: Open -Assigned To: sixd +Assigned To:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Dec 07 15:01:27 2023 UTC