Closed Bug 1186700 Opened 5 years ago Closed 5 years ago

Inserting data into the mail_staging table fails on PostgreSQL due to unspecified BLOB type

Categories

(Bugzilla :: Database, defect, major)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: mtyson, Assigned: mtyson)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Attached patch mailer_blob_fix (obsolete) — Splinter Review
The "INSERT INTO mail_staging" in Bugzilla/Mailer.pm fails on Postgres as we don't tell the driver that the column is a BLOB type, which means that it doesn't know to escape the data properly for a blob type.

Attached is a patch to tell the driver that we are passing in a BLOB.
Attachment #8637544 - Flags: review?(gerv)
Previous patch had an unneeded "my $dbh = Bugzilla->dbh".  (A leftover from porting the patch from 4.4)
Attachment #8637544 - Attachment is obsolete: true
Attachment #8637544 - Flags: review?(gerv)
Attachment #8637577 - Flags: review?(gerv)
Comment on attachment 8637577 [details] [diff] [review]
mailer_blob_fix_2

>+        my $sth = $dbh->prepare("INSERT INTO mail_staging (message) VALUES(?)");

Nit: add a whitespace after VALUES: VALUES (?). Otherwise this looks good.
Severity: normal → major
Status: NEW → ASSIGNED
Depends on: 448574
Flags: blocking5.0.1?
Keywords: regression
Summary: mail_staging insert doesn't specify BLOB type → Inserting data into the mail_staging table fails on PostgreSQL due to unspecified BLOB type
Target Milestone: --- → Bugzilla 5.0
Version: unspecified → 5.0
Comment on attachment 8637577 [details] [diff] [review]
mailer_blob_fix_2

Review of attachment 8637577 [details] [diff] [review]:
-----------------------------------------------------------------

r=gerv with LpSolit's change.

Gerv
Attachment #8637577 - Flags: review?(gerv) → review+
Flags: approval?
Flags: approval5.0?
Flags: approval?
Flags: approval5.0?
Flags: approval5.0+
Flags: approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   61a971c..12ca183  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   7fec569..fdc4581  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Flags: blocking5.0.1?
You need to log in before you can comment on or make changes to this bug.