MantisBT: master f1d5a8b3

Author Committer Branch Timestamp Parent
dregad dregad master 2016-01-30 13:04 master 66f735c5
Affected Issues  0020547: Attachments can't be uploaded after upgrade from 1.2 with MySQL in STRICT_ALL_TABLES sql_mode
Changeset

Insert file attachments records in a single step

Commit 12a7f8342b9df21b694a7c0bf23f251230add2ad split the attachment of
a BLOB in the bug_file and project_file tables in 2 steps, first
inserting the record, then updating it to add the BLOB's content.

This introduced a regression with MySQL when SQL_MODE is set to
STRICT_ALL_TABLES and the database was created pre 1.3.x and
subsequently upgraded. In 1.2, BLOB columns are created with a NOT NULL
attribute, due to custom ADOdb code (see 19dbfb0e290a30fcfe1ec29566e611d36c1c7aa9)

This reverts the behavior to what it was before 12a7f834, i.e. execute a
single INSERT statement that also populates the BLOB (except with Oracle
which requires this to occur as a separate operation).

Fixes 0020547

mod - api/soap/mc_file_api.php Diff File
mod - core/file_api.php Diff File