brownsys / K9db

MySQL-compatible database for GDPR compliance by construction.
MIT License
30 stars 0 forks source link

OWNS chains of length 2 and longer are sometimes unrecongized. #161

Open KinanBab opened 1 year ago

KinanBab commented 1 year ago

Example:

CREATE DATA_SUBJECT TABLE t1(ID INT PRIMARY KEY);
CREATE TABLE t4(ID INT PRIMARY KEY);
CREATE TABLE t3(ID INT PRIMARY KEY, fkk int OWNS t4(ID));
CREATE TABLE t2(ID INT PRIMARY KEY, fkk int OWNS t3(ID));

T4 is not recognized as owned by t1.

This also occurs when one OWNS in the chain is inside the DATA_SUBJECT table.

This is likely a problem in create.cc, where the code transfers ownership when it sees an OWNS only one step (rather than several).