Common subdirectories: tw/tests and tw.good/tests
diff -u tw/tw.module tw.good/tw.module
--- tw/tw.module	2009-04-14 17:04:33.000000000 -0400
+++ tw.good/tw.module	2009-04-30 18:57:57.000000000 -0400
@@ -36,11 +36,11 @@
 
     // See if we're already managing this table
     $sql = "SELECT twtid FROM {tw_tables} 
-            WHERE connection='%s' AND tablename='%s'";
+            WHERE `connection`='%s' AND tablename='%s'";
     $twtid = db_result(db_query($sql, $connection, $tablename));
     if (!$twtid) {
       db_query("INSERT INTO {tw_tables}
-                (connection, tablename)
+                (`connection`, tablename)
                 VALUES('%s', '%s')",
                $connection, $tablename);
     } 
@@ -76,7 +76,7 @@
       $connection = 'default';
     }
     $sql = "SELECT twtid FROM {tw_tables} 
-            WHERE connection='%s' AND tablename='%s'";
+            WHERE `connection`='%s' AND tablename='%s'";
     $twtid = db_result(db_query($sql, $connection, $tablename));
     if ($twtid) {
       // Remove all relationship references
@@ -112,7 +112,7 @@
     $connection = 'default';
   }
   $sql = "SELECT twtid FROM {tw_tables} 
-          WHERE connection='%s' AND tablename='%s'";
+          WHERE `connection`='%s' AND tablename='%s'";
   $twtid = db_result(db_query($sql, $connection, $tablename));
   if ($twtid) {
     $sql = "UPDATE {tw_columns}
@@ -185,7 +185,7 @@
   $sql = "SELECT tc.twcid
           FROM {tw_tables} tt
           INNER JOIN {tw_columns} tc ON tt.twtid=tc.twtid AND tc.colname='%s'
-          WHERE tt.connection='%s' AND tt.tablename='%s'";
+          WHERE tt.`connection`='%s' AND tt.tablename='%s'";
   $twcid = db_result(db_query($sql, $colname, $connection, $tablename));
   return $twcid;
 }
@@ -199,7 +199,7 @@
  */
 function tw_perform_analysis($tablename, $connection = 'default') {
   $twtid = db_result(db_query("SELECT twtid FROM {tw_tables}
-                               WHERE connection='%s' AND tablename='%s'",
+                               WHERE `connection`='%s' AND tablename='%s'",
                               $connection, $tablename));
 
   // Let the Schema module figure out the table definition
diff -u tw/tw.views_default.inc tw.good/tw.views_default.inc
--- tw/tw.views_default.inc	2009-04-15 16:56:49.000000000 -0400
+++ tw.good/tw.views_default.inc	2009-04-30 18:57:09.000000000 -0400
@@ -17,11 +17,11 @@
 
   // Go through each import table and create default views for them
   // Skip any without a primary key
-  $sql = "SELECT tt.twtid,tt.tablename,tt.connection,COUNT(*) cnt
+  $sql = "SELECT tt.twtid,tt.tablename,tt.`connection`,COUNT(*) cnt
           FROM {tw_tables} tt
           INNER JOIN {tw_columns} tc ON tt.twtid=tc.twtid
           WHERE tc.primarykey=1
-          GROUP BY tt.twtid,tt.tablename,tt.connection";
+          GROUP BY tt.twtid,tt.tablename,tt.`connection`";
   $tblresult = db_query($sql);
   while ($tblrow = db_fetch_object($tblresult)) {
     // For a default view to be possible, the table must have a single primary key field
Common subdirectories: tw/tw_import and tw.good/tw_import
diff -u tw/tw_pages.inc tw.good/tw_pages.inc
--- tw/tw_pages.inc	2009-04-17 16:15:55.000000000 -0400
+++ tw.good/tw_pages.inc	2009-04-30 18:53:17.000000000 -0400
@@ -34,7 +34,7 @@
     '#suffix' => '</div>',
   );
 
-  $sql = "SELECT COUNT(DISTINCT(connection)) FROM {tw_tables} WHERE connection <> 'default'";
+  $sql = "SELECT COUNT(DISTINCT(`connection`)) FROM {tw_tables} WHERE `connection` <> 'default'";
   $extconns = db_result(db_query($sql));
   if ($extconns >= 1) {
     $connheader = array('data' => t('Connection'), 'field' => 'twt.connection', 'sort' => 'asc');
