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
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
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
> 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
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
> >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()"
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
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
> 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
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
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
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"),
12 matches
Mail list logo