diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-20 13:00:42 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 11:44:08 +0100 |
commit | aa660ec232a236a9c62e4bf2b1535127bb8521be (patch) | |
tree | 919877f3e2d9af0701660e8f5bcb8051097ed5c5 /lib | |
parent | 9f690216913fffc6b4c93545492ea26905a5fe61 (diff) | |
download | nextcloud-server-aa660ec232a236a9c62e4bf2b1535127bb8521be.tar.gz nextcloud-server-aa660ec232a236a9c62e4bf2b1535127bb8521be.zip |
Throw an exception in case no table name is passed into lastInsertId of the Oracle adapter
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/db/adapteroci8.php | 3 | ||||
-rw-r--r-- | lib/private/db/connection.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/db/adapteroci8.php b/lib/private/db/adapteroci8.php index 6e7857e6620..76c265bc178 100644 --- a/lib/private/db/adapteroci8.php +++ b/lib/private/db/adapteroci8.php @@ -26,6 +26,9 @@ namespace OC\DB; class AdapterOCI8 extends Adapter { public function lastInsertId($table) { + if (is_null($table)) { + throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()'); + } if ($table !== null) { $suffix = '_SEQ'; $table = '"' . $table . $suffix . '"'; diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index 1b86d3d383a..85b1b7cd5ea 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -214,8 +214,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { * @param string $seqName Name of the sequence object from which the ID should be returned. * @return string A string representation of the last inserted ID. */ - public function lastInsertId($seqName = null) - { + public function lastInsertId($seqName = null) { if ($seqName) { $seqName = $this->replaceTablePrefix($seqName); } |