Menu

#185 Do not explicitly insert null into NOT NULL columns with DEFAULT

2.5.2
closed-fixed
None
5
2016-08-27
2014-07-21
No

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.

Discussion

  • Mattias Jiderhamn

    Applied is a patch that implements this

     
  • Mattias Jiderhamn

    [double post]

     

    Last edit: Mattias Jiderhamn 2014-07-22
  • Mattias Jiderhamn

    Is there any reason this patch has not been applied yet?

     
    • Jeff Jensen

      Jeff Jensen - 2015-04-25

      Missed it and time. "Ping" on an issue is not a problem!

       
  • Jeff Jensen

    Jeff Jensen - 2015-04-25
    • status: open --> closed-fixed
    • assigned_to: Jeff Jensen
    • Release: (future) --> 2.5.2
     
  • Jeff Jensen

    Jeff Jensen - 2015-04-25

    Thank you for adding this, with test.
    (yes, merge request makes it easier!)

     
  • Mattias Jiderhamn

    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).

     
  • Jeff Jensen

    Jeff Jensen - 2016-08-27

    Thanks for mentioning, good idea. We should add a note like this to the docs. Where do you suggest?

     

Log in to post a comment.