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
b0f25245
Commit
b0f25245
authored
Jan 01, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-80 - Bugfix in Connection::_bindTypedValues().
parent
b4dad07a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
Connection.php
lib/Doctrine/DBAL/Connection.php
+1
-1
WriteTest.php
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
+13
-0
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
b0f25245
...
...
@@ -1007,7 +1007,7 @@ class Connection implements DriverConnection
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if
(
is_int
(
key
(
$params
)))
{
// Positional parameters
$typeOffset
=
isset
(
$types
[
0
]
)
?
-
1
:
0
;
$typeOffset
=
array_key_exists
(
0
,
$types
)
?
-
1
:
0
;
$bindIndex
=
1
;
foreach
(
$params
as
$position
=>
$value
)
{
$typeIndex
=
$bindIndex
+
$typeOffset
;
...
...
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
View file @
b0f25245
...
...
@@ -2,6 +2,7 @@
namespace
Doctrine\Tests\DBAL\Functional
;
use
Doctrine\DBAL\Types\Type
;
use
PDO
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
@@ -25,6 +26,18 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
_conn
->
executeUpdate
(
'DELETE FROM write_table'
);
}
/**
* @group DBAL-80
*/
public
function
testExecuteUpdateFirstTypeIsNull
()
{
$sql
=
"INSERT INTO write_table (test_string, test_int) VALUES (?, ?)"
;
$this
->
_conn
->
executeUpdate
(
$sql
,
array
(
"text"
,
1111
),
array
(
null
,
PDO
::
PARAM_INT
));
$sql
=
"SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"
;
$this
->
assertTrue
((
bool
)
$this
->
_conn
->
fetchColumn
(
$sql
,
array
(
"text"
,
1111
)));
}
public
function
testExecuteUpdate
()
{
$sql
=
"INSERT INTO write_table (test_int) VALUES ( "
.
$this
->
_conn
->
quote
(
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