brownsys / K9db

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

Pelton views can contain multiple columns with the same primary key value #134

Closed Mr-vedant-gupta closed 1 year ago

Mr-vedant-gupta commented 2 years ago

Issue

It is possible for Pelton's views to contain multiple columns with the same primary key value

Cause

On encountering an insert statement with a duplicate primary key value, mariadb's default behaviour seems to be to replace the preexisting entry with the newer one rather than raising an error (changing the behaviour to raise an error instead would be a simple solution to this bug). The materialised views are then updated with the new table entry, but are not asked to delete the older entry, which also persists

Demonstration of Issue

When running websubmit-rs with a pelton backend, entering mutiple lectures with the same id (primary key) resulted in the application listing multiple lecture entries with the same id

KinanBab commented 1 year ago

Fixed