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

Batch insert: fix inserting constant 'null' #1762

Merged
merged 1 commit into from Sep 24, 2020

Conversation

stevenschlansker
Copy link
Member

Fixes #1761

@stevenschlansker stevenschlansker requested a review from a team September 24, 2020 19:04
@stevenschlansker stevenschlansker force-pushed the batch-insert-null branch 2 times, most recently from 82a6d02 to 361562e Compare September 24, 2020 19:32
@@ -67,6 +67,21 @@ public void testInsertSingleIteratorNoTx() {
assertThat(b.size()).isEqualTo(2);
}

@Test
public void testBindConstantNull() {
UsesBatching b = handle.attach(UsesBatching.class);
Copy link

@leaumar leaumar Sep 24, 2020

Choose a reason for hiding this comment

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

avoid single-letter variables please (aside from the meme i for iterations, I'd say Handle h at most could also be a meme in our context since it's so common)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, this is all just clone of existing tests, with only one other change...

Copy link

Choose a reason for hiding this comment

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

Sounds like the improvement could be made in 2 places :)


b.withConstantValue(ids, null);

assertThat(b.size()).isEqualTo(5);
Copy link

Choose a reason for hiding this comment

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

isn't there a hasSize?

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't a Collection, so that doesn't apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

NullPointerException in SqlBatch with a constant parameter value of null
2 participants