datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 37 forks source link

ExternalStorage: Bug related to extremenly short table names #311

Closed guzman-raphael closed 3 years ago

guzman-raphael commented 3 years ago

This issue is for the corner case where table names are extremely short e.g. a.

The error is with the TableAccessor here. It implicitly assumes table names have a minimum of 2 characters (from here; compute tables have a 2 character prefix i.e. __).

Fix could be fairly straightforward in TableAccessor e.g.

if tierCharLen > 0 && length(tableName) >= tierCharLen && ~isempty(regexp(dj.Schema.tierPrefixes{k}, ...

Even better would be to use a regex to extract only the prefix and compare directly...