summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-07-16 14:35:47 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-07-16 14:35:47 +0200
commite26612244af029a794751d0d93a9ac419aef53db (patch)
tree6954f4279fa92ef323b9e209120c247c86cf07ee /lib
parent10b59f101f324dc1379d48b6a7d3daeb48de7e08 (diff)
downloadnextcloud-server-e26612244af029a794751d0d93a9ac419aef53db.tar.gz
nextcloud-server-e26612244af029a794751d0d93a9ac419aef53db.zip
Make MySQL return "number of found rows" instead of number of "affected rows".
Diffstat (limited to 'lib')
-rw-r--r--lib/private/db/connectionfactory.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php
index 8f852cf7127..c132a2321cd 100644
--- a/lib/private/db/connectionfactory.php
+++ b/lib/private/db/connectionfactory.php
@@ -60,7 +60,13 @@ class ConnectionFactory {
if (!isset($this->defaultConnectionParams[$normalizedType])) {
throw new \InvalidArgumentException("Unsupported type: $type");
}
- return $this->defaultConnectionParams[$normalizedType];
+ $result = $this->defaultConnectionParams[$normalizedType];
+ if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
+ $result['driverOptions'] = array(
+ \PDO::MYSQL_ATTR_FOUND_ROWS => true,
+ );
+ }
+ return $result;
}
/**