summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-07-20 23:03:23 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-20 23:03:23 +0000
commita0ff6f13e6e58f4652e9a4c3a3201b2c63c8ff09 (patch)
treeda137b6faff73a01a14139802fb23b1797188422
parent5e54310bd4c503c34441ac505b707403feea0cc6 (diff)
parentb21f5630533911b4266578c0895ddfdc5ff25c7f (diff)
downloadcts-a0ff6f13e6e58f4652e9a4c3a3201b2c63c8ff09.tar.gz
Merge cherrypicks of [12196470, 12196437] into rvc-release
Change-Id: I9205a134047f72c6c3d7ece4c8aee06c938e3095
-rw-r--r--tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
index 32609e97d37..3856d1d95dc 100644
--- a/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
@@ -1948,4 +1948,17 @@ public class SQLiteDatabaseTest extends AndroidTestCase {
+ patchLevel, patchLevel >= EXPECTED_MIN_PATCH_LEVEL);
}
+ // http://b/147928666
+ public void testDefaultLegacyAlterTableEnabled() {
+ mDatabase.beginTransaction();
+ mDatabase.execSQL("CREATE TABLE \"t1\" (\"c1\" INTEGER, PRIMARY KEY(\"c1\"));");
+ mDatabase.execSQL("CREATE TABLE \"t2\" (\"c1\" INTEGER);");
+ mDatabase.execSQL("CREATE VIEW \"v1\" AS SELECT c1 from t1;");
+ mDatabase.execSQL("DROP TABLE t1;");
+ // The following statement will fail to execute without the legacy flag because
+ // we have a view in the schema with a dangling reference to a table that doesn't
+ // exist any more.
+ mDatabase.execSQL("ALTER TABLE \"t2\" RENAME TO \"t1\";");
+ mDatabase.endTransaction();
+ }
}