Subject: | on duplicate key update |
Date: | Wed, 5 Jun 2013 12:41:51 -0400 |
To: | bug-DBI [...] rt.cpan.org |
From: | Larry Siden <lsiden [...] gmail.com> |
Show quoted text
>
> do {
> my $sth->prepare('insert into mytable ... on duplicate key update
> key=val, ...');
> $sth->execute(@values);
> };
should return 1 if a row was inserted and 2 if a row was updated, but on my
installation it always returns 1 unless there was some error.
While this is not documented in the Perl docs for DBI, this feature is part
of MySQL and a post on StackOverflow report that DBI::execute() complies
with this feature: http://stackoverflow.com/a/11800417/270511
I'm trying to avoid a duplicate post, but I could not find anything on
https://rt.cpan.org/Public/Dist/Display.html?Name=DBI. (There is a search
box, but I cannot find a feature that will enable me to limit my search to
one Perl module, so I don't have an effective way to look for this bug on
rt.cpan.org.)
- mysql Ver 14.12 Distrib 5.0.96, for sun-solaris2.9 (sparc) using
readline 5.1
- Perl 5.10.1
- DBI 1.616
Please add me to the mail notification list for this bug. Thank you.