Re: DBD::Oracle - credentials

2011-01-18 Thread Tim Bunce
On Fri, Jan 14, 2011 at 04:45:52PM +0100, H.Merijn Brand wrote:
> 
> Yes, the *DBD::Oracle* README. I know, I found it there, but I was more
> looking for guides from DBI. Does DBI document that DBU_USER/DBI_PASS
> would somehow overrule other (default) settings?

DBI_USER and DBI_PASS are applied as defaults in DBI->connect()
so, if set, they'll be applied before the driver gets a chance to
consider what to do.

It's the $drh->default_user() method that looks up the env vars.
That method isn't documented, which is a bug in itself.

> I think the DBD::Oracle README does exactly what it said. So it is not
> wrong.

Agreed. There may be room for practical improvements if there are clear
problems with the current behavior.

Tim.


Re: DBD::Oracle - credentials

2011-01-14 Thread H.Merijn Brand
On Fri, 14 Jan 2011 15:21:39 +, "Martin J. Evans"
 wrote:

> On 14/01/11 15:01, H.Merijn Brand wrote:
> > On Fri, 14 Jan 2011 14:56:46 +, "Martin J. Evans"
> >  wrote:
> > 
> >> On 14/01/11 14:30, H.Merijn Brand wrote:
> >>> Maybe this is a feature request, but if I have
> >>>
> >>>   ORACLE_USERID=john/sekrit
> >>>   DBI_USER=pablo
> >>>   DBI_PASS=neruda
> >>>
> >>> I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
> >>> the ORACLE_USERID. Anyone can come up with a good reason why this os
> >>> not happening at the moment?
> >>>
> >>> How do other DBD's set precedence if environment variable are allowed
> >>> for login credentials?
> >>>
> >>
> >> Just a minor point (not saying it stops the discussion) but I don't
> >> think ORACLE_USERID is something DBD::Oracle defines (other than in
> >> test code in t/*). So is your point to do with running tests in t/* or
> >> in general?
> > 
> > I ran into this in the test suite indeed. Your findings below just
> > confirm my expectation :)
> > 
> > I posted it here because I saw no generic docs about this
> 
> It is in the README.

Yes, the *DBD::Oracle* README. I know, I found it there, but I was more
looking for guides from DBI. Does DBI document that DBU_USER/DBI_PASS
would somehow overrule other (default) settings?

I think the DBD::Oracle README does exactly what it said. So it is not
wrong.

> The supplied tests will connect to the database using the value of the
> ORACLE_USERID environment variable to supply the username/password.
> 
> Don't know why it cannot fall back on DBI_USER/DBI_PASS.
> 
> >> $ export ORACLE_USERID=wrong/wrong
> >> $ export DBI_USER=real_user
> >> $ export DBI_PASS=valid_password
> >> $ export DBI_DSN='dbi:Oracle:host=betoracle.easysoft.local;sid=devel'
> >> $ perl -le 'use DBI; my $h = DBI->connect();'
> >>
> >> works for me. i.e., ORACLE_USERID contains invalid username/password
> >> and DBI_USER/DBI_PASS contain valid username/password and it connects
> >> fine.
> >>
> >> Perhaps I misunderstood you Merijn.

-- 
H.Merijn Brand  http://tux.nl  Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/   http://www.test-smoke.org/
http://qa.perl.org  http://www.goldmark.org/jeff/stupid-disclaimers/


Re: DBD::Oracle - credentials

2011-01-14 Thread John Scoles

 On 14/01/2011 10:21 AM, Martin J. Evans wrote:

On 14/01/11 15:01, H.Merijn Brand wrote:

On Fri, 14 Jan 2011 14:56:46 +, "Martin J. Evans"
  wrote:


On 14/01/11 14:30, H.Merijn Brand wrote:

Maybe this is a feature request, but if I have

   ORACLE_USERID=john/sekrit
   DBI_USER=pablo
   DBI_PASS=neruda

I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
the ORACLE_USERID. Anyone can come up with a good reason why this os
not happening at the moment?

How do other DBD's set precedence if environment variable are allowed
for login credentials?


Just a minor point (not saying it stops the discussion) but I don't
think ORACLE_USERID is something DBD::Oracle defines (other than in
test code in t/*). So is your point to do with running tests in t/* or
in general?

I ran into this in the test suite indeed. Your findings below just
confirm my expectation :)

I posted it here because I saw no generic docs about this

It is in the README.

The supplied tests will connect to the database using the value of the
ORACLE_USERID environment variable to supply the username/password.

Don't know why it cannot fall back on DBI_USER/DBI_PASS.


$ export ORACLE_USERID=wrong/wrong
$ export DBI_USER=real_user
$ export DBI_PASS=valid_password
$ export DBI_DSN='dbi:Oracle:host=betoracle.easysoft.local;sid=devel'
$ perl -le 'use DBI; my $h = DBI->connect();'

works for me. i.e., ORACLE_USERID contains invalid username/password
and DBI_USER/DBI_PASS contain valid username/password and it connects
fine.

Perhaps I misunderstood you Merijn.

Martin



Martin

Why not.

Seems like a good Idea and easy to implement I guess we are just 
carrying on an old tradition nothing says we have to use ORACLE_USERID 
which is a little out dated.


Time to update the POD and a tests I guess.

Might be best for 1.29 as 1.28 is rather full right now.

Cheers
John


Re: DBD::Oracle - credentials

2011-01-14 Thread Martin J. Evans
On 14/01/11 15:01, H.Merijn Brand wrote:
> On Fri, 14 Jan 2011 14:56:46 +, "Martin J. Evans"
>  wrote:
> 
>> On 14/01/11 14:30, H.Merijn Brand wrote:
>>> Maybe this is a feature request, but if I have
>>>
>>>   ORACLE_USERID=john/sekrit
>>>   DBI_USER=pablo
>>>   DBI_PASS=neruda
>>>
>>> I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
>>> the ORACLE_USERID. Anyone can come up with a good reason why this os
>>> not happening at the moment?
>>>
>>> How do other DBD's set precedence if environment variable are allowed
>>> for login credentials?
>>>
>>
>> Just a minor point (not saying it stops the discussion) but I don't
>> think ORACLE_USERID is something DBD::Oracle defines (other than in
>> test code in t/*). So is your point to do with running tests in t/* or
>> in general?
> 
> I ran into this in the test suite indeed. Your findings below just
> confirm my expectation :)
> 
> I posted it here because I saw no generic docs about this

It is in the README.

The supplied tests will connect to the database using the value of the
ORACLE_USERID environment variable to supply the username/password.

Don't know why it cannot fall back on DBI_USER/DBI_PASS.

>> $ export ORACLE_USERID=wrong/wrong
>> $ export DBI_USER=real_user
>> $ export DBI_PASS=valid_password
>> $ export DBI_DSN='dbi:Oracle:host=betoracle.easysoft.local;sid=devel'
>> $ perl -le 'use DBI; my $h = DBI->connect();'
>>
>> works for me. i.e., ORACLE_USERID contains invalid username/password
>> and DBI_USER/DBI_PASS contain valid username/password and it connects
>> fine.
>>
>> Perhaps I misunderstood you Merijn.
>>
>> Martin
> 
> 

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com


Re: DBD::Oracle - credentials

2011-01-14 Thread H.Merijn Brand
On Fri, 14 Jan 2011 14:56:46 +, "Martin J. Evans"
 wrote:

> On 14/01/11 14:30, H.Merijn Brand wrote:
> > Maybe this is a feature request, but if I have
> > 
> >   ORACLE_USERID=john/sekrit
> >   DBI_USER=pablo
> >   DBI_PASS=neruda
> > 
> > I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
> > the ORACLE_USERID. Anyone can come up with a good reason why this os
> > not happening at the moment?
> > 
> > How do other DBD's set precedence if environment variable are allowed
> > for login credentials?
> > 
> 
> Just a minor point (not saying it stops the discussion) but I don't
> think ORACLE_USERID is something DBD::Oracle defines (other than in
> test code in t/*). So is your point to do with running tests in t/* or
> in general?

I ran into this in the test suite indeed. Your findings below just
confirm my expectation :)

I posted it here because I saw no generic docs about this

> $ export ORACLE_USERID=wrong/wrong
> $ export DBI_USER=real_user
> $ export DBI_PASS=valid_password
> $ export DBI_DSN='dbi:Oracle:host=betoracle.easysoft.local;sid=devel'
> $ perl -le 'use DBI; my $h = DBI->connect();'
> 
> works for me. i.e., ORACLE_USERID contains invalid username/password
> and DBI_USER/DBI_PASS contain valid username/password and it connects
> fine.
> 
> Perhaps I misunderstood you Merijn.
> 
> Martin


-- 
H.Merijn Brand  http://tux.nl  Perl Monger  http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/   http://www.test-smoke.org/
http://qa.perl.org  http://www.goldmark.org/jeff/stupid-disclaimers/


Re: DBD::Oracle - credentials

2011-01-14 Thread Martin J. Evans
On 14/01/11 14:30, H.Merijn Brand wrote:
> Maybe this is a feature request, but if I have
> 
>   ORACLE_USERID=john/sekrit
>   DBI_USER=pablo
>   DBI_PASS=neruda
> 
> I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
> the ORACLE_USERID. Anyone can come up with a good reason why this os
> not happening at the moment?
> 
> How do other DBD's set precedence if environment variable are allowed
> for login credentials?
> 

Just a minor point (not saying it stops the discussion) but I don't think 
ORACLE_USERID is something DBD::Oracle defines (other than in test code in 
t/*). So is your point to do with running tests in t/* or in general?

$ export ORACLE_USERID=wrong/wrong
$ export DBI_USER=real_user
$ export DBI_PASS=valid_password
$ export DBI_DSN='dbi:Oracle:host=betoracle.easysoft.local;sid=devel'
$ perl -le 'use DBI; my $h = DBI->connect();'

works for me. i.e., ORACLE_USERID contains invalid username/password and 
DBI_USER/DBI_PASS contain valid username/password and it connects fine.

Perhaps I misunderstood you Merijn.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com


Re: DBD::Oracle - credentials

2011-01-14 Thread John Scoles

 On 14/01/2011 9:30 AM, H.Merijn Brand wrote:

Maybe this is a feature request, but if I have

   ORACLE_USERID=john/sekrit
   DBI_USER=pablo
   DBI_PASS=neruda

I *do* expect that DBD::Oracle uses DBI_USER and DBI_PASS *instead of*
the ORACLE_USERID. Anyone can come up with a good reason why this os
not happening at the moment?

How do other DBD's set precedence if environment variable are allowed
for login credentials?

Funny the question never came up before. I guess we can have a look at 
it.  I do not know about the other drivers?