Skip to content

Null boolean value on generated countBy with where clause query #735

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

Closed
ben-dale opened this issue Mar 3, 2022 · 1 comment
Closed

Null boolean value on generated countBy with where clause query #735

ben-dale opened this issue Mar 3, 2022 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@ben-dale
Copy link

ben-dale commented Mar 3, 2022

We recently tried to upgrade one of our projects from springboot 2.6.3 to 2.6.4 (upgrading spring-data-r2dbc:1.4.1 to spring-data-r2dbc:1.4.2), which introduced an interesting error that we believe stems from this project 🤔

We have an interface:

interface XYZRepository : CoroutineCrudRepository<XYZ, UUID> {
    suspend fun countByAvailabilityTrue(): Int
}

We turned on logging using the r2dbc logging application properties to see what query was being generated:

logging.level.io.r2dbc.postgresql.QUERY=DEBUG
logging.level.io.r2dbc.postgresql.PARAM=DEBUG

Before upgrading to springboot 2.6.3 (spring-data-r2dbc:1.4.1):

{"message":"Executing query: SELECT COUNT(xyz.user_id) FROM xyz WHERE xyz.availability = TRUE","status":"DEBUG"}

After upgrading to springboot 2.6.4 (spring-data-r2dbc:1.4.2):

{"message":"Bind parameter [0] to null, type: java.lang.Boolean","status":"DEBUG"}
{"message":"Executing query: SELECT COUNT(xyz.user_id) FROM xyz WHERE xyz.availability = $1","status":"DEBUG"}

Notice after the upgrade, the boolean parameter is being forcibly set to null.

We understand from the documentation here and here that our usage should be valid.

Apologies in advance if this is not the correct project to raise this issue in. Thanks!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 3, 2022
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 4, 2022
@mp911de
Copy link
Member

mp911de commented Mar 4, 2022

This is a duplicate of #733. Care to upgrade to the latest snapshots of Spring Data R2DBC and retry to confirm that the bugfix works for you?

@mp911de mp911de closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants