[Pkg-owncloud-commits] [owncloud] 12/42: user workarount to compare CLOB column with CHAR value

David Prévot taffit at moszumanska.debian.org
Wed Jan 22 21:21:48 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit 047ae7fb2378d9b43767fdf078d5a37eea9dcbca
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Tue Jan 21 11:56:34 2014 +0100

    user workarount to compare CLOB column with CHAR value
---
 apps/user_ldap/lib/helper.php | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php
index 09f6469..9727d84 100644
--- a/apps/user_ldap/lib/helper.php
+++ b/apps/user_ldap/lib/helper.php
@@ -48,18 +48,25 @@ class Helper {
 	static public function getServerConfigurationPrefixes($activeConfigurations = false) {
 		$referenceConfigkey = 'ldap_configuration_active';
 
-		$query = '
+		$sql = '
 			SELECT DISTINCT `configkey`
 			FROM `*PREFIX*appconfig`
 			WHERE `appid` = \'user_ldap\'
 				AND `configkey` LIKE ?
 		';
+
 		if($activeConfigurations) {
-			$query .= ' AND `configvalue` = \'1\'';
+			if (\OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
+				//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
+				$sql .= ' AND to_char(`configvalue`)=\'1\'';
+			} else {
+				$sql .= ' AND `configvalue` = \'1\'';
+			}
 		}
-		$query = \OCP\DB::prepare($query);
 
-		$serverConfigs = $query->execute(array('%'.$referenceConfigkey))->fetchAll();
+		$stmt = \OCP\DB::prepare($sql);
+
+		$serverConfigs = $stmt->execute(array('%'.$referenceConfigkey))->fetchAll();
 		$prefixes = array();
 
 		foreach($serverConfigs as $serverConfig) {

-- 
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