[interchange] Rely on DBI to provide quoting when necessary, prevent problems

Mike Heins <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 0ff8004497578c64a12d5bf3c0819f9154f5347a
Author: Mike Heins <[email protected]>
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");
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.