Open dglee3 opened 2 years ago
Adding some documentation on reproducing this issue:
getSchema.m:
function obj = getSchema
persistent schemaObject
if isempty(schemaObject)
schemaObject = dj.Schema(dj.conn, 'test', 'test');
end
obj = schemaObject;
end
Person.m:
%{
person: varchar(30)
-----
myblob: longblob
%}
classdef Person < dj.Manual
end
test_insert_empty_array.m:
clc
clear functions
dj.version
dj.conn
dj.createSchema('test', '/src/test', 'test')
test.Person
insert(test.Person, {'jeff', [1,2,3,4]})
insert(test.Person, {'jeff2', []})
schemaObject = dj.Schema(dj.conn, 'test', 'test');
fetch1(test.Person & 'person="jeff"', 'myblob')
fetch1(test.Person & 'person="jeff2"', 'myblob')
dropQuick(schemaObject)
So that would confirm that there is a regression issue between the two version as you should be able to store and retrieve []
Thanks @jverswijver for testing and collecting these details! This does confirm a regression issue which elevates the priority.
@dglee3 We are wrapping up a few features on datajoint/datajoint-python so we'll be able to address this soon thereafter. We'll have more updates on planning this activity next week.
Bug Report
Description
In a newer version of DataJoint, empty matrices ([]) are inserted into a table as NULL rather than a longblob representing the empty set. This results in discrepancies when fetching data uploaded by different versions.
Reproducibility
puff: longblob
Error in dj.Relvar/insert (line 353) [v, placeholder] = makePlaceholder(i, tuple.(header.attributes(i).name));
Error in experiment.TrialSummary/makeTuples (line 144) insert(self, key)
Error in dj.internal.AutoPopulate/taskCore (line 215) self.makeTuples(key)
Error in dj.internal.AutoPopulate>@(key,fun,args)fun(args{:}) (line 129) rels{i}.executionEngine = @(key, fun, args) fun(args{:});
Error in dj.internal.AutoPopulate/populate_ (line 327) self.executionEngine(key, @taskCore, {self, key})
Error in dj.internal.AutoPopulate/populate (line 130) [varargout{1:nargout}] = rels{i}.populate_(varargin{:});