Bugs in study Date columns in 14.1

LabKey Support Forum (Inactive)
Bugs in study Date columns in 14.1 Anthony Corbett  2014-05-20 08:35
Status: Closed
 

Yes, in 14.1 I am able to insert and update an existing row with a null value for the date and it saves successfully. In 13.3 this returned an error with a required message.

I should note that we are running 14.1 revision 32327 if that helps.


I ran the following query on both our production server (13.3) and our staging server ( 14.1, a mirror copy of the 13.3 database then upgraded to 14.1):

SELECT dd.name, dd.domainid, pdom.required, pd.name, pd.rangeuri
FROM exp.domaindescriptor dd
LEFT JOIN exp.propertydomain pdom on pdom.domainid = dd.domainid
LEFT JOIN exp.propertydescriptor pd on pd.propertyid=pdom.propertyid
WHERE dd.container='016c8d71-64a2-102f-a436-294e4fa51049' and dd.name='birthBaselineVisit';


13.3 property descriptors:

        name | domainid | required | name | rangeuri
--------------------+----------+----------+----------------------+-------------------------------------------
 birthBaselineVisit | 1108 | t | eval_location | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | t | date | http://www.w3.org/2001/XMLSchema#dateTime
 birthBaselineVisit | 1108 | t | baseline_appearance | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | t | baseline_illnessType | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | f | baseline_weight | http://www.w3.org/2001/XMLSchema#double
(5 rows)


14.1 property descriptors:

        name | domainid | required | name | rangeuri
--------------------+----------+----------+----------------------+-----------------------------------------
 birthBaselineVisit | 1108 | t | eval_location | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | t | baseline_appearance | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | t | baseline_illnessType | http://www.w3.org/2001/XMLSchema#int
 birthBaselineVisit | 1108 | f | baseline_weight | http://www.w3.org/2001/XMLSchema#double
(4 rows)



I think it is incorrect to say that upgrading to 14.1 doesn't delete any metadata, as you can see that the date property descriptor for this dataset is removed in 14.1. I don't know how a user defined field in 13.3 that had user specified metadata can be applied in 14.1 if the property descriptor is deleted.

Since the date property descriptor is deleted in 14.1 and the DATE PropertyStorageSpec in DatasetDomainKind.BASE_PROPERTIES Set is initialized with the nullable set to TRUE, there is no way to make this date field required in 14.1. Hence is completely non-backwards compatible.

To stay backwards compatible maybe a fix would be to not delete property descriptors that overlap with DatasetDomainKind.BASE_PROPERTIES when the code is upgrading the database to 14.1; especially dates....