Closed Bug 1169767 Opened 9 years ago Closed 9 years ago

Upgrading from pre-4.4 to master fails

Categories

(Bugzilla :: Installation & Upgrading, defect)

defect
Not set
blocker

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file)

Bug 1007605 added this code into Bugzilla::Config::BugChange:

  my $resolution_field = Bugzilla::Field->new({ name => 'resolution', cache => 1 });

But this code will load all columns from the fielddefs table before checksetup.pl had a chance to upgrade the DB schema, and if you upgrade from 4.2 or older, the new long_desc column has not yet been added to the fielddefs table, and so this code will crash:

DBD::mysql::db selectrow_hashref failed: Unknown column 'long_desc' in 'field list' [for Statement "SELECT id,name,description,long_desc,type,custom,mailhead,sortkey,obsolete,enter_bug,buglist,visibility_field_id,value_field_id,reverse_desc,is_mandatory,is_numeric FROM fielddefs WHERE name = ?"] at Bugzilla/Object.pm line 156.
        Bugzilla::Object::_load_from_db('Bugzilla::Field', 'HASH(0xda957e8)') called at Bugzilla/Object.pm line 83
        Bugzilla::Object::new('Bugzilla::Field', 'HASH(0xda957e8)') called at Bugzilla/Config/BugChange.pm line 34
        Bugzilla::Config::BugChange::get_param_list('Bugzilla::Config::BugChange') called at Bugzilla/Config.pm line 45
        Bugzilla::Config::_load_params() called at Bugzilla/Config.pm line 213
        Bugzilla::Config::update_params() called at ./checksetup.pl line 140


Upgrading from 4.4 or 5.0 to master will work, because their DB schema already has the new long_desc column.
Oh :-( How do we fix this?

Gerv
Attached patch patch, v1Splinter Review
Only load the code when needed, i.e. when displaying editparams.cgi.
Assignee: installation → LpSolit
Status: NEW → ASSIGNED
Attachment #8613099 - Flags: review?(dkl)
Comment on attachment 8613099 [details] [diff] [review]
patch, v1

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

r=dkl
Attachment #8613099 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval? → approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   1ed6e01..f53defb  master -> master
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: