[Pkg-owncloud-commits] [owncloud] 81/258: Use Doctrine Platform to generate SQL query for table truncation.
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:23 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 ebbd40385a2a1d722b5809174c5e80b756fdd040
Author: Andreas Fischer <bantu at owncloud.com>
Date: Fri Aug 29 20:53:51 2014 +0200
Use Doctrine Platform to generate SQL query for table truncation.
---
apps/user_ldap/lib/helper.php | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php
index b6d7bad..bce2823 100644
--- a/apps/user_ldap/lib/helper.php
+++ b/apps/user_ldap/lib/helper.php
@@ -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)) {
--
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