Commit 090329a7 authored by Steve Müller's avatar Steve Müller

#2595: fix test error "ORA-00984: column not allowed here" on Oracle 11g

parent ca228e9d
......@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8;
use Doctrine\DBAL\Driver\OCI8\Driver;
use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase;
class OCI8ConnectionTest extends DbalFunctionalTestCase
......@@ -32,12 +33,20 @@ class OCI8ConnectionTest extends DbalFunctionalTestCase
*/
public function testLastInsertIdAcceptsFqn()
{
$this->_conn->executeUpdate('CREATE SEQUENCE dbal2595_seq');
$this->_conn->executeUpdate('CREATE TABLE DBAL2595(id NUMBER DEFAULT dbal2595_seq.NEXTVAL, foo NUMBER)');
$platform = $this->_conn->getDatabasePlatform();
$schemaManager = $this->_conn->getSchemaManager();
$table = new Table('DBAL2595');
$table->addColumn('id', 'integer', array('autoincrement' => true));
$table->addColumn('foo', 'integer');
$schemaManager->dropAndCreateTable($table);
$this->_conn->executeUpdate('INSERT INTO DBAL2595 (foo) VALUES (1)');
$schema = $this->_conn->getDatabase();
$sequence = $platform->getIdentitySequenceName($schema . '.DBAL2595', 'id');
$this->assertSame(1, $this->driverConnection->lastInsertId($schema . '.dbal2595_seq'));
$this->assertSame(1, $this->driverConnection->lastInsertId($sequence));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment