[MySQL] In MySQL 5, columns sometimes have defaults that have no defaults in the Schema

RESOLVED FIXED in Bugzilla 3.4

Status

()

RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: mkanat, Assigned: mkanat)

Tracking

Bugzilla 3.4
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
The current checksetup-landfill test is failing with a lot of differences like this:

-  `grantor_id` mediumint(9) NOT NULL default '0'
+  `grantor_id` mediumint(9) NOT NULL

When you import an old DB into MySQL 5, some columns contain defaults when they shouldn't--I think this is because old MySQLs always had defaults on columns. We should remove defaults from columns that aren't supposed to have them, on an upgrade.
(Assignee)

Comment 1

10 years ago
Created attachment 353191 [details] [diff] [review]
v1

Okay, this fixes it. We remove defaults from columns that shouldn't have them, if we're on MySQL 5 and bugs.assigned_to has a default (which is the oldest column that could have this problem).
Assignee: database → mkanat
Status: NEW → ASSIGNED
Attachment #353191 - Flags: review+
(Assignee)

Updated

10 years ago
Attachment #353191 - Attachment description: 1 → v1
(Assignee)

Comment 2

10 years ago
Okay, tests should pass now.

Checking in Bugzilla/DB/Mysql.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v  <--  Mysql.pm
new revision: 1.70; previous revision: 1.69
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Flags: approval+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.