/ Check-in [21e95d28]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge all changes from index_xinfo, including the move of the pragma table into the separate pragma.h file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: 21e95d28a51e56b45a9d4166475972535e53f954
User & Date: drh 2015-02-04 23:51:59
Context
2015-02-05
01:49
Figure out the primary-key type of a table using queries of sqlite_master and the table_info and index_list pragmas, obviating the need for SQLITE_TESTCTRL_TBLTYPE. check-in: 50ecdfc4 user: drh tags: ota-update
2015-02-04
23:51
Merge all changes from index_xinfo, including the move of the pragma table into the separate pragma.h file. check-in: 21e95d28 user: drh tags: ota-update
23:13
Merge all recent trunk changes, including the movement of the pragma table into the separate pragma.h header file. Closed-Leaf check-in: 3af19f84 user: drh tags: index_xinfo
19:20
Fix the error messages returned by ota if an update violates a unique constraint. check-in: c4845a3b user: dan tags: ota-update
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   251    251     $(TOP)/src/pager.c \
   252    252     $(TOP)/src/pager.h \
   253    253     $(TOP)/src/parse.y \
   254    254     $(TOP)/src/pcache.c \
   255    255     $(TOP)/src/pcache.h \
   256    256     $(TOP)/src/pcache1.c \
   257    257     $(TOP)/src/pragma.c \
          258  +  $(TOP)/src/pragma.h \
   258    259     $(TOP)/src/prepare.c \
   259    260     $(TOP)/src/printf.c \
   260    261     $(TOP)/src/random.c \
   261    262     $(TOP)/src/resolve.c \
   262    263     $(TOP)/src/rowset.c \
   263    264     $(TOP)/src/select.c \
   264    265     $(TOP)/src/status.c \
................................................................................
   470    471      $(TOP)/src/os.h \
   471    472      $(TOP)/src/os_common.h \
   472    473      $(TOP)/src/os_setup.h \
   473    474      $(TOP)/src/os_win.h \
   474    475      $(TOP)/src/pager.h \
   475    476      $(TOP)/src/pcache.h \
   476    477      parse.h  \
          478  +   $(TOP)/src/pragma.h \
   477    479      sqlite3.h  \
   478    480      $(TOP)/src/sqlite3ext.h \
   479    481      $(TOP)/src/sqliteInt.h  \
   480    482      $(TOP)/src/sqliteLimit.h \
   481    483      $(TOP)/src/vdbe.h \
   482    484      $(TOP)/src/vdbeInt.h \
   483    485      $(TOP)/src/whereInt.h \
