Subject: | Support for MySQL REPLACE syntax needed |
SQL::Interp needs support for the REPLACE INTO syntax:
http://dev.mysql.com/doc/refman/5.1/en/replace.html
It's a very simple one-line fix:
[tbrannon@devel SQL-Interp-1.06]$ diff -u lib/SQL/Interp.pm
lib/SQL/Interp.pm.orig
--- lib/SQL/Interp.pm 2009-02-20 12:03:58.000000000 -0500
+++ lib/SQL/Interp.pm.orig 2007-12-20 13:11:59.000000000 -0500
@@ -191,7 +191,7 @@
_sql_interp_data($val);
} keys %$item);
}
- elsif ($sql =~
/\b(REPLACE|INSERT)[\w\s]*\sINTO\s*$id_match\s*$/si) {
+ elsif ($sql =~ /\bINSERT[\w\s]*\sINTO\s*$id_match\s*$/si) {
$item = [ $$item ] if ref $item eq 'SCALAR';
if (ref $item eq 'ARRAY') {
$sql .= " VALUES(" . join(', ', map {
[tbrannon@devel SQL-Interp-1.06]$