Bug #70825 [Csd]: Cannot fetch multiple values with group in ini file
| From: | cmb@php.net | Date: | Thu, 25 Aug 2016 16:51:13 +0000 |
| Subject: | Bug #70825 [Csd]: Cannot fetch multiple values with group in ini file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203549@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70825&edit=1
ID: 70825
Updated by: cmb@php.net
Reported by: gmblar+php at gmail dot com
Summary: Cannot fetch multiple values with group in ini file
Status: Closed
Type: Bug
Package: DBM/DBA related
Operating System: MacOS X 10.11.1
PHP Version: 7.0.0RC6
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2016-08-25 16:50:15] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=84512a117789563a64172115c648944538006a69
Log: Fix #70825: Cannot fetch multiple values with group in ini file
------------------------------------------------------------------------
[2015-10-31 19:26:48] gmblar+php at gmail dot com
Description:
------------
When use compound keys (group, key) with engine inifile, you cannot read multiple values with skip
value -1.
Test script:
---------------
<?php
$handle = dba_open('/tmp/test1.ini', 'n', 'inifile');
dba_insert('foo', 23, $handle);
dba_insert('foo', 42, $handle);
dba_insert('foo', 1337, $handle);
var_dump(dba_fetch('foo', -1, $handle));
var_dump(dba_fetch('foo', -1, $handle));
var_dump(dba_fetch('foo', -1, $handle));
dba_close($handle);
$handle = dba_open('/tmp/test2.ini', 'n', 'inifile');
dba_insert(['foo', 'bar'], 23, $handle);
dba_insert(['foo', 'bar'], 42, $handle);
dba_insert(['foo', 'bar'], 1337, $handle);
var_dump(dba_fetch(['foo', 'bar'], -1, $handle));
var_dump(dba_fetch(['foo', 'bar'], -1, $handle));
var_dump(dba_fetch(['foo', 'bar'], -1, $handle));
dba_close($handle);
$handle = dba_open('/tmp/test3.ini', 'n', 'inifile');
dba_insert('[foo]bar', 23, $handle);
dba_insert('[foo]bar', 42, $handle);
dba_insert('[foo]bar', 1337, $handle);
var_dump(dba_fetch('[foo]bar', -1, $handle));
var_dump(dba_fetch('[foo]bar', -1, $handle));
var_dump(dba_fetch('[foo]bar', -1, $handle));
dba_close($handle);
$handle = dba_open('/tmp/test4.ini', 'n', 'inifile');
dba_insert('[foo]bar', 23, $handle);
dba_insert('[foo]bar', 42, $handle);
dba_insert('[foo]bar', 1337, $handle);
var_dump(dba_fetch('[foo]bar', 0, $handle));
var_dump(dba_fetch('[foo]bar', 1, $handle));
var_dump(dba_fetch('[foo]bar', 2, $handle));
dba_close($handle);
Expected result:
----------------
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
Actual result:
--------------
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
bool(false)
bool(false)
string(2) "23"
bool(false)
bool(false)
string(2) "23"
string(2) "42"
string(4) "1337"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70825&edit=1