Permalink
Browse files

Fixing issues with unicode quoting.

  • Loading branch information...
1 parent 9ab2ec7 commit 3169c5a1e78f4ab272fa8f51ae73655fa538d2d6 @markstory markstory committed Jun 23, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -558,6 +558,8 @@ public function renderStatement($type, $data) {
public function value($data, $column = null) {
if (is_array($data) || is_object($data)) {
return parent::value($data, $column);
+ } elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'), true)) {
+ return $data;
}
if (empty($column)) {
@@ -658,8 +660,10 @@ public function buildColumn($column) {
} else {
$result = str_replace('DEFAULT NULL', 'NULL', $result);
}
- } else if (array_keys($column) == array('type', 'name')) {
+ } elseif (array_keys($column) == array('type', 'name')) {
$result .= ' NULL';
+ } elseif (strpos($result, "DEFAULT N'")) {
+ $result = str_replace("DEFAULT N'", "DEFAULT '", $result);
}
return $result;
}

0 comments on commit 3169c5a

Please sign in to comment.