difference on: default - appropriate action?
TallDavid - May 10, 2009 - 18:28
| Project: | Schema |
| Version: | 6.x-1.6 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | mikeryan |
| Status: | postponed |
| Issue tags: | default, mismatch, schema module |
Jump to:
Description
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?

#1
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?
#2
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?
#3
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.
#4
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.
#5
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...
#6
#7
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]
#8
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'
#9
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
#10
#11
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.
#12
Problem still exists with 6.x-1.x-dev dated 2009-Sep-27.
#13
I've never been able to reproduce this issue - it would best be fixed by someone who can reproduce it.