|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
44 - 22 = ?
Subscribe to this entry?

 [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: Tue Dec 05 10:01:26 2023 UTC