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
2c10252b
Commit
2c10252b
authored
Sep 05, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-339] Prevent PDO API failure in setFetchMode()
parent
7a657fa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
Statement.php
lib/Doctrine/DBAL/Statement.php
+6
-0
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+15
-0
No files found.
lib/Doctrine/DBAL/Statement.php
View file @
2c10252b
...
...
@@ -190,6 +190,12 @@ class Statement implements \IteratorAggregate, DriverStatement
public
function
setFetchMode
(
$fetchMode
,
$arg2
=
null
,
$arg3
=
null
)
{
if
(
$arg2
===
null
)
{
return
$this
->
stmt
->
setFetchMode
(
$fetchMode
);
}
else
if
(
$arg3
===
null
)
{
return
$this
->
stmt
->
setFetchMode
(
$fetchMode
,
$arg2
);
}
return
$this
->
stmt
->
setFetchMode
(
$fetchMode
,
$arg2
,
$arg3
);
}
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
2c10252b
...
...
@@ -501,6 +501,21 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
assertFalse
(
$this
->
_conn
->
query
(
'SELECT test_int FROM fetch_table'
)
->
fetchColumn
());
}
/**
* @group DBAL-339
*/
public
function
testSetFetchModeOnDbalStatement
()
{
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
executeQuery
(
$sql
,
array
(
1
,
"foo"
));
$stmt
->
setFetchMode
(
\PDO
::
FETCH_NUM
);
while
(
$row
=
$stmt
->
fetch
())
{
$this
->
assertTrue
(
isset
(
$row
[
0
]));
$this
->
assertTrue
(
isset
(
$row
[
1
]));
}
}
private
function
setupFixture
()
{
$this
->
_conn
->
executeQuery
(
'DELETE FROM fetch_table'
)
->
execute
();
...
...
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