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

Persisting empty list in spring data r2dbc v3.1.1 results in null value being inserted instead of empty array #1544

Closed
jurriaan opened this issue Jun 27, 2023 · 4 comments
Assignees
Labels
status: superseded An issue that has been superseded by another

Comments

@jurriaan
Copy link

jurriaan commented Jun 27, 2023

When updating from Spring v3.0.x to v3.1.1 we get the following database error when trying to persist an empty list of an enum type (kotlin emptyList()) to an array column in PostgreSQL:

null value in column "foo" of relation "bar" violates not-null constraint

I think this is due to this commit:

c55ba78#diff-959f5816c3648926ab975cd65e6f5d130ab2f51607d7d2e7de40543223705c32L179

The empty array with an enum componentType is not processed properly and eventually a null is returned here:

image

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 27, 2023
@mp911de mp911de self-assigned this Jun 28, 2023
@mp911de
Copy link
Member

mp911de commented Jun 28, 2023

I'm not able to reproduce the issue. Converting an entity that contains an empty List of enum values renders an empty array (String[0]) that is passed to the drivers.

If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem.

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Jun 28, 2023
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jul 5, 2023
@spring-projects-issues
Copy link

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Jul 12, 2023
jurriaan added a commit to jurriaan/issue-1544 that referenced this issue Jul 17, 2023
@jurriaan
Copy link
Author

@mp911de I've set up a minimal sample here: https://github.com/jurriaan/issue-1544, seems that I cannot get it to persist non-empty lists of enums as well.

@mp911de mp911de added the status: superseded An issue that has been superseded by another label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants