aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMatt Tyson <mtyson@redhat.com>2015-07-28 18:46:56 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-07-28 18:46:56 +0200
commitfdc4581ff1a2b73ef5c4c9d07825cfa599e5b972 (patch)
tree4ef579d7a67ac037b4d7c0c0a0a8fed38ed30fd6 /Bugzilla
parent7fec5691f3fdabacefb646b12c4dcc610210a499 (diff)
downloadbugs-fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972.tar
bugs-fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972.tar.gz
bugs-fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972.tar.bz2
bugs-fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972.tar.xz
bugs-fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972.zip
Bug 1186700: Inserting data into the mail_staging table fails on PostgreSQL due to unspecified BLOB type
r=gerv a=sgreen
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Mailer.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index 0b82ded41..6c4de83e7 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -41,6 +41,8 @@ sub MessageToMTA {
return;
}
+ my $dbh = Bugzilla->dbh;
+
my $email;
if (ref $msg) {
$email = $msg;
@@ -58,11 +60,14 @@ sub MessageToMTA {
# email immediately, in case the transaction is rolled back. Instead we
# insert it into the mail_staging table, and bz_commit_transaction calls
# send_staged_mail() after the transaction is committed.
- if (! $send_now && Bugzilla->dbh->bz_in_transaction()) {
+ if (! $send_now && $dbh->bz_in_transaction()) {
# The e-mail string may contain tainted values.
my $string = $email->as_string;
trick_taint($string);
- Bugzilla->dbh->do("INSERT INTO mail_staging (message) VALUES(?)", undef, $string);
+
+ my $sth = $dbh->prepare("INSERT INTO mail_staging (message) VALUES (?)");
+ $sth->bind_param(1, $string, $dbh->BLOB_TYPE);
+ $sth->execute;
return;
}