Comments (6)
Example of an incorrect deletion on version 3.4.2
table lab.DutyRoaster: (lab.User as foreign key many times)
%{
duty_roaster_date: date # date from which this assignment is valid.
-----
(monday_duty) -> lab.User(user_id)
(tuesday_duty) -> lab.User(user_id)
(wednesday_duty) -> lab.User(user_id)
.
.
%}
testtech_del1 is a reference only for record 2 {'2021-03-11'}
lab.DutyRoaster
DUTY_ROASTER_DATE monday_duty tuesday_duty wednesday_duty ...
_________________ _________________ _________________ _________________ ...
{'2021-03-10'} {'jrw10' } {'baptista' } {'jrw10' } ...
{'2021-03-11'} {'testtech_del1'} {'testtech_del2'} {'testtech_del1'} ...
We try to delete that user it tries to delete all records from duty_roaster :
key.user_id = 'testtech_del1'
del(lab.User & key)
ABOUT TO DELETE:
1 tuples from `u19_lab`.`user` (manual)
2 tuples from `u19_lab`.`duty_roaster` (manual)
from datajoint-matlab.
from datajoint-matlab.
Do we have any updates on this ?
Our team here in Princeton has been facing this issue a lot now.
Thanks
from datajoint-matlab.
Hi @Alvalunasan, thanks for the report. After discussion with @guzman-raphael, the team will be able to return to this issue within 2-3 weeks.
from datajoint-matlab.
Just commenting here since this hasn't had any traction in a while. I believe this issue can be resolved with an edit to a single line of code, as in 938626c. This probably arose in the most recent release because of weak typing in MATLAB and testing against a table with only one foreign key. I haven't checked that the rest of the logic there is sound, but if you read the comments it's obvious this is what they were going for. So as a workaround before this gets formally addressed you should just be able to edit that line in your datajoint installation.
from datajoint-matlab.
Thanks @Alvalunasan. I will adapt your example for a test case.
Schema diagram
Table definitions
lab.User
%{
user_id: varchar(32)
%}
classdef User < dj.Manual
end
lab.Duty
%{
duty_date: date
-----
(duty_first) -> lab.User(user_id)
(duty_second) -> lab.User(user_id)
%}
classdef Duty < dj.Manual
end
Insert table entries
users = [{'user0'
'user1'
'user2'}]
insert(lab.User, users)
duty = [{'2020-01-01','user0','user1'},
{'2020-12-31','user1','user2'}]
insert(lab.Duty, duty)
Table entries
lab.User()
USER_ID
_________
{'user0'}
{'user1'}
{'user2'}
lab.Duty()
DUTY_DATE duty_first duty_second
______________ __________ ___________
{'2020-01-01'} {'user0'} {'user1'}
{'2020-12-31'} {'user1'} {'user2'}
Test case 1 with DataJoint MATLAB 3.4.2
Versions
MATLAB R2020b
DataJoint MATLAB 3.4.2
mym 2.8.2
- Deleting
user0
in lab.User, deletes all entries in lab.Duty table.
key.user_id = 'user0'
del(lab.User & key)
ABOUT TO DELETE:
1 tuples from `kabilar_lab`.`user` (manual)
2 tuples from `kabilar_lab`.`duty` (manual)
Proceed to delete? (yes/no) > yes
Deleting from lab.Duty
Deleting from lab.User
committed
lab.Duty()
0 tuples
Test case 2 with DataJoint MATLAB 3.4.3
Versions
MATLAB R2020b
DataJoint MATLAB 3.4.3
mym 2.8.2
- Deleting
user0
in lab.User, throws an error.
key.user_id = 'user0';
del(lab.User & key)
Error using ~
Too many input arguments.
Error in dj.Relvar/del (line 95)
if ~fks.aliased
from datajoint-matlab.
Related Issues (20)
- Markdown not properly rendered in FEX Toolbox description
- fetchn(tableA * tableB, 'field') does not work in 3.4.2
- del deletes some incorrect entries from downstream tables with renamed foreign keys HOT 1
- table classes on path was not recognized when deleting or populating
- error with fetchn DataJoint version 3.4.2 HOT 1
- `{}` is not supported in attribute comments HOT 1
- bool and boolean is not supported in 3.4.1 HOT 1
- Parallelize file transfer for external blobs HOT 1
- Occasional fwrite errors using file-based stores
- fetching 'KEY' error HOT 2
- discovering existing tables across python/matlab HOT 5
- Empty matrices are converted to NULL HOT 2
- syncDef missing [nullable] & comment properties HOT 2
- Officially use the `+` operator for unions
- SSL Connection error HOT 2
- Schema name must start with lower case HOT 2
- Allow strings as well as char HOT 2
- MATLAB hangs and ramps up CPU usage if user closes the password Diagloue Box
- Allow pasting when logging into a database
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datajoint-matlab.