am f265a1d2: am 36796363: Fix SQL for upgrade from ver 6 to ver 7 of Email database

Merge commit 'f265a1d21735a15e3707f7922110dd2f7eef8824'

* commit 'f265a1d21735a15e3707f7922110dd2f7eef8824':
  Fix SQL for upgrade from ver 6 to ver 7 of Email database
This commit is contained in:
Marc Blank 2009-10-20 11:12:39 -07:00 committed by Android Git Automerger
commit aa0314a500

View File

@ -182,7 +182,7 @@ public class EmailProvider extends ContentProvider {
"; delete from " + Message.DELETED_TABLE_NAME + "; delete from " + Message.DELETED_TABLE_NAME +
" where " + MessageColumns.MAILBOX_KEY + "=old." + EmailContent.RECORD_ID + " where " + MessageColumns.MAILBOX_KEY + "=old." + EmailContent.RECORD_ID +
"; end"; "; end";
static { static {
// Email URI matching table // Email URI matching table
UriMatcher matcher = sURIMatcher; UriMatcher matcher = sURIMatcher;
@ -692,7 +692,7 @@ public class EmailProvider extends ContentProvider {
} }
if (oldVersion == 6) { if (oldVersion == 6) {
// Use the newer mailbox_delete trigger // Use the newer mailbox_delete trigger
db.execSQL("delete trigger mailbox_delete;"); db.execSQL("drop trigger mailbox_delete;");
db.execSQL(TRIGGER_MAILBOX_DELETE); db.execSQL(TRIGGER_MAILBOX_DELETE);
oldVersion = 7; oldVersion = 7;
} }
@ -874,7 +874,7 @@ public class EmailProvider extends ContentProvider {
// Clients shouldn't normally be adding rows to these tables, as they are // Clients shouldn't normally be adding rows to these tables, as they are
// maintained by triggers. However, we need to be able to do this for unit // maintained by triggers. However, we need to be able to do this for unit
// testing, so we allow the insert and then throw the same exception that we // testing, so we allow the insert and then throw the same exception that we
// would if this weren't allowed. // would if this weren't allowed.
if (match == UPDATED_MESSAGE || match == DELETED_MESSAGE) { if (match == UPDATED_MESSAGE || match == DELETED_MESSAGE) {
throw new IllegalArgumentException("Unknown URL " + uri); throw new IllegalArgumentException("Unknown URL " + uri);
} }