Index: schema.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/schema/schema.module,v
retrieving revision 1.43.2.10
diff -u -p -r1.43.2.10 schema.module
--- schema.module	17 May 2010 18:31:07 -0000	1.43.2.10
+++ schema.module	13 Feb 2011 09:10:20 -0000
@@ -291,7 +291,7 @@ function schema_compare_schemas($ref, $i
     if (isset($table['primary key'])) {
       $keys = db_field_names($table['primary key']);
       foreach ($keys as $key) {
-        if (!isset($table['fields'][$key]['not null']) || $table['fields'][$key]['not null'] != TRUE) {
+        if (isset($table['fields'][$key]['not null']) && $table['fields'][$key]['not null'] != TRUE) {
           $info['warn'][] = t('%table.%column is part of the primary key but is not specified to be \'not null\'.', array('%table' => $t_name, '%column' => $key));
         }
       }
@@ -382,6 +382,15 @@ function schema_compare_table($ref, $ins
       unset($col['default']);
     }
 
+    // PRIMARY KEY columns that do not have 'not null' => TRUE in their schema
+    // definition do not need to be flagged since at a database level these
+    // columns are implicitly (and silently) declared NOT NULL.
+    // Set 'not null' = TRUE for PRIMARY KEY columns so they match the reported
+    // database schema.
+    if (isset($ref['primary key']) && array_search($colname, $ref['primary key']) !== FALSE) {
+      $col['not null'] = TRUE;
+    }
+
     $kdiffs = array();
     foreach ($col_keys as $key => $val) {
 
