Merge pull request #2254 from owncloud/fixing-mssql-utf8-and-insert-empty-string-master

Fixing mssql utf8 and insert empty string master
This commit is contained in:
Thomas Müller 2013-03-12 11:52:40 -07:00
commit 2e9d641337
2 changed files with 8 additions and 3 deletions

View File

@ -292,8 +292,10 @@ class OC_DB {
'username' => $user,
'password' => $pass,
'hostspec' => $host,
'database' => $name
);
'database' => $name,
'charset' => 'UTF-8'
);
$options['portability'] = $options['portability'] - MDB2_PORTABILITY_EMPTY_TO_NULL;
break;
default:
return false;

View File

@ -203,7 +203,10 @@ class Cache {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ')'
. ' VALUES(' . implode(', ', $valuesPlaceholder) . ')');
$query->execute($params);
$result = $query->execute($params);
if (\MDB2::isError($result)) {
\OCP\Util::writeLog('cache', 'Insert to cache failed: '.$result, \OCP\Util::ERROR);
}
return (int)\OC_DB::insertid('*PREFIX*filecache');
}