Merging in MS SQL fixes from 1.1

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3591 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-09-28 22:41:50 +00:00
parent 03ec6ccb2a
commit 49d8dac242

View file

@ -207,7 +207,7 @@ class DboMssql extends DboSource {
} }
$fields = false; $fields = false;
$cols = $this->fetchAll("SELECT COLUMN_NAME as Field, DATA_TYPE as Type, COL_LENGTH('" . $model->tablePrefix . $model->table . "', COLUMN_NAME) as Length, IS_NULLABLE As [Null], COLUMN_DEFAULT as [Default], COLUMNPROPERTY(OBJECT_ID('" . $model->table . "'), COLUMN_NAME, 'IsIdentity') as [Key], NUMERIC_SCALE as Size FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" . $model->table . "'", false); $cols = $this->fetchAll("SELECT COLUMN_NAME as Field, DATA_TYPE as Type, COL_LENGTH('" . $this->fullTableName($model, false) . "', COLUMN_NAME) as Length, IS_NULLABLE As [Null], COLUMN_DEFAULT as [Default], COLUMNPROPERTY(OBJECT_ID('" . $this->fullTableName($model, false) . "'), COLUMN_NAME, 'IsIdentity') as [Key], NUMERIC_SCALE as Size FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" . $this->fullTableName($model, false) . "'", false);
foreach($cols as $column) { foreach($cols as $column) {
$fields[] = array( $fields[] = array(
@ -218,7 +218,7 @@ class DboMssql extends DboSource {
); );
} }
$this->__cacheDescription($model->tablePrefix . $model->table, $fields); $this->__cacheDescription($this->fullTableName($model, false), $fields);
return $fields; return $fields;
} }
@ -267,7 +267,7 @@ class DboMssql extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
$data = addslashes($data); $data = stripslashes(r("'", "''", $data));
break; break;
} }
return "'" . $data . "'"; return "'" . $data . "'";