]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use Doctrine Platform to generate SQL query for table truncation.
authorAndreas Fischer <bantu@owncloud.com>
Fri, 29 Aug 2014 18:53:51 +0000 (20:53 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Fri, 29 Aug 2014 18:53:51 +0000 (20:53 +0200)
apps/user_ldap/lib/helper.php

index b6d7bad87276a52b8fd562d3d7368e6bbb1f6932..bce28230feaee8ef209c292c165dc2584a86563f 100644 (file)
@@ -159,14 +159,9 @@ class Helper {
                        return false;
                }
 
-               $dbtype = \OCP\Config::getSystemValue('dbtype');
-               if(strpos($dbtype, 'sqlite') !== false || $dbtype === 'oci') {
-                       $query = \OCP\DB::prepare('DELETE FROM '.$table);
-               } else {
-                       $query = \OCP\DB::prepare('TRUNCATE '.$table);
-               }
-
-
+               $connection = \OC_DB::getConnection();
+               $sql = $connection->getDatabasePlatform()->getTruncateTableSQL($table);
+               $query = \OCP\DB::prepare($sql);
                $res = $query->execute();
 
                if(\OCP\DB::isError($res)) {