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

Unified Diff: third_party/sqlite/src/tool/max-limits.c

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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
« no previous file with comments | « third_party/sqlite/src/tool/logest.c ('k') | third_party/sqlite/src/tool/mkautoconfamal.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/tool/max-limits.c
diff --git a/third_party/sqlite/src/tool/max-limits.c b/third_party/sqlite/src/tool/max-limits.c
new file mode 100644
index 0000000000000000000000000000000000000000..d019974426d06c8b24449688d6cf3b5b7aa93fb5
--- /dev/null
+++ b/third_party/sqlite/src/tool/max-limits.c
@@ -0,0 +1,41 @@
+/*
+** Link this program against an SQLite library of unknown provenance in order
+** to display the compile-time maximum values for various settings.
+*/
+#include "sqlite3.h"
+#include <stdio.h>
+
+static const struct {
+ int eCode;
+ char *zName;
+} aLimit[] = {
+ { SQLITE_LIMIT_LENGTH, "SQLITE_MAX_LENGTH" },
+ { SQLITE_LIMIT_SQL_LENGTH, "SQLITE_MAX_SQL_LENGTH" },
+ { SQLITE_LIMIT_COLUMN, "SQLITE_MAX_COLUMN" },
+ { SQLITE_LIMIT_EXPR_DEPTH, "SQLITE_MAX_EXPR_DEPTH" },
+ { SQLITE_LIMIT_COMPOUND_SELECT, "SQLITE_MAX_COMPOUND_SELECT" },
+ { SQLITE_LIMIT_VDBE_OP, "SQLITE_MAX_VDBE_OP" },
+ { SQLITE_LIMIT_FUNCTION_ARG, "SQLITE_MAX_FUNCTION_ARG" },
+ { SQLITE_LIMIT_ATTACHED, "SQLITE_MAX_ATTACHED" },
+ { SQLITE_LIMIT_LIKE_PATTERN_LENGTH, "SQLITE_MAX_LIKE_PATTERN_LENGTH" },
+ { SQLITE_LIMIT_VARIABLE_NUMBER, "SQLITE_MAX_VARIABLE_NUMBER" },
+ { SQLITE_LIMIT_TRIGGER_DEPTH, "SQLITE_MAX_TRIGGER_DEPTH" },
+ { SQLITE_LIMIT_WORKER_THREADS, "SQLITE_MAX_WORKER_THREADS" },
+};
+
+static int maxLimit(sqlite3 *db, int eCode){
+ int iOrig = sqlite3_limit(db, eCode, 0x7fffffff);
+ return sqlite3_limit(db, eCode, iOrig);
+}
+
+int main(int argc, char **argv){
+ sqlite3 *db;
+ int j, rc;
+ rc = sqlite3_open(":memory:", &db);
+ if( rc==SQLITE_OK ){
+ for(j=0; j<sizeof(aLimit)/sizeof(aLimit[0]); j++){
+ printf("%-35s %10d\n", aLimit[j].zName, maxLimit(db, aLimit[j].eCode));
+ }
+ sqlite3_close(db);
+ }
+}
« no previous file with comments | « third_party/sqlite/src/tool/logest.c ('k') | third_party/sqlite/src/tool/mkautoconfamal.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698