................................................................................
   991    993   
   992    994   LogEst$(TEXE):	$(TOP)/tool/logest.c sqlite3.h
   993    995   	$(LTLINK) -I. -o $@ $(TOP)/tool/logest.c
   994    996   
   995    997   wordcount$(TEXE):	$(TOP)/test/wordcount.c sqlite3.c
   996    998   	$(LTLINK) -o $@ $(TOP)/test/wordcount.c sqlite3.c $(TLIBS)
   997    999   
   998         -speedtest1$(TEXE):	$(TOP)/test/wordcount.c sqlite3.lo
         1000  +speedtest1$(TEXE):	$(TOP)/test/speedtest1.c sqlite3.lo
   999   1001   	$(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
  1000   1002   
  1001   1003   # This target will fail if the SQLite amalgamation contains any exported
  1002   1004   # symbols that do not begin with "sqlite3_". It is run as part of the
  1003   1005   # releasetest.tcl script.
  1004   1006   #
  1005   1007   checksymbols: sqlite3.lo

Changes to Makefile.msc.

   769    769     $(TOP)\src\pager.c \
   770    770     $(TOP)\src\pager.h \
   771    771     $(TOP)\src\parse.y \
   772    772     $(TOP)\src\pcache.c \
   773    773     $(TOP)\src\pcache.h \
   774    774     $(TOP)\src\pcache1.c \
   775    775     $(TOP)\src\pragma.c \
          776  +  $(TOP)\src\pragma.h \
   776    777     $(TOP)\src\prepare.c \
   777    778     $(TOP)\src\printf.c \
   778    779     $(TOP)\src\random.c \
   779    780     $(TOP)\src\resolve.c \
   780    781     $(TOP)\src\rowset.c \
   781    782     $(TOP)\src\select.c \
   782    783     $(TOP)\src\status.c \
................................................................................
   992    993      $(TOP)\src\os.h \
   993    994      $(TOP)\src\os_common.h \
   994    995      $(TOP)\src\os_setup.h \
   995    996      $(TOP)\src\os_win.h \
   996    997      $(TOP)\src\pager.h \
   997    998      $(TOP)\src\pcache.h \
   998    999      parse.h \
         1000  +   $(TOP)\src\pragma.h \
   999   1001      sqlite3.h \
  1000   1002      $(TOP)\src\sqlite3ext.h \
  1001   1003      $(TOP)\src\sqliteInt.h \
  1002   1004      $(TOP)\src\sqliteLimit.h \
  1003   1005      $(TOP)\src\vdbe.h \
  1004   1006      $(TOP)\src\vdbeInt.h \
  1005   1007      $(TOP)\src\whereInt.h

Changes to main.mk.

   129    129     $(TOP)/src/pager.c \
   130    130     $(TOP)/src/pager.h \
   131    131     $(TOP)/src/parse.y \
   132    132     $(TOP)/src/pcache.c \
   133    133     $(TOP)/src/pcache.h \
   134    134     $(TOP)/src/pcache1.c \
   135    135     $(TOP)/src/pragma.c \
          136  +  $(TOP)/src/pragma.h \
   136    137     $(TOP)/src/prepare.c \
   137    138     $(TOP)/src/printf.c \
   138    139     $(TOP)/src/random.c \
   139    140     $(TOP)/src/resolve.c \
   140    141     $(TOP)/src/rowset.c \
   141    142     $(TOP)/src/select.c \
   142    143     $(TOP)/src/status.c \
................................................................................
   353    354      $(TOP)/src/os.h \
   354    355      $(TOP)/src/os_common.h \
   355    356      $(TOP)/src/os_setup.h \
   356    357      $(TOP)/src/os_win.h \
   357    358      $(TOP)/src/pager.h \
   358    359      $(TOP)/src/pcache.h \
   359    360      parse.h  \
          361  +   $(TOP)/src/pragma.h \
   360    362      sqlite3.h  \
   361    363      $(TOP)/src/sqlite3ext.h \
   362    364      $(TOP)/src/sqliteInt.h  \
   363    365      $(TOP)/src/sqliteLimit.h \
   364    366      $(TOP)/src/vdbe.h \
   365    367      $(TOP)/src/vdbeInt.h \
   366    368      $(TOP)/src/whereInt.h

Changes to src/pragma.c.

    18     18   #    define SQLITE_ENABLE_LOCKING_STYLE 1
    19     19   #  else
    20     20   #    define SQLITE_ENABLE_LOCKING_STYLE 0
    21     21   #  endif
    22     22   #endif
    23     23   
    24     24   /***************************************************************************
    25         -** The next block of code, including the PragTyp_XXXX macro definitions and
    26         -** the aPragmaName[] object is composed of generated code. DO NOT EDIT.
    27         -**
    28         -** To add new pragmas, edit the code in ../tool/mkpragmatab.tcl and rerun
    29         -** that script.  Then copy/paste the output in place of the following:
    30         -*/
    31         -#define PragTyp_HEADER_VALUE                   0
    32         -#define PragTyp_AUTO_VACUUM                    1
    33         -#define PragTyp_FLAG                           2
    34         -#define PragTyp_BUSY_TIMEOUT                   3
    35         -#define PragTyp_CACHE_SIZE                     4
    36         -#define PragTyp_CASE_SENSITIVE_LIKE            5
    37         -#define PragTyp_COLLATION_LIST                 6
    38         -#define PragTyp_COMPILE_OPTIONS                7
    39         -#define PragTyp_DATA_STORE_DIRECTORY           8
    40         -#define PragTyp_DATABASE_LIST                  9
    41         -#define PragTyp_DEFAULT_CACHE_SIZE            10
    42         -#define PragTyp_ENCODING                      11
    43         -#define PragTyp_FOREIGN_KEY_CHECK             12
    44         -#define PragTyp_FOREIGN_KEY_LIST              13
    45         -#define PragTyp_INCREMENTAL_VACUUM            14
    46         -#define PragTyp_INDEX_INFO                    15
    47         -#define PragTyp_INDEX_LIST                    16
    48         -#define PragTyp_INTEGRITY_CHECK               17
    49         -#define PragTyp_JOURNAL_MODE                  18
    50         -#define PragTyp_JOURNAL_SIZE_LIMIT            19
    51         -#define PragTyp_LOCK_PROXY_FILE               20
    52         -#define PragTyp_LOCKING_MODE                  21
    53         -#define PragTyp_PAGE_COUNT                    22
    54         -#define PragTyp_MMAP_SIZE                     23
    55         -#define PragTyp_PAGE_SIZE                     24
    56         -#define PragTyp_PAGER_OTA_MODE                25
    57         -#define PragTyp_SECURE_DELETE                 26
    58         -#define PragTyp_SHRINK_MEMORY                 27
    59         -#define PragTyp_SOFT_HEAP_LIMIT               28
    60         -#define PragTyp_STATS                         29
    61         -#define PragTyp_SYNCHRONOUS                   30
    62         -#define PragTyp_TABLE_INFO                    31
    63         -#define PragTyp_TEMP_STORE                    32
    64         -#define PragTyp_TEMP_STORE_DIRECTORY          33
    65         -#define PragTyp_THREADS                       34
    66         -#define PragTyp_WAL_AUTOCHECKPOINT            35
    67         -#define PragTyp_WAL_CHECKPOINT                36
    68         -#define PragTyp_ACTIVATE_EXTENSIONS           37
    69         -#define PragTyp_HEXKEY                        38
    70         -#define PragTyp_KEY                           39
    71         -#define PragTyp_REKEY                         40
    72         -#define PragTyp_LOCK_STATUS                   41
    73         -#define PragTyp_PARSER_TRACE                  42
    74         -#define PragFlag_NeedSchema           0x01
    75         -#define PragFlag_ReadOnly             0x02
    76         -static const struct sPragmaNames {
    77         -  const char *const zName;  /* Name of pragma */
    78         -  u8 ePragTyp;              /* PragTyp_XXX value */
    79         -  u8 mPragFlag;             /* Zero or more PragFlag_XXX values */
    80         -  u32 iArg;                 /* Extra argument */
    81         -} aPragmaNames[] = {
    82         -#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD)
    83         -  { /* zName:     */ "activate_extensions",
    84         -    /* ePragTyp:  */ PragTyp_ACTIVATE_EXTENSIONS,
    85         -    /* ePragFlag: */ 0,
    86         -    /* iArg:      */ 0 },
    87         -#endif
    88         -#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
    89         -  { /* zName:     */ "application_id",
    90         -    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
    91         -    /* ePragFlag: */ 0,
    92         -    /* iArg:      */ BTREE_APPLICATION_ID },
    93         -#endif
    94         -#if !defined(SQLITE_OMIT_AUTOVACUUM)
    95         -  { /* zName:     */ "auto_vacuum",
    96         -    /* ePragTyp:  */ PragTyp_AUTO_VACUUM,
    97         -    /* ePragFlag: */ PragFlag_NeedSchema,
    98         -    /* iArg:      */ 0 },
    99         -#endif
   100         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   101         -#if !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
   102         -  { /* zName:     */ "automatic_index",
   103         -    /* ePragTyp:  */ PragTyp_FLAG,
   104         -    /* ePragFlag: */ 0,
   105         -    /* iArg:      */ SQLITE_AutoIndex },
   106         -#endif
   107         -#endif
   108         -  { /* zName:     */ "busy_timeout",
   109         -    /* ePragTyp:  */ PragTyp_BUSY_TIMEOUT,
   110         -    /* ePragFlag: */ 0,
   111         -    /* iArg:      */ 0 },
   112         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   113         -  { /* zName:     */ "cache_size",
   114         -    /* ePragTyp:  */ PragTyp_CACHE_SIZE,
   115         -    /* ePragFlag: */ PragFlag_NeedSchema,
   116         -    /* iArg:      */ 0 },
   117         -#endif
   118         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   119         -  { /* zName:     */ "cache_spill",
   120         -    /* ePragTyp:  */ PragTyp_FLAG,
   121         -    /* ePragFlag: */ 0,
   122         -    /* iArg:      */ SQLITE_CacheSpill },
   123         -#endif
   124         -  { /* zName:     */ "case_sensitive_like",
   125         -    /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
   126         -    /* ePragFlag: */ 0,
   127         -    /* iArg:      */ 0 },
   128         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   129         -  { /* zName:     */ "checkpoint_fullfsync",
   130         -    /* ePragTyp:  */ PragTyp_FLAG,
   131         -    /* ePragFlag: */ 0,
   132         -    /* iArg:      */ SQLITE_CkptFullFSync },
   133         -#endif
   134         -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   135         -  { /* zName:     */ "collation_list",
   136         -    /* ePragTyp:  */ PragTyp_COLLATION_LIST,
   137         -    /* ePragFlag: */ 0,
   138         -    /* iArg:      */ 0 },
   139         -#endif
   140         -#if !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS)
   141         -  { /* zName:     */ "compile_options",
   142         -    /* ePragTyp:  */ PragTyp_COMPILE_OPTIONS,
   143         -    /* ePragFlag: */ 0,
   144         -    /* iArg:      */ 0 },
   145         -#endif
   146         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   147         -  { /* zName:     */ "count_changes",
   148         -    /* ePragTyp:  */ PragTyp_FLAG,
   149         -    /* ePragFlag: */ 0,
   150         -    /* iArg:      */ SQLITE_CountRows },
   151         -#endif
   152         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   153         -  { /* zName:     */ "data_store_directory",
   154         -    /* ePragTyp:  */ PragTyp_DATA_STORE_DIRECTORY,
   155         -    /* ePragFlag: */ 0,
   156         -    /* iArg:      */ 0 },
   157         -#endif
   158         -#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   159         -  { /* zName:     */ "data_version",
   160         -    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   161         -    /* ePragFlag: */ PragFlag_ReadOnly,
   162         -    /* iArg:      */ BTREE_DATA_VERSION },
   163         -#endif
   164         -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   165         -  { /* zName:     */ "database_list",
   166         -    /* ePragTyp:  */ PragTyp_DATABASE_LIST,
   167         -    /* ePragFlag: */ PragFlag_NeedSchema,
   168         -    /* iArg:      */ 0 },
   169         -#endif
   170         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   171         -  { /* zName:     */ "default_cache_size",
   172         -    /* ePragTyp:  */ PragTyp_DEFAULT_CACHE_SIZE,
   173         -    /* ePragFlag: */ PragFlag_NeedSchema,
   174         -    /* iArg:      */ 0 },
   175         -#endif
   176         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   177         -#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   178         -  { /* zName:     */ "defer_foreign_keys",
   179         -    /* ePragTyp:  */ PragTyp_FLAG,
   180         -    /* ePragFlag: */ 0,
   181         -    /* iArg:      */ SQLITE_DeferFKs },
   182         -#endif
   183         -#endif
   184         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   185         -  { /* zName:     */ "empty_result_callbacks",
   186         -    /* ePragTyp:  */ PragTyp_FLAG,
   187         -    /* ePragFlag: */ 0,
   188         -    /* iArg:      */ SQLITE_NullCallback },
   189         -#endif
   190         -#if !defined(SQLITE_OMIT_UTF16)
   191         -  { /* zName:     */ "encoding",
   192         -    /* ePragTyp:  */ PragTyp_ENCODING,
   193         -    /* ePragFlag: */ 0,
   194         -    /* iArg:      */ 0 },
   195         -#endif
   196         -#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   197         -  { /* zName:     */ "foreign_key_check",
   198         -    /* ePragTyp:  */ PragTyp_FOREIGN_KEY_CHECK,
   199         -    /* ePragFlag: */ PragFlag_NeedSchema,
   200         -    /* iArg:      */ 0 },
   201         -#endif
   202         -#if !defined(SQLITE_OMIT_FOREIGN_KEY)
   203         -  { /* zName:     */ "foreign_key_list",
   204         -    /* ePragTyp:  */ PragTyp_FOREIGN_KEY_LIST,
   205         -    /* ePragFlag: */ PragFlag_NeedSchema,
   206         -    /* iArg:      */ 0 },
   207         -#endif
   208         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   209         -#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   210         -  { /* zName:     */ "foreign_keys",
   211         -    /* ePragTyp:  */ PragTyp_FLAG,
   212         -    /* ePragFlag: */ 0,
   213         -    /* iArg:      */ SQLITE_ForeignKeys },
   214         -#endif
   215         -#endif
   216         -#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   217         -  { /* zName:     */ "freelist_count",
   218         -    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   219         -    /* ePragFlag: */ PragFlag_ReadOnly,
   220         -    /* iArg:      */ BTREE_FREE_PAGE_COUNT },
   221         -#endif
   222         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   223         -  { /* zName:     */ "full_column_names",
   224         -    /* ePragTyp:  */ PragTyp_FLAG,
   225         -    /* ePragFlag: */ 0,
   226         -    /* iArg:      */ SQLITE_FullColNames },
   227         -  { /* zName:     */ "fullfsync",
   228         -    /* ePragTyp:  */ PragTyp_FLAG,
   229         -    /* ePragFlag: */ 0,
   230         -    /* iArg:      */ SQLITE_FullFSync },
   231         -#endif
   232         -#if defined(SQLITE_HAS_CODEC)
   233         -  { /* zName:     */ "hexkey",
   234         -    /* ePragTyp:  */ PragTyp_HEXKEY,
   235         -    /* ePragFlag: */ 0,
   236         -    /* iArg:      */ 0 },
   237         -  { /* zName:     */ "hexrekey",
   238         -    /* ePragTyp:  */ PragTyp_HEXKEY,
   239         -    /* ePragFlag: */ 0,
   240         -    /* iArg:      */ 0 },
   241         -#endif
   242         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   243         -#if !defined(SQLITE_OMIT_CHECK)
   244         -  { /* zName:     */ "ignore_check_constraints",
   245         -    /* ePragTyp:  */ PragTyp_FLAG,
   246         -    /* ePragFlag: */ 0,
   247         -    /* iArg:      */ SQLITE_IgnoreChecks },
   248         -#endif
   249         -#endif
   250         -#if !defined(SQLITE_OMIT_AUTOVACUUM)
   251         -  { /* zName:     */ "incremental_vacuum",
   252         -    /* ePragTyp:  */ PragTyp_INCREMENTAL_VACUUM,
   253         -    /* ePragFlag: */ PragFlag_NeedSchema,
   254         -    /* iArg:      */ 0 },
   255         -#endif
   256         -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   257         -  { /* zName:     */ "index_info",
   258         -    /* ePragTyp:  */ PragTyp_INDEX_INFO,
   259         -    /* ePragFlag: */ PragFlag_NeedSchema,
   260         -    /* iArg:      */ 0 },
   261         -  { /* zName:     */ "index_list",
   262         -    /* ePragTyp:  */ PragTyp_INDEX_LIST,
   263         -    /* ePragFlag: */ PragFlag_NeedSchema,
   264         -    /* iArg:      */ 0 },
   265         -  { /* zName:     */ "index_xinfo",
   266         -    /* ePragTyp:  */ PragTyp_INDEX_INFO,
   267         -    /* ePragFlag: */ PragFlag_NeedSchema,
   268         -    /* iArg:      */ 1 },
   269         -#endif
   270         -#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
   271         -  { /* zName:     */ "integrity_check",
   272         -    /* ePragTyp:  */ PragTyp_INTEGRITY_CHECK,
   273         -    /* ePragFlag: */ PragFlag_NeedSchema,
   274         -    /* iArg:      */ 0 },
   275         -#endif
   276         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   277         -  { /* zName:     */ "journal_mode",
   278         -    /* ePragTyp:  */ PragTyp_JOURNAL_MODE,
   279         -    /* ePragFlag: */ PragFlag_NeedSchema,
   280         -    /* iArg:      */ 0 },
   281         -  { /* zName:     */ "journal_size_limit",
   282         -    /* ePragTyp:  */ PragTyp_JOURNAL_SIZE_LIMIT,
   283         -    /* ePragFlag: */ 0,
   284         -    /* iArg:      */ 0 },
   285         -#endif
   286         -#if defined(SQLITE_HAS_CODEC)
   287         -  { /* zName:     */ "key",
   288         -    /* ePragTyp:  */ PragTyp_KEY,
   289         -    /* ePragFlag: */ 0,
   290         -    /* iArg:      */ 0 },
   291         -#endif
   292         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   293         -  { /* zName:     */ "legacy_file_format",
   294         -    /* ePragTyp:  */ PragTyp_FLAG,
   295         -    /* ePragFlag: */ 0,
   296         -    /* iArg:      */ SQLITE_LegacyFileFmt },
   297         -#endif
   298         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
   299         -  { /* zName:     */ "lock_proxy_file",
   300         -    /* ePragTyp:  */ PragTyp_LOCK_PROXY_FILE,
   301         -    /* ePragFlag: */ 0,
   302         -    /* iArg:      */ 0 },
   303         -#endif
   304         -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
   305         -  { /* zName:     */ "lock_status",
   306         -    /* ePragTyp:  */ PragTyp_LOCK_STATUS,
   307         -    /* ePragFlag: */ 0,
   308         -    /* iArg:      */ 0 },
   309         -#endif
   310         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   311         -  { /* zName:     */ "locking_mode",
   312         -    /* ePragTyp:  */ PragTyp_LOCKING_MODE,
   313         -    /* ePragFlag: */ 0,
   314         -    /* iArg:      */ 0 },
   315         -  { /* zName:     */ "max_page_count",
   316         -    /* ePragTyp:  */ PragTyp_PAGE_COUNT,
   317         -    /* ePragFlag: */ PragFlag_NeedSchema,
   318         -    /* iArg:      */ 0 },
   319         -  { /* zName:     */ "mmap_size",
   320         -    /* ePragTyp:  */ PragTyp_MMAP_SIZE,
   321         -    /* ePragFlag: */ 0,
   322         -    /* iArg:      */ 0 },
   323         -  { /* zName:     */ "page_count",
   324         -    /* ePragTyp:  */ PragTyp_PAGE_COUNT,
   325         -    /* ePragFlag: */ PragFlag_NeedSchema,
   326         -    /* iArg:      */ 0 },
   327         -  { /* zName:     */ "page_size",
   328         -    /* ePragTyp:  */ PragTyp_PAGE_SIZE,
   329         -    /* ePragFlag: */ 0,
   330         -    /* iArg:      */ 0 },
   331         -#endif
   332         -#if defined(SQLITE_ENABLE_OTA)
   333         -  { /* zName:     */ "pager_ota_mode",
   334         -    /* ePragTyp:  */ PragTyp_PAGER_OTA_MODE,
   335         -    /* ePragFlag: */ 0,
   336         -    /* iArg:      */ 0 },
   337         -#endif
   338         -#if defined(SQLITE_DEBUG)
   339         -  { /* zName:     */ "parser_trace",
   340         -    /* ePragTyp:  */ PragTyp_PARSER_TRACE,
   341         -    /* ePragFlag: */ 0,
   342         -    /* iArg:      */ 0 },
   343         -#endif
   344         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   345         -  { /* zName:     */ "query_only",
   346         -    /* ePragTyp:  */ PragTyp_FLAG,
   347         -    /* ePragFlag: */ 0,
   348         -    /* iArg:      */ SQLITE_QueryOnly },
   349         -#endif
   350         -#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
   351         -  { /* zName:     */ "quick_check",
   352         -    /* ePragTyp:  */ PragTyp_INTEGRITY_CHECK,
   353         -    /* ePragFlag: */ PragFlag_NeedSchema,
   354         -    /* iArg:      */ 0 },
   355         -#endif
   356         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   357         -  { /* zName:     */ "read_uncommitted",
   358         -    /* ePragTyp:  */ PragTyp_FLAG,
   359         -    /* ePragFlag: */ 0,
   360         -    /* iArg:      */ SQLITE_ReadUncommitted },
   361         -  { /* zName:     */ "recursive_triggers",
   362         -    /* ePragTyp:  */ PragTyp_FLAG,
   363         -    /* ePragFlag: */ 0,
   364         -    /* iArg:      */ SQLITE_RecTriggers },
   365         -#endif
   366         -#if defined(SQLITE_HAS_CODEC)
   367         -  { /* zName:     */ "rekey",
   368         -    /* ePragTyp:  */ PragTyp_REKEY,
   369         -    /* ePragFlag: */ 0,
   370         -    /* iArg:      */ 0 },
   371         -#endif
   372         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   373         -  { /* zName:     */ "reverse_unordered_selects",
   374         -    /* ePragTyp:  */ PragTyp_FLAG,
   375         -    /* ePragFlag: */ 0,
   376         -    /* iArg:      */ SQLITE_ReverseOrder },
   377         -#endif
   378         -#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   379         -  { /* zName:     */ "schema_version",
   380         -    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   381         -    /* ePragFlag: */ 0,
   382         -    /* iArg:      */ BTREE_SCHEMA_VERSION },
   383         -#endif
   384         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   385         -  { /* zName:     */ "secure_delete",
   386         -    /* ePragTyp:  */ PragTyp_SECURE_DELETE,
   387         -    /* ePragFlag: */ 0,
   388         -    /* iArg:      */ 0 },
   389         -#endif
   390         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   391         -  { /* zName:     */ "short_column_names",
   392         -    /* ePragTyp:  */ PragTyp_FLAG,
   393         -    /* ePragFlag: */ 0,
   394         -    /* iArg:      */ SQLITE_ShortColNames },
   395         -#endif
   396         -  { /* zName:     */ "shrink_memory",
   397         -    /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
   398         -    /* ePragFlag: */ 0,
   399         -    /* iArg:      */ 0 },
   400         -  { /* zName:     */ "soft_heap_limit",
   401         -    /* ePragTyp:  */ PragTyp_SOFT_HEAP_LIMIT,
   402         -    /* ePragFlag: */ 0,
   403         -    /* iArg:      */ 0 },
   404         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   405         -#if defined(SQLITE_DEBUG)
   406         -  { /* zName:     */ "sql_trace",
   407         -    /* ePragTyp:  */ PragTyp_FLAG,
   408         -    /* ePragFlag: */ 0,
   409         -    /* iArg:      */ SQLITE_SqlTrace },
   410         -#endif
   411         -#endif
   412         -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   413         -  { /* zName:     */ "stats",
   414         -    /* ePragTyp:  */ PragTyp_STATS,
   415         -    /* ePragFlag: */ PragFlag_NeedSchema,
   416         -    /* iArg:      */ 0 },
   417         -#endif
   418         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   419         -  { /* zName:     */ "synchronous",
   420         -    /* ePragTyp:  */ PragTyp_SYNCHRONOUS,
   421         -    /* ePragFlag: */ PragFlag_NeedSchema,
   422         -    /* iArg:      */ 0 },
   423         -#endif
   424         -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   425         -  { /* zName:     */ "table_info",
   426         -    /* ePragTyp:  */ PragTyp_TABLE_INFO,
   427         -    /* ePragFlag: */ PragFlag_NeedSchema,
   428         -    /* iArg:      */ 0 },
   429         -#endif
   430         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   431         -  { /* zName:     */ "temp_store",
   432         -    /* ePragTyp:  */ PragTyp_TEMP_STORE,
   433         -    /* ePragFlag: */ 0,
   434         -    /* iArg:      */ 0 },
   435         -  { /* zName:     */ "temp_store_directory",
   436         -    /* ePragTyp:  */ PragTyp_TEMP_STORE_DIRECTORY,
   437         -    /* ePragFlag: */ 0,
   438         -    /* iArg:      */ 0 },
   439         -#endif
   440         -  { /* zName:     */ "threads",
   441         -    /* ePragTyp:  */ PragTyp_THREADS,
   442         -    /* ePragFlag: */ 0,
   443         -    /* iArg:      */ 0 },
   444         -#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   445         -  { /* zName:     */ "user_version",
   446         -    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   447         -    /* ePragFlag: */ 0,
   448         -    /* iArg:      */ BTREE_USER_VERSION },
   449         -#endif
   450         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   451         -#if defined(SQLITE_DEBUG)
   452         -  { /* zName:     */ "vdbe_addoptrace",
   453         -    /* ePragTyp:  */ PragTyp_FLAG,
   454         -    /* ePragFlag: */ 0,
   455         -    /* iArg:      */ SQLITE_VdbeAddopTrace },
   456         -  { /* zName:     */ "vdbe_debug",
   457         -    /* ePragTyp:  */ PragTyp_FLAG,
   458         -    /* ePragFlag: */ 0,
   459         -    /* iArg:      */ SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace },
   460         -  { /* zName:     */ "vdbe_eqp",
   461         -    /* ePragTyp:  */ PragTyp_FLAG,
   462         -    /* ePragFlag: */ 0,
   463         -    /* iArg:      */ SQLITE_VdbeEQP },
   464         -  { /* zName:     */ "vdbe_listing",
   465         -    /* ePragTyp:  */ PragTyp_FLAG,
   466         -    /* ePragFlag: */ 0,
   467         -    /* iArg:      */ SQLITE_VdbeListing },
   468         -  { /* zName:     */ "vdbe_trace",
   469         -    /* ePragTyp:  */ PragTyp_FLAG,
   470         -    /* ePragFlag: */ 0,
   471         -    /* iArg:      */ SQLITE_VdbeTrace },
   472         -#endif
   473         -#endif
   474         -#if !defined(SQLITE_OMIT_WAL)
   475         -  { /* zName:     */ "wal_autocheckpoint",
   476         -    /* ePragTyp:  */ PragTyp_WAL_AUTOCHECKPOINT,
   477         -    /* ePragFlag: */ 0,
   478         -    /* iArg:      */ 0 },
   479         -  { /* zName:     */ "wal_checkpoint",
   480         -    /* ePragTyp:  */ PragTyp_WAL_CHECKPOINT,
   481         -    /* ePragFlag: */ PragFlag_NeedSchema,
   482         -    /* iArg:      */ 0 },
   483         -#endif
   484         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   485         -  { /* zName:     */ "writable_schema",
   486         -    /* ePragTyp:  */ PragTyp_FLAG,
   487         -    /* ePragFlag: */ 0,
   488         -    /* iArg:      */ SQLITE_WriteSchema|SQLITE_RecoveryMode },
   489         -#endif
   490         -};
   491         -/* Number of pragmas: 59 on by default, 73 total. */
   492         -/* End of the automatically generated pragma table.
   493         -***************************************************************************/
           25  +** The "pragma.h" include file is an automatically generated file that
           26  +** that includes the PragType_XXXX macro definitions and the aPragmaName[]
           27  +** object.  This ensures that the aPragmaName[] table is arranged in
           28  +** lexicographical order to facility a binary search of the pragma name.
           29  +** Do not edit pragma.h directly.  Edit and rerun the script in at 
           30  +** ../tool/mkpragmatab.tcl. */
           31  +#include "pragma.h"
   494     32   
   495     33   /*
   496     34   ** Interpret the given string as a safety level.  Return 0 for OFF,
   497     35   ** 1 for ON or NORMAL and 2 for FULL.  Return 1 for an empty or 
   498     36   ** unrecognized string argument.  The FULL option is disallowed
   499     37   ** if the omitFull parameter it 1.
   500     38   **

Added src/pragma.h.

            1  +/* DO NOT EDIT!
            2  +** This file is automatically generated by the script at
            3  +** ../tool/mkpragmatab.tcl.  To update the set of pragmas, edit
            4  +** that script and rerun it.
            5  +*/
            6  +#define PragTyp_HEADER_VALUE                   0
            7  +#define PragTyp_AUTO_VACUUM                    1
            8  +#define PragTyp_FLAG                           2
            9  +#define PragTyp_BUSY_TIMEOUT                   3
           10  +#define PragTyp_CACHE_SIZE                     4
           11  +#define PragTyp_CASE_SENSITIVE_LIKE            5
           12  +#define PragTyp_COLLATION_LIST                 6
           13  +#define PragTyp_COMPILE_OPTIONS                7
           14  +#define PragTyp_DATA_STORE_DIRECTORY           8
           15  +#define PragTyp_DATABASE_LIST                  9
           16  +#define PragTyp_DEFAULT_CACHE_SIZE            10
           17  +#define PragTyp_ENCODING                      11
           18  +#define PragTyp_FOREIGN_KEY_CHECK             12
           19  +#define PragTyp_FOREIGN_KEY_LIST              13
           20  +#define PragTyp_INCREMENTAL_VACUUM            14
           21  +#define PragTyp_INDEX_INFO                    15
           22  +#define PragTyp_INDEX_LIST                    16
           23  +#define PragTyp_INTEGRITY_CHECK               17
           24  +#define PragTyp_JOURNAL_MODE                  18
           25  +#define PragTyp_JOURNAL_SIZE_LIMIT            19
           26  +#define PragTyp_LOCK_PROXY_FILE               20
           27  +#define PragTyp_LOCKING_MODE                  21
           28  +#define PragTyp_PAGE_COUNT                    22
           29  +#define PragTyp_MMAP_SIZE                     23
           30  +#define PragTyp_PAGE_SIZE                     24
           31  +#define PragTyp_PAGER_OTA_MODE                25
           32  +#define PragTyp_SECURE_DELETE                 26
           33  +#define PragTyp_SHRINK_MEMORY                 27
           34  +#define PragTyp_SOFT_HEAP_LIMIT               28
           35  +#define PragTyp_STATS                         29
           36  +#define PragTyp_SYNCHRONOUS                   30
           37  +#define PragTyp_TABLE_INFO                    31
           38  +#define PragTyp_TEMP_STORE                    32
           39  +#define PragTyp_TEMP_STORE_DIRECTORY          33
           40  +#define PragTyp_THREADS                       34
           41  +#define PragTyp_WAL_AUTOCHECKPOINT            35
           42  +#define PragTyp_WAL_CHECKPOINT                36
           43  +#define PragTyp_ACTIVATE_EXTENSIONS           37
           44  +#define PragTyp_HEXKEY                        38
           45  +#define PragTyp_KEY                           39
           46  +#define PragTyp_REKEY                         40
           47  +#define PragTyp_LOCK_STATUS                   41
           48  +#define PragTyp_PARSER_TRACE                  42
           49  +#define PragFlag_NeedSchema           0x01
           50  +#define PragFlag_ReadOnly             0x02
           51  +static const struct sPragmaNames {
           52  +  const char *const zName;  /* Name of pragma */
           53  +  u8 ePragTyp;              /* PragTyp_XXX value */
           54  +  u8 mPragFlag;             /* Zero or more PragFlag_XXX values */
           55  +  u32 iArg;                 /* Extra argument */
           56  +} aPragmaNames[] = {
           57  +#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD)
           58  +  { /* zName:     */ "activate_extensions",
           59  +    /* ePragTyp:  */ PragTyp_ACTIVATE_EXTENSIONS,
           60  +    /* ePragFlag: */ 0,
           61  +    /* iArg:      */ 0 },
           62  +#endif
           63  +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
           64  +  { /* zName:     */ "application_id",
           65  +    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
           66  +    /* ePragFlag: */ 0,
           67  +    /* iArg:      */ BTREE_APPLICATION_ID },
           68  +#endif
           69  +#if !defined(SQLITE_OMIT_AUTOVACUUM)
           70  +  { /* zName:     */ "auto_vacuum",
           71  +    /* ePragTyp:  */ PragTyp_AUTO_VACUUM,
           72  +    /* ePragFlag: */ PragFlag_NeedSchema,
           73  +    /* iArg:      */ 0 },
           74  +#endif
           75  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
           76  +#if !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
           77  +  { /* zName:     */ "automatic_index",
           78  +    /* ePragTyp:  */ PragTyp_FLAG,
           79  +    /* ePragFlag: */ 0,
           80  +    /* iArg:      */ SQLITE_AutoIndex },
           81  +#endif
           82  +#endif
           83  +  { /* zName:     */ "busy_timeout",
           84  +    /* ePragTyp:  */ PragTyp_BUSY_TIMEOUT,
           85  +    /* ePragFlag: */ 0,
           86  +    /* iArg:      */ 0 },
           87  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
           88  +  { /* zName:     */ "cache_size",
           89  +    /* ePragTyp:  */ PragTyp_CACHE_SIZE,
           90  +    /* ePragFlag: */ PragFlag_NeedSchema,
           91  +    /* iArg:      */ 0 },
           92  +#endif
           93  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
           94  +  { /* zName:     */ "cache_spill",
           95  +    /* ePragTyp:  */ PragTyp_FLAG,
           96  +    /* ePragFlag: */ 0,
           97  +    /* iArg:      */ SQLITE_CacheSpill },
           98  +#endif
           99  +  { /* zName:     */ "case_sensitive_like",
          100  +    /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
          101  +    /* ePragFlag: */ 0,
          102  +    /* iArg:      */ 0 },
          103  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          104  +  { /* zName:     */ "checkpoint_fullfsync",
          105  +    /* ePragTyp:  */ PragTyp_FLAG,
          106  +    /* ePragFlag: */ 0,
          107  +    /* iArg:      */ SQLITE_CkptFullFSync },
          108  +#endif
          109  +#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
          110  +  { /* zName:     */ "collation_list",
          111  +    /* ePragTyp:  */ PragTyp_COLLATION_LIST,
          112  +    /* ePragFlag: */ 0,
          113  +    /* iArg:      */ 0 },
          114  +#endif
          115  +#if !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS)
          116  +  { /* zName:     */ "compile_options",
          117  +    /* ePragTyp:  */ PragTyp_COMPILE_OPTIONS,
          118  +    /* ePragFlag: */ 0,
          119  +    /* iArg:      */ 0 },
          120  +#endif
          121  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          122  +  { /* zName:     */ "count_changes",
          123  +    /* ePragTyp:  */ PragTyp_FLAG,
          124  +    /* ePragFlag: */ 0,
          125  +    /* iArg:      */ SQLITE_CountRows },
          126  +#endif
          127  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
          128  +  { /* zName:     */ "data_store_directory",
          129  +    /* ePragTyp:  */ PragTyp_DATA_STORE_DIRECTORY,
          130  +    /* ePragFlag: */ 0,
          131  +    /* iArg:      */ 0 },
          132  +#endif
          133  +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
          134  +  { /* zName:     */ "data_version",
          135  +    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
          136  +    /* ePragFlag: */ PragFlag_ReadOnly,
          137  +    /* iArg:      */ BTREE_DATA_VERSION },
          138  +#endif
          139  +#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
          140  +  { /* zName:     */ "database_list",
          141  +    /* ePragTyp:  */ PragTyp_DATABASE_LIST,
          142  +    /* ePragFlag: */ PragFlag_NeedSchema,
          143  +    /* iArg:      */ 0 },
          144  +#endif
          145  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
          146  +  { /* zName:     */ "default_cache_size",
          147  +    /* ePragTyp:  */ PragTyp_DEFAULT_CACHE_SIZE,
          148  +    /* ePragFlag: */ PragFlag_NeedSchema,
          149  +    /* iArg:      */ 0 },
          150  +#endif
          151  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          152  +#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
          153  +  { /* zName:     */ "defer_foreign_keys",
          154  +    /* ePragTyp:  */ PragTyp_FLAG,
          155  +    /* ePragFlag: */ 0,
          156  +    /* iArg:      */ SQLITE_DeferFKs },
          157  +#endif
          158  +#endif
          159  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          160  +  { /* zName:     */ "empty_result_callbacks",
          161  +    /* ePragTyp:  */ PragTyp_FLAG,
          162  +    /* ePragFlag: */ 0,
          163  +    /* iArg:      */ SQLITE_NullCallback },
          164  +#endif
          165  +#if !defined(SQLITE_OMIT_UTF16)
          166  +  { /* zName:     */ "encoding",
          167  +    /* ePragTyp:  */ PragTyp_ENCODING,
          168  +    /* ePragFlag: */ 0,
          169  +    /* iArg:      */ 0 },
          170  +#endif
          171  +#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
          172  +  { /* zName:     */ "foreign_key_check",
          173  +    /* ePragTyp:  */ PragTyp_FOREIGN_KEY_CHECK,
          174  +    /* ePragFlag: */ PragFlag_NeedSchema,
          175  +    /* iArg:      */ 0 },
          176  +#endif
          177  +#if !defined(SQLITE_OMIT_FOREIGN_KEY)
          178  +  { /* zName:     */ "foreign_key_list",
          179  +    /* ePragTyp:  */ PragTyp_FOREIGN_KEY_LIST,
          180  +    /* ePragFlag: */ PragFlag_NeedSchema,
          181  +    /* iArg:      */ 0 },
          182  +#endif
          183  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          184  +#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
          185  +  { /* zName:     */ "foreign_keys",
          186  +    /* ePragTyp:  */ PragTyp_FLAG,
          187  +    /* ePragFlag: */ 0,
          188  +    /* iArg:      */ SQLITE_ForeignKeys },
          189  +#endif
          190  +#endif
          191  +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
          192  +  { /* zName:     */ "freelist_count",
          193  +    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
          194  +    /* ePragFlag: */ PragFlag_ReadOnly,
          195  +    /* iArg:      */ BTREE_FREE_PAGE_COUNT },
          196  +#endif
          197  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          198  +  { /* zName:     */ "full_column_names",
          199  +    /* ePragTyp:  */ PragTyp_FLAG,
          200  +    /* ePragFlag: */ 0,
          201  +    /* iArg:      */ SQLITE_FullColNames },
          202  +  { /* zName:     */ "fullfsync",
          203  +    /* ePragTyp:  */ PragTyp_FLAG,
          204  +    /* ePragFlag: */ 0,
          205  +    /* iArg:      */ SQLITE_FullFSync },
          206  +#endif
          207  +#if defined(SQLITE_HAS_CODEC)
          208  +  { /* zName:     */ "hexkey",
          209  +    /* ePragTyp:  */ PragTyp_HEXKEY,
          210  +    /* ePragFlag: */ 0,
          211  +    /* iArg:      */ 0 },
          212  +  { /* zName:     */ "hexrekey",
          213  +    /* ePragTyp:  */ PragTyp_HEXKEY,
          214  +    /* ePragFlag: */ 0,
          215  +    /* iArg:      */ 0 },
          216  +#endif
          217  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          218  +#if !defined(SQLITE_OMIT_CHECK)
          219  +  { /* zName:     */ "ignore_check_constraints",
          220  +    /* ePragTyp:  */ PragTyp_FLAG,
          221  +    /* ePragFlag: */ 0,
          222  +    /* iArg:      */ SQLITE_IgnoreChecks },
          223  +#endif
          224  +#endif
          225  +#if !defined(SQLITE_OMIT_AUTOVACUUM)
          226  +  { /* zName:     */ "incremental_vacuum",
          227  +    /* ePragTyp:  */ PragTyp_INCREMENTAL_VACUUM,
          228  +    /* ePragFlag: */ PragFlag_NeedSchema,
          229  +    /* iArg:      */ 0 },
          230  +#endif
          231  +#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
          232  +  { /* zName:     */ "index_info",
          233  +    /* ePragTyp:  */ PragTyp_INDEX_INFO,
          234  +    /* ePragFlag: */ PragFlag_NeedSchema,
          235  +    /* iArg:      */ 0 },
          236  +  { /* zName:     */ "index_list",
          237  +    /* ePragTyp:  */ PragTyp_INDEX_LIST,
          238  +    /* ePragFlag: */ PragFlag_NeedSchema,
          239  +    /* iArg:      */ 0 },
          240  +  { /* zName:     */ "index_xinfo",
          241  +    /* ePragTyp:  */ PragTyp_INDEX_INFO,
          242  +    /* ePragFlag: */ PragFlag_NeedSchema,
          243  +    /* iArg:      */ 1 },
          244  +#endif
          245  +#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
          246  +  { /* zName:     */ "integrity_check",
          247  +    /* ePragTyp:  */ PragTyp_INTEGRITY_CHECK,
          248  +    /* ePragFlag: */ PragFlag_NeedSchema,
          249  +    /* iArg:      */ 0 },
          250  +#endif
          251  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
          252  +  { /* zName:     */ "journal_mode",
          253  +    /* ePragTyp:  */ PragTyp_JOURNAL_MODE,
          254  +    /* ePragFlag: */ PragFlag_NeedSchema,
          255  +    /* iArg:      */ 0 },
          256  +  { /* zName:     */ "journal_size_limit",
          257  +    /* ePragTyp:  */ PragTyp_JOURNAL_SIZE_LIMIT,
          258  +    /* ePragFlag: */ 0,
          259  +    /* iArg:      */ 0 },
          260  +#endif
          261  +#if defined(SQLITE_HAS_CODEC)
          262  +  { /* zName:     */ "key",
          263  +    /* ePragTyp:  */ PragTyp_KEY,
          264  +    /* ePragFlag: */ 0,
          265  +    /* iArg:      */ 0 },
          266  +#endif
          267  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          268  +  { /* zName:     */ "legacy_file_format",
          269  +    /* ePragTyp:  */ PragTyp_FLAG,
          270  +    /* ePragFlag: */ 0,
          271  +    /* iArg:      */ SQLITE_LegacyFileFmt },
          272  +#endif
          273  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
          274  +  { /* zName:     */ "lock_proxy_file",
          275  +    /* ePragTyp:  */ PragTyp_LOCK_PROXY_FILE,
          276  +    /* ePragFlag: */ 0,
          277  +    /* iArg:      */ 0 },
          278  +#endif
          279  +#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
          280  +  { /* zName:     */ "lock_status",
          281  +    /* ePragTyp:  */ PragTyp_LOCK_STATUS,
          282  +    /* ePragFlag: */ 0,
          283  +    /* iArg:      */ 0 },
          284  +#endif
          285  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
          286  +  { /* zName:     */ "locking_mode",
          287  +    /* ePragTyp:  */ PragTyp_LOCKING_MODE,
          288  +    /* ePragFlag: */ 0,
          289  +    /* iArg:      */ 0 },
          290  +  { /* zName:     */ "max_page_count",
          291  +    /* ePragTyp:  */ PragTyp_PAGE_COUNT,
          292  +    /* ePragFlag: */ PragFlag_NeedSchema,
          293  +    /* iArg:      */ 0 },
          294  +  { /* zName:     */ "mmap_size",
          295  +    /* ePragTyp:  */ PragTyp_MMAP_SIZE,
          296  +    /* ePragFlag: */ 0,
          297  +    /* iArg:      */ 0 },
          298  +  { /* zName:     */ "page_count",
          299  +    /* ePragTyp:  */ PragTyp_PAGE_COUNT,
          300  +    /* ePragFlag: */ PragFlag_NeedSchema,
          301  +    /* iArg:      */ 0 },
          302  +  { /* zName:     */ "page_size",
          303  +    /* ePragTyp:  */ PragTyp_PAGE_SIZE,
          304  +    /* ePragFlag: */ 0,
          305  +    /* iArg:      */ 0 },
          306  +#endif
          307  +#if defined(SQLITE_ENABLE_OTA)
          308  +  { /* zName:     */ "pager_ota_mode",
          309  +    /* ePragTyp:  */ PragTyp_PAGER_OTA_MODE,
          310  +    /* ePragFlag: */ 0,
          311  +    /* iArg:      */ 0 },
          312  +#endif
          313  +#if defined(SQLITE_DEBUG)
          314  +  { /* zName:     */ "parser_trace",
          315  +    /* ePragTyp:  */ PragTyp_PARSER_TRACE,
          316  +    /* ePragFlag: */ 0,
          317  +    /* iArg:      */ 0 },
          318  +#endif
          319  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          320  +  { /* zName:     */ "query_only",
          321  +    /* ePragTyp:  */ PragTyp_FLAG,
          322  +    /* ePragFlag: */ 0,
          323  +    /* iArg:      */ SQLITE_QueryOnly },
          324  +#endif
          325  +#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
          326  +  { /* zName:     */ "quick_check",
          327  +    /* ePragTyp:  */ PragTyp_INTEGRITY_CHECK,
          328  +    /* ePragFlag: */ PragFlag_NeedSchema,
          329  +    /* iArg:      */ 0 },
          330  +#endif
          331  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          332  +  { /* zName:     */ "read_uncommitted",
          333  +    /* ePragTyp:  */ PragTyp_FLAG,
          334  +    /* ePragFlag: */ 0,
          335  +    /* iArg:      */ SQLITE_ReadUncommitted },
          336  +  { /* zName:     */ "recursive_triggers",
          337  +    /* ePragTyp:  */ PragTyp_FLAG,
          338  +    /* ePragFlag: */ 0,
          339  +    /* iArg:      */ SQLITE_RecTriggers },
          340  +#endif
          341  +#if defined(SQLITE_HAS_CODEC)
          342  +  { /* zName:     */ "rekey",
          343  +    /* ePragTyp:  */ PragTyp_REKEY,
          344  +    /* ePragFlag: */ 0,
          345  +    /* iArg:      */ 0 },
          346  +#endif
          347  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          348  +  { /* zName:     */ "reverse_unordered_selects",
          349  +    /* ePragTyp:  */ PragTyp_FLAG,
          350  +    /* ePragFlag: */ 0,
          351  +    /* iArg:      */ SQLITE_ReverseOrder },
          352  +#endif
          353  +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
          354  +  { /* zName:     */ "schema_version",
          355  +    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
          356  +    /* ePragFlag: */ 0,
          357  +    /* iArg:      */ BTREE_SCHEMA_VERSION },
          358  +#endif
          359  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
          360  +  { /* zName:     */ "secure_delete",
          361  +    /* ePragTyp:  */ PragTyp_SECURE_DELETE,
          362  +    /* ePragFlag: */ 0,
          363  +    /* iArg:      */ 0 },
          364  +#endif
          365  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          366  +  { /* zName:     */ "short_column_names",
          367  +    /* ePragTyp:  */ PragTyp_FLAG,
          368  +    /* ePragFlag: */ 0,
          369  +    /* iArg:      */ SQLITE_ShortColNames },
          370  +#endif
          371  +  { /* zName:     */ "shrink_memory",
          372  +    /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
          373  +    /* ePragFlag: */ 0,
          374  +    /* iArg:      */ 0 },
          375  +  { /* zName:     */ "soft_heap_limit",
          376  +    /* ePragTyp:  */ PragTyp_SOFT_HEAP_LIMIT,
          377  +    /* ePragFlag: */ 0,
          378  +    /* iArg:      */ 0 },
          379  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          380  +#if defined(SQLITE_DEBUG)
          381  +  { /* zName:     */ "sql_trace",
          382  +    /* ePragTyp:  */ PragTyp_FLAG,
          383  +    /* ePragFlag: */ 0,
          384  +    /* iArg:      */ SQLITE_SqlTrace },
          385  +#endif
          386  +#endif
          387  +#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
          388  +  { /* zName:     */ "stats",
          389  +    /* ePragTyp:  */ PragTyp_STATS,
          390  +    /* ePragFlag: */ PragFlag_NeedSchema,
          391  +    /* iArg:      */ 0 },
          392  +#endif
          393  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
          394  +  { /* zName:     */ "synchronous",
          395  +    /* ePragTyp:  */ PragTyp_SYNCHRONOUS,
          396  +    /* ePragFlag: */ PragFlag_NeedSchema,
          397  +    /* iArg:      */ 0 },
          398  +#endif
          399  +#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
          400  +  { /* zName:     */ "table_info",
          401  +    /* ePragTyp:  */ PragTyp_TABLE_INFO,
          402  +    /* ePragFlag: */ PragFlag_NeedSchema,
          403  +    /* iArg:      */ 0 },
          404  +#endif
          405  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
          406  +  { /* zName:     */ "temp_store",
          407  +    /* ePragTyp:  */ PragTyp_TEMP_STORE,
          408  +    /* ePragFlag: */ 0,
          409  +    /* iArg:      */ 0 },
          410  +  { /* zName:     */ "temp_store_directory",
          411  +    /* ePragTyp:  */ PragTyp_TEMP_STORE_DIRECTORY,
          412  +    /* ePragFlag: */ 0,
          413  +    /* iArg:      */ 0 },
          414  +#endif
          415  +  { /* zName:     */ "threads",
          416  +    /* ePragTyp:  */ PragTyp_THREADS,
          417  +    /* ePragFlag: */ 0,
          418  +    /* iArg:      */ 0 },
          419  +#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
          420  +  { /* zName:     */ "user_version",
          421  +    /* ePragTyp:  */ PragTyp_HEADER_VALUE,
          422  +    /* ePragFlag: */ 0,
          423  +    /* iArg:      */ BTREE_USER_VERSION },
          424  +#endif
          425  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          426  +#if defined(SQLITE_DEBUG)
          427  +  { /* zName:     */ "vdbe_addoptrace",
          428  +    /* ePragTyp:  */ PragTyp_FLAG,
          429  +    /* ePragFlag: */ 0,
          430  +    /* iArg:      */ SQLITE_VdbeAddopTrace },
          431  +  { /* zName:     */ "vdbe_debug",
          432  +    /* ePragTyp:  */ PragTyp_FLAG,
          433  +    /* ePragFlag: */ 0,
          434  +    /* iArg:      */ SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace },
          435  +  { /* zName:     */ "vdbe_eqp",
          436  +    /* ePragTyp:  */ PragTyp_FLAG,
          437  +    /* ePragFlag: */ 0,
          438  +    /* iArg:      */ SQLITE_VdbeEQP },
          439  +  { /* zName:     */ "vdbe_listing",
          440  +    /* ePragTyp:  */ PragTyp_FLAG,
          441  +    /* ePragFlag: */ 0,
          442  +    /* iArg:      */ SQLITE_VdbeListing },
          443  +  { /* zName:     */ "vdbe_trace",
          444  +    /* ePragTyp:  */ PragTyp_FLAG,
          445  +    /* ePragFlag: */ 0,
          446  +    /* iArg:      */ SQLITE_VdbeTrace },
          447  +#endif
          448  +#endif
          449  +#if !defined(SQLITE_OMIT_WAL)
          450  +  { /* zName:     */ "wal_autocheckpoint",
          451  +    /* ePragTyp:  */ PragTyp_WAL_AUTOCHECKPOINT,
          452  +    /* ePragFlag: */ 0,
          453  +    /* iArg:      */ 0 },
          454  +  { /* zName:     */ "wal_checkpoint",
          455  +    /* ePragTyp:  */ PragTyp_WAL_CHECKPOINT,
          456  +    /* ePragFlag: */ PragFlag_NeedSchema,
          457  +    /* iArg:      */ 0 },
          458  +#endif
          459  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          460  +  { /* zName:     */ "writable_schema",
          461  +    /* ePragTyp:  */ PragTyp_FLAG,
          462  +    /* ePragFlag: */ 0,
          463  +    /* iArg:      */ SQLITE_WriteSchema|SQLITE_RecoveryMode },
          464  +#endif
          465  +};
          466  +/* Number of pragmas: 59 on by default, 73 total. */

