Skip to content

pg.Result.fields isn't always an array #2056

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

Closed
songsanli opened this issue Jan 6, 2020 · 1 comment · Fixed by #2060
Closed

pg.Result.fields isn't always an array #2056

songsanli opened this issue Jan 6, 2020 · 1 comment · Fixed by #2060
Labels

Comments

@songsanli
Copy link

After this commit, pg.Result.fields will be an array only after pg.Result.addFields() is called.

However, pg.Result.addFields() is called only in the callback of RowDescription event, which is dispatched by pg in response to a SELECT, FETCH, etc query. If I send sqls like create SCHEMA hello, the pg.Result.fields will remain undefined. This behavior is different from the doc:

Every result will have a fields array.

Please heve a look. Thanks.

@brianc
Copy link
Owner

brianc commented Jan 7, 2020

ahh dang yeah I need to fix that, sorry about the hassle there. I cut the end of my finger off on NYE 🤕 and juuust about healed up but haven't realy been able to type effectively up until yesterday...I'll get a change for backwards compatibility (+ a test for this) released ASAP (1-2 days 🤞 )

@charmander charmander added the bug label Jan 8, 2020
brianc added a commit that referenced this issue Jan 9, 2020
This fixes a subtle backwards incompatible change.  Added a test to prevent further regressions.  Closes #2056
brianc added a commit that referenced this issue Jan 10, 2020
This fixes a subtle backwards incompatible change.  Added a test to prevent further regressions.  Closes #2056
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants