Throw an exception in case no table name is passed into lastInsertId of the Oracle adapter

remotes/origin/fix-delete-homeidr-on-userdelete
Thomas Müller 2015-11-20 13:00:42 +07:00
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);
}