/ Check-in [4a97ba4e]
Login

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

Overview
Comment:Ensure that "PRAGMA case_sensitive_like" and "PRAGMA shrink_memory" set the number of output columns to 0 (as they are statements that return no data).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.16
Files: files | file ages | folders
SHA1:4a97ba4ee0d3295569ca01aaea7df74fd481eb3b
User & Date: dan 2017-01-06 13:52:58
Context
2017-01-06
13:53
Clarify the documentation on sqlite3_column_count(). check-in: 01b4cb26 user: dan tags: branch-3.16
13:52
Ensure that "PRAGMA case_sensitive_like" and "PRAGMA shrink_memory" set the number of output columns to 0 (as they are statements that return no data). check-in: 4a97ba4e user: dan tags: branch-3.16
11:56
Improve handling of corrupt databases in fts5. check-in: b0726941 user: dan tags: branch-3.16
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pragma.h.

171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
...
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
  /* ePragTyp:  */ PragTyp_CACHE_SPILL,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
#endif
 {/* zName:     */ "case_sensitive_like",
  /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
  /* ePragFlg:  */ 0,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
 {/* zName:     */ "cell_size_check",
  /* ePragTyp:  */ PragTyp_FLAG,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ SQLITE_CellSizeCk },
................................................................................
  /* ePragTyp:  */ PragTyp_FLAG,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ SQLITE_ShortColNames },
#endif
 {/* zName:     */ "shrink_memory",
  /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
  /* ePragFlg:  */ 0,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
 {/* zName:     */ "soft_heap_limit",
  /* ePragTyp:  */ PragTyp_SOFT_HEAP_LIMIT,
  /* ePragFlg:  */ PragFlg_Result0,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },







|







 







|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
...
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
  /* ePragTyp:  */ PragTyp_CACHE_SPILL,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
#endif
 {/* zName:     */ "case_sensitive_like",
  /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
  /* ePragFlg:  */ PragFlg_NoColumns,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
 {/* zName:     */ "cell_size_check",
  /* ePragTyp:  */ PragTyp_FLAG,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ SQLITE_CellSizeCk },
................................................................................
  /* ePragTyp:  */ PragTyp_FLAG,
  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ SQLITE_ShortColNames },
#endif
 {/* zName:     */ "shrink_memory",
  /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
  /* ePragFlg:  */ PragFlg_NoColumns,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },
 {/* zName:     */ "soft_heap_limit",
  /* ePragTyp:  */ PragTyp_SOFT_HEAP_LIMIT,
  /* ePragFlg:  */ PragFlg_Result0,
  /* ColNames:  */ 0, 0,
  /* iArg:      */ 0 },

Changes to test/pragma4.test.

64
65
66
67
68
69
70













71
72
73

  # Without RHS:
  do_pragma_ncol_test 1.$tn.1 [lindex [split $sql =] 0] 1
   
  # With RHS:
  do_pragma_ncol_test 1.$tn.2 $sql  0
}















finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

  # Without RHS:
  do_pragma_ncol_test 1.$tn.1 [lindex [split $sql =] 0] 1
   
  # With RHS:
  do_pragma_ncol_test 1.$tn.2 $sql  0
}

# These pragmas should never return any values.
#
foreach {tn sql} {
  1 "PRAGMA shrink_memory"
  2 "PRAGMA shrink_memory = 10"
  3 "PRAGMA case_sensitive_like = 0"
  4 "PRAGMA case_sensitive_like = 1"
  5 "PRAGMA case_sensitive_like"
} {

  do_pragma_ncol_test 2.$tn.1 $sql 0
}


finish_test

Changes to tool/mkpragmatab.tcl.

267
268
269
270
271
272
273

274
275
276
277
278
279
280
...
324
325
326
327
328
329
330

331
332
333
334
335
336
337
  COLS: table rowid parent fkid
  IF:   !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)

  NAME: parser_trace
  IF:   defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)

  NAME: case_sensitive_like


  NAME: integrity_check
  FLAG: NeedSchema
  IF:   !defined(SQLITE_OMIT_INTEGRITY_CHECK)

  NAME: quick_check
  TYPE: INTEGRITY_CHECK
................................................................................
  COLS: busy log checkpointed
  IF:   !defined(SQLITE_OMIT_WAL)

  NAME: wal_autocheckpoint
  IF:   !defined(SQLITE_OMIT_WAL)

  NAME: shrink_memory


  NAME: busy_timeout
  FLAG: Result0
  COLS: timeout

  NAME: lock_status
  FLAG: Result0







>







 







>







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
...
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
  COLS: table rowid parent fkid
  IF:   !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)

  NAME: parser_trace
  IF:   defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)

  NAME: case_sensitive_like
  FLAG: NoColumns

  NAME: integrity_check
  FLAG: NeedSchema
  IF:   !defined(SQLITE_OMIT_INTEGRITY_CHECK)

  NAME: quick_check
  TYPE: INTEGRITY_CHECK
................................................................................
  COLS: busy log checkpointed
  IF:   !defined(SQLITE_OMIT_WAL)

  NAME: wal_autocheckpoint
  IF:   !defined(SQLITE_OMIT_WAL)

  NAME: shrink_memory
  FLAG: NoColumns

  NAME: busy_timeout
  FLAG: Result0
  COLS: timeout

  NAME: lock_status
  FLAG: Result0