in reply to Re^4: DBH Insert of Binary Data
in thread DBH Insert of Binary Data
Try this with your favorite DBD. The DBD and/or the RDBMS may prevent the injection at some later time, but the quote method has little to do with it.
my $val = $dbh->quote(q{Boston;DELETE FROM myTable});As for the quote method not messing up a binary, you're probably correct in most cases, but in cases where the DBD supports several escaping methods (e.g. both '' and \') it's possible to have problems. And even where it doesn't cause problems, you're adding three different steps to the process - quoting the Blob, unquoting the Blob, and parsing the Blob as a value within the SQL string.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: DBH Insert of Binary Data
by Joost (Canon) on Mar 19, 2005 at 01:36 UTC | |
by jZed (Prior) on Mar 19, 2005 at 01:39 UTC | |
by Joost (Canon) on Mar 19, 2005 at 01:44 UTC | |
by jZed (Prior) on Mar 19, 2005 at 01:46 UTC |
In Section
Seekers of Perl Wisdom