Skip to content
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

Fixed #29199 -- Fixed crash when database user password contains @ sign on Oracle. #9768

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

felixxm
Copy link
Member

@felixxm felixxm commented Mar 9, 2018

return settings_dict['NAME']

def _connect_string(self):
return '%s/\\"%s\\"@%s' % (self.settings_dict['USER'], self.settings_dict['PASSWORD'], self._dsn())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only format that works with sqlplus, but it doesn't work as a dsn argument to cx_Oracle.connect(). That's why I decided to separate the dsn() method.

Copy link

@shaneallgeier shaneallgeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried this patch out (applied against the stable/1.11.x branch) and it works great for me.
After reviewing the diff, the new code seems perfectly concise.

# expected.
if 'ORA-01017' not in str(e):
self.fail('Unexpected error raised with password: %s' % e)
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is unneeded as per c9ae09a.



@unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests')
class PasswordWithAtSignTest(TransactionTestCase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a more generic class name so it could be used for other tests? (may be fine to rename and reuse HiddenNoDataFoundExceptionTest?)

…gn on Oracle.

Thanks Tim Graham for the review.
@felixxm
Copy link
Member Author

felixxm commented Mar 13, 2018

@timgraham @shaneallgeier Thanks for reviews. I updated tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants