? scripts/auto-install.php
? sites/mysql7.lupe
? sites/default/files
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.888
diff -u -p -r1.888 common.inc
--- includes/common.inc	27 Apr 2009 20:19:35 -0000	1.888
+++ includes/common.inc	6 May 2009 21:22:19 -0000
@@ -3990,6 +3990,11 @@ function drupal_write_record($table, &$o
     // NOTE: Each table should come with one serial field only.
     if ($info['type'] == 'serial') {
       $serial = $field;
+
+      // NULL and 0 are not valid values for a serial column. 
+      if (empty($primary_keys) && empty($object->$field)) {
+        throw new Exception('NULL or 0 passed as value for serial column ' . $table . '.' . $field . ' not allowed in drupal_write_record()');
+      }
     }
 
     // Build arrays for the fields and values in our query.
Index: includes/database/mysql/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/mysql/database.inc,v
retrieving revision 1.17
diff -u -p -r1.17 database.inc
--- includes/database/mysql/database.inc	25 Mar 2009 18:43:01 -0000	1.17
+++ includes/database/mysql/database.inc	6 May 2009 21:22:20 -0000
@@ -43,7 +43,7 @@ class DatabaseConnection_mysql extends D
     // kinds of database systems. These settings force MySQL to behave
     // the same as postgresql, or sqlite in regards to syntax interpretation
     // and invalid data handling. See http://drupal.org/node/344575 for further disscussion.
-    $this->exec("SET sql_mode='ANSI,TRADITIONAL'");
+    $this->exec("SET sql_mode='ANSI,TRADITIONAL,NO_AUTO_VALUE_ON_ZERO'");
   }
 
   public function queryRange($query, array $args, $from, $count, array $options = array()) {
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.16
diff -u -p -r1.16 node.install
--- modules/node/node.install	25 Apr 2009 14:01:05 -0000	1.16
+++ modules/node/node.install	6 May 2009 21:22:20 -0000
@@ -18,7 +18,7 @@ function node_schema() {
         'description' => 'The current {node_revision}.vid version identifier.',
         'type' => 'int',
         'unsigned' => TRUE,
-        'not null' => TRUE,
         'default' => 0,
       ),
       'type' => array(
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1042
diff -u -p -r1.1042 node.module
--- modules/node/node.module	26 Apr 2009 19:44:39 -0000	1.1042
+++ modules/node/node.module	6 May 2009 21:22:21 -0000
@@ -1097,6 +1097,7 @@ function node_save(&$node) {
 
   // Generate the node table query and the node_revisions table query.
   if ($node->is_new) {
+    unset($node->nid);
     drupal_write_record('node', $node);
     _node_save_revision($node, $user->uid);
     $op = 'insert';
@@ -1104,6 +1105,7 @@ function node_save(&$node) {
   else {
     drupal_write_record('node', $node, 'nid');
     if (!empty($node->revision)) {
+			unset($node->vid);
       _node_save_revision($node, $user->uid);
     }
