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

Invalid handling of Int.MinValue for fetchSize in quill-jdbc-zio streaming #2705

Open
Evergreen-person opened this issue Feb 13, 2023 · 0 comments

Comments

@Evergreen-person
Copy link

Version: 4.6.0
Module: quill-jdbc-zio
Database: mysql

I get empty list when try to use streaming with fetchSize=Int.MinValue to tell the driver to stream the results back one row at a time as described here in ResultSet

stream(query[Shipment], Int.MinValue)

Expected behavior

stream(query[Shipment], Int.MinValue) == stream(query[Shipment])
it should differ only by fetching way

Actual behavior

Getting empty list

Workaround

it seems the problem is that negative size is not handled at all

fetchSize match {
// TODO Assuming chunk size is fetch size. Not sure if this is optimal.
// Maybe introduce some switches to control this?
case Some(size) =>
ZStream.fromIterator(iter, size)
case None =>
ZStream.fromIterator(new ResultSetIterator(rs, conn, extractor))
}

@getquill/maintainers

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

No branches or pull requests

1 participant