/ Check-in [5c05d8ec]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set" PRAGMA statements that do not return a value in that case (e.g. page_size, cache_size, auto_vacuum).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pragma-columncount-fix
Files: files | file ages | folders
SHA1: 5c05d8ec5e895661dae2de30c73dfdeaff93511e
User & Date: dan 2017-01-05 19:32:48
Context
2017-01-05
20:00
Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set" PRAGMA statements that do not return a value in that case (e.g. page_size, cache_size, auto_vacuum). check-in: 2f57939a user: dan tags: trunk
19:32
Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set" PRAGMA statements that do not return a value in that case (e.g. page_size, cache_size, auto_vacuum). Closed-Leaf check-in: 5c05d8ec user: dan tags: pragma-columncount-fix
17:23
Fix handling the case where a sub-query in a FROM clause is itself a UNION ALL, and one side of that UNION ALL is a query on a view that includes an ORDER BY. Fix for ticket [190c2507]. check-in: 590ca83b user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

   404    404   
   405    405     /* Make sure the database schema is loaded if the pragma requires that */
   406    406     if( (pPragma->mPragFlg & PragFlg_NeedSchema)!=0 ){
   407    407       if( sqlite3ReadSchema(pParse) ) goto pragma_out;
   408    408     }
   409    409   
   410    410     /* Register the result column names for pragmas that return results */
   411         -  if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 ){
          411  +  if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 
          412  +   && ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0)
          413  +  ){
   412    414       setPragmaResultColumnNames(v, pPragma);
   413    415     }
   414    416   
   415    417     /* Jump to the appropriate pragma handler */
   416    418     switch( pPragma->ePragTyp ){
   417    419     
   418    420   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
................................................................................
  1948   1950       }
  1949   1951   #endif
  1950   1952     }
  1951   1953     break;
  1952   1954   #endif
  1953   1955   
  1954   1956     } /* End of the PRAGMA switch */
         1957  +
         1958  +  /* The following block is a no-op unless SQLITE_DEBUG is defined. Its only
         1959  +  ** purpose is to execute assert() statements to verify that if the
         1960  +  ** PragFlg_NoColumns1 flag is set and the caller specified an argument
         1961  +  ** to the PRAGMA, the implementation has not added any OP_ResultRow 
         1962  +  ** instructions to the VM.  */
         1963  +  if( (pPragma->mPragFlg & PragFlg_NoColumns1) && zRight ){
         1964  +    sqlite3VdbeVerifyNoResultRow(v);
         1965  +  }
  1955   1966   
  1956   1967   pragma_out:
  1957   1968     sqlite3DbFree(db, zLeft);
  1958   1969     sqlite3DbFree(db, zRight);
  1959   1970   }
  1960   1971   #ifndef SQLITE_OMIT_VIRTUALTABLE
  1961   1972   /*****************************************************************************

Changes to src/pragma.h.

    48     48   #define PragTyp_REKEY                         40
    49     49   #define PragTyp_LOCK_STATUS                   41
    50     50   #define PragTyp_PARSER_TRACE                  42
    51     51   
    52     52   /* Property flags associated with various pragma. */
    53     53   #define PragFlg_NeedSchema 0x01 /* Force schema load before running */
    54     54   #define PragFlg_NoColumns  0x02 /* OP_ResultRow called with zero columns */
    55         -#define PragFlg_ReadOnly   0x04 /* Read-only HEADER_VALUE */
    56         -#define PragFlg_Result0    0x08 /* Acts as query when no argument */
    57         -#define PragFlg_Result1    0x10 /* Acts as query when has one argument */
    58         -#define PragFlg_SchemaOpt  0x20 /* Schema restricts name search if present */
    59         -#define PragFlg_SchemaReq  0x40 /* Schema required - "main" is default */
           55  +#define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
           56  +#define PragFlg_ReadOnly   0x08 /* Read-only HEADER_VALUE */
           57  +#define PragFlg_Result0    0x10 /* Acts as query when no argument */
           58  +#define PragFlg_Result1    0x20 /* Acts as query when has one argument */
           59  +#define PragFlg_SchemaOpt  0x40 /* Schema restricts name search if present */
           60  +#define PragFlg_SchemaReq  0x80 /* Schema required - "main" is default */
    60     61   
    61     62   /* Names of columns for pragmas that return multi-column result
    62     63   ** or that return single-column results where the name of the
    63     64   ** result column is different from the name of the pragma
    64     65   */
    65     66   static const char *const pragCName[] = {
    66     67     /*   0 */ "cache_size",  /* Used by: default_cache_size */
................................................................................
   129    130     /* ePragFlg:  */ 0,
   130    131     /* ColNames:  */ 0, 0,
   131    132     /* iArg:      */ 0 },
   132    133   #endif
   133    134   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   134    135    {/* zName:     */ "application_id",
   135    136     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   136         -  /* ePragFlg:  */ PragFlg_Result0,
          137  +  /* ePragFlg:  */ PragFlg_NoColumns1|PragFlg_Result0,
   137    138     /* ColNames:  */ 0, 0,
   138    139     /* iArg:      */ BTREE_APPLICATION_ID },
   139    140   #endif
   140    141   #if !defined(SQLITE_OMIT_AUTOVACUUM)
   141    142    {/* zName:     */ "auto_vacuum",
   142    143     /* ePragTyp:  */ PragTyp_AUTO_VACUUM,
   143         -  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
          144  +  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   144    145     /* ColNames:  */ 0, 0,
   145    146     /* iArg:      */ 0 },
   146    147   #endif
   147    148   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   148    149   #if !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
   149    150    {/* zName:     */ "automatic_index",
   150    151     /* ePragTyp:  */ PragTyp_FLAG,
   151         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          152  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   152    153     /* ColNames:  */ 0, 0,
   153    154     /* iArg:      */ SQLITE_AutoIndex },
   154    155   #endif
   155    156   #endif
   156    157    {/* zName:     */ "busy_timeout",
   157    158     /* ePragTyp:  */ PragTyp_BUSY_TIMEOUT,
   158    159     /* ePragFlg:  */ PragFlg_Result0,
   159    160     /* ColNames:  */ 45, 1,
   160    161     /* iArg:      */ 0 },
   161    162   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   162    163    {/* zName:     */ "cache_size",
   163    164     /* ePragTyp:  */ PragTyp_CACHE_SIZE,
   164         -  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
          165  +  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   165    166     /* ColNames:  */ 0, 0,
   166    167     /* iArg:      */ 0 },
   167    168   #endif
   168    169   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   169    170    {/* zName:     */ "cache_spill",
   170    171     /* ePragTyp:  */ PragTyp_CACHE_SPILL,
   171         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq,
          172  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   172    173     /* ColNames:  */ 0, 0,
   173    174     /* iArg:      */ 0 },
   174    175   #endif
   175    176    {/* zName:     */ "case_sensitive_like",
   176    177     /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
   177    178     /* ePragFlg:  */ 0,
   178    179     /* ColNames:  */ 0, 0,
   179    180     /* iArg:      */ 0 },
   180    181    {/* zName:     */ "cell_size_check",
   181    182     /* ePragTyp:  */ PragTyp_FLAG,
   182         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          183  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   183    184     /* ColNames:  */ 0, 0,
   184    185     /* iArg:      */ SQLITE_CellSizeCk },
   185    186   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   186    187    {/* zName:     */ "checkpoint_fullfsync",
   187    188     /* ePragTyp:  */ PragTyp_FLAG,
   188         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          189  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   189    190     /* ColNames:  */ 0, 0,
   190    191     /* iArg:      */ SQLITE_CkptFullFSync },
   191    192   #endif
   192    193   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   193    194    {/* zName:     */ "collation_list",
   194    195     /* ePragTyp:  */ PragTyp_COLLATION_LIST,
   195    196     /* ePragFlg:  */ PragFlg_Result0,
................................................................................
   202    203     /* ePragFlg:  */ PragFlg_Result0,
   203    204     /* ColNames:  */ 0, 0,
   204    205     /* iArg:      */ 0 },
   205    206   #endif
   206    207   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   207    208    {/* zName:     */ "count_changes",
   208    209     /* ePragTyp:  */ PragTyp_FLAG,
   209         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          210  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   210    211     /* ColNames:  */ 0, 0,
   211    212     /* iArg:      */ SQLITE_CountRows },
   212    213   #endif
   213    214   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   214    215    {/* zName:     */ "data_store_directory",
   215    216     /* ePragTyp:  */ PragTyp_DATA_STORE_DIRECTORY,
   216         -  /* ePragFlg:  */ 0,
          217  +  /* ePragFlg:  */ PragFlg_NoColumns1,
   217    218     /* ColNames:  */ 0, 0,
   218    219     /* iArg:      */ 0 },
   219    220   #endif
   220    221   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   221    222    {/* zName:     */ "data_version",
   222    223     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   223         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_ReadOnly,
          224  +  /* ePragFlg:  */ PragFlg_ReadOnly|PragFlg_Result0,
   224    225     /* ColNames:  */ 0, 0,
   225    226     /* iArg:      */ BTREE_DATA_VERSION },
   226    227   #endif
   227    228   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   228    229    {/* zName:     */ "database_list",
   229    230     /* ePragTyp:  */ PragTyp_DATABASE_LIST,
   230    231     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0,
   231    232     /* ColNames:  */ 25, 3,
   232    233     /* iArg:      */ 0 },
   233    234   #endif
   234    235   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   235    236    {/* zName:     */ "default_cache_size",
   236    237     /* ePragTyp:  */ PragTyp_DEFAULT_CACHE_SIZE,
   237         -  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
          238  +  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   238    239     /* ColNames:  */ 0, 1,
   239    240     /* iArg:      */ 0 },
   240    241   #endif
   241    242   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   242    243   #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   243    244    {/* zName:     */ "defer_foreign_keys",
   244    245     /* ePragTyp:  */ PragTyp_FLAG,
   245         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          246  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   246    247     /* ColNames:  */ 0, 0,
   247    248     /* iArg:      */ SQLITE_DeferFKs },
   248    249   #endif
   249    250   #endif
   250    251   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   251    252    {/* zName:     */ "empty_result_callbacks",
   252    253     /* ePragTyp:  */ PragTyp_FLAG,
   253         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          254  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   254    255     /* ColNames:  */ 0, 0,
   255    256     /* iArg:      */ SQLITE_NullCallback },
   256    257   #endif
   257    258   #if !defined(SQLITE_OMIT_UTF16)
   258    259    {/* zName:     */ "encoding",
   259    260     /* ePragTyp:  */ PragTyp_ENCODING,
   260         -  /* ePragFlg:  */ PragFlg_Result0,
          261  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   261    262     /* ColNames:  */ 0, 0,
   262    263     /* iArg:      */ 0 },
   263    264   #endif
   264    265   #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   265    266    {/* zName:     */ "foreign_key_check",
   266    267     /* ePragTyp:  */ PragTyp_FOREIGN_KEY_CHECK,
   267    268     /* ePragFlg:  */ PragFlg_NeedSchema,
