mirror of
https://github.com/dg/dibi.git
synced 2025-08-30 01:09:50 +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
@@ -134,7 +134,10 @@ $fluent = $conn->select('*')
|
||||
->where(['x' => 'a', 'b', 'c']);
|
||||
|
||||
Assert::same(
|
||||
reformat('SELECT * FROM [me] AS [t] WHERE col > 10 AND ([x] = \'a\') AND (b) AND (c)'),
|
||||
reformat([
|
||||
'sqlsrv' => "SELECT * FROM [me] AS [t] WHERE col > 10 AND ([x] = N'a') AND (b) AND (c)",
|
||||
"SELECT * FROM [me] AS [t] WHERE col > 10 AND ([x] = 'a') AND (b) AND (c)",
|
||||
]),
|
||||
(string) $fluent
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user