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

Getting rows from get prepared primes can fail #195

Open
jbridger opened this issue Oct 13, 2017 · 1 comment
Open

Getting rows from get prepared primes can fail #195

jbridger opened this issue Oct 13, 2017 · 1 comment

Comments

@jbridger
Copy link
Contributor

We upgraded from 1.0.8 to 1.1.2, and encountered a breaking change that affected us.

As part of our testing, we will create some default prepared statements primes without any rows, e.g.:

primingClient.prime(preparedStatementBuilder()
                .withQuery("query")
                .withThen(then().withVariableTypes(<variable_types>)));

Later on in our tests we will use the priming client to get the prepared primings, and attempt to access the rows of the then of the prepared prime using the getRows accessor. This accessor returns an immutable version of the rows.

In 1.0.8, the rows field is an empty list (in the above priming), and the accessor returns an immutable version of the empty list.

In 1.1.2, the rows field is null, and you get a null pointer exception from the attempt to convert the rows to the unmodifiable collection.

One way we can work around this is to prime the query with an empty list of rows.

Is this an intentional API change, or potentially a bug? We noticed the PrimePreparedStore has changed significantly in those versions. in 1.0.8, rows was explicitly initialised to an empty list if it was not supplied.

@chbatey
Copy link
Member

chbatey commented Oct 16, 2017

Probably a bug, would be great to see a PR if you have time.

polyglotpiglet pushed a commit to polyglotpiglet/scassandra-server that referenced this issue Mar 14, 2018
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

2 participants