................................................................................
   275    276     /* ColNames:  */ 30, 8,
   276    277     /* iArg:      */ 0 },
   277    278   #endif
   278    279   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   279    280   #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   280    281    {/* zName:     */ "foreign_keys",
   281    282     /* ePragTyp:  */ PragTyp_FLAG,
   282         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          283  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   283    284     /* ColNames:  */ 0, 0,
   284    285     /* iArg:      */ SQLITE_ForeignKeys },
   285    286   #endif
   286    287   #endif
   287    288   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   288    289    {/* zName:     */ "freelist_count",
   289    290     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   290         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_ReadOnly,
          291  +  /* ePragFlg:  */ PragFlg_ReadOnly|PragFlg_Result0,
   291    292     /* ColNames:  */ 0, 0,
   292    293     /* iArg:      */ BTREE_FREE_PAGE_COUNT },
   293    294   #endif
   294    295   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   295    296    {/* zName:     */ "full_column_names",
   296    297     /* ePragTyp:  */ PragTyp_FLAG,
   297         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          298  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   298    299     /* ColNames:  */ 0, 0,
   299    300     /* iArg:      */ SQLITE_FullColNames },
   300    301    {/* zName:     */ "fullfsync",
   301    302     /* ePragTyp:  */ PragTyp_FLAG,
   302         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          303  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   303    304     /* ColNames:  */ 0, 0,
   304    305     /* iArg:      */ SQLITE_FullFSync },
   305    306   #endif
   306    307   #if defined(SQLITE_HAS_CODEC)
   307    308    {/* zName:     */ "hexkey",
   308    309     /* ePragTyp:  */ PragTyp_HEXKEY,
   309    310     /* ePragFlg:  */ 0,
................................................................................
   315    316     /* ColNames:  */ 0, 0,
   316    317     /* iArg:      */ 0 },
   317    318   #endif
   318    319   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   319    320   #if !defined(SQLITE_OMIT_CHECK)
   320    321    {/* zName:     */ "ignore_check_constraints",
   321    322     /* ePragTyp:  */ PragTyp_FLAG,
   322         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          323  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   323    324     /* ColNames:  */ 0, 0,
   324    325     /* iArg:      */ SQLITE_IgnoreChecks },
   325    326   #endif
   326    327   #endif
   327    328   #if !defined(SQLITE_OMIT_AUTOVACUUM)
   328    329    {/* zName:     */ "incremental_vacuum",
   329    330     /* ePragTyp:  */ PragTyp_INCREMENTAL_VACUUM,
................................................................................
   373    374     /* ePragFlg:  */ 0,
   374    375     /* ColNames:  */ 0, 0,
   375    376     /* iArg:      */ 0 },
   376    377   #endif
   377    378   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   378    379    {/* zName:     */ "legacy_file_format",
   379    380     /* ePragTyp:  */ PragTyp_FLAG,
   380         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          381  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   381    382     /* ColNames:  */ 0, 0,
   382    383     /* iArg:      */ SQLITE_LegacyFileFmt },
   383    384   #endif
   384    385   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
   385    386    {/* zName:     */ "lock_proxy_file",
   386    387     /* ePragTyp:  */ PragTyp_LOCK_PROXY_FILE,
   387         -  /* ePragFlg:  */ 0,
          388  +  /* ePragFlg:  */ PragFlg_NoColumns1,
   388    389     /* ColNames:  */ 0, 0,
   389    390     /* iArg:      */ 0 },
   390    391   #endif
   391    392   #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
   392    393    {/* zName:     */ "lock_status",
   393    394     /* ePragTyp:  */ PragTyp_LOCK_STATUS,
   394    395     /* ePragFlg:  */ PragFlg_Result0,
................................................................................
   414    415    {/* zName:     */ "page_count",
   415    416     /* ePragTyp:  */ PragTyp_PAGE_COUNT,
   416    417     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
   417    418     /* ColNames:  */ 0, 0,
   418    419     /* iArg:      */ 0 },
   419    420    {/* zName:     */ "page_size",
   420    421     /* ePragTyp:  */ PragTyp_PAGE_SIZE,
   421         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq,
          422  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   422    423     /* ColNames:  */ 0, 0,
   423    424     /* iArg:      */ 0 },
   424    425   #endif
   425    426   #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)
   426    427    {/* zName:     */ "parser_trace",
   427    428     /* ePragTyp:  */ PragTyp_PARSER_TRACE,
   428    429     /* ePragFlg:  */ 0,
   429    430     /* ColNames:  */ 0, 0,
   430    431     /* iArg:      */ 0 },
   431    432   #endif
   432    433   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   433    434    {/* zName:     */ "query_only",
   434    435     /* ePragTyp:  */ PragTyp_FLAG,
   435         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          436  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   436    437     /* ColNames:  */ 0, 0,
   437    438     /* iArg:      */ SQLITE_QueryOnly },
   438    439   #endif
   439    440   #if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
   440    441    {/* zName:     */ "quick_check",
   441    442     /* ePragTyp:  */ PragTyp_INTEGRITY_CHECK,
   442    443     /* ePragFlg:  */ PragFlg_NeedSchema,
   443    444     /* ColNames:  */ 0, 0,
   444    445     /* iArg:      */ 0 },
   445    446   #endif
   446    447   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   447    448    {/* zName:     */ "read_uncommitted",
   448    449     /* ePragTyp:  */ PragTyp_FLAG,
   449         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          450  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   450    451     /* ColNames:  */ 0, 0,
   451    452     /* iArg:      */ SQLITE_ReadUncommitted },
   452    453    {/* zName:     */ "recursive_triggers",
   453    454     /* ePragTyp:  */ PragTyp_FLAG,
   454         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          455  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   455    456     /* ColNames:  */ 0, 0,
   456    457     /* iArg:      */ SQLITE_RecTriggers },
   457    458   #endif
   458    459   #if defined(SQLITE_HAS_CODEC)
   459    460    {/* zName:     */ "rekey",
   460    461     /* ePragTyp:  */ PragTyp_REKEY,
   461    462     /* ePragFlg:  */ 0,
   462    463     /* ColNames:  */ 0, 0,
   463    464     /* iArg:      */ 0 },
   464    465   #endif
   465    466   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   466    467    {/* zName:     */ "reverse_unordered_selects",
   467    468     /* ePragTyp:  */ PragTyp_FLAG,
   468         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          469  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   469    470     /* ColNames:  */ 0, 0,
   470    471     /* iArg:      */ SQLITE_ReverseOrder },
   471    472   #endif
   472    473   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   473    474    {/* zName:     */ "schema_version",
   474    475     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   475         -  /* ePragFlg:  */ PragFlg_Result0,
          476  +  /* ePragFlg:  */ PragFlg_NoColumns1|PragFlg_Result0,
   476    477     /* ColNames:  */ 0, 0,
   477    478     /* iArg:      */ BTREE_SCHEMA_VERSION },
   478    479   #endif
   479    480   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   480    481    {/* zName:     */ "secure_delete",
   481    482     /* ePragTyp:  */ PragTyp_SECURE_DELETE,
   482    483     /* ePragFlg:  */ PragFlg_Result0,
   483    484     /* ColNames:  */ 0, 0,
   484    485     /* iArg:      */ 0 },
   485    486   #endif
   486    487   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   487    488    {/* zName:     */ "short_column_names",
   488    489     /* ePragTyp:  */ PragTyp_FLAG,
   489         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          490  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   490    491     /* ColNames:  */ 0, 0,
   491    492     /* iArg:      */ SQLITE_ShortColNames },
   492    493   #endif
   493    494    {/* zName:     */ "shrink_memory",
   494    495     /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
   495    496     /* ePragFlg:  */ 0,
   496    497     /* ColNames:  */ 0, 0,
................................................................................
   500    501     /* ePragFlg:  */ PragFlg_Result0,
   501    502     /* ColNames:  */ 0, 0,
   502    503     /* iArg:      */ 0 },
   503    504   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   504    505   #if defined(SQLITE_DEBUG)
   505    506    {/* zName:     */ "sql_trace",
   506    507     /* ePragTyp:  */ PragTyp_FLAG,
   507         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          508  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   508    509     /* ColNames:  */ 0, 0,
   509    510     /* iArg:      */ SQLITE_SqlTrace },
   510    511   #endif
   511    512   #endif
   512    513   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   513    514    {/* zName:     */ "stats",
   514    515     /* ePragTyp:  */ PragTyp_STATS,
................................................................................
   515    516     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
   516    517     /* ColNames:  */ 7, 4,
   517    518     /* iArg:      */ 0 },
   518    519   #endif
   519    520   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   520    521    {/* zName:     */ "synchronous",
   521    522     /* ePragTyp:  */ PragTyp_SYNCHRONOUS,
   522         -  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
          523  +  /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   523    524     /* ColNames:  */ 0, 0,
   524    525     /* iArg:      */ 0 },
   525    526   #endif
   526    527   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   527    528    {/* zName:     */ "table_info",
   528    529     /* ePragTyp:  */ PragTyp_TABLE_INFO,
   529    530     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt,
   530    531     /* ColNames:  */ 1, 6,
   531    532     /* iArg:      */ 0 },
   532    533   #endif
   533    534   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   534    535    {/* zName:     */ "temp_store",
   535    536     /* ePragTyp:  */ PragTyp_TEMP_STORE,
   536         -  /* ePragFlg:  */ PragFlg_Result0,
          537  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   537    538     /* ColNames:  */ 0, 0,
   538    539     /* iArg:      */ 0 },
   539    540    {/* zName:     */ "temp_store_directory",
   540    541     /* ePragTyp:  */ PragTyp_TEMP_STORE_DIRECTORY,
   541         -  /* ePragFlg:  */ 0,
          542  +  /* ePragFlg:  */ PragFlg_NoColumns1,
   542    543     /* ColNames:  */ 0, 0,
   543    544     /* iArg:      */ 0 },
   544    545   #endif
   545    546    {/* zName:     */ "threads",
   546    547     /* ePragTyp:  */ PragTyp_THREADS,
   547    548     /* ePragFlg:  */ PragFlg_Result0,
   548    549     /* ColNames:  */ 0, 0,
   549    550     /* iArg:      */ 0 },
   550    551   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   551    552    {/* zName:     */ "user_version",
   552    553     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   553         -  /* ePragFlg:  */ PragFlg_Result0,
          554  +  /* ePragFlg:  */ PragFlg_NoColumns1|PragFlg_Result0,
   554    555     /* ColNames:  */ 0, 0,
   555    556     /* iArg:      */ BTREE_USER_VERSION },
   556    557   #endif
   557    558   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   558    559   #if defined(SQLITE_DEBUG)
   559    560    {/* zName:     */ "vdbe_addoptrace",
   560    561     /* ePragTyp:  */ PragTyp_FLAG,
   561         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          562  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   562    563     /* ColNames:  */ 0, 0,
   563    564     /* iArg:      */ SQLITE_VdbeAddopTrace },
   564    565    {/* zName:     */ "vdbe_debug",
   565    566     /* ePragTyp:  */ PragTyp_FLAG,
   566         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          567  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   567    568     /* ColNames:  */ 0, 0,
   568    569     /* iArg:      */ SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace },
   569    570    {/* zName:     */ "vdbe_eqp",
   570    571     /* ePragTyp:  */ PragTyp_FLAG,
   571         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          572  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   572    573     /* ColNames:  */ 0, 0,
   573    574     /* iArg:      */ SQLITE_VdbeEQP },
   574    575    {/* zName:     */ "vdbe_listing",
   575    576     /* ePragTyp:  */ PragTyp_FLAG,
   576         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          577  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   577    578     /* ColNames:  */ 0, 0,
   578    579     /* iArg:      */ SQLITE_VdbeListing },
   579    580    {/* zName:     */ "vdbe_trace",
   580    581     /* ePragTyp:  */ PragTyp_FLAG,
   581         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          582  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   582    583     /* ColNames:  */ 0, 0,
   583    584     /* iArg:      */ SQLITE_VdbeTrace },
   584    585   #endif
   585    586   #endif
   586    587   #if !defined(SQLITE_OMIT_WAL)
   587    588    {/* zName:     */ "wal_autocheckpoint",
   588    589     /* ePragTyp:  */ PragTyp_WAL_AUTOCHECKPOINT,
................................................................................
   594    595     /* ePragFlg:  */ PragFlg_NeedSchema,
   595    596     /* ColNames:  */ 42, 3,
   596    597     /* iArg:      */ 0 },
   597    598   #endif
   598    599   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   599    600    {/* zName:     */ "writable_schema",
   600    601     /* ePragTyp:  */ PragTyp_FLAG,
   601         -  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns,
          602  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   602    603     /* ColNames:  */ 0, 0,
   603    604     /* iArg:      */ SQLITE_WriteSchema|SQLITE_RecoveryMode },
   604    605   #endif
   605    606   };
   606    607   /* Number of pragmas: 60 on by default, 73 total. */

