[RDBO] Bitfield problem - again

2006-01-24 Thread Svilen Ivanov
Hi I have troubles saving bitfields in database. The bitfield columns are properly loaded from DB and I can manipulate them through Bit::Vector interface. However I cannot save my changes back in DB. Attached simple test case. I localized the problem in DB/Object/MakeMethods/Generic.pm, line 670-

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06 2:29 AM, Ron Savage wrote: > What is the state? > Is there any unshipped Oracle code available to be worked on? > Is it a matter of converting *::Pg.pm, say, to *::Oracle.pm, for starters? > > At the moment I have a great deal of time available to do the typing, if the > answer to the p

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06 2:29 AM, Ron Savage wrote: > > What is the state? > > Is there any unshipped Oracle code available to be worked on? > > Is it a matter of converting *::Pg.pm, say, to *::Oracle.pm, for starters? > > > > At the moment I have a great d

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > Note the funky B'00' syntax for setting the default bitfield value. > DBD::mysql's inability to deal with this is the main source of our woes. To > wit: > > $sth = $dbh->prepare('UPDATE photos SET fl = ? WHERE id = 1'); > $sth->execute

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > I may be able to help with this. Luckily, if you stick with Oracle > 9.2+, it can use the standard JOIN syntax. Hm, is that reasonable? What is the most popular version of Oracle these days? > Oracle doesn't have a LIMIT syntax, though it can b

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > Ahhh ... there's a solution here. *grins* I provided a patch to > DBD::mysql to do param type guessing using the undocumented > mysql_unsafe_bind_type_guessing attribute Is that a connect option or a $dbh/$sth attribute? Can you give me an examp

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Sean Davis
On 1/24/06 10:39 AM, "John Siracusa" <[EMAIL PROTECTED]> wrote: > > Anyway, like I said, baby steps. Start by implementing the Rose::DB > public API in a new Rose::DB::Oracle module. While that's happening, > it'd be great iif someone could post the various Oracle-isms discussed > above to th

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06, Sean Davis <[EMAIL PROTECTED]> wrote: > I'm not an Oracle user and, like John, do not have access to it, but is > there precedent for someone who does have access to open a database for John > et al. for development purposes? This is probably a dumb idea and is laden > with security an

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread Rob Kinyon
It's a $dbh attribute. $dbh->{mysql_unsafe_bind_type_guessing} = 1; The reason it's considered 'unsafe' is that, theoretically, it's a place where SQL Injection -could- occur. However, it's extremely unlikely, given the strictness of the parsing. (You can review the parsing yourself - it's in dbd

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > It's a $dbh attribute. > > $dbh->{mysql_unsafe_bind_type_guessing} = 1; > > The reason it's considered 'unsafe' is that, theoretically, it's a > place where SQL Injection -could- occur. However, it's extremely > unlikely, given the strictness of t

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > I may be able to help with this. Luckily, if you stick with Oracle > > 9.2+, it can use the standard JOIN syntax. > > Hm, is that reasonable? What is the most popular version of Oracle thes

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > It's a $dbh attribute. > > > > $dbh->{mysql_unsafe_bind_type_guessing} = 1; > > > > The reason it's considered 'unsafe' is that, theoretically, it's a > > place where SQL Injection -could- o

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > The reason I wrote the patch is so that I would use indices for > numeric columns. If MySQL has to convert the value from a string to a > number, it doesn't use an index. You might want to consider that when > dealing with stuff. That shouldn't b

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > "Most popular" is a difficult term. DBD::Oracle supports back to > Oracle 7, after a fashion. 9.2 has been out for about 5-6 years and in > my consulting career, I've never encountered anything before 9.2 > (except in extreme legacy cases where I

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > The reason I wrote the patch is so that I would use indices for > > numeric columns. If MySQL has to convert the value from a string to a > > number, it doesn't use an index. You might want

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > "Most popular" is a difficult term. DBD::Oracle supports back to > > Oracle 7, after a fashion. 9.2 has been out for about 5-6 years and in > > my consulting career, I've never encountered a

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > According to the DBI docs under the description of the execute() > method, it says: > > If any arguments are given, then C will effectively call > L for each value before executing the statement. ...the key word being "effectively." I'm operatin

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > Heh. It's a little more complicated than that. You have to create a > BEFORE INSERT trigger to read the next value from the sequence and set > the ID to it. Well, whatever gymnastics the db owner has to go through to set up the tables in the firs

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > According to the DBI docs under the description of the execute() > > method, it says: > > > > If any arguments are given, then C will effectively call > > L for each value before executing t

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
At this point, we're beyond my 2yr+ old memory of how to do something I never actually implemented in production. :-) Are we going to do this? If we are, I'll bug some friends of mine. Rob --- This SF.net email is sponsored by: Splunk Inc. Do

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread John Siracusa
On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > Are we going to do this? If we are, I'll bug some friends of mine. That probably depends on whether or not someone in "we" has an Oracle server to play with. I'm game if/when I get access to an Oracle database. I hear there's a "personal server

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
On 1/24/06, John Siracusa <[EMAIL PROTECTED]> wrote: > On 1/24/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > Are we going to do this? If we are, I'll bug some friends of mine. > > That probably depends on whether or not someone in "we" has an Oracle > server to play with. I'm game if/when I get ac

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Ron Savage
On Tue, 24 Jan 2006 15:49:29 -0500, Rob Kinyon wrote: Hi Rob Yeah. It's 9 am here now so I'll ask at work today if I can have a database (aka ) set up to play with. But I'd be the only one who could access it. >> Does DBD::Oracle support all of DBI's various *_info() methods correctly? This see

Re: [RDBO] Q: State of Oracle support

2006-01-24 Thread Rob Kinyon
If absolutely necessary, I can set one up on my home server, but I technically don't have a server-like IP access (even though I have DynDNS), so I really don't want a lot of access on it. Rob On 1/24/06, Ron Savage <[EMAIL PROTECTED]> wrote: > On Tue, 24 Jan 2006 15:49:29 -0500, Rob Kinyon wrote

[RDBO] Calling bind_param() explicitly vs. passing args to execute()

2006-01-24 Thread John Siracusa
The benchmark code is at the end of this message. Binding a single value: Rate bind1 exec1 bind1 4174/s-- -2% exec1 4247/s2%-- Binding 10 values: Rate bind10 exec10 bind10 3234/s -- -13% exec10 3700/s14% -- The hit doesn't look horrible, but the sca

Re: [RDBO] Bitfield problem - again

2006-01-24 Thread John Siracusa
On 1/24/06 10:01 AM, Rob Kinyon wrote: > Ahhh ... there's a solution here. *grins* I provided a patch to > DBD::mysql to do param type guessing using the undocumented > mysql_unsafe_bind_type_guessing attribute. [...] This worked like a charm. MySQL 5 bitfields now work with both BIT and TINYINT