Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d27f3177 authored by Lee Shombert's avatar Lee Shombert
Browse files

Improve SQL statement type guesses

Bug: 277114870

This improves the function that guesses at the SQL statement type.  An
internal function gives finer grained guesses.  These guesses are not
part of the public API.

The new guesses:
 1. CREATE - a table create statement (maps to public DDL)
 2. COMMENT - a leading comment (maps to public OTHER)
 3. WITH - a leading with statement (e.g., CTE) (maps to public OTHER)

The finer grained guess is used in one place.  'WITH' statements are
cached in the prepared statement cache.  This is correct behavior
because a 'WITH' statement is always either a STATEMENT_SELECT or
STATEMENT_UPDATED as well, and these are both cached.

Unit tests for the new statement type guesser have been added.  There
will not be any CTS tests because the new function is internal.  Also,
a concurrency test has been added to verify that read-only statements
with comments are correctly assigned to non-primary database
connections and therefore can run in parallel with read/write
statements.

Test: atest
 * FrameworksCoreTests:android.database
 * CtsDatabaseTestCases

Change-Id: Icfd16a60c9ebf2291bd6a4a76d03495eb01e34e9
parent 4c0797b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment