Skip to content

Commit

Permalink
Fixed a potential cause of ORA-12519: TNS:no appropriate service hand…
Browse files Browse the repository at this point in the history
…ler found
  • Loading branch information
morozov committed Dec 2, 2018
1 parent 0e09b3a commit 6c867cd
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@

class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
{
/** @var bool */
private static $privilegesGranted = false;

protected function setUp()
{
parent::setUp();

if (! isset($GLOBALS['db_username'])) {
$this->markTestSkipped('Foo');
if (self::$privilegesGranted) {
return;
}

$username = $GLOBALS['db_username'];
if (! isset($GLOBALS['db_username'])) {
self::markTestSkipped('Username must be explicitly specified in connection parameters for this test');
}

$query = 'GRANT ALL PRIVILEGES TO ' . $username;
TestUtil::getTempConnection()
->exec('GRANT ALL PRIVILEGES TO ' . $GLOBALS['db_username']);

$conn = TestUtil::getTempConnection();
$conn->executeUpdate($query);
self::$privilegesGranted = true;
}

public function testRenameTable()
Expand Down

0 comments on commit 6c867cd

Please sign in to comment.