Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19639

Fix deltas on null base values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.3
    • Component/s: Core, Quotas
    • Tags:
    • Sprint:
      nxFG 8.3.2, nxFG 8.3.3
    • Story Points:
      0

      Description

      When applying a DeltaLong to a value, the case of non-initialized property (null) must be treated properly because:

      • on VCS we cannot increment a NULL value (UPDATE table SET col = col + 100 gives NULL on NULL columns).
      • on MongoDB we have to make sure that there is no field set and not an actual null value (because $inc does the right thing on a non-existent field but fails on a null value with the following error.

        Cannot apply $inc to a value of non-numeric type. {_id: ObjectId('573167aac9e77c68ffe32e5a')} has the field 'dss:sizeTrash' of non-numeric type NULL

      So we must:

      • make sure we always know exactly what we expect to be stored in the database, so avoid schemas with default values,
      • store in the DeltaLong the expected base value including when it is null,
      • on MongoDB unset fields that are null,
      • on VCS only increment when the base of the DeltaLong is not null, otherwise do a normal store.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d