title: SQLiteConstraintException: NOT NULL constraint failed on a REAL field
body: <p>I received a Crash report on a piece of code that usually works.</p>
  
  <p>The exception is launched in the insertOrThrow and is: "Exception android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: HISTORY.altitude (code 1299)".</p>
  
  <p>All field are declared in the Table as NOT NULL, in particular the HISTORY.altitude field is declared as "REAL NOT NULL"</p>
  
  <p>I cannot understand how is possible that it is NULL, since I fill it few lines over the insert command.</p>
  
  <p>Anyone has an idea of how it is possible?</p>
  
  <pre><code>synchronized public void addSample( long time, int method, float altitude, int accuracy )
  {
      ...
          ContentValues cv = new ContentValues();
  
          long day = new TimeUtils.Day(time).getMillis();
          cv.put(MetaData.COLUMN_DAY, day);
          cv.put(MetaData.COLUMN_TIME, time);
          cv.put(MetaData.COLUMN_ALTITUDE, altitude);
          cv.put(MetaData.COLUMN_METHOD, method);
          cv.put(MetaData.COLUMN_ACCURACY, accuracy);
  
          long id = latestSample.mId;
          id = mDb.insertOrThrow(MetaData.TABLE_NAME, null, cv);  // &lt;--- Here crash
      ...
  }
  </code></pre>
  
  <p>Here the code used to define the table:</p>
  
  <pre><code>/* Inner class that defines the table contents */
  public static abstract class MetaData implements BaseColumns
  {
      public static final String TABLE_NAME = "HISTORY";
      public static final String COLUMN_DAY = "day";
      public static final String COLUMN_TIME = "time";
      public static final String COLUMN_ALTITUDE = "altitude";
      public static final String COLUMN_METHOD = "method";
      public static final String COLUMN_ACCURACY = "accuracy";
  }
  
  private static final String SQL_CREATE_HISTORY_TABLE =
          "CREATE TABLE " + MetaData.TABLE_NAME + " ( " +
                  MetaData._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                  MetaData.COLUMN_DAY + " INTEGER NOT NULL, " +
                  MetaData.COLUMN_TIME + " INTEGER NOT NULL, " +
                  MetaData.COLUMN_ALTITUDE + " REAL NOT NULL, " +
                  MetaData.COLUMN_METHOD + " INTEGER NOT NULL, " +
                  MetaData.COLUMN_ACCURACY + " INTEGER NOT NULL " +
                  " );\n" +
          "CREATE INDEX " + MetaData.COLUMN_METHOD + " ON " + MetaData.TABLE_NAME + " (" + MetaData.COLUMN_METHOD + ");\n" +
          "CREATE INDEX " + MetaData.COLUMN_DAY + " ON " + MetaData.TABLE_NAME + " (" + MetaData.COLUMN_DAY + ");\n" +
          "CREATE INDEX " + MetaData.COLUMN_TIME + " ON " + MetaData.TABLE_NAME + " (" + MetaData.COLUMN_TIME + ");";
  </code></pre>