php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36421 Empty fields are retrieved by odbc_result on joins
Submitted: 2006-02-16 18:41 UTC Modified: 2006-04-19 01:00 UTC
From: michael dot rachow at gmail dot com Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 4.4.2 OS: XP Pro
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: michael dot rachow at gmail dot com
New email:
PHP Version: OS:

 

 [2006-02-16 18:41 UTC] michael dot rachow at gmail dot com
Description:
------------
Two tables A and B.
A is left joined to B on one integer column.
For all records where joined column of table A contains a null value all fields of the record in resultset are empty. The resultset usually containes more than one record.

The records are retrieved by
odbc_result.

This is observed only on SQL Server 2005 Express.
Checked with PHP 4.4.2 and 4.4.1

I have the original Windows build of PHP 4.4.2

Reproduce code:
---------------
Table A
 cint integer
 cstr char
 ...

Table B
 cint integer
 cstr char
 ...

... A left join B on A.cint = B.cint ...

Expected result:
----------------
If A.cint is null only B.cstr should be empty.


Actual result:
--------------
All selected fields A.cint, A.cstr, B.cint, B.cstr are empty when retrieving them with odbc_result.
When A.cint cotains an integer where a record with A.cint = B.cint exists all data are retrieved.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-16 18:56 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-02-17 16:17 UTC] michael dot rachow at gmail dot com
I have created a script that have to be configured with database connection info but will then create and fill all needed tables.
The described behaviour can be observed when running against SQL Server 2005 Express.
http://www.proficar.de/download/IQXpert/join2005.pehpe
 [2006-04-11 17:21 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-04-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC