|Subject:||on duplicate key update|
|Date:||Wed, 5 Jun 2013 12:41:51 -0400|
|From:||Larry Siden <email@example.com>|
Show quoted text
my $sth->prepare('insert into mytable ... on duplicate key update key=val, ...');
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:
I'm trying to avoid a duplicate post, but I could not find anything on . (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.