Skip to content
Snippets Groups Projects
Commit 7330f61a authored by Jan-Christoph Borchardt's avatar Jan-Christoph Borchardt
Browse files

Merge pull request #4799 from owncloud/tune_legacy_cache_webdav_properties_prefixing_master

Concatenate string in SQL instead of PHP
parents bcad6e64 9ae82949
No related branches found
No related tags found
No related merge requests found
...@@ -3,17 +3,14 @@ ...@@ -3,17 +3,14 @@
// fix webdav properties,add namespace in front of the property, update for OC4.5 // fix webdav properties,add namespace in front of the property, update for OC4.5
$installedVersion=OCP\Config::getAppValue('files', 'installed_version'); $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) { if (version_compare($installedVersion, '1.1.6', '<')) {
$query = OC_DB::prepare( 'SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`' ); $concat = OC_DB::getConnection()->getDatabasePlatform()->
$result = $query->execute(); getConcatExpression( '\'{DAV:}\'', '`propertyname`' );
$updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties`' $query = OC_DB::prepare('
.' SET `propertyname` = ?' UPDATE `*PREFIX*properties`
.' WHERE `userid` = ?' SET `propertyname` = ' . $concat . '
.' AND `propertypath` = ?'); WHERE `propertyname` NOT LIKE \'{%\'
while( $row = $result->fetchRow()) { ');
if ( $row['propertyname'][0] != '{' ) { $query->execute();
$updateQuery->execute(array('{DAV:}' + $row['propertyname'], $row['userid'], $row['propertypath']));
}
}
} }
//update from OC 3 //update from OC 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment