[Pkg-owncloud-commits] [owncloud] 40/394: prepare SQL query only once, that's what prepared statements are for. Should improve upgrade time with larger setups

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:11:22 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit ab7561b2b61fe5b5798e66da8f8c472a0936020e
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Mon Nov 5 20:47:26 2012 +0100

    prepare SQL query only once, that's what prepared statements are for. Should improve upgrade time with larger setups
---
 apps/files/appinfo/update.php |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
index bcbbc60..b9a5386 100644
--- a/apps/files/appinfo/update.php
+++ b/apps/files/appinfo/update.php
@@ -5,10 +5,10 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
 if (version_compare($installedVersion, '1.1.6', '<')) {
 	$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
 	$result = $query->execute();
+	$updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?');
 	while( $row = $result->fetchRow()){
 		if ( $row["propertyname"][0] != '{' ) {
-			$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
-			$query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] ));
+			$updateQuery->execute(array('{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"]));
 		}
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list