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
7101ecd7
Commit
7101ecd7
authored
Nov 03, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work a little bit on the setFetchMode()/traversable patch from damz
parent
f4acc79a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
UPGRADE
UPGRADE
+10
-1
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+8
-4
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+9
-0
No files found.
UPGRADE
View file @
7101ecd7
...
@@ -4,3 +4,12 @@
...
@@ -4,3 +4,12 @@
Both methods now accept an optional last parameter $types with binding types of the values passed.
Both methods now accept an optional last parameter $types with binding types of the values passed.
This can potentially break child classes that have overwritten one of these methods.
This can potentially break child classes that have overwritten one of these methods.
## Doctrine\DBAL\Connection#executeQuery
Doctrine\DBAL\Connection#executeQuery() got a new last parameter "QueryCacheProfile $qcp"
## Doctrine\DBAL\Driver\Statement split
The Driver statement was split into a ResultStatement and the normal statement extending from it.
This seperates the configuration and the retrieval API from a statement.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
7101ecd7
...
@@ -19,7 +19,9 @@
...
@@ -19,7 +19,9 @@
namespace
Doctrine\DBAL\Driver\OCI8
;
namespace
Doctrine\DBAL\Driver\OCI8
;
use
\PDO
;
use
PDO
;
use
IteratorAggregate
;
use
Doctrine\DBAL\Driver\Statement
;
/**
/**
* The OCI8 implementation of the Statement interface.
* The OCI8 implementation of the Statement interface.
...
@@ -27,7 +29,7 @@ use \PDO;
...
@@ -27,7 +29,7 @@ use \PDO;
* @since 2.0
* @since 2.0
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
OCI8Statement
implements
\IteratorAggregate
,
\Doctrine\DBAL\Driver\
Statement
class
OCI8Statement
implements
\IteratorAggregate
,
Statement
{
{
/** Statement handle. */
/** Statement handle. */
protected
$_dbh
;
protected
$_dbh
;
...
@@ -204,8 +206,9 @@ class OCI8Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Stateme
...
@@ -204,8 +206,9 @@ class OCI8Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Stateme
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
fetch
(
$fetchStyle
=
PDO
::
FETCH_BOTH
)
public
function
fetch
(
$fetchStyle
=
null
)
{
{
$fetchStyle
=
$fetchStyle
?:
$this
->
_defaultFetchStyle
;
if
(
!
isset
(
self
::
$fetchStyleMap
[
$fetchStyle
]))
{
if
(
!
isset
(
self
::
$fetchStyleMap
[
$fetchStyle
]))
{
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchStyle
);
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchStyle
);
}
}
...
@@ -216,8 +219,9 @@ class OCI8Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Stateme
...
@@ -216,8 +219,9 @@ class OCI8Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Stateme
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public
function
fetchAll
(
$fetchStyle
=
PDO
::
FETCH_BOTH
)
public
function
fetchAll
(
$fetchStyle
=
null
)
{
{
$fetchStyle
=
$fetchStyle
?:
$this
->
_defaultFetchStyle
;
if
(
!
isset
(
self
::
$fetchStyleMap
[
$fetchStyle
]))
{
if
(
!
isset
(
self
::
$fetchStyleMap
[
$fetchStyle
]))
{
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchStyle
);
throw
new
\InvalidArgumentException
(
"Invalid fetch style: "
.
$fetchStyle
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
7101ecd7
...
@@ -303,4 +303,13 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -303,4 +303,13 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
assertEquals
(
0
,
count
(
$rows
),
"no result should be returned, otherwise SQL injection is possible"
);
$this
->
assertEquals
(
0
,
count
(
$rows
),
"no result should be returned, otherwise SQL injection is possible"
);
}
}
public
function
testSetDefaultFetchMode
()
{
$stmt
=
$this
->
_conn
->
query
(
"SELECT * FROM fetch_table"
);
$stmt
->
setFetchMode
(
\PDO
::
FETCH_NUM
);
$row
=
array_keys
(
$stmt
->
fetch
());
$this
->
assertEquals
(
0
,
count
(
array_filter
(
$row
,
function
(
$v
)
{
return
!
is_numeric
(
$v
);
})),
"should be no non-numerical elements in the result."
);
}
}
}
\ No newline at end of file
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