mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Throw an exception in case no table name is passed into lastInsertId of the Oracle adapter
This commit is contained in:
parent
9f69021691
commit
aa660ec232
2 changed files with 4 additions and 2 deletions
|
|
@ -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 . '"';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue