MantisBT: master a3e52aab

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

Ensure consistent definition blob columns

In 1.2.x, custom code in adodb-datadict.inc.php disabled silent dropping
of NOT NULL attribute (see 19dbfb0e290a30fcfe1ec29566e611d36c1c7aa9).
Consequently, BLOBs columns created in that version do not allow NULL
values:

mysql> desc mantis_bug_file_table content;
+---------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+----------+------+-----+---------+-------+
| content | longblob | NO | | NULL | |
+---------+----------+------+-----+---------+-------+

In 1.3, we reverted to standard ADOdb behavior, so the NOT NULL
attribute is ignored by the data dictionary and BLOB columns are
allowed to be NULL:

mysql> desc mantis_bug_file_table content;
+---------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+----------+------+-----+---------+-------+
| content | longblob | YES | | NULL | |
+---------+----------+------+-----+---------+-------+

This results in an inconsistent schema definition between instances
upgraded from 1.2.x to 1.3.x, vs created straight in 1.3.x.

To avoid any issues due to this situation, we add 2 schema steps to
update the BLOB columns so they allow NULL values.

Issue 0020547

mod - admin/schema.php Diff File