Skip to content

Commit 14c094e

Browse files
Merge pull request #240 from guzman-raphael/fix-238
Add check for sparse blobs
2 parents 1dd9c55 + d842885 commit 14c094e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

+dj/Relvar.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ function insert(self, tuples, command)
249249
blobs{end+1} = char(v); %#ok<AGROW>
250250
end
251251
elseif header.attributes(i).isBlob
252+
assert(~issparse(v), ...
253+
'DataJoint:DataType:Mismatch', ...
254+
'The field `%s` must not be a sparse blob', ...
255+
header.attributes(i).name);
252256
valueStr = sprintf('%s"{M}",', valueStr);
253257
blobs{end+1} = v; %#ok<AGROW>
254258
else
@@ -363,6 +367,10 @@ function update(self, attrname, value)
363367
valueStr = '"{S}"';
364368
value = {char(value)};
365369
case header.attributes(ix).isBlob
370+
assert(~issparse(value), ...
371+
'DataJoint:DataType:Mismatch', ...
372+
'The field `%s` must not be a sparse blob', ...
373+
attrname);
366374
valueStr = '"{M}"';
367375
value = {value};
368376
case header.attributes(ix).isNumeric

0 commit comments

Comments
 (0)