summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/AdapterMySQL.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-05-19 12:34:40 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2016-05-21 01:59:03 +0200
commit7e3ce8352666af86d597e1fdce95bfe57531207e (patch)
tree4d0641773e8f1e740285ea7b6bfdf497409a5b78 /lib/private/DB/AdapterMySQL.php
parent59a85a4c76b80658d9373e3acf4f71b872b244a0 (diff)
downloadnextcloud-server-7e3ce8352666af86d597e1fdce95bfe57531207e.tar.gz
nextcloud-server-7e3ce8352666af86d597e1fdce95bfe57531207e.zip
Add a method to lock a table
Diffstat (limited to 'lib/private/DB/AdapterMySQL.php')
-rw-r--r--lib/private/DB/AdapterMySQL.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/DB/AdapterMySQL.php b/lib/private/DB/AdapterMySQL.php
index ab87c589747..8504fc74e0f 100644
--- a/lib/private/DB/AdapterMySQL.php
+++ b/lib/private/DB/AdapterMySQL.php
@@ -24,6 +24,18 @@
namespace OC\DB;
class AdapterMySQL extends Adapter {
+
+ /**
+ * @param string $tableName
+ */
+ public function lockTable($tableName) {
+ $this->conn->executeUpdate('LOCK TABLES `' .$tableName . '` WRITE');
+ }
+
+ public function unlockTable() {
+ $this->conn->executeUpdate('UNLOCK TABLES');
+ }
+
public function fixupStatement($statement) {
$statement = str_replace(' ILIKE ', ' COLLATE utf8_general_ci LIKE ', $statement);
return $statement;