Commit 92c0fbf2 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-231' into 2.1.x

parents 148a049d 55fc886c
...@@ -61,7 +61,7 @@ class SQLParserUtils ...@@ -61,7 +61,7 @@ class SQLParserUtils
} else { } else {
$name = ""; $name = "";
// TODO: Something faster/better to match this than regex? // TODO: Something faster/better to match this than regex?
for ($j = $i; ($j < $stmtLen && preg_match('(([:a-zA-Z0-9]{1}))', $statement[$j])); $j++) { for ($j = $i; ($j < $stmtLen && preg_match('(([:a-zA-Z0-9_]{1}))', $statement[$j])); $j++) {
$name .= $statement[$j]; $name .= $statement[$j];
} }
$paramMap[$name][] = $i; // named parameters can be duplicated! $paramMap[$name][] = $i; // named parameters can be duplicated!
......
...@@ -33,6 +33,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase ...@@ -33,6 +33,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array('SELECT * FROM Foo WHERE bar IN (:name1, :name2)', false, array(':name1' => array(32), ':name2' => array(40))), array('SELECT * FROM Foo WHERE bar IN (:name1, :name2)', false, array(':name1' => array(32), ':name2' => array(40))),
array('SELECT ":foo" FROM Foo WHERE bar IN (:name1, :name2)', false, array(':name1' => array(37), ':name2' => array(45))), array('SELECT ":foo" FROM Foo WHERE bar IN (:name1, :name2)', false, array(':name1' => array(37), ':name2' => array(45))),
array("SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)", false, array(':name1' => array(37), ':name2' => array(45))), array("SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)", false, array(':name1' => array(37), ':name2' => array(45))),
array('SELECT :foo_id', false, array(':foo_id' => array(7))), // Ticket DBAL-231
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment