title: Issue with SQLite DROP TABLE statement
body: <p>EDIT: At this point, I found the errant typo that was responsible, and my question has become "How did the typo that I made cause the error that I received" and "How might I have better debugged this in the future?"</p>
  
  <p>I've setup a database script for SQLite (through pysqlite) as follows:
  <pre><code>DROP TABLE IF EXISTS LandTerritory;
  CREATE TABLE LandTerritory (
    name   varchar(50) PRIMARY KEY NOT NULL UNIQUE, 
    hasSC  boolean NOT NULL DEFAULT 0
  );</pre></code></p>
  
  <p>I'm expecting this to always run without error.  However, if I run this script twice, (using the <code>sqlite.Connection.executescript</code> method) I get this error:<br>
  <code>OperationalError:table LandTerritory already exists</code></p>
  
  <p>Trying to debug this myself, I run <code>DROP TABLE LandTerritory</code> on its own and get:
  <code>sqlite3.OperationalError: no such table: main.LandTerrito</code></p>
  
  <p>I'm guessing this has something to do with the "main." part, but I'm not sure what.  </p>
  
  <p>EDIT:
  Okay <code>PRAGMA foreign_keys=ON</code> is definitely involved here, too.  When I create my connection, I turned on foreign_keys.  If I don't turn that on, I don't seem to get this error.</p>
  
  <p>And I should have mentioned that there's more to the script, but I had assumed the error was occurring in these first 2 statements.  The rest of the script just does the same, drop table, define table.  A few of the tables have foreign key references to <code>LandTerritory</code>.  </p>
  
  <p>Is there a way to get something like line number information about the sqlite errors?  That would be really helpful.  </p>
  
  <p>EDIT 2:
  Okay, here's another table in the script that references the first.    </p>
  
  <pre><code>DROP TABLE IF EXISTS LandAdjacent;
  CREATE TABLE LandAdjacent (
    tname1 varchar(50) NOT NULL,
    tname2 varchar(50) NOT NULL,
    PRIMARY KEY (tname1, tname2),
    /* Foreign keys */
    FOREIGN KEY (tname1)
      REFERENCES LandTerrito
      ON DELETE CASCADE
      ON UPDATE CASCADE, 
    FOREIGN KEY (tname2)
      REFERENCES LandTerritory(name)
      ON DELETE CASCADE
      ON UPDATE CASCADE
  );
  </code></pre>
  
  <p>Looking at this, I found were the "LandTerrito" came from, somehow a few characters got cut off.  I'm guessing fixing this may fix my problem.  </p>
  
  <p>But I'm really confused how a broken line in this table led to the script running correctly the first time, and then giving me an error related to a different table when I run it the second time, and how foreign keys played into this. </p>
  
  <p>I guess, to reiterate from above, is there a better way to debug this sort of thing?  </p>