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

Ensure we don't have duplicated columns in update (Fixes #2651) #6501

Closed
wants to merge 1 commit into from
Closed

Ensure we don't have duplicated columns in update (Fixes #2651) #6501

wants to merge 1 commit into from

Conversation

kieranajp
Copy link

@kieranajp kieranajp commented Aug 2, 2020

Hi,

I noticed that an erroneous update query was being generated in my application (using the Postgres driver), similar to the error described in #2651:

ERROR:  multiple assignments to same column "column_id"
STATEMENT:  UPDATE "tasks" SET "column_id" = $2, "column_id" = $3, "task_position" = $4 WHERE "id" IN ($1)

I did a bit of digging and was able to narrow it down to this updatedColumns array not having a uniqueness check.

image

I'm not sure exactly what it is about my entity structure that triggers this, but I added a sanity check anyway. Please let me know if there's anything I can do to help get this merged.

Cheers,
--Kieran

@imnotjames
Copy link
Contributor

Won't this fail with having too many parameters, then?

Also, could you rebase this against master so we can see the tests running? :)

@kieranajp
Copy link
Author

Good question - honestly I don't remember. We ended up switching away from Node for the backend of this particular application so I'm afraid I don't have a way to repro this anymore.

Rebase incoming anyway.

Copy link
Contributor

@imnotjames imnotjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs tests to confirm the behavior. If you can't reproduce it that might be an issue.

@HctrM
Copy link

HctrM commented Dec 2, 2020

I've also encountered this issue with Postgres driver and saving a relation with the foreign key ref. Looking forward to bug fix.

@imnotjames
Copy link
Contributor

This PR has been stale a while without tests. We can't merge in code without confirming it resolves the underlying issue.

Closing out.

@imnotjames imnotjames closed this Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants