Skip to content

Fix prepare value map to postgres #925

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 2 commits into from
Jan 27, 2016

Conversation

mnahkies
Copy link
Contributor

There was an issue where if a complex value (a value having a toPostgres function defined) was passed to prepareValue from a map operation, the index of the value would be passed as an additional parameter and prevent the internal seen variable from being correctly initialized.

Rather than try and identify all usages of this and fix the individual map operations, I thought it would be better to prevent the seen variable from being accidentally tampered with.

An example of current usage that causes problems: https://github.com/brianc/node-pg-cursor/blob/master/index.js#L6

@brianc
Copy link
Owner

brianc commented Jan 27, 2016

Very nice @mnahkies! I'll get a patch version pushed to npm today! Thank you!

brianc added a commit that referenced this pull request Jan 27, 2016
@brianc brianc merged commit e6649f2 into brianc:master Jan 27, 2016
@mnahkies mnahkies deleted the fix-prepare-value-map-to-postgres branch January 29, 2016 21:37
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.

2 participants