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
dc0f9c8b
Commit
dc0f9c8b
authored
May 05, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-257] Fix fetchColumn() on empty result for OCI8 to return false
parent
1f188109
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+1
-1
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+10
-0
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
dc0f9c8b
...
...
@@ -255,7 +255,7 @@ class OCI8Statement implements \IteratorAggregate, Statement
public
function
fetchColumn
(
$columnIndex
=
0
)
{
$row
=
oci_fetch_array
(
$this
->
_sth
,
OCI_NUM
|
OCI_RETURN_NULLS
|
OCI_RETURN_LOBS
);
return
$row
[
$columnIndex
]
;
return
isset
(
$row
[
$columnIndex
])
?
$row
[
$columnIndex
]
:
false
;
}
/**
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
dc0f9c8b
...
...
@@ -491,6 +491,16 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
assertStringStartsWith
(
'2010-01-01 10:10:10'
,
$results
[
0
]
->
test_datetime
);
}
/**
* @group DBAL-257
*/
public
function
testEmptyFetchColumnReturnsFalse
()
{
$this
->
_conn
->
executeQuery
(
'DELETE FROM fetch_table'
)
->
execute
();
$this
->
assertFalse
(
$this
->
_conn
->
fetchColumn
(
'SELECT test_int FROM fetch_table'
));
$this
->
assertFalse
(
$this
->
_conn
->
query
(
'SELECT test_int FROM fetch_table'
)
->
fetchColumn
());
}
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