Skip to content

Commit

Permalink
Fixing a couple failing tests on windows using sqlserver
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 7, 2012
1 parent 9a7e69d commit cd562f5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/Cake/Model/Datasource/Database/Sqlserver.php
Expand Up @@ -645,14 +645,7 @@ public function insertMulti($table, $fields, $values) {
$this->_execute('SET IDENTITY_INSERT ' . $this->fullTableName($table) . ' ON');
}

$table = $this->fullTableName($table);
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
$this->begin();
foreach ($values as $value) {
$holder = implode(', ', array_map(array(&$this, 'value'), $value));
$this->_execute("INSERT INTO {$table} ({$fields}) VALUES ({$holder})");
}
$this->commit();
parent::insertMulti($table, $fields, $values);

if ($hasPrimaryKey) {
$this->_execute('SET IDENTITY_INSERT ' . $this->fullTableName($table) . ' OFF');
Expand Down Expand Up @@ -717,9 +710,6 @@ public function buildIndex($indexes, $table = null) {
* @return string
*/
protected function _getPrimaryKey($model) {
if (!is_object($model)) {
$model = new Model(false, $model);
}
$schema = $this->describe($model);
foreach ($schema as $field => $props) {
if (isset($props['key']) && $props['key'] == 'primary') {
Expand Down

0 comments on commit cd562f5

Please sign in to comment.