Browse files

Rely on DBI to provide quoting when necessary, prevent problems

if numeric/float keys allowed in some databases.
  • Loading branch information...
1 parent 90b150a commit 0ff8004497578c64a12d5bf3c0819f9154f5347a Mike Heins committed Feb 3, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/Vend/Table/DBI.pm
View
7 lib/Vend/Table/DBI.pm
@@ -1740,9 +1740,10 @@ sub delete_record {
);
return undef;
}
- unless( exists $s->[$CONFIG]{NUMERIC}{$s->[$KEY]} and $key =~ /^\d+$/) {
- $key = $s->[$WDBI]->quote($key)
- }
+
+ ## Rely on DBI to quote
+ $key = $s->[$WDBI]->quote($key, $s->[$KEY]);
+
$s->[$DBI]->do("delete from $s->[$TABLE] where $s->[$KEY] = $key");
}

0 comments on commit 0ff8004

Please sign in to comment.