diff options
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); } |