summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2020-08-31 15:07:22 +0200
committerGitHub <noreply@github.com>2020-08-31 15:07:22 +0200
commit849c13f202451bf619ddec0c583de863a8b74217 (patch)
treee906a374549bdaa92f238546dac309e98ecd5a6a /lib/public
parent7c8a8dc143b59d5a4a1763443c1c9e9922d982fc (diff)
parent3bc54bfd062d9396f438a295ebc1dd16cbed0e5e (diff)
downloadnextcloud-server-849c13f202451bf619ddec0c583de863a8b74217.tar.gz
nextcloud-server-849c13f202451bf619ddec0c583de863a8b74217.zip
Merge pull request #22472 from nextcloud/fix/contacts-interaction-blob-postgres
Fix writing BLOBs to postgres with recent contacts interaction
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Db/Entity.php7
-rw-r--r--lib/public/AppFramework/Db/QBMapper.php2
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php
index 954b8787c4c..34719c82aea 100644
--- a/lib/public/AppFramework/Db/Entity.php
+++ b/lib/public/AppFramework/Db/Entity.php
@@ -110,7 +110,12 @@ abstract class Entity {
// if type definition exists, cast to correct type
if ($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
- settype($args[0], $this->_fieldTypes[$name]);
+ $type = $this->_fieldTypes[$name];
+ if ($type === 'blob') {
+ // (B)LOB is treated as string when we read from the DB
+ $type = 'string';
+ }
+ settype($args[0], $type);
}
$this->$name = $args[0];
} else {
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php
index 9b396965706..ebbe92e7875 100644
--- a/lib/public/AppFramework/Db/QBMapper.php
+++ b/lib/public/AppFramework/Db/QBMapper.php
@@ -230,6 +230,8 @@ abstract class QBMapper {
case 'bool':
case 'boolean':
return IQueryBuilder::PARAM_BOOL;
+ case 'blob':
+ return IQueryBuilder::PARAM_LOB;
}
return IQueryBuilder::PARAM_STR;