Doc #19303 [Opn]: Using an indexed type array with assoc or object fetch doesn't set types
| From: | danielc at analysisandsolutions dot com | Date: | Thu, 25 Oct 2012 20:31:12 +0000 |
| Subject: | Doc #19303 [Opn]: Using an indexed type array with assoc or object fetch doesn't set types | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-9239@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19303&edit=1
ID: 19303
Updated by: danielc@analysisandsolutions.com
Reported By: mike at silverorange dot com
Summary: Using an indexed type array with assoc or object
fetch doesn't set types
Status: Open
Type: Documentation Problem
Package: MDB2
Operating System: Irrelevant
Package Version: SVN
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
Hi Mike:
Ugh. So this is a BC break from 2.4.x. This is definitely needs
documentation, particularly in the release notes.
While passing an enum array of types worked in some cases in 2.4.x,
there are some cases it did not. See bug #9502 and bug #18203.
Here's some history of the code in question:
Original code in 2.4.x: r234892
http://svn.php.net/viewvc?view=revision&revision=308955
all quippo
http://svn.php.net/viewvc?view=revision&revision=321210
mdb2 me
http://svn.php.net/viewvc?view=revision&revision=321234
mdb2 me
http://svn.php.net/viewvc?view=revision&revision=322953
all gauthierm
http://svn.php.net/viewvc?view=revision&revision=328145
drivers me
A patch that passes all of the unit tests is always welcome,
particularly those in tests/Standard/UsageTest.php
tests/Standard/BugsTest.php.
Previous Comments:
------------------------------------------------------------------------
[2012-10-25 11:19:05] gauthierm
What doesn't work in the patch? In MDB2 2.4.x, enumerated arrays of
types worked
with assoc and object fetch methods.
------------------------------------------------------------------------
[2012-10-25 02:21:15] danielc
-Type: Bug
+Type: Documentation Problem
This is by design.
The code in the each driver's fetchRow() method and in
MDB2_Result_Common::setResultTypes() are explicitly constructed to have
enumerated arrays of types go with enumerated arrays of results and have
associative arrays of types go with associative and object results.
That aside, a modified version of the provided patch doesn't work for
me.
I added some tests in commit r328136. The unsupported variations are
commented out.
The documentation could (well, should) be better about explaining this,
so I'll convert it to a documentation ticket.
------------------------------------------------------------------------
[2012-02-23 19:57:46] gauthierm
Added #patch
bug:19303;patch:MDB2-indexed-types-assoc-fetch;revision:1330027066;.
------------------------------------------------------------------------
[2012-02-23 18:37:24] gauthierm
Added #patch
bug:19303;patch:MDB2-indexed-types-assoc-fetch;revision:1330022244;.
------------------------------------------------------------------------
[2012-02-23 18:35:55] gauthierm
Description:
------------
Using an indexed type array with assoc or object fetch doesn't set
types. The
returned results are all strings rather than the specified types.
Using an associative types array works correctly.
The attached patch fixes the issue in SVN trunk
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19303&edit=1