Upgrading from pre-4.4 to master fails

RESOLVED FIXED in Bugzilla 6.0

Status

()

--
blocker
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: LpSolit, Assigned: LpSolit)

Tracking

({regression})

Bugzilla 6.0
regression
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
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
(Assignee)

Comment 2

3 years ago
Created attachment 8613099 [details] [diff] [review]
patch, v1

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+

Updated

3 years ago
Flags: approval?
Flags: approval? → approval+
(Assignee)

Comment 4

3 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   1ed6e01..f53defb  master -> master
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.