f54e44c Ticket #47435 - Very large entryusn values after enabling the USN plugin and the lastusn value is negative.

Authored and Committed by nhosoi 10 years ago
    Ticket #47435 - Very large entryusn values after enabling the USN plugin and the lastusn value is negative.
    
    1. Bug description: The initial value of lastusn is -1, but since
    the entryusn has the unsigned long long integer type, the server
    returns 18446744073709551615 == 0XFFFFFFFFFFFFFFFF.
    
    Fix description: The initial value "-1" is returned as it is.
    
    2. Bug description: Entryusn syntax is defined as an integer in
    the schema.  If negative values are accidentally stored in the
    entryusn value in the database, it was casted to the unsigned
    integer in the entryusn initialization code (usn_get_last_usn).
    
    Fix description: When an entryusn value is retrieved from the
    database, it's checked as a singed integer once and if it is
    negative, it's replaced with the initial value "-1".
    
    https://fedorahosted.org/389/ticket/47435
    
    Reviewed by Mark and Rich (Thank you!!)
    (cherry picked from commit c94da991450da486b2032815b867bd2548a1614c)