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

Fix get value of last column with same name in result rows #3063

Merged

Conversation

sehrope
Copy link
Contributor

@sehrope sehrope commented Sep 7, 2023

First commit adds a failing test for the issue and the second one fixes the issue by explicitly setting a null value in the else block (like before). I think we'll still get most of the gains from prebuilt object patch as the shape is still not dynamic and I'd bet V8 is smart enough to optimize setting a value to itself (i.e. null to null).

Here's the failing test without the patch: https://github.com/sehrope/node-postgres/actions/runs/6112124966/job/16588908962#step:7:677

Fixes #3062

…e is populated

Fixes handling of result rows that have the same column name duplicated in the results to ensure
that the last value is the one returned to the user. This was the old behavior but unintentionally
broken when the pre-built object optimization was added.
@brianc
Copy link
Owner

brianc commented Sep 14, 2023

Thank you!

@brianc brianc merged commit 106ca8a into brianc:master Sep 14, 2023
15 checks passed
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.

With duplicated column names, result row gets value from rightmost non-null column (or default null)
3 participants