[interchange] Rely on DBI to provide quoting when necessary, prevent problems
Mike Heins
interchange-cvs at icdevgroup.org
Thu Feb 3 22:36:32 UTC 2011
commit 0ff8004497578c64a12d5bf3c0819f9154f5347a
Author: Mike Heins <mike at bill.heins.net>
Date: Thu Feb 3 17:33:59 2011 -0500
Rely on DBI to provide quoting when necessary, prevent problems
if numeric/float keys allowed in some databases.
lib/Vend/Table/DBI.pm | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/lib/Vend/Table/DBI.pm b/lib/Vend/Table/DBI.pm
index f40261c..c3a5b5d 100644
--- a/lib/Vend/Table/DBI.pm
+++ b/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");
}
More information about the interchange-cvs
mailing list