From b253361ef761e0791c83729e636ed3827b724abc Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 2 Aug 2019 10:37:21 +0200 Subject: [PATCH 1/2] A test case for issue #3640 Signed-off-by: Roeland Jago Douma --- tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php index ea8d4dc0752..ba087eaa28d 100644 --- a/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php +++ b/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php @@ -89,7 +89,7 @@ public static function dataGetPlaceholderPositions() : iterable ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE "\\\\") AND (data.description LIKE :condition_1 ESCAPE \'\\\\\') ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE `\\\\`) AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], ['SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE \'\\\\\') AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, [121 => 'condition_0', 174 => 'condition_1']], - + ["SELECT * FROM Foo WHERE (foo.bar LIKE :condition_0 ESCAPE '\') AND (foo.baz = :condition_1) AND (foo.bak LIKE :condition_2 ESCAPE '\')", false, [38 => 'condition_0', 78 => 'condition_1', 110 => 'condition_2']], ]; } From bcf78d5ea262e18510c944c5983ae1218c4f1800 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 5 Dec 2019 15:28:46 +0100 Subject: [PATCH 2/2] Fix regex for escaped literals Signed-off-by: Christoph Wurst --- lib/Doctrine/DBAL/SQLParserUtils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/DBAL/SQLParserUtils.php b/lib/Doctrine/DBAL/SQLParserUtils.php index 9768883846e..0807308ad59 100644 --- a/lib/Doctrine/DBAL/SQLParserUtils.php +++ b/lib/Doctrine/DBAL/SQLParserUtils.php @@ -31,9 +31,9 @@ class SQLParserUtils public const POSITIONAL_TOKEN = '\?'; public const NAMED_TOKEN = '(?