-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
returnInstanceForEmptyRow
does not work for constructor auto-mapping
#2665
Comments
Hello @cvmocanu , Thanks for the report & repro! I could verify a problem (i.e. As seen in the log, the query in the test does not return any row.
When there is no row in the result set, MyBatis returns |
returnInstanceForEmptyRow
does not seem to work (at least in this case)returnInstanceForEmptyRow
does not work for constructor auto-mapping
I have committed the fix. As I explained, the test you attached still fails. Thanks again for your contribution! |
@harawata, thanks so much. I've fixed the example, in case it helps: Do you have an idea when the fix will be released? |
MyBatis version
3.5.10
Database vendor and version
PostgreSQL 11.6 (Debian 11.6-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
Test case or example project
mybatis-bug.zip
Steps to reproduce
You need to have Java, Docker, and Docker-Compose installed.
From the root of the project:
docker-compose up -d
./gradlew run
Expected result
The project prints
ALL OK
Actual result
The project throws an exception
got null row because all columns are null, even though returnInstanceForEmptyRow is true
.The text was updated successfully, but these errors were encountered: