Commit 9e025f68 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

sqlite: Add SQLITE_OMIT_EXPLAIN and SQLITE_OMIT_REINDEX.

Disable two SQLite features that aren't used in Chrome, saving 9KB of
binary size.

Change-Id: I87ff8c454eed8fe554a6ba93f3cc28d10b91258e
Reviewed-on: https://chromium-review.googlesource.com/c/1341492
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612931}
parent d6d3d18c
...@@ -21,7 +21,7 @@ SQLITE_ALTER_TABLE statement succeeded. ...@@ -21,7 +21,7 @@ SQLITE_ALTER_TABLE statement succeeded.
SQLITE_TRANSACTION statement failed: could not prepare statement (23 not authorized) SQLITE_TRANSACTION statement failed: could not prepare statement (23 not authorized)
SQLITE_ATTACH statement failed: could not prepare statement (23 not authorized) SQLITE_ATTACH statement failed: could not prepare statement (23 not authorized)
SQLITE_DETACH statement failed: could not prepare statement (23 not authorized) SQLITE_DETACH statement failed: could not prepare statement (23 not authorized)
SQLITE_REINDEX statement succeeded. SQLITE_REINDEX statement failed: could not prepare statement (1 near "REINDEX": syntax error)
SQLITE_ANALYZE statement failed: could not prepare statement (23 not authorized) SQLITE_ANALYZE statement failed: could not prepare statement (23 not authorized)
SQLITE_DROP_INDEX statement succeeded. SQLITE_DROP_INDEX statement succeeded.
SQLITE_DROP_TEMP_TABLE statement succeeded. SQLITE_DROP_TEMP_TABLE statement succeeded.
...@@ -60,7 +60,7 @@ SQLITE_ALTER_TABLE statement failed: could not prepare statement (23 not authori ...@@ -60,7 +60,7 @@ SQLITE_ALTER_TABLE statement failed: could not prepare statement (23 not authori
SQLITE_TRANSACTION statement failed: could not prepare statement (23 not authorized) SQLITE_TRANSACTION statement failed: could not prepare statement (23 not authorized)
SQLITE_ATTACH statement failed: could not prepare statement (23 not authorized) SQLITE_ATTACH statement failed: could not prepare statement (23 not authorized)
SQLITE_DETACH statement failed: could not prepare statement (23 not authorized) SQLITE_DETACH statement failed: could not prepare statement (23 not authorized)
SQLITE_REINDEX statement failed: could not prepare statement (23 not authorized) SQLITE_REINDEX statement failed: could not prepare statement (1 near "REINDEX": syntax error)
SQLITE_ANALYZE statement failed: could not prepare statement (23 not authorized) SQLITE_ANALYZE statement failed: could not prepare statement (23 not authorized)
SQLITE_DROP_INDEX statement failed: could not prepare statement (23 not authorized) SQLITE_DROP_INDEX statement failed: could not prepare statement (23 not authorized)
SQLITE_DROP_TEMP_TABLE statement failed: could not prepare statement (23 not authorized) SQLITE_DROP_TEMP_TABLE statement failed: could not prepare statement (23 not authorized)
......
...@@ -114,6 +114,13 @@ config("chromium_sqlite3_compile_options") { ...@@ -114,6 +114,13 @@ config("chromium_sqlite3_compile_options") {
# Chrome does not use sqlite3_column_decltype(). # Chrome does not use sqlite3_column_decltype().
"SQLITE_OMIT_DECLTYPE", "SQLITE_OMIT_DECLTYPE",
# EXPLAIN's output is not stable across releases [1], so it should not be
# used in Chrome. Skipping the EXPLAIN machinery also results in
# non-trivial binary savings.
#
# [1] https://www.sqlite.org/lang_explain.html
"SQLITE_OMIT_EXPLAIN",
# Chrome does not use sqlite3_{get,free}_table(). # Chrome does not use sqlite3_{get,free}_table().
"SQLITE_OMIT_GET_TABLE", "SQLITE_OMIT_GET_TABLE",
...@@ -127,6 +134,15 @@ config("chromium_sqlite3_compile_options") { ...@@ -127,6 +134,15 @@ config("chromium_sqlite3_compile_options") {
# Chrome doesn't use TCL variables. # Chrome doesn't use TCL variables.
"SQLITE_OMIT_TCL_VARIABLE", "SQLITE_OMIT_TCL_VARIABLE",
# The REINDEX statemnt is only useful if a collation sequence's definition
# changes [1]. Chrome never defines its own collation sequences [2, 3], so
# it never needs to call REINDEX.
#
# [1] https://www.sqlite.org/lang_reindex.html
# [2] https://www.sqlite.org/datatype3.html#collating_sequences
# [3] https://www.sqlite.org/c3ref/create_collation.html
"SQLITE_OMIT_REINDEX",
# Chrome doesn't use sqlite3_{profile,trace}(). # Chrome doesn't use sqlite3_{profile,trace}().
"SQLITE_OMIT_TRACE", "SQLITE_OMIT_TRACE",
......
This diff is collapsed.
...@@ -10,7 +10,7 @@ mkdir bld ...@@ -10,7 +10,7 @@ mkdir bld
cd bld cd bld
../configure ../configure
OPTS="-DSQLITE_OMIT_UPSERT -DSQLITE_OMIT_WINDOWFUNC" OPTS="-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_REINDEX -DSQLITE_OMIT_UPSERT -DSQLITE_OMIT_WINDOWFUNC"
make "OPTS=$OPTS" shell.c sqlite3.h sqlite3.c make "OPTS=$OPTS" shell.c sqlite3.h sqlite3.c
cp -f sqlite3.h sqlite3.c ../../amalgamation cp -f sqlite3.h sqlite3.c ../../amalgamation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment