Program: 14786
Project: 14786
Buggy source:
public WordPressDB(Context ctx){
  this.context=ctx;
  db=ctx.openOrCreateDatabase(DATABASE_NAME,0,null);
  db.execSQL(CREATE_TABLE_SETTINGS);
  db.execSQL(CREATE_TABLE_POSTS);
  db.execSQL(CREATE_TABLE_CATEGORIES);
  db.execSQL(CREATE_TABLE_QUICKPRESS_SHORTCUTS);
  db.execSQL(CREATE_TABLE_MEDIA);
  db.execSQL(CREATE_TABLE_THEMES);
  db.execSQL(CREATE_TABLE_NOTES);
  CommentTable.createTables(db);
  int currentVersion=db.getVersion();
switch (currentVersion) {
case 0:
    currentVersion++;
case 1:
  db.execSQL(ADD_BLOGID);
db.execSQL(UPDATE_BLOGID);
db.execSQL(ADD_LOCATION_FLAG);
db.execSQL(ADD_DOTCOM_USERNAME);
db.execSQL(ADD_DOTCOM_PASSWORD);
db.execSQL(ADD_API_KEY);
db.execSQL(ADD_API_BLOGID);
db.execSQL(ADD_DOTCOM_FLAG);
db.execSQL(ADD_WP_VERSION);
currentVersion=9;
case 9:
db.execSQL(ADD_HTTPUSER);
db.execSQL(ADD_HTTPPASSWORD);
migratePasswords();
currentVersion++;
case 10:
db.delete(POSTS_TABLE,null,null);
db.execSQL(CREATE_TABLE_POSTS);
migrateDrafts();
db.execSQL(ADD_POST_FORMATS);
currentVersion++;
case 11:
db.execSQL(ADD_SCALED_IMAGE);
db.execSQL(ADD_SCALED_IMAGE_IMG_WIDTH);
db.execSQL(ADD_LOCAL_POST_CHANGES);
currentVersion++;
case 12:
db.execSQL(ADD_FEATURED_IN_POST);
currentVersion++;
case 13:
db.execSQL(ADD_HOME_URL);
currentVersion++;
case 14:
db.execSQL(ADD_BLOG_OPTIONS);
currentVersion++;
case 15:
currentVersion++;
case 16:
migrateWPComAccount();
currentVersion++;
case 17:
db.execSQL(ADD_PARENTID_IN_CATEGORIES);
currentVersion++;
case 18:
db.execSQL(ADD_ACCOUNTS_ADMIN_FLAG);
db.execSQL(ADD_MEDIA_FILE_URL);
db.execSQL(ADD_MEDIA_THUMBNAIL_URL);
db.execSQL(ADD_MEDIA_UNIQUE_ID);
db.execSQL(ADD_MEDIA_BLOG_ID);
db.execSQL(ADD_MEDIA_DATE_GMT);
db.execSQL(ADD_MEDIA_UPLOAD_STATE);
currentVersion++;
case 19:
currentVersion++;
case 20:
db.execSQL(ADD_ACCOUNTS_HIDDEN_FLAG);
currentVersion++;
case 21:
db.execSQL(ADD_MEDIA_VIDEOPRESS_SHORTCODE);
currentVersion++;
case 22:
currentVersion++;
case 23:
CommentTable.reset(db);
currentVersion++;
}
db.setVersion(DATABASE_VERSION);
}

Fixed version (ground truth):
public WordPressDB(Context ctx){
  this.context=ctx;
  db=ctx.openOrCreateDatabase(DATABASE_NAME,0,null);
  db.execSQL(CREATE_TABLE_SETTINGS);
  db.execSQL(CREATE_TABLE_POSTS);
  db.execSQL(CREATE_TABLE_CATEGORIES);
  db.execSQL(CREATE_TABLE_QUICKPRESS_SHORTCUTS);
  db.execSQL(CREATE_TABLE_MEDIA);
  db.execSQL(CREATE_TABLE_THEMES);
  db.execSQL(CREATE_TABLE_NOTES);
  CommentTable.createTables(db);
  int currentVersion=db.getVersion();
switch (currentVersion) {
case 0:
    currentVersion++;
case 1:
  db.execSQL(ADD_BLOGID);
db.execSQL(UPDATE_BLOGID);
db.execSQL(ADD_LOCATION_FLAG);
db.execSQL(ADD_DOTCOM_USERNAME);
db.execSQL(ADD_DOTCOM_PASSWORD);
db.execSQL(ADD_API_KEY);
db.execSQL(ADD_API_BLOGID);
db.execSQL(ADD_DOTCOM_FLAG);
db.execSQL(ADD_WP_VERSION);
currentVersion=9;
case 9:
db.execSQL(ADD_HTTPUSER);
db.execSQL(ADD_HTTPPASSWORD);
migratePasswords();
currentVersion++;
case 10:
db.delete(POSTS_TABLE,null,null);
db.execSQL(CREATE_TABLE_POSTS);
db.execSQL(ADD_POST_FORMATS);
currentVersion++;
case 11:
db.execSQL(ADD_SCALED_IMAGE);
db.execSQL(ADD_SCALED_IMAGE_IMG_WIDTH);
db.execSQL(ADD_LOCAL_POST_CHANGES);
currentVersion++;
case 12:
db.execSQL(ADD_FEATURED_IN_POST);
currentVersion++;
case 13:
db.execSQL(ADD_HOME_URL);
currentVersion++;
case 14:
db.execSQL(ADD_BLOG_OPTIONS);
currentVersion++;
case 15:
currentVersion++;
case 16:
migrateWPComAccount();
currentVersion++;
case 17:
db.execSQL(ADD_PARENTID_IN_CATEGORIES);
currentVersion++;
case 18:
db.execSQL(ADD_ACCOUNTS_ADMIN_FLAG);
db.execSQL(ADD_MEDIA_FILE_URL);
db.execSQL(ADD_MEDIA_THUMBNAIL_URL);
db.execSQL(ADD_MEDIA_UNIQUE_ID);
db.execSQL(ADD_MEDIA_BLOG_ID);
db.execSQL(ADD_MEDIA_DATE_GMT);
db.execSQL(ADD_MEDIA_UPLOAD_STATE);
currentVersion++;
case 19:
currentVersion++;
case 20:
db.execSQL(ADD_ACCOUNTS_HIDDEN_FLAG);
currentVersion++;
case 21:
db.execSQL(ADD_MEDIA_VIDEOPRESS_SHORTCODE);
currentVersion++;
case 22:
currentVersion++;
case 23:
CommentTable.reset(db);
currentVersion++;
}
db.setVersion(DATABASE_VERSION);
}