From: Arthur Schiwon Date: Fri, 31 May 2013 18:07:13 +0000 (+0200) Subject: LDAP: sqlite compatibility for emptyiing tables X-Git-Tag: v6.0.0alpha2~702^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2ff9677cd17749767060f30dc55bfd66b22fcc26;p=nextcloud-server.git LDAP: sqlite compatibility for emptyiing tables --- diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index 07d13a806a6..10ed40ebd6a 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -118,7 +118,13 @@ class Helper { return false; } - $query = \OCP\DB::prepare('TRUNCATE '.$table); + if(strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false) { + $query = \OCP\DB::prepare('DELETE FROM '.$table); + } else { + $query = \OCP\DB::prepare('TRUNCATE '.$table); + } + + $res = $query->execute(); if(\OCP\DB::isError($res)) {