diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-19 11:07:17 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-21 23:17:37 +0200 |
commit | be7c6139938564fc2ce5a12982eb82f60087f900 (patch) | |
tree | 790f122e1ad588dbbdd87682551723e87f0934cf /lib/db | |
parent | b66c9098bd4188a1fbeb92351d1370736c10d1b4 (diff) | |
download | nextcloud-server-be7c6139938564fc2ce5a12982eb82f60087f900.tar.gz nextcloud-server-be7c6139938564fc2ce5a12982eb82f60087f900.zip |
Fix errors from unit tests
Diffstat (limited to 'lib/db')
-rw-r--r-- | lib/db/adapter.php | 3 | ||||
-rw-r--r-- | lib/db/adaptersqlite.php | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/db/adapter.php b/lib/db/adapter.php index 92c24b46fff..20e7ea4a600 100644 --- a/lib/db/adapter.php +++ b/lib/db/adapter.php @@ -38,8 +38,7 @@ class Adapter { $inserts = array_merge($inserts, $inserts); try { - $statement = $this->conn->prepare($query); - $result = $statement->execute($inserts); + $result = $this->conn->executeUpdate($query, $inserts); } catch(\Doctrine\DBAL\DBALException $e) { $entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry .= 'Offending command was: ' . $query.'<br />'; diff --git a/lib/db/adaptersqlite.php b/lib/db/adaptersqlite.php index 61cfaa44242..fa6d308ae32 100644 --- a/lib/db/adaptersqlite.php +++ b/lib/db/adaptersqlite.php @@ -27,7 +27,7 @@ class AdapterSqlite extends Adapter { $query = substr($query, 0, strlen($query) - 5); try { $stmt = $this->conn->prepare($query); - $result = $stmt->execute(array($input)); + $result = $stmt->execute(array_values($input)); } catch(\Doctrine\DBAL\DBALException $e) { $entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry .= 'Offending command was: ' . $query . '<br />'; @@ -36,7 +36,7 @@ class AdapterSqlite extends Adapter { \OC_Template::printErrorPage( $entry ); } - if ($stmt->fetchColumn() === 0) { + if ($stmt->fetchColumn() === '0') { $query = 'INSERT INTO `' . $table . '` (`' . implode('`,`', array_keys($input)) . '`) VALUES(' . str_repeat('?,', count($input)-1).'? ' . ')'; |