Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
0bbb36ec
Commit
0bbb36ec
authored
Mar 14, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-228] Fix bug with PDO::FETCH_BOTH when passed to Statement#fetchAll() in OCI8
parent
3b5ba65b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+8
-2
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+21
-0
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
0bbb36ec
...
...
@@ -227,8 +227,14 @@ class OCI8Statement implements \IteratorAggregate, Statement
}
$result
=
array
();
if
(
self
::
$fetchStyleMap
[
$fetchStyle
]
===
OCI_BOTH
)
{
while
(
$row
=
$this
->
fetch
(
$fetchStyle
))
{
$result
[]
=
$row
;
}
}
else
{
oci_fetch_all
(
$this
->
_sth
,
$result
,
0
,
-
1
,
self
::
$fetchStyleMap
[
$fetchStyle
]
|
OCI_RETURN_NULLS
|
OCI_FETCHSTATEMENT_BY_ROW
|
OCI_RETURN_LOBS
);
}
return
$result
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
0bbb36ec
...
...
@@ -83,6 +83,27 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
assertEquals
(
array
(
'test_int'
=>
1
,
'test_string'
=>
'foo'
),
$rows
[
0
]);
}
/**
* @group DBAL-228
*/
public
function
testPrepareWithFetchAllBoth
()
{
$paramInt
=
1
;
$paramStr
=
'foo'
;
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
bindParam
(
1
,
$paramInt
);
$stmt
->
bindParam
(
2
,
$paramStr
);
$stmt
->
execute
();
$rows
=
$stmt
->
fetchAll
(
\PDO
::
FETCH_BOTH
);
$rows
[
0
]
=
array_change_key_case
(
$rows
[
0
],
\CASE_LOWER
);
$this
->
assertEquals
(
array
(
'test_int'
=>
1
,
'test_string'
=>
'foo'
,
0
=>
1
,
1
=>
'foo'
),
$rows
[
0
]);
}
public
function
testPrepareWithFetchColumn
()
{
$paramInt
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment