Schema modules reports Mismatch issues with default values similar to the one below:

  • comments

    • column thread - difference on: default
      declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 255, 'not null' => TRUE)

      actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '')
  • What is the appropriate action that should be taken to correct this type of mismatch?

    Comments

    mikeryan’s picture

    Is this a dupe of #256826: Comparison mismatch when default is NULL? Does the patch there eliminate the message? I couldn't reproduce a problem there...

    What Drupal core version are you on? What MySQL version?

    TallDavid’s picture

    Not sure.
    Was that patch to 1.3 rolled into the 1.4-rc1 version?
    Should I ignore the Schema Mismatch report or is there something that I need to do to update the database tables?

    mikeryan’s picture

    No, I didn't roll it in because I couldn't reproduce the problem it purports to solve. You're seeing exactly the symptom I would expect, so if you could try applying the patch and see if it eliminates the mismatch message, that would demonstrate that the patch is good and I will roll it in.

    There doesn't appear to be an actual issue with your tables - the issue is with an apparently-spurious message.

    TallDavid’s picture

    Sorry, I'm not setup to apply patches. I'll gladly test a -dev version with the patch already applied.

    It looks like I missed two of your previous questions. Drupal version 6.11. MySQL version 5.1.30.
    Since you confirm that there doesn't appear to be an actual issue with the tables, I'll ignore the error message until a pre-rolled test version is available.

    mikeryan’s picture

    Status: Active » Postponed (maintainer needs more info)

    Can you execute the query

    SELECT COLUMN_NAME,COLUMN_DEFAULT FROM COLUMNS WHERE TABLE_SCHEMA = 'your db name here'
    AND TABLE_NAME = comments

    and see what default is reported for the thread column? I get NULL with MySQL 5.0.41...

    mikeryan’s picture

    Status: Postponed (maintainer needs more info) » Closed (fixed)
    TallDavid’s picture

    Version: 6.x-1.4-rc1 » 6.x-1.6
    Status: Closed (fixed) » Active

    As requested:

    SELECT COLUMN_NAME, COLUMN_DEFAULT
    FROM COLUMNS WHERE TABLE_SCHEMA = 'talldave_drpl24'
    AND TABLE_NAME = comments

    MySQL said: Documentation
    #1146 - Table 'talldave_drpl24.COLUMNS' doesn't exist

    [Note to self: T-H.com]

    mikeryan’s picture

    Status: Active » Postponed (maintainer needs more info)

    My bad, here's the query to try:

    SELECT COLUMN_NAME,COLUMN_DEFAULT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'talldave_drpl24'
    AND TABLE_NAME = 'comments'

    TallDavid’s picture

    Here's the output:

    COLUMN_NAME COLUMN_DEFAULT
    cid NULL
    pid 0
    nid 0
    uid 0
    subject
    comment NULL
    hostname
    timestamp 0
    status 0
    format 0
    thread
    name NULL
    mail NULL
    homepage NULL

    TallDavid’s picture

    Status: Postponed (maintainer needs more info) » Active
    mikeryan’s picture

    Assigned: Unassigned » mikeryan
    Status: Active » Needs review

    OK, you are missing NULL on thread, which implies to me that the patch in the referenced issue may fix it. I've committed that - please give the current CVS a try.

    Thanks.

    TallDavid’s picture

    Status: Needs review » Active

    Problem still exists with 6.x-1.x-dev dated 2009-Sep-27.

    mikeryan’s picture

    Status: Active » Postponed

    I've never been able to reproduce this issue - it would best be fixed by someone who can reproduce it.

    • mikeryan committed 680c8fd on 8.x-1.x
      #458828 by mikeryan - Diffs due to default NULL
      
      
    jcnventura’s picture

    Issue summary: View changes
    Status: Postponed » Fixed

    Status: Fixed » Closed (fixed)

    Automatically closed - issue fixed for 2 weeks with no activity.