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: no panic if i.reader.Next() returns an empty result #37

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

akvlad
Copy link
Contributor

@akvlad akvlad commented Sep 6, 2023

Proposed Changes

fix for bug if reader.Next returns an empty result.
Now it results in panic:

panic: runtime error: index out of range [0] with length 0

goroutine 424 [running]:
github.com/apache/arrow/go/v12/arrow/array.(*String).Value(...)
	/go/pkg/mod/github.com/apache/arrow/go/v12@v12.0.0/arrow/array/string.go:54
github.com/InfluxCommunity/influxdb3-go/influx.getArrowValue({0x18e4ed0, 0xc000e44aa0}, 0x0)
	/go/pkg/mod/github.com/!influx!community/influxdb3-go@v0.1.0/influx/query_iterator.go:139 +0x1085
github.com/InfluxCommunity/influxdb3-go/influx.(*QueryIterator).Next(0xc000aa62c0)
	/go/pkg/mod/github.com/!influx!community/influxdb3-go@v0.1.0/influx/query_iterator.go:62 +0x205

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

Hi @akvlad,

Thank you for your PR! 👍

Could you please add a simple test case for your changes? Once that's done, we'll be ready to merge your PR. We appreciate your contribution!

Regards

@akvlad
Copy link
Contributor Author

akvlad commented Sep 7, 2023

This bug was reproduced when I had sent a request over about 200G of data with 5 cores.

I'll think about the way of testing it.

@akvlad
Copy link
Contributor Author

akvlad commented Sep 7, 2023

Added a unit test.
And optimized the fix to one line. :)

Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

@akvlad thanks again for your PR 👍

LGTM 🚀

@bednar bednar merged commit 3fa711c into InfluxCommunity:main Sep 8, 2023
7 checks passed
@bednar bednar added this to the 0.3.0 milestone Sep 8, 2023
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