ID: 44270
Updated by: uw@php.net
Reported By: stein at visibone dot com
Status: Assigned
Bug Type: MySQLi related
Operating System: Win2K
PHP Version: 5.2.5
Assigned To: andrey
New Comment:
The more I think about it, the better I like NULL. NULL will be used on
the C-level, under the hood. false gets used in ext/mysql. And both NULL
and false have a different meaning than empty string. An empty string
means that there is some information - even if the string is empty. NULL
means that no information is available.
In any case the procedural and OO interface should return the same
value. Comments?
I don't mind the PHP manual much as its a very minor change which most
people will not notice as NULL == '' is true.
Previous Comments:
------------------------------------------------------------------------
[2008-07-15 16:06:20] uw@php.net
... and of course: free to fix for whoever comes first
------------------------------------------------------------------------
[2008-07-15 16:05:27] uw@php.net
Bug - I'll modify mysqi_info.phpt to cover this detail.
------------------------------------------------------------------------
[2008-03-04 15:11:21] uwendel at mysql dot com
Interesting question and good point. In real life only few people might
notice the difference and cast the return value to string, but good
question...
Please don't commit the change. I wonder if there are more such tiny
differences. For example, I wonder if my mysqli_info.phpt test is
correct. Let me check in more detail first before we change anything.
Ulf
------------------------------------------------------------------------
[2008-03-04 13:45:07] felipe@php.net
Hi Johannes/Ulf
Whereas the documentation says "empty string" for each string property,
i guess that could be modified the macro responsible for that.
http://felipe.ath.cx/diff/bug44270.diff
What do you think? :)
------------------------------------------------------------------------
[2008-02-27 17:55:22] stein at visibone dot com
Description:
------------
$mysqli->info is NULL instead of empty string for "not supported
situations" (i.e. queries other than multi-row INSERT, LOAD, ALTER,
UPDATE) The procedural mysqli_info() does return the empty string, as
documented.
Reproduce code:
---------------
Query: 'INSERT INTO t (id) VALUES (1),(2),(3)'
mysqli_info(): 'Records: 3 Duplicates: 0 Warnings: 0'
$mysqli->info: 'Records: 3 Duplicates: 0 Warnings: 0'
Query: 'INSERT INTO t (id) VALUES (9)'
mysqli_info(): ''
$mysqli->info: NULL
Expected result:
----------------
(see above)
Actual result:
--------------
the object oriented property $mysqli->info should be the empty string
after "not supported situations", e.g. a single-row insert.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44270&edit=1