Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model.save() works bad in queries with joined tables (CRITICAL BUG!) #99

Open
valeriy-maslov opened this issue Sep 23, 2016 · 2 comments

Comments

@valeriy-maslov
Copy link

This is more like web client part bug.
This thing was found while modifying model entity for query with multiple tables connected with outer join.
The app project with test case will be soon. Right now I can provide only a simple text explanation.
Let's say we have 2 tables A & B connected with foreign key.
In the project we make a query with this tables joined by outer join, for this example let's say it is left outer join for A & B.
App makes requery() of this entity and changes some data.
While using left outer join there is possibility of empty fields appearing for table B in case of left join, which means that there is no matching record in B. If there is it's okay, we can modify data with no problem. But if there is not matching record, so platypus must insert it into B and update foreign key field in A. But it does not do that, ORM tries to modify nonexist record in B instead.

@marat-gainullin
Copy link
Owner

It would be quite new functionality for the Platypus ORM. This situation pushes us to turn some updates into insert/update/update while applying a change log to a database.

Can you please turn your test project into test case in PlatypusTests ?

@valeriy-maslov
Copy link
Author

I can do it, okay. I'll write you when it will be finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants