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:
committed by
David Grudl
parent
e66cb84cb5
commit
7f22279333
@@ -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 *
|
||||
|
Reference in New Issue
Block a user