I switched to DJ 3.4.1 and the behavior of "fetchn" had changed. In older versions, if the query was empty "fetchn" used to return just an empty result. But in the new version it throws an error. To solve this I now need to wrap every fetchn with an if statement to check that the query is not empty, which is very cumbersome.
Reproducibility
Include:
OS (WIN | MACOS | Linux) WINDOWS
MATLAB Version 2019a
MySQL Version
MySQL Deployment Strategy (local-native | local-docker | remote)
DataJoint Version 3.4.1
Minimum number of steps to reliably reproduce the issue
Complete error stack as a result of evaluating the above steps
Expected Behavior
A clear and concise description of what you expected to happen.
I expect to get an empty result of the fetchn.
Instead I get:
tr_ignore = fetchn(EXP.BehaviorTrial & key & 'outcome="ignore"','trial');
Index exceeds the number of array elements (0).
Error in dj.internal.GeneralRelvar/fetchn (line 292)
if isnumeric(s(1).(name{1}{1})) && length(s(1).(name{1}{1})) == 1
Bug Report
Description
I switched to DJ 3.4.1 and the behavior of "fetchn" had changed. In older versions, if the query was empty "fetchn" used to return just an empty result. But in the new version it throws an error. To solve this I now need to wrap every fetchn with an if statement to check that the query is not empty, which is very cumbersome.
Reproducibility
Include:
Expected Behavior
A clear and concise description of what you expected to happen.
I expect to get an empty result of the fetchn.
Instead I get:
tr_ignore = fetchn(EXP.BehaviorTrial & key & 'outcome="ignore"','trial'); Index exceeds the number of array elements (0).
Error in dj.internal.GeneralRelvar/fetchn (line 292) if isnumeric(s(1).(name{1}{1})) && length(s(1).(name{1}{1})) == 1