From 06b2446269f16035444eea1335e13b355a48e442 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 16 Mar 2015 15:37:12 +0100 Subject: [PATCH 1/2] The key is over configkey, user and app, not the value stupid me :( --- lib/private/allconfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/allconfig.php b/lib/private/allconfig.php index b8bba7986e..8d4f13e5b9 100644 --- a/lib/private/allconfig.php +++ b/lib/private/allconfig.php @@ -196,7 +196,7 @@ class AllConfig implements \OCP\IConfig { 'userid' => $userId, 'appid' => $appName, 'configkey' => $key, - ], ['configvalue', 'userid', 'appid']); + ], ['configkey', 'userid', 'appid']); $affectedRows = 1; } elseif ($exists) { $data = array($value, $userId, $appName, $key); From c2a5bd6a01be635f3d1c59f624cda337f05c4237 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 16 Mar 2015 15:41:00 +0100 Subject: [PATCH 2/2] Also add a note that clob does not work in the compare array --- lib/private/appframework/db/db.php | 1 + lib/private/db/adapter.php | 1 + lib/private/db/adaptersqlite.php | 1 + lib/private/db/connection.php | 1 + lib/public/idbconnection.php | 1 + 5 files changed, 5 insertions(+) diff --git a/lib/private/appframework/db/db.php b/lib/private/appframework/db/db.php index 0824e108f4..a9c6fc1e9c 100644 --- a/lib/private/appframework/db/db.php +++ b/lib/private/appframework/db/db.php @@ -127,6 +127,7 @@ class Db implements IDb { * @param array $input data that should be inserted into the table (column name => value) * @param array|null $compare List of values that should be checked for "if not exists" * If this is null or an empty array, all keys of $input will be compared + * Please note: text fields (clob) must not be used in the compare array * @return int number of inserted rows * @throws \Doctrine\DBAL\DBALException */ diff --git a/lib/private/db/adapter.php b/lib/private/db/adapter.php index de7b04c74d..8c251c8207 100644 --- a/lib/private/db/adapter.php +++ b/lib/private/db/adapter.php @@ -46,6 +46,7 @@ class Adapter { * @param array $input data that should be inserted into the table (column name => value) * @param array|null $compare List of values that should be checked for "if not exists" * If this is null or an empty array, all keys of $input will be compared + * Please note: text fields (clob) must not be used in the compare array * @return int number of inserted rows * @throws \Doctrine\DBAL\DBALException */ diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index 31f88940f0..a910696733 100644 --- a/lib/private/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php @@ -25,6 +25,7 @@ class AdapterSqlite extends Adapter { * @param array $input data that should be inserted into the table (column name => value) * @param array|null $compare List of values that should be checked for "if not exists" * If this is null or an empty array, all keys of $input will be compared + * Please note: text fields (clob) must not be used in the compare array * @return int number of inserted rows * @throws \Doctrine\DBAL\DBALException */ diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index 023e265f24..8748f66b36 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -163,6 +163,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { * @param array $input data that should be inserted into the table (column name => value) * @param array|null $compare List of values that should be checked for "if not exists" * If this is null or an empty array, all keys of $input will be compared + * Please note: text fields (clob) must not be used in the compare array * @return int number of inserted rows * @throws \Doctrine\DBAL\DBALException */ diff --git a/lib/public/idbconnection.php b/lib/public/idbconnection.php index 1117c2da9b..38f5c7e2e5 100644 --- a/lib/public/idbconnection.php +++ b/lib/public/idbconnection.php @@ -83,6 +83,7 @@ interface IDBConnection { * @param array $input data that should be inserted into the table (column name => value) * @param array|null $compare List of values that should be checked for "if not exists" * If this is null or an empty array, all keys of $input will be compared + * Please note: text fields (clob) must not be used in the compare array * @return int number of inserted rows * @throws \Doctrine\DBAL\DBALException */