8000 Sqlsrv does not properly rebind values · Issue #2656 · doctrine/dbal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Sqlsrv does not properly rebind values #2656
Closed
@fischerman

Description

@fischerman

If the same statement is used with different parameters, the sqlsrv driver always inserts the first set of values. An attempt to bind a new value using bindValue() has no effect.

$em->getConnection()->beginTransaction();
$stmt = $em->getConnection()->prepare('INSERT INTO ... VALUES (?)');

$first = 'first';
$stmt->bindValue(1, $first, 'string');
$stmt->execute();

$second= 'second';
$stmt->bindValue(1, $second, 'string');
$stmt->execute();

$stmt->closeCursor();
$em->getConnection()->commit();

After the transaction completes, it contains two times first but no second. This also affects the ORM, if two entities of the same type are inserted.

Tested with

  • PHP 7.1.1, sqlsrv ext 4.1.4, DBAL 2.5.11
  • PHP 7.0, SQLSRV40, DBAL 2.5.11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0