Bug 455800

Summary: Update database during migration to change NULL resolution values to empty string
Product: [Community] Bugzilla Reporter: David Lawrence <dkl>
Component: DatabaseAssignee: David Lawrence <dkl>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 3.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-30 20:15:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 406071    
Attachments:
Description Flags
Patch to update bugs.resolution to empty string during database migration (v1)
tfu: review-
Patch to update bugs.resolution to empty string during database migration (v2) none

Description David Lawrence 2008-07-17 20:58:04 UTC
Description of problem:
Update db_fixup.sql to change all NULL resolution values in the bugs table to
empty strings to match the format 3.2 is expecting. Eventually this will be
fixed back to NULL along with the upstream.

Comment 1 David Lawrence 2008-07-17 22:36:01 UTC
Created attachment 312087 [details]
Patch to update bugs.resolution to empty string during database migration (v1)

Comment 2 David Lawrence 2008-07-17 22:36:30 UTC
Comment on attachment 312087 [details]
Patch to update bugs.resolution to empty string during database migration (v1)

Tony please verify that this looks okay.

Thanks
Dave

Comment 3 Tony Fu 2008-07-18 03:30:45 UTC
Comment on attachment 312087 [details]
Patch to update bugs.resolution to empty string during database migration (v1)

>Index: redhat/db_fixup.sql
>===================================================================
>RCS file: /cvs/qa/rh_bugzilla_3/redhat/db_fixup.sql,v
>retrieving revision 1.13
>diff -u -r1.13 db_fixup.sql
>--- redhat/db_fixup.sql	26 Jun 2008 15:51:41 -0000	1.13
>+++ redhat/db_fixup.sql	17 Jul 2008 22:34:31 -0000
>@@ -331,4 +331,9 @@
> 
> --- Create new columns in fielddefs needed for public custom field support
> ALTER TABLE fielddefs ADD COLUMN public tinyint(4) NOT NULL default '0';
>+
>+--- Update bugs table, set NULL resolution values to empty string
>+UPDATE bugs SET resolution = '' WHERE resolution = NULL;
--- xxx-tfu: Mysql uses "IS NULL" rather than "=null" to check NULL value, so
the above query should be
--- UPDATE bugs SET resolution = '' WHERE resolution IS NULL;

>+ALTER TABLE bugs MODIFY resolution VARCHAR(64) NOT NULL DEFAULT '';
>+
>

Comment 4 David Lawrence 2008-07-18 03:47:03 UTC
Created attachment 312098 [details]
Patch to update bugs.resolution to empty string during database migration (v2)

Ugh, I knew that but went brain dead when I wrote that. Good catch. Here is an
updated patch.

Thanks
Dave

Comment 5 David Lawrence 2008-07-23 20:58:27 UTC
Checked in fix to redhat/db_fixup.sql for this.

Comment 6 David Lawrence 2008-07-30 20:15:19 UTC
Pushed to partner-bugzilla.redhat.com today.