[interchange] Make &Vend::Table::DBI::delete_record quote internally, not DBI directly

Jon Jensen interchange-cvs at icdevgroup.org
Fri Apr 29 03:04:09 UTC 2016


commit 712851fc2a65cb514199a357275197b70a3752cf
Author: Jon Jensen <jon at endpoint.com>
Date:   Thu Apr 28 19:47:49 2016 -0600

    Make &Vend::Table::DBI::delete_record quote internally, not DBI directly
    
    Before, this was wrongly passing to DBI's quote method a field name as
    its second parameter instead of a DBI constant such as SQL_NUMERIC or
    SQL_VARCHAR. This bogus second parameter is silently ignored by some
    DBDs, but DBD::Pg fairly recently started rejecting invalid types here:
    
    http://www.nntp.perl.org/group/perl.dbd.pg.changes/2015/02/msg1379.html
    
    Instead, let Interchange's &Vend::Table::DBI::quote do its work like it
    does most everywhere else.

 lib/Vend/Table/DBI.pm |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/lib/Vend/Table/DBI.pm b/lib/Vend/Table/DBI.pm
index 92380b3..268b5bc 100644
--- a/lib/Vend/Table/DBI.pm
+++ b/lib/Vend/Table/DBI.pm
@@ -1901,8 +1901,7 @@ sub delete_record {
 		return undef;
 	}
 
-	## Rely on DBI to quote
-	$key = $s->[$DBI]->quote($key, $s->[$KEY]);
+	$key = $s->quote($key, $s->[$KEY]);
 
     $s->[$DBI]->do("delete from $s->[$QTABLE] where $s->[$QKEY] = $key");
 }



More information about the interchange-cvs mailing list