mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
DibiMsSql2005Driver: fixed identifier escaping
Annoted link to MS SQL doc does not talk about open bracket '[' escaping, only closing bracket ']'. dibi::query('CREATE TABLE %n (id INT)', 'abc[]def'); - old: creates table 'abc[[]def' - new: creates table 'abc[]def'
This commit is contained in:
@@ -243,7 +243,7 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult
|
|||||||
|
|
||||||
case dibi::IDENTIFIER:
|
case dibi::IDENTIFIER:
|
||||||
// @see http://msdn.microsoft.com/en-us/library/ms176027.aspx
|
// @see http://msdn.microsoft.com/en-us/library/ms176027.aspx
|
||||||
return '[' . str_replace(array('[', ']'), array('[[', ']]'), $value) . ']';
|
return '[' . str_replace(']', ']]', $value) . ']';
|
||||||
|
|
||||||
case dibi::BOOL:
|
case dibi::BOOL:
|
||||||
return $value ? 1 : 0;
|
return $value ? 1 : 0;
|
||||||
|
Reference in New Issue
Block a user