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

fixes issue with shiftOrResize when a mark occurs before and a reset … #1194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PHaroZ
Copy link
Contributor

@PHaroZ PHaroZ commented Jan 17, 2023

In ru.yandex.clickhouse.response.StreamSplitter if mark() is called (eg from ru.yandex.clickhouse.response.ClickHouseResultSet#onTheSeparatorRow) and then shiftOrResize() occurs, then reset() leaves the stream in an invalid result.

posNext and posRead are reset but buf still contain the next chunk of data.

In such a case ru.yandex.clickhouse.response.ClickHouseResultSet#getTotals fails if the data of the total line are split across two chunks of data.

I know this class should be removed but, while waiting for a new stable version, this issue cause unavoidable error. (and, as far as I know, there is no equivalent feature in the new jdbc driver)

@CLAassistant
Copy link

CLAassistant commented Jan 17, 2023

CLA assistant check
All committers have signed the CLA.

@PHaroZ PHaroZ marked this pull request as ready for review January 17, 2023 14:04
@zhicwu
Copy link
Contributor

zhicwu commented Jan 18, 2023

Hi @PHaroZ, thanks for sharing. As of now, in 0.3.2+, the last row in result set is the total, which might be weird. Perhaps we can fix this by adding multi-resultset support, which returns two resultsets for a with total query.

@wudstrand
Copy link

Do you think this bug is related?

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.

None yet

4 participants