Req #52302 [Csd]: mysqli_fetch_all does not work with MYSQLI_USE_RESULT
| From: | andrey@php.net | Date: | Wed, 11 Aug 2010 08:01:48 +0000 |
| Subject: | Req #52302 [Csd]: mysqli_fetch_all does not work with MYSQLI_USE_RESULT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-153323@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52302&edit=1
ID: 52302
Updated by: andrey@php.net
Reported by: brianlmoon@php.net
Summary: mysqli_fetch_all does not work with
MYSQLI_USE_RESULT
Status: Closed
Type: Feature/Change Request
Package: MySQLi related
Operating System: Linux
PHP Version: 5.3.2
-Assigned To: mysql
+Assigned To: andrey
Block user comment: N
New Comment:
USE_RESULT will work, as of 5.3.4 (already in svn). E_WARNING or
E_NOTICE?
I mean, it is good for consistency to have it work for both. Sometimes
you might get a result set, as a parameter, and don't know where it came
from, you should not fail because it was unbuffered. Thus, E_WARNING is
a bit too much, IMO, but maybe E_NOTICE...
Previous Comments:
------------------------------------------------------------------------
[2010-08-10 01:43:49] brianlmoon@php.net
Can we get an E_WARNING when fetch_all is called with a result handle
that is using USE_RESULT? Can the documentation be updated to include a
notice that this will not work?
------------------------------------------------------------------------
[2010-08-09 19:37:18] andrey@php.net
Fix will appear in 5.3.4
In any case, it is sub-optimal to use MYSQLI_USE_RESULT with fetch_all,
compared to MYSQLI_STORE_RESULT. However, fetch_all with USE_RESULT
should be faster than manually looping.
------------------------------------------------------------------------
[2010-08-09 19:29:32] andrey@php.net
Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&revision=302045
Log: Fix Request #52302 mysqli_fetch_all does not work with
MYSQLI_USE_RESULT
------------------------------------------------------------------------
[2010-08-05 14:11:27] johannes@php.net
The key point here is that the stored buffer can directly be used for
fetch_all. The fetch_all does nothing but increasing the ref counts on
the buffered values and adding them to an array. doing this with
USE_RESULT would do an implicit STORE_RESULT.
Marking this a Feature request.
------------------------------------------------------------------------
[2010-07-16 17:42:59] brianlmoon@php.net
No, it makes perfect sense. In fact, it should be the preferred way to
use fetch_all. Why store the data only to dump it into a PHP array on
the next line? That is a very inefficient use of memory and plain
careless development.
Or do you mean to say that fetch_all is fundamentally broken and will
only work with STORE_RESULT?
------------------------------------------------------------------------
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/bug.php?id=52302
--
Edit this bug report at http://bugs.php.net/bug.php?id=52302&edit=1