Bug 455800 - Update database during migration to change NULL resolution values to empty string
Update database during migration to change NULL resolution values to empty st...
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Database (Show other bugs)
3.2
All Linux
low Severity low (vote)
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks: RHBZ30UpgradeTracker
  Show dependency treegraph
 
Reported: 2008-07-17 16:58 EDT by David Lawrence
Modified: 2013-06-24 00:04 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-30 16:15:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to update bugs.resolution to empty string during database migration (v1) (682 bytes, patch)
2008-07-17 18:36 EDT, David Lawrence
tfu: review-
Details | Diff
Patch to update bugs.resolution to empty string during database migration (v2) (683 bytes, patch)
2008-07-17 23:47 EDT, David Lawrence
no flags Details | Diff

  None (edit)
Description David Lawrence 2008-07-17 16:58:04 EDT
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 18:36:01 EDT
Created attachment 312087 [details]
Patch to update bugs.resolution to empty string during database migration (v1)
Comment 2 David Lawrence 2008-07-17 18:36:30 EDT
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-17 23:30:45 EDT
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-17 23:47:03 EDT
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 16:58:27 EDT
Checked in fix to redhat/db_fixup.sql for this.
Comment 6 David Lawrence 2008-07-30 16:15:19 EDT
Pushed to partner-bugzilla.redhat.com today.

Note You need to log in before you can comment on or make changes to this bug.