Changes to src/vdbe.h.

   179    179   int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int);
   180    180   int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
   181    181   int sqlite3VdbeAddOp4Dup8(Vdbe*,int,int,int,int,const u8*,int);
   182    182   int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int);
   183    183   void sqlite3VdbeEndCoroutine(Vdbe*,int);
   184    184   #if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
   185    185     void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N);
          186  +  void sqlite3VdbeVerifyNoResultRow(Vdbe *p);
   186    187   #else
   187    188   # define sqlite3VdbeVerifyNoMallocRequired(A,B)
          189  +# define sqlite3VdbeVerifyNoResultRow(A)
   188    190   #endif
   189    191   VdbeOp *sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp, int iLineno);
   190    192   void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
   191    193   void sqlite3VdbeChangeOpcode(Vdbe*, u32 addr, u8);
   192    194   void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
   193    195   void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
   194    196   void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);

Changes to src/vdbeaux.c.

   641    641   ** to verify that certain calls to sqlite3VdbeAddOpList() can never
   642    642   ** fail due to a OOM fault and hence that the return value from
   643    643   ** sqlite3VdbeAddOpList() will always be non-NULL.
   644    644   */
   645    645   #if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
   646    646   void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N){
   647    647     assert( p->nOp + N <= p->pParse->nOpAlloc );
          648  +}
          649  +#endif
          650  +
          651  +/*
          652  +** Verify that the VM passed as the only argument does not contain
          653  +** an OP_ResultRow opcode. Fail an assert() if it does. This is used
          654  +** by code in pragma.c to ensure that the implementation of certain
          655  +** pragmas comports with the flags specified in the mkpragmatab.tcl
          656  +** script.
          657  +*/
          658  +#if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
          659  +void sqlite3VdbeVerifyNoResultRow(Vdbe *p){
          660  +  int i;
          661  +  for(i=0; i<p->nOp; i++){
          662  +    assert( p->aOp[i].opcode!=OP_ResultRow );
          663  +  }
   648    664   }
   649    665   #endif
   650    666   
   651    667   /*
   652    668   ** This function returns a pointer to the array of opcodes associated with
   653    669   ** the Vdbe passed as the first argument. It is the callers responsibility
   654    670   ** to arrange for the returned array to be eventually freed using the 

Added test/pragma4.test.

            1  +# 2017 Jan 4
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +
           14  +set testdir [file dirname $argv0]
           15  +source $testdir/tester.tcl
           16  +set testprefix pragma4
           17  +
           18  +proc do_pragma_ncol_test {tn sql nCol} {
           19  +  set ::stmt 0
           20  +  set ::stmt [sqlite3_prepare_v2 db $sql -1 dummy]
           21  +  uplevel [list do_test $tn { sqlite3_column_count $::stmt } $nCol]
           22  +  sqlite3_finalize $::stmt
           23  +}
           24  +
           25  +# If there is no RHS argument, the following PRAGMA statements operate as
           26  +# queries, returning a single row containing a single column. 
           27  +#
           28  +# Or, if there is RHS argument, they return zero rows of zero columns.
           29  +#
           30  +foreach {tn sql} {
           31  +  1 "PRAGMA application_id = 10"
           32  +  2 "PRAGMA automatic_index = 1"
           33  +  3 "PRAGMA auto_vacuum = 1"
           34  +  4 "PRAGMA cache_size = -100"
           35  +  5 "PRAGMA cache_spill = 1"
           36  +  6 "PRAGMA cell_size_check = 1"
           37  +  7 "PRAGMA checkpoint_fullfsync = 1"
           38  +  8 "PRAGMA count_changes = 1"
           39  +  9 "PRAGMA default_cache_size = 100"
           40  + 10 "PRAGMA defer_foreign_keys = 1"
           41  + 11 "PRAGMA empty_result_callbacks = 1"
           42  + 12 "PRAGMA encoding = 'utf-8'"
           43  + 13 "PRAGMA foreign_keys = 1"
           44  + 14 "PRAGMA full_column_names = 1"
           45  + 15 "PRAGMA fullfsync = 1"
           46  + 16 "PRAGMA ignore_check_constraints = 1"
           47  + 17 "PRAGMA legacy_file_format = 1"
           48  + 18 "PRAGMA page_size = 511"
           49  + 19 "PRAGMA page_size = 512"
           50  + 20 "PRAGMA query_only = false"
           51  + 21 "PRAGMA read_uncommitted = true"
           52  + 22 "PRAGMA recursive_triggers = false"
           53  + 23 "PRAGMA reverse_unordered_selects = false"
           54  + 24 "PRAGMA schema_version = 211"
           55  + 25 "PRAGMA short_column_names = 1"
           56  + 26 "PRAGMA synchronous = full"
           57  + 27 "PRAGMA temp_store_directory = '/tmp'"
           58  + 28 "PRAGMA temp_store_directory = ''"
           59  + 29 "PRAGMA temp_store = memory"
           60  + 30 "PRAGMA user_version = 405"
           61  + 31 "PRAGMA writable_schema = 1"
           62  +} {
           63  +  reset_db
           64  +
           65  +  # Without RHS:
           66  +  do_pragma_ncol_test 1.$tn.1 [lindex [split $sql =] 0] 1
           67  +   
           68  +  # With RHS:
           69  +  do_pragma_ncol_test 1.$tn.2 $sql  0
           70  +}
           71  +
           72  +
           73  +finish_test

Changes to tool/mkpragmatab.tcl.

    14     14   set flagMeaning(NeedSchema) {Force schema load before running}
    15     15   set flagMeaning(ReadOnly)   {Read-only HEADER_VALUE}
    16     16   set flagMeaning(Result0)    {Acts as query when no argument}
    17     17   set flagMeaning(Result1)    {Acts as query when has one argument}
    18     18   set flagMeaning(SchemaReq)  {Schema required - "main" is default}
    19     19   set flagMeaning(SchemaOpt)  {Schema restricts name search if present}
    20     20   set flagMeaning(NoColumns)  {OP_ResultRow called with zero columns}
           21  +set flagMeaning(NoColumns1) {zero columns if RHS argument is present}
    21     22   
    22     23   set pragma_def {
    23     24     NAME: full_column_names
    24     25     TYPE: FLAG
    25     26     ARG:  SQLITE_FullColNames
    26     27     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    27     28   
................................................................................
    52     53   
    53     54     NAME: checkpoint_fullfsync
    54     55     TYPE: FLAG
    55     56     ARG:  SQLITE_CkptFullFSync
    56     57     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    57     58   
    58     59     NAME: cache_spill
    59         -  FLAG: Result0 SchemaReq
           60  +  FLAG: Result0 SchemaReq NoColumns1
    60     61     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    61     62   
    62     63     NAME: reverse_unordered_selects
    63     64     TYPE: FLAG
    64     65     ARG:  SQLITE_ReverseOrder
    65     66     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    66     67   
................................................................................
   145    146     IF:   !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   146    147   
   147    148     NAME: cell_size_check
   148    149     TYPE: FLAG
   149    150     ARG:  SQLITE_CellSizeCk
   150    151   
   151    152     NAME: default_cache_size
   152         -  FLAG: NeedSchema Result0 SchemaReq
          153  +  FLAG: NeedSchema Result0 SchemaReq NoColumns1
   153    154     COLS: cache_size
   154    155     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   155    156   
   156    157     NAME: page_size
   157         -  FLAG: Result0 SchemaReq
          158  +  FLAG: Result0 SchemaReq NoColumns1
   158    159     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   159    160   
   160    161     NAME: secure_delete
   161    162     FLAG: Result0
   162    163     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   163    164   
   164    165     NAME: page_count
................................................................................
   179    180     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   180    181   
   181    182     NAME: journal_size_limit
   182    183     FLAG: Result0 SchemaReq
   183    184     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   184    185   
   185    186     NAME: cache_size
   186         -  FLAG: NeedSchema Result0 SchemaReq
          187  +  FLAG: NeedSchema Result0 SchemaReq NoColumns1
   187    188     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   188    189   
   189    190     NAME: mmap_size
   190    191     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   191    192   
   192    193     NAME: auto_vacuum
   193         -  FLAG: NeedSchema Result0 SchemaReq
          194  +  FLAG: NeedSchema Result0 SchemaReq NoColumns1
   194    195     IF:   !defined(SQLITE_OMIT_AUTOVACUUM)
   195    196   
   196    197     NAME: incremental_vacuum
   197    198     FLAG: NeedSchema NoColumns
   198    199     IF:   !defined(SQLITE_OMIT_AUTOVACUUM)
   199    200   
   200    201     NAME: temp_store
   201         -  FLAG: Result0
          202  +  FLAG: Result0 NoColumns1
   202    203     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   203    204   
   204    205     NAME: temp_store_directory
          206  +  FLAG: NoColumns1
   205    207     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   206    208   
   207    209     NAME: data_store_directory
          210  +  FLAG: NoColumns1
   208    211     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   209    212   
   210    213     NAME: lock_proxy_file
          214  +  FLAG: NoColumns1
   211    215     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
   212    216   
   213    217     NAME: synchronous
   214         -  FLAG: NeedSchema Result0 SchemaReq
          218  +  FLAG: NeedSchema Result0 SchemaReq NoColumns1
   215    219     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   216    220   
   217    221     NAME: table_info
   218    222     FLAG: NeedSchema Result1 SchemaOpt
   219    223     COLS: cid name type notnull dflt_value pk
   220    224     IF:   !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   221    225   
................................................................................
   274    278   
   275    279     NAME: quick_check
   276    280     TYPE: INTEGRITY_CHECK
   277    281     FLAG: NeedSchema
   278    282     IF:   !defined(SQLITE_OMIT_INTEGRITY_CHECK)
   279    283   
   280    284     NAME: encoding
   281         -  FLAG: Result0
          285  +  FLAG: Result0 NoColumns1
   282    286     IF:   !defined(SQLITE_OMIT_UTF16)
   283    287   
   284    288     NAME: schema_version
   285    289     TYPE: HEADER_VALUE
   286    290     ARG:  BTREE_SCHEMA_VERSION
          291  +  FLAG: NoColumns1 Result0
   287    292     IF:   !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   288    293   
   289    294     NAME: user_version
   290    295     TYPE: HEADER_VALUE
   291    296     ARG:  BTREE_USER_VERSION
          297  +  FLAG: NoColumns1 Result0
   292    298     IF:   !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   293    299   
   294    300     NAME: data_version
   295    301     TYPE: HEADER_VALUE
   296    302     ARG:  BTREE_DATA_VERSION
   297         -  FLAG: ReadOnly
          303  +  FLAG: ReadOnly Result0
   298    304     IF:   !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   299    305   
   300    306     NAME: freelist_count
   301    307     TYPE: HEADER_VALUE
   302    308     ARG:  BTREE_FREE_PAGE_COUNT
   303         -  FLAG: ReadOnly
          309  +  FLAG: ReadOnly Result0
   304    310     IF:   !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   305    311   
   306    312     NAME: application_id
   307    313     TYPE: HEADER_VALUE
   308    314     ARG:  BTREE_APPLICATION_ID
          315  +  FLAG: NoColumns1 Result0
   309    316     IF:   !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   310    317   
   311    318     NAME: compile_options
   312    319     FLAG: Result0
   313    320     IF:   !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS)
   314    321   
   315    322     NAME: wal_checkpoint
................................................................................
   404    411     if {$id=="NAME"} {
   405    412       record_one    
   406    413       set name $val
   407    414       set type [string toupper $val]
   408    415     } elseif {$id=="TYPE"} {
   409    416       set type $val
   410    417       if {$type=="FLAG"} {
   411         -      lappend flags Result0 NoColumns
   412         -    }
   413         -    if {$type=="HEADER_VALUE"} {
   414         -      lappend flags Result0
          418  +      lappend flags Result0 NoColumns1
   415    419       }
   416    420     } elseif {$id=="ARG"} {
   417    421       set arg $val
   418    422     } elseif {$id=="COLS"} {
   419    423       set cols $val
   420    424     } elseif {$id=="IF"} {
   421    425       lappend if $val