Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: sql/recovery.cc

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sql/recovery.cc
diff --git a/sql/recovery.cc b/sql/recovery.cc
index f9da40762bc444523a78b62a23b924a498d7cf7b..f179a636546b79ced978a55dca2482d6197a7d89 100644
--- a/sql/recovery.cc
+++ b/sql/recovery.cc
@@ -366,15 +366,10 @@ bool Recovery::AutoRecoverTable(const char* table_name,
const bool default_is_null = (default_type == COLUMN_TYPE_NULL);
const int pk_column = s.ColumnInt(5);
- if (pk_column > 0) {
- // TODO(shess): http://www.sqlite.org/pragma.html#pragma_table_info
- // documents column 5 as the index of the column in the primary key
- // (zero for not in primary key). I find that it is always 1 for
- // columns in the primary key. Since this code is very dependent on
- // that pragma, review if the implementation changes.
- DCHECK_EQ(1, pk_column);
+ // http://www.sqlite.org/pragma.html#pragma_table_info documents column 5 as
+ // the 1-based index of the column in the primary key, otherwise 0.
+ if (pk_column > 0)
++pk_column_count;
- }
// Construct column declaration as "name type [optional constraint]".
std::string column_decl = column_name;

Powered by Google App Engine
This is Rietveld 408576698