Changes to test/speedtest1.c.

     8      8     "Options:\n"
     9      9     "  --autovacuum        Enable AUTOVACUUM mode\n"
    10     10     "  --cachesize N       Set the cache size to N\n" 
    11     11     "  --exclusive         Enable locking_mode=EXCLUSIVE\n"
    12     12     "  --explain           Like --sqlonly but with added EXPLAIN keywords\n"
    13     13     "  --heap SZ MIN       Memory allocator uses SZ bytes & min allocation MIN\n"
    14     14     "  --incrvacuum        Enable incremenatal vacuum mode\n"
    15         -  "  --journalmode M     Set the journal_mode to MODE\n"
           15  +  "  --journal M         Set the journal_mode to M\n"
    16     16     "  --key KEY           Set the encryption key to KEY\n"
    17     17     "  --lookaside N SZ    Configure lookaside for N slots of SZ bytes each\n"
    18     18     "  --nosync            Set PRAGMA synchronous=OFF\n"
    19     19     "  --notnull           Add NOT NULL constraints to table columns\n"
    20     20     "  --pagesize N        Set the page size to N\n"
    21     21     "  --pcache N SZ       Configure N pages of pagecache each of size SZ bytes\n"
    22     22     "  --primarykey        Use PRIMARY KEY instead of UNIQUE where appropriate\n"

Changes to tool/mkpragmatab.tcl.

     1      1   #!/usr/bin/tclsh
     2      2   #
     3      3   # Run this script to generate the pragma name lookup table C code.
     4      4   #
     5      5   # To add new pragmas, first add the name and other relevant attributes
     6      6   # of the pragma to the "pragma_def" object below.  Then run this script
     7         -# to generate the C-code for the lookup table and copy/paste the output
     8         -# of this script into the appropriate spot in the pragma.c source file.
            7  +# to generate the ../src/pragma.h header file that contains macros and
            8  +# the lookup table needed for pragma name lookup in the pragma.c module.
     9      9   # Then add the extra "case PragTyp_XXXXX:" and subsequent code for the
    10         -# new pragma.
           10  +# new pragma in ../src/pragma.c.
    11     11   #
    12     12   
    13     13   set pragma_def {
    14     14     NAME: full_column_names
    15     15     TYPE: FLAG
    16     16     ARG:  SQLITE_FullColNames
    17     17     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
................................................................................
   315    315     NAME: soft_heap_limit
   316    316   
   317    317     NAME: threads
   318    318   
   319    319     NAME: pager_ota_mode
   320    320     IF:   defined(SQLITE_ENABLE_OTA)
   321    321   }
   322         -fconfigure stdout -translation lf
          322  +
          323  +# Open the output file
          324  +#
          325  +set destfile "[file dir [file dir [file normal $argv0]]]/src/pragma.h"
          326  +puts "Overwriting $destfile with new pragma table..."
          327  +set fd [open $destfile wb]
          328  +puts $fd {/* DO NOT EDIT!
          329  +** This file is automatically generated by the script at
          330  +** ../tool/mkpragmatab.tcl.  To update the set of pragmas, edit
          331  +** that script and rerun it.
          332  +*/}
          333  +
          334  +# Parse the PRAGMA table above.
          335  +#
   323    336   set name {}
   324    337   set type {}
   325    338   set if {}
   326    339   set flags {}
   327    340   set arg 0
   328    341   proc record_one {} {
   329    342     global name type if arg allbyname typebyif flags
................................................................................
   369    382   set pnum 0
   370    383   foreach name $allnames {
   371    384     set type [lindex $allbyname($name) 0]
   372    385     if {[info exists seentype($type)]} continue
   373    386     set if [lindex $allbyname($name) 2]
   374    387     if {[regexp SQLITE_DEBUG $if] || [regexp SQLITE_HAS_CODEC $if]} continue
   375    388     set seentype($type) 1
   376         -  puts [format {#define %-35s %4d} PragTyp_$type $pnum]
          389  +  puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
   377    390     incr pnum
   378    391   }
   379    392   foreach name $allnames {
   380    393     set type [lindex $allbyname($name) 0]
   381    394     if {[info exists seentype($type)]} continue
   382    395     set if [lindex $allbyname($name) 2]
   383    396     if {[regexp SQLITE_DEBUG $if]} continue
   384    397     set seentype($type) 1
   385         -  puts [format {#define %-35s %4d} PragTyp_$type $pnum]
          398  +  puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
   386    399     incr pnum
   387    400   }
   388    401   foreach name $allnames {
   389    402     set type [lindex $allbyname($name) 0]
   390    403     if {[info exists seentype($type)]} continue
   391    404     set seentype($type) 1
   392         -  puts [format {#define %-35s %4d} PragTyp_$type $pnum]
          405  +  puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
   393    406     incr pnum
   394    407   }
   395    408   
   396    409   # Generate #defines for flags
   397    410   #
   398    411   set fv 1
   399    412   foreach f [lsort [array names allflags]] {
   400         -  puts [format {#define PragFlag_%-20s 0x%02x} $f $fv]
          413  +  puts $fd [format {#define PragFlag_%-20s 0x%02x} $f $fv]
   401    414     set fv [expr {$fv*2}]
   402    415   }
   403    416   
   404    417   # Generate the lookup table
   405    418   #
   406         -puts "static const struct sPragmaNames \173"
   407         -puts "  const char *const zName;  /* Name of pragma */"
   408         -puts "  u8 ePragTyp;              /* PragTyp_XXX value */"
   409         -puts "  u8 mPragFlag;             /* Zero or more PragFlag_XXX values */"
   410         -puts "  u32 iArg;                 /* Extra argument */"
   411         -puts "\175 aPragmaNames\[\] = \173"
          419  +puts $fd "static const struct sPragmaNames \173"
          420  +puts $fd "  const char *const zName;  /* Name of pragma */"
          421  +puts $fd "  u8 ePragTyp;              /* PragTyp_XXX value */"
          422  +puts $fd "  u8 mPragFlag;             /* Zero or more PragFlag_XXX values */"
          423  +puts $fd "  u32 iArg;                 /* Extra argument */"
          424  +puts $fd "\175 aPragmaNames\[\] = \173"
   412    425   
   413    426   set current_if {}
   414    427   set spacer [format {    %26s } {}]
   415    428   foreach name $allnames {
   416    429     foreach {type arg if flag} $allbyname($name) break
   417    430     if {$if!=$current_if} {
   418    431       if {$current_if!=""} {
   419    432         foreach this_if $current_if {
   420         -        puts "#endif"
          433  +        puts $fd "#endif"
   421    434         }
   422    435       }
   423    436       set current_if $if
   424    437       if {$current_if!=""} {
   425    438         foreach this_if $current_if {
   426         -        puts "#if $this_if"
          439  +        puts $fd "#if $this_if"
   427    440         }
   428    441       }
   429    442     }
   430    443     set typex [format PragTyp_%-23s $type,]
   431    444     if {$flag==""} {
   432    445       set flagx "0"
   433    446     } else {
   434    447       set flagx PragFlag_[join $flag {|PragFlag_}]
   435    448     }
   436         -  puts "  \173 /* zName:     */ \"$name\","
   437         -  puts "    /* ePragTyp:  */ PragTyp_$type,"
   438         -  puts "    /* ePragFlag: */ $flagx,"
   439         -  puts "    /* iArg:      */ $arg \175,"
          449  +  puts $fd "  \173 /* zName:     */ \"$name\","
          450  +  puts $fd "    /* ePragTyp:  */ PragTyp_$type,"
          451  +  puts $fd "    /* ePragFlag: */ $flagx,"
          452  +  puts $fd "    /* iArg:      */ $arg \175,"
   440    453   }
   441    454   if {$current_if!=""} {
   442    455     foreach this_if $current_if {
   443         -    puts "#endif"
          456  +    puts $fd "#endif"
   444    457     }
   445    458   }
   446         -puts "\175;"
          459  +puts $fd "\175;"
   447    460   
   448    461   # count the number of pragmas, for information purposes
   449    462   #
   450    463   set allcnt 0
   451    464   set dfltcnt 0
   452    465   foreach name $allnames {
   453    466     incr allcnt
   454    467     set if [lindex $allbyname($name) 2]
   455    468     if {[regexp {^defined} $if] || [regexp {[^!]defined} $if]} continue
   456    469     incr dfltcnt
   457    470   }
   458         -puts "/* Number of pragmas: $dfltcnt on by default, $allcnt total. */"
          471  +puts $fd "/* Number of pragmas: $dfltcnt on by default, $allcnt total. */"

Changes to tool/mksqlite3c.tcl.

   106    106      os_common.h
   107    107      os_setup.h
   108    108      os_win.h
   109    109      os.h
   110    110      pager.h
   111    111      parse.h
   112    112      pcache.h
          113  +   pragma.h
   113    114      rtree.h
   114    115      sqlite3ext.h
   115    116      sqlite3.h
   116    117      sqliteicu.h
   117    118      sqliteInt.h
   118    119      sqliteLimit.h
   119    120      vdbe.h