Bug 861127 - Upgrade issue with respect to min/max property attributes
Upgrade issue with respect to min/max property attributes
Product: RHQ Project
Classification: Other
Component: Database (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: Mike Thompson
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2012-09-27 11:16 EDT by Heiko W. Rupp
Modified: 2013-09-04 05:41 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-04 05:41:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Log from customer upgrade that went awry (1.61 MB, application/octet-stream)
2012-09-27 17:18 EDT, Mike Thompson
no flags Details

  None (edit)
Description Heiko W. Rupp 2012-09-27 11:16:32 EDT
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 2 Mike Thompson 2012-09-27 17:13:32 EDT
master commit id: a751296

This was an issue of adding a new field and not upgrading all of the nulls to 0's if there was previous values in the db. The new fix converts the nulls to zeros and also prevents this from happening on any new values by converting the null to zero on the setters.

The affected fields are:
PropertyDefinitionList.min and PropertyDefinitionList.max

I will move this to modified until verification of the upgrade tests.
Comment 3 Mike Thompson 2012-09-27 17:18:01 EDT
Created attachment 618291 [details]
Log from customer upgrade that went awry
Comment 4 Andreas Veithen 2012-09-28 07:46:42 EDT
+                    <statement desc="Update the NULL to 0 for MAX_ENTRIES">
+                        UPDATE RHQ_CONFIG_PROP_DEF
+                        SET MAX_ENTRIES = 0
+                        WHERE MAX_ENTRIES IS NULL
+                    </statement>

Shouldn't the default value for MAX_ENTRIES be 2147483647 (Integer.MAX_VALUE)?
Comment 5 Mike Thompson 2012-09-28 11:06:50 EDT
You are correct Andreas. Thanks that would have manifested itself later as another bug. Cut and paste errors in the fog of war;)
Comment 6 Mike Thompson 2012-09-30 14:16:49 EDT
Commit to master: aed6157

This latest fix sets an appropriate maximum enables fixes the test for checking  failures of the database upgrade process (which was not enabled for this version RHQ4.5).
Comment 7 Heiko W. Rupp 2013-09-04 05:41:20 EDT
Closing as this has been implemented for a long time.

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