summaryrefslogtreecommitdiff
path: root/android/OldPhoneNumberUtilsTest.cpp
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2020-05-07 10:16:08 +0100
committerZimuzo Ezeozue <zezeozue@google.com>2020-05-11 09:58:50 +0000
commit88147c430cc041a27d07e593ffea12b7aa586f7a (patch)
tree62abce96a859169074db03d9699cc10b58ce2720 /android/OldPhoneNumberUtilsTest.cpp
parent0f62c1a0e8b463b5b27035e11478e66d7daec69a (diff)
Fix 'ALTER RENAME TABLE' compat issue
This CL disables SQLite's new behavior in "ALTER RENAME TABLE" introduced in version 3.25.0 (https://www.sqlite.org/changes.html). In this new behavior, when renaming a table, SQLite would automatically update all the views and triggers referencing to it, which is nice if an app is always using 3.25 or later. However, in practice, almost all android apps have to support older android versions where this behavior is not supported, apps just can't rely on this feature. Other downsides of the new behavior (in the context of android ecosystem) includes: - Because the new behavior would crash an app when a rename would cause a dangling view or trigger *even when the app does have a fix-up step after ALTER RENAME TABLE* in which case it'd just work fine at the end, it is very risky to enable the new behavior on all apps. - This new behavior also means existing upgrade steps (which may have been introduced years ago) could suddenly fail, if the step is executed in R. This means, if an app used an "ALTER TABLE RENAME" in the upgrade step from ver 1 to ver 2 five years ago and never after, and almost all users are already running ver 2 or newer, *if* there's still a user who are on ver 1, upgrading the app to the latest version could suddenly fail on R. Applications wishing to enable the new behavior can enable it at runtime with the following call: SQLiteDatabase db = ....; // open a DB db.execPerConnectionSQL("PRAGMA legacy_alter_table = 0;", null); Test: atest SQLiteSecurityTest Bug: 147928666 Change-Id: I64546deebd3782ed685fcb46498bc487e0f8d5b6
Diffstat (limited to 'android/OldPhoneNumberUtilsTest.cpp')
0 files changed, 0 insertions, 0 deletions