Continuation of feature request #184 (https://sourceforge.net/p/dbunit/feature-requests/184/):
If column is defined as NOT NULL and has a DEFAULT value, dbUnit should not explicitly include null value in insert operations, but instead skip the column to trigger the default.
Applied is a patch that implements this
[double post]
Last edit: Mattias Jiderhamn 2014-07-22
Is there any reason this patch has not been applied yet?
Missed it and time. "Ping" on an issue is not a problem!
Created a Merge Request also, in case that speeds things up: https://sourceforge.net/p/dbunit/code.git/merge-requests/7/
Thank you for adding this, with test.
(yes, merge request makes it easier!)
It should be noted that the INSERT statement generated is based on the first record in a dataset, which means that if the first record has a value for the NOT NULL + DEFAULT column, then an explicit NULL will be inserted for records without a value (potentially causing an error).
Thanks for mentioning, good idea. We should add a note like this to the docs. Where do you suggest?