Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-25 Thread Kyle Hayes
As of a couple of months ago, there is a bug with DBI's implementation of $dbh->{'mysql_insert'}. It didn't handle 64-bit IDs correctly. We converted everything to use SELECT LAST_INSERT_ID(). It works. MySQL is fine, the problem was in DBI. Don't use SELECT MAX(ID) ... as that will not d

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-25 Thread Ilya Martynov
x> My problem with this is that I have no control over the versioning. I'm x> using an ISP who was gracious enough to upgrade one of the servers (hosting x> our largest clients) to 3.23 because it was having a BUNCH of other x> problems. x> So if the {mysql_insertid} thing is an issue, is there

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-23 Thread Chip Paswater
I use: $Gdata{'custid'} = $dbh->{'mysql_insertid'}; on 3.23.38 with perl 5.6.1 and DBI-1.15 Works like a champ! On Sat, Jun 23, 2001 at 01:07:07PM -0500, xris wrote: > > Two things you might want to try... first download and install the newest > > Msql-Mysql DBD drivers.. check what the docume

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-23 Thread xris
> Two things you might want to try... first download and install the newest > Msql-Mysql DBD drivers.. check what the documentation says in there.. and > second, keep changing what variable you are trying to access and maybe you > will find one works that isnt documented. My problem with this is

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-23 Thread Colin Faber
personally I don't care what select you guys feel the need to call, so long as the dbi call is correct, rather it doesn't matter though because selectrow_array() simply calls prepare() execute() any ways. I'd normally use LAST_INSERT_ID() my self (only if i had to) other wise find a better way t

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-23 Thread ryc
> >heh, my ($id) = $dbh->selectrow_array("SELECT MAX(id) FROM tbl;"); > > You're in for a VERY nasty surprise as soon as two of these happen to > run in parallel. I agree, you may get another insert before that select occurs and end up getting the wrong id. You should use "SELECT LAST_INSERTID()"

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-23 Thread Matthias Urlichs
At 0:36 -0600 2001-06-23, Colin Faber wrote: >heh, my ($id) = $dbh->selectrow_array("SELECT MAX(id) FROM tbl;"); You're in for a VERY nasty surprise as soon as two of these happen to run in parallel. Our code uses $sth->{mysql_insertid}. We don't have any 3.22 servers, though -- they can't do

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-22 Thread Colin Faber
heh, my ($id) = $dbh->selectrow_array("SELECT MAX(id) FROM tbl;"); xris wrote: > > > Woops sorry about that last message. > > Try using the following: > > my $id = $sth->{insertid}; > > That is what I had to change it to, to get it working.. despite what the > > documentation says. > > Actually

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-22 Thread xris
> Woops sorry about that last message. > Try using the following: > my $id = $sth->{insertid}; > That is what I had to change it to, to get it working.. despite what the > documentation says. Actually, I can't use that. The script dies, it's not like it just warns me that it doesn't work, but it

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-22 Thread ryc
Woops sorry about that last message. Try using the following: my $id = $sth->{insertid}; That is what I had to change it to, to get it working.. despite what the documentation says. GL. ryan > > My ISP recently updated one of their servers to 3.23.38, and all of a > sudden > > a BUNCH of my

Re: $sth->{mysql_insertid} not working in 3.23.38?

2001-06-22 Thread ryc
I had the same problem when upgrading... and I found that using > My ISP recently updated one of their servers to 3.23.38, and all of a sudden > a BUNCH of my code stopped working. I use a number of insert queries (new > items, new search caches, etc), where I insert a blank record, and then t

$sth->{mysql_insertid} not working in 3.23.38?

2001-06-22 Thread xris
My ISP recently updated one of their servers to 3.23.38, and all of a sudden a BUNCH of my code stopped working. I use a number of insert queries (new items, new search caches, etc), where I insert a blank record, and then take notes of its id (usually "int unsigned auto_increment primary key"),