ID:               13549
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         Documentation problem
 Operating System: Windows 2000
 PHP Version:      4.2.2
 New Comment:

My last paragraph of the previous comment says it all. What needs to be
done is to go through all functions like mysql_fetch_row that all PHP
database API support and include that comment regarding how to
determine if a column contains a NULL, using proper English.


Previous Comments:
------------------------------------------------------------------------

[2002-08-17 23:50:15] [EMAIL PROTECTED]

Stop.  Pay attention to the "bug" you are reporting and read what has
been said.  If you feel that the documentation covering the MSSQL
module is lacking, please add to this "bug" report what you feel is
sufficent.  

And yes the "bug" is invalid in the current code.  I really don't care
about the past versions.  The only thing I implied is that your
assumption that the two are similar is a false belief.  While they may
be similiar now (or were), it does not stand to reason that they will
stay that way.  

------------------------------------------------------------------------

[2002-08-17 17:19:13] [EMAIL PROTECTED]

I checked the latest version of PHP (4.2.2) and the bug is indeed gone.
Since it really existed and I just reconfirmed in PHP 4.0.6 it was not
bogus as you claimed. Also the fixed behaviour of mssql_fetch_row is
the same as mysql_fetch_row, unlike you implied that it would be
independent.

Anyway, the lack of documentation of how NULL values are returned in
*sql_fetch_row functions is still lacking.

I am reopening this report so anybody with time and patience goes
through all PHP database API functions that fetch query result rows
like mssql_fetch_row, mysql_fetch_row, etc... be clear that columns
with NULL are returned as undefined.

------------------------------------------------------------------------

[2002-08-14 21:52:17] [EMAIL PROTECTED]

MSSQL may have been based upont the MySQL functionality, but it is now
it's on beast.  To continue thinking along the lines that the two are
similiar is just a bad idea.  

The code in question by you is this:
if (Z_TYPE(result->data[result->cur_row][i]) != IS_NULL) {
/* ... snip ... */
}
else
{
    if (result_type & MSSQL_NUM)
         add_index_null(return_value, i);
    if (result_type & MSSQL_ASSOC)
         add_assoc_null(return_value, 
            result->fields[i].name);
}

As you can see, the behavior is checked based upon the IS_NULL value. 
When it is decided that there is a NULL value returned, it is further
checked against the two other types.  The first of which sets an
add_index_null to the return_value, based upon the value of 'i'.  'i'
is an integer, thus it will always have a value, at the least of zero.

That being said, if you still feel this should be more properly
documented I welcome you to write that section of, paste it into this
bug report, and reopen it.  

As it stands this isn't a bug, thus it shouldn't be in the bug
database, and I again state: If you need help please ask on the
php-general mailing list, but the bug database is not the place for
support questions.    

------------------------------------------------------------------------

[2002-08-14 21:30:39] [EMAIL PROTECTED]

There is no personal issue here. Assuming that this bug report  was was
a support request just showed that you did not pay much attention to
what was reported. Pay attention and test what reported as broken is
what you should have done as your homework.

The issue here is that MS SQL API was modeled after MySQL API a long
time ago in the PHP 3 days. By then there was no boolean type in PHP.
As far as I can recall this function was not return anything then for
NULL columns, just like in MySQL API which does not document this
behaviour.

This problem was spotted by running regression tests that succeed in
MySQL but not in MSSQL. That is why I assumed it can only be a bug,
especially because it could never have returned a boolean value when it
was working as expected.

Setting straight the behaviour of a function that is not completely
documented is not breaking compatibility. Making it work consistently
with the way it was originally based on, is the right way to solve the
issue.

------------------------------------------------------------------------

[2002-08-14 09:29:21] [EMAIL PROTECTED]

Seeing as this bug was submitted against PHP 4.0.6, and that we are now
at 4.2.2 (a long ways) this is now to be considered a feature thanks to
backwards compatibility.  

I haven't seen any other complaints about this functionality, nor have
I heard any.  A quick search on google reveals no complaints either.  I
did do my homework Mr. Lemos, so please don't turn this into a personal
issue.  

If you believe that this should be documented, so be it.  Write up the
bit of documentation that you believe is required, and post it inside
this bug.  

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/13549

-- 
Edit this bug report at http://bugs.php.net/?id=13549&edit=1


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to