Skip to content

Commit

Permalink
Make &Vend::Table::DBI::delete_record quote internally, not DBI directly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonjensen committed Apr 29, 2016
1 parent f96adeb commit 712851f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Vend/Table/DBI.pm
Expand Up @@ -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");
}
Expand Down

0 comments on commit 712851f

Please sign in to comment.