-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Oracle connection string without dbname #908
Fix Oracle connection string without dbname #908
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-1301 We use Jira to track the state of pull requests and the versions they got |
@mRoca AFAIK connecting to an Oracle database without a database instance reference (SID, SERVICE_NAME) isn't possible. So without the |
92d9749
to
9f1fe22
Compare
@deeky666 : I've updated the PR, an InvalidArgumentException is now thrown without valid SERVICE_NAME or SID. |
$service = 'SERVICE_NAME=' . $serviceName; | ||
$service = '(SERVICE_NAME=' . $serviceName . ')'; | ||
} else { | ||
$service = '(SID=' . $serviceName . ')'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add the parentheses here. Having to add them in multiple statements is cumbersome, when you can add them later on. Please leave it the way it was before.
Besides nit picking, looks good to me, but is missing a test. Afterwards can be merged IMO. |
Closing this PR in favor of #3297 |
When using the DoctrineBundle, the
CreateDatabaseDoctrineCommand
andDropDatabaseDoctrineCommand
commands unset thedbname
parameter before getting the connection, in order to get a connection to the instance and not to the database which has to be created or removed : https://github.com/doctrine/DoctrineBundle/blob/master/Command/CreateDatabaseDoctrineCommand.php#L76 , and https://github.com/doctrine/DoctrineBundle/blob/master/Command/DropDatabaseDoctrineCommand.php#L78 .Without this parameter, the connect string can't be created. This PR checks if a
dbname
parameter is available before setting the CONNECT_DATA value.