Index: includes/database/sqlite/schema.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/sqlite/schema.inc,v
retrieving revision 1.20
diff -u -p -r1.20 schema.inc
--- includes/database/sqlite/schema.inc	22 Oct 2010 15:18:56 -0000	1.20
+++ includes/database/sqlite/schema.inc	11 Dec 2010 07:36:51 -0000
@@ -380,11 +380,33 @@ class DatabaseSchema_sqlite extends Data
       }
       if (isset($mapped_fields[$type])) {
         list($type, $size) = explode(':', $mapped_fields[$type]);
+        $default = $row->dflt_value;
+        // The value retrieved from SQLite is always retreived as a string,
+        // even if the intended value has a different type (NULL, integer,
+        // etc).
+        // Values from SQLite starting with a single quote are meant to be
+        // interpreted as strings.
+        if ($default[0] == "'") {
+          // Single quotes are escaped with a second single quote. De-escape
+          // them to avoid the driver double escaping them (' -> '' -> '''').
+          // Additionally, the first and last characters (both single quotes)
+          // are discarted using substr.
+          $default = str_replace("''", "'", substr($default, 1, -1));
+        }
+        elseif (strtoupper($default) == 'NULL') {
+          $default = NULL;
+        }
+        elseif ($type == 'INTEGER') {
+          $default = (int) $default;
+        }
+        elseif ($type == 'FLOAT') {
+          $default = (float) $default;
+        }
         $schema['fields'][$row->name] = array(
           'type' => $type,
           'size' => $size,
           'not null' => !empty($row->notnull),
-          'default' => trim($row->dflt_value, "'"),
+          'default' => $default,
         );
         if ($length) {
           $schema['fields'][$row->name]['length'] = $length;
