1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Mysqli statement execute error : Column 'old_value' cannot be null

Discussion in 'Resolved Bug Reports' started by Chris D, Feb 5, 2014.

  1. Chris D

    Chris D XenForo Developer Staff Member

    This error could be thrown as a result of the user change logging where a column is added to a xf_user_* table that has a default value of NULL.

    As soon as the DataWriter changes that value, this error will be thrown by the change logging system when it attempts to write the NULL to the old_value field.

    It can be worked around (the only cases where I see this being a problem in my add-ons can be solved actually by excluding these from the change logging) but it might be better to catch this in the code and convert it to an empty string or 0 or allow NULL for that field.
     
    Last edited: Feb 6, 2014
    Adam Howard likes this.
  2. Adam Howard

    Adam Howard Well-Known Member

    Confirmed this in beta 1

    (Thought it was add-on related so never said a word about it)
     
  3. Mike

    Mike XenForo Developer Staff Member

    Fixed this now by forcing strings (which treats null the same as an empty string). This is obviously debatable and it's possible that a null value is actually desirable here. I'm thinking that this is generally focused on user visible changes so this approach is acceptable.
     
    Divvens and Andy.N like this.
  4. Andy.N

    Andy.N Well-Known Member

    Got this error a few times already since beta 1 when I manually upgraded a member to a custom usergroup. I thought it has something to do my custom addons but hope this can be fixed for once in beta 3.
     
  5. Mike

    Mike XenForo Developer Staff Member

    FYI, it is add-on related -- the change will stop the error for an add-on that doesn't update anything, but the add-on will still have the changes potentially logged (which may or may not be desirable).
     
    Divvens and Chris D like this.
  6. Chris D

    Chris D XenForo Developer Staff Member

    I've had a few questions about this, is this basically the fix?

    upload_2014-2-6_15-35-17.png
     
  7. Mike

    Mike XenForo Developer Staff Member

    Roughly, there's a minor tweak to ensure that it doesn't log something that is now equal.
     
    Divvens and Chris D like this.
  8. Chris D

    Chris D XenForo Developer Staff Member

    Thanks Mike. Awesome job.
     

Share This Page