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

add null check to deal with edge case where Sql Spanner Query has nul… #1208

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

zhumin8
Copy link
Contributor

@zhumin8 zhumin8 commented Aug 2, 2022

Fix for edge case with spring cloud gcp data spanner SQL query:
when the query result is a simple field, and return is null, it should not fail. Like this one.
@Query("SELECT name from test where id = @id")
Optional<String> getNameById(@Param("id") String id);

fixes #637

@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@zhumin8 zhumin8 marked this pull request as ready for review August 22, 2022 13:59
@zhumin8 zhumin8 merged commit 0e829d9 into main Aug 22, 2022
@zhumin8 zhumin8 deleted the fix-637 branch August 22, 2022 14:05
kateryna216 added a commit to kateryna216/spring-cloud-gcp that referenced this pull request Oct 20, 2022
…l return. (GoogleCloudPlatform#1208)

Fix for edge case with spring cloud gcp data spanner SQL query:
when the query result is a simple field, and return is null, it should not fail. Like this one.
@query("SELECT name from test where id = @id")
Optional<String> getNameById(@param("id") String id);

fixes GoogleCloudPlatform#637
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.

Spanner Sql query fails in edge case: when return type is simple field and return is null
2 participants