Program: 53336
Project: 53336
Buggy source:
/** 
 * Manages the database schema migration.
 */
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  if (oldVersion < 2) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_NEEDS_ACTION);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_NEEDS_ACTION);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_IN_PROCESS);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_IN_PROCESS);
  }
  if (oldVersion < 3) {
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_START_SORTING+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE_SORTING+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_START_SORTING+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_START+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE_SORTING+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE);
  }
  if (oldVersion < 4) {
    db.execSQL(SQL_DROP_TASK_VIEW);
    db.execSQL(SQL_DROP_INSTANCE_VIEW);
    db.execSQL(SQL_DROP_TASKS_CLEANUP_TRIGGER);
    db.execSQL(SQL_DROP_PROPERTIES_TABLE);
    db.execSQL(SQL_CREATE_PROPERTIES_TABLE);
    db.execSQL(SQL_CREATE_TASKS_CLEANUP_TRIGGER);
    db.execSQL(SQL_CREATE_CATEGORIES_MAPPING_TABLE);
    db.execSQL(SQL_CREATE_ALARMS_TABLE);
    db.execSQL(SQL_CREATE_TASK_VIEW);
    db.execSQL(SQL_CREATE_TASK_PROPERTY_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_PROPERTY_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_CATEGORY_VIEW);
    db.execSQL(createIndexString(Tables.PROPERTIES,false,TaskContract.Properties.MIMETYPE,TaskContract.Properties.TASK_ID));
    db.execSQL(createIndexString(Tables.PROPERTIES,false,TaskContract.Properties.TASK_ID));
    db.execSQL(createIndexString(Tables.CATEGORIES,false,TaskContract.Categories.ACCOUNT_NAME,TaskContract.Categories.ACCOUNT_TYPE,TaskContract.Categories.NAME));
    db.execSQL(createIndexString(Tables.CATEGORIES,false,TaskContract.Categories.NAME));
    db.execSQL(SQL_CREATE_ALARM_PROPERTY_CLEANUP_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_CREATE_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_UPDATE_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_DELETE_TRIGGER);
  }
  if (oldVersion < 6) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.PARENT_ID+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.HAS_ALARMS+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.SORTING+ "String_Node_Str");
  }
  if (oldVersion < 7) {
    db.execSQL(SQL_CREATE_LISTS_CLEANUP_TRIGGER);
  }
  if (oldVersion < 8) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.PRIORITY+ "String_Node_Str"+ Tasks.PRIORITY+ "String_Node_Str");
  }
  FTSDatabaseHelper.onUpgrade(db,oldVersion,newVersion);
}

Fixed version (ground truth):
/** 
 * Manages the database schema migration.
 */
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  Log.i(TAG,"String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  if (oldVersion < 2) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_NEEDS_ACTION);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_NEW+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_NEEDS_ACTION);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_IN_PROCESS);
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ TaskContract.Tasks.IS_CLOSED+ "String_Node_Str"+ TaskContract.Tasks.STATUS+ "String_Node_Str"+ TaskContract.Tasks.STATUS_IN_PROCESS);
  }
  if (oldVersion < 3) {
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_START_SORTING+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE_SORTING+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.INSTANCES + "String_Node_Str"+ TaskContract.Instances.INSTANCE_START_SORTING+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_START+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE_SORTING+ "String_Node_Str"+ TaskContract.Instances.INSTANCE_DUE);
  }
  if (oldVersion < 4) {
    db.execSQL(SQL_DROP_TASK_VIEW);
    db.execSQL(SQL_DROP_INSTANCE_VIEW);
    db.execSQL(SQL_DROP_TASKS_CLEANUP_TRIGGER);
    db.execSQL(SQL_DROP_PROPERTIES_TABLE);
    db.execSQL(SQL_CREATE_PROPERTIES_TABLE);
    db.execSQL(SQL_CREATE_TASKS_CLEANUP_TRIGGER);
    db.execSQL(SQL_CREATE_CATEGORIES_MAPPING_TABLE);
    db.execSQL(SQL_CREATE_ALARMS_TABLE);
    db.execSQL(SQL_CREATE_TASK_VIEW);
    db.execSQL(SQL_CREATE_TASK_PROPERTY_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_PROPERTY_VIEW);
    db.execSQL(SQL_CREATE_INSTANCE_CATEGORY_VIEW);
    db.execSQL(createIndexString(Tables.PROPERTIES,false,TaskContract.Properties.MIMETYPE,TaskContract.Properties.TASK_ID));
    db.execSQL(createIndexString(Tables.PROPERTIES,false,TaskContract.Properties.TASK_ID));
    db.execSQL(createIndexString(Tables.CATEGORIES,false,TaskContract.Categories.ACCOUNT_NAME,TaskContract.Categories.ACCOUNT_TYPE,TaskContract.Categories.NAME));
    db.execSQL(createIndexString(Tables.CATEGORIES,false,TaskContract.Categories.NAME));
    db.execSQL(SQL_CREATE_ALARM_PROPERTY_CLEANUP_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_CREATE_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_UPDATE_TRIGGER);
    db.execSQL(SQL_CREATE_ALARM_COUNT_DELETE_TRIGGER);
  }
  if (oldVersion < 6) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.PARENT_ID+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.HAS_ALARMS+ "String_Node_Str");
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.SORTING+ "String_Node_Str");
  }
  if (oldVersion < 7) {
    db.execSQL(SQL_CREATE_LISTS_CLEANUP_TRIGGER);
  }
  if (oldVersion < 8) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks.PRIORITY+ "String_Node_Str"+ Tasks.PRIORITY+ "String_Node_Str");
  }
  if (oldVersion < 9) {
    db.execSQL("String_Node_Str" + Tables.TASKS + "String_Node_Str"+ Tasks._UID+ "String_Node_Str");
    db.execSQL(SQL_CREATE_TASK_PROPERTY_CLEANUP_TRIGGER);
  }
  FTSDatabaseHelper.onUpgrade(db,oldVersion,newVersion);
}