#44270 [Opn->Asn]: $mysqli->info is NULL, not an empty string, for "not supported situations"

From: Date: Wed, 02 Apr 2008 10:22:26 +0000
Subject: #44270 [Opn->Asn]: $mysqli->info is NULL, not an empty string, for "not supported situations"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123861@lists.php.net to get a copy of this message
ID: 44270 Updated by: jani@php.net Reported By: stein at visibone dot com -Status: Open +Status: Assigned Bug Type: MySQLi related Operating System: Win2K PHP Version: 5.2.5 Assigned To: andrey Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#123861) next »