diff options
author | Matt Tyson <mtyson@redhat.com> | 2015-07-28 18:46:56 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2015-07-28 18:46:56 +0200 |
commit | fdc4581ff1a2b73ef5c4c9d07825cfa599e5b972 (patch) | |
tree | 4ef579d7a67ac037b4d7c0c0a0a8fed38ed30fd6 /Bugzilla | |
parent | 7fec5691f3fdabacefb646b12c4dcc610210a499 (diff) | |
download | bugs-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.pm | 9 |
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; } |