From e1ff3f5e11e866940b25c140cce9c2e3953c513f Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 6 Jan 2017 13:49:40 +0000 Subject: [PATCH] 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). FossilOrigin-Name: 6696cd1878be4bd44a24841b04163e52d847711e --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pragma.h | 4 ++-- test/pragma4.test | 13 +++++++++++++ tool/mkpragmatab.tcl | 2 ++ 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 2c3a5de518..67b3b622ee 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\shandling\sof\scorrupt\sdata\sin\sfts5. -D 2017-01-06T11:55:03.576 +C Ensure\sthat\s"PRAGMA\scase_sensitive_like"\sand\s"PRAGMA\sshrink_memory"\sset\sthe\nnumber\sof\soutput\scolumns\sto\s0\s(as\sthey\sare\sstatements\sthat\sreturn\sno\sdata). +D 2017-01-06T13:49:40.112 F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -382,7 +382,7 @@ F src/pcache.c 51070ec9b8251bbf9c6ea3d35fd96a458752929e F src/pcache.h 2cedcd8407eb23017d92790b112186886e179490 F src/pcache1.c e3967219b2a92b9edcb9324a4ba75009090d3953 F src/pragma.c 0e7a7c6f1c6fd8ff50c0fff65b8bb80174bc49c5 -F src/pragma.h 27fd6a8a051d6ea09bb656ce8a01dfc76f101956 +F src/pragma.h 61aa5389118594bebb28120a6720401aee34ce1a F src/prepare.c b1140c3d0cf59bc85ace00ce363153041b424b7a F src/printf.c ff10a9b9902cd2afe5f655f3013c6307d969b1fd F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 @@ -1010,7 +1010,7 @@ F test/permutations.test cd0b7bc04bf5e50d3a993d24c834d591f7d4f5fe F test/pragma.test 1e94755164a3a3264cd39836de4bebcb7809e5f8 F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f F test/pragma3.test 14c12bc5352b1e100e0b6b44f371053a81ccf8ed -F test/pragma4.test 79333554eb18567ae21ee1df980a5b2442d38910 +F test/pragma4.test 6e85b6eab8e61ffc9c7db59d842276674e8e3264 F test/printf.test b3ff34e73d59124140eaf89f7672e21bc2ca5fcc F test/printf2.test 0b61566dd1c0f0b802f59dffa228c5dc5aa6b054 F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb @@ -1481,7 +1481,7 @@ F tool/mkmsvcmin.tcl 2f12f7fa8858bbe61cf81820a2da96c79ed1ca8d F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c F tool/mkopcodeh.tcl a01d2c1d8a6205b03fc635adf3735b4c523befd3 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e -F tool/mkpragmatab.tcl 1b2c06e1da539a1f1fbeba2d26041024012cf1e7 +F tool/mkpragmatab.tcl ebb4bfcd2f8010e0a3934b6118db4b5f2f5edf5c F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl fef88397668ae83166735c41af99d79f56afaabb F tool/mksqlite3c.tcl 06b2e6a0f21cc0a5d70fbbd136b3e0a96470645e @@ -1543,7 +1543,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9ea0baddd893e54ec79399ae83033ae139650535 -R 44d29edf796e0dea15e29c7ababbe2c4 +P 609ac1c73f7c2b48a571c178a72383996a9538fe +R 812971df62a9791f0bfb0122470a2213 U dan -Z 2fd88d4ddce12153e4aca3cee686cd44 +Z ebefd6b7654323e8a23a6cf648753c0a diff --git a/manifest.uuid b/manifest.uuid index e770ae0a32..865cc47649 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -609ac1c73f7c2b48a571c178a72383996a9538fe \ No newline at end of file +6696cd1878be4bd44a24841b04163e52d847711e \ No newline at end of file diff --git a/src/pragma.h b/src/pragma.h index 49a4080fe9..5d8d0aa35b 100644 --- a/src/pragma.h +++ b/src/pragma.h @@ -175,7 +175,7 @@ static const PragmaName aPragmaName[] = { #endif {/* zName: */ "case_sensitive_like", /* ePragTyp: */ PragTyp_CASE_SENSITIVE_LIKE, - /* ePragFlg: */ 0, + /* ePragFlg: */ PragFlg_NoColumns, /* ColNames: */ 0, 0, /* iArg: */ 0 }, {/* zName: */ "cell_size_check", @@ -493,7 +493,7 @@ static const PragmaName aPragmaName[] = { #endif {/* zName: */ "shrink_memory", /* ePragTyp: */ PragTyp_SHRINK_MEMORY, - /* ePragFlg: */ 0, + /* ePragFlg: */ PragFlg_NoColumns, /* ColNames: */ 0, 0, /* iArg: */ 0 }, {/* zName: */ "soft_heap_limit", diff --git a/test/pragma4.test b/test/pragma4.test index 3a4514901b..9a89b247de 100644 --- a/test/pragma4.test +++ b/test/pragma4.test @@ -67,5 +67,18 @@ foreach {tn sql} { 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 1.$tn.1 $sql 0 +} + finish_test diff --git a/tool/mkpragmatab.tcl b/tool/mkpragmatab.tcl index c081a10474..c22f72d491 100644 --- a/tool/mkpragmatab.tcl +++ b/tool/mkpragmatab.tcl @@ -271,6 +271,7 @@ set pragma_def { IF: defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE) NAME: case_sensitive_like + FLAG: NoColumns NAME: integrity_check FLAG: NeedSchema @@ -328,6 +329,7 @@ set pragma_def { IF: !defined(SQLITE_OMIT_WAL) NAME: shrink_memory + FLAG: NoColumns NAME: busy_timeout FLAG: Result0 -- 2.47.2