You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
I was not able to find an open or closed issue matching what I'm seeing.
This is not a question. (Questions should be asked on chat (Signup here) or our forums.)
Hi, i use a OCI8 (oracle) adapter for an application in Expressive. zend-db and zend-hydrator is installed. I need sometime to use buffer() function to iterate more than one time in the result.
It appear that the first row is doubled in the result when i use buffer(). When i'm not use buffer the result is correct.
I also check with MariaDB database for testing and it works in both case (with and without buffer).
I don't know if that problem are really in zend-hydrator or somewhere else because it happened in my case with oracle only.
PHP 7.1.x / 7.3.x
zendframework/zend-hydrator (3.0.2)
zendframework/zend-db (2.10.0)
OCI8 Version (2.2.0)
Thanks!
Code to reproduce the issue
Just a partial code to see
/* * Test with MariaDB */$sql = sprintf("MariaDB SQL query that retreive 5 records");
$result = $this->mariadbAdapter->createStatement($sql)->execute();
// Hydrating, not totally configured for that test$hydrator = newObjectPropertyHydrator();
$resultSet = newHydratingResultSet($hydrator, newTestEntity());
$resultSet->initialize($result);
$resultSet->buffer(); // With or without the use of buffer, all works like expected/* * Test with Oracle */$sql = sprintf("Oracle SQL query that retreive 5 records");
$result2 = $this->oracleAdapter->createStatement($sql)->execute();
// Hydrating, not totally configured for that test$hydrator2 = newObjectPropertyHydrator();
$resultSet2 = newHydratingResultSet($hydrator2, newTestEntity());
$resultSet2->initialize($result2);
$resultSet2->buffer(); // -> First row is doubled if buffer enabled!!/* In view $resultSet is on $this->mariadbDatas and $resultSet2 on $this->oracleDatas */
<h2>MariaDB Results:</h2>
<!-- MariaDB results -->
<?phpforeach($this->mariadbDatasas$row): ?>
<pre>
<?phpprint_r($row) ?>
</pre>
<?phpendforeach; ?>
<h2>Oracle Results:</h2>
<!-- Oracle results -->
<?phpforeach($this->oracleDatasas$row): ?>
<pre>
<?phpprint_r($row) ?>
</pre>
<?phpendforeach; ?>
Expected results
A
B
C
D
E
Actual results with buffer() // oracle only
A
A <- first line doubled in the results
B
C
D
E
The text was updated successfully, but these errors were encountered:
Hi, i use a OCI8 (oracle) adapter for an application in Expressive. zend-db and zend-hydrator is installed. I need sometime to use buffer() function to iterate more than one time in the result.
It appear that the first row is doubled in the result when i use buffer(). When i'm not use buffer the result is correct.
I also check with MariaDB database for testing and it works in both case (with and without buffer).
I don't know if that problem are really in zend-hydrator or somewhere else because it happened in my case with oracle only.
Thanks!
Code to reproduce the issue
Just a partial code to see
Expected results
A
B
C
D
E
Actual results with buffer() // oracle only
A
A <- first line doubled in the results
B
C
D
E
The text was updated successfully, but these errors were encountered: