1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-31 17:51:43 +02:00

SqlsrvDriver: Correct escaping of special characters (N prefix) (#332)

In case nvarchar type is used and e.g. chinese have to be saved, there have to be N in front of the value, this escaping works fine for varchar columns as well.
This commit is contained in:
Tomáš Kuthan
2019-07-12 14:33:38 +02:00
committed by David Grudl
parent e66cb84cb5
commit 7f22279333
5 changed files with 118 additions and 25 deletions

View File

@@ -60,13 +60,22 @@ WHERE [id] > 0
// nested condition
Assert::match(
reformat("
reformat([
'sqlsrv' => "
SELECT *
FROM [customers]
WHERE
[name] LIKE N'xxx'
/* AND ...=1 */
/* 1 LIMIT 10 */",
"
SELECT *
FROM [customers]
WHERE
[name] LIKE 'xxx'
/* AND ...=1 */
/* 1 LIMIT 10 */"),
/* 1 LIMIT 10 */",
]),
$conn->translate('
SELECT *