Skip to content

Fix unreasonable update tests #181

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

Merged
merged 3 commits into from
May 12, 2025
Merged

Fix unreasonable update tests #181

merged 3 commits into from
May 12, 2025

Conversation

danjoa
Copy link
Contributor

@danjoa danjoa commented May 8, 2025

The tests fixed for cds9 in this PR did some rather weird things like:

UPDATE(Foo).with({ ID:111, bar:12 }) // would change all rows in Foo to have the same ID: 111

... which should rather be like that:

UPDATE(Foo,{ID:111}).with({ bar:12 }) // updates Foo #111 only 

@nkaputnik
Copy link
Contributor

@Sv7enNowitzki can you look into this?

@Sv7enNowitzki
Copy link
Collaborator

Hi @danjoa and @nkaputnik ,

I don't understand. In the statement UPDATE(Foo).with({ ID:111, bar:12 }), will there be duplicate ID: 111? Since it's targeting the same Foo entity, theoretically, there should only be a unique value ID: 111, right?

Best Regards,
Wenjun

@danjoa
Copy link
Contributor Author

danjoa commented May 9, 2025

There was no where clause at all, hence the update would apply to all rows.

@danjoa
Copy link
Contributor Author

danjoa commented May 9, 2025

With the latest change from @johannes-vogel tests are green now, for both cds8 (current latest) as well as upcoming cds9 (tested internally).

@danjoa danjoa merged commit d537795 into main May 12, 2025
3 checks passed
@danjoa danjoa deleted the fixing-tests branch May 12, 2025 09:34
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

Successfully merging this pull request may close these issues.

4 participants