Fossil SCM

Merged in trunk.

stephan 2020-05-07 02:36 fileedit-ajaxify merge
Commit 087c5d1f3ea33d86287a8841a2e8824eb9b6adc3e01801a17ae4ca4f30080c8d
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -128,11 +128,11 @@
128128
** supported by the rebuild command itself, if any are
129129
** present, are passed along verbatim. The --force and
130130
** --randomize options are not supported.
131131
**
132132
** sync Run a "sync" on all repositories. Only the --verbose
133
-** option is supported.
133
+** and --unversioned options are supported.
134134
**
135135
** setting Run the "setting", "set", or "unset" commands on all
136136
** set repositories. These command are particularly useful in
137137
** unset conjunction with the "max-loadavg" setting which cannot
138138
** otherwise be set globally.
139139
--- src/allrepo.c
+++ src/allrepo.c
@@ -128,11 +128,11 @@
128 ** supported by the rebuild command itself, if any are
129 ** present, are passed along verbatim. The --force and
130 ** --randomize options are not supported.
131 **
132 ** sync Run a "sync" on all repositories. Only the --verbose
133 ** option is supported.
134 **
135 ** setting Run the "setting", "set", or "unset" commands on all
136 ** set repositories. These command are particularly useful in
137 ** unset conjunction with the "max-loadavg" setting which cannot
138 ** otherwise be set globally.
139
--- src/allrepo.c
+++ src/allrepo.c
@@ -128,11 +128,11 @@
128 ** supported by the rebuild command itself, if any are
129 ** present, are passed along verbatim. The --force and
130 ** --randomize options are not supported.
131 **
132 ** sync Run a "sync" on all repositories. Only the --verbose
133 ** and --unversioned options are supported.
134 **
135 ** setting Run the "setting", "set", or "unset" commands on all
136 ** set repositories. These command are particularly useful in
137 ** unset conjunction with the "max-loadavg" setting which cannot
138 ** otherwise be set globally.
139
+10 -2
--- src/builtin.c
+++ src/builtin.c
@@ -55,17 +55,25 @@
5555
return (char*)builtin_file(zFilename, 0);
5656
}
5757
5858
/*
5959
** COMMAND: test-builtin-list
60
+**
61
+** If -verbose is used, it outputs a line at the end
62
+** with the total item count and size.
6063
**
6164
** List the names and sizes of all built-in resources.
6265
*/
6366
void test_builtin_list(void){
64
- int i;
67
+ int i, size = 0;;
6568
for(i=0; i<count(aBuiltinFiles); i++){
66
- fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte);
69
+ const int n = aBuiltinFiles[i].nByte;
70
+ fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,n);
71
+ size += n;
72
+ }
73
+ if(find_option("verbose","v",0)!=0){
74
+ fossil_print("%d entries totaling %d bytes\n", i, size);
6775
}
6876
}
6977
7078
/*
7179
** WEBPAGE: test-builtin-files
7280
--- src/builtin.c
+++ src/builtin.c
@@ -55,17 +55,25 @@
55 return (char*)builtin_file(zFilename, 0);
56 }
57
58 /*
59 ** COMMAND: test-builtin-list
 
 
 
60 **
61 ** List the names and sizes of all built-in resources.
62 */
63 void test_builtin_list(void){
64 int i;
65 for(i=0; i<count(aBuiltinFiles); i++){
66 fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte);
 
 
 
 
 
67 }
68 }
69
70 /*
71 ** WEBPAGE: test-builtin-files
72
--- src/builtin.c
+++ src/builtin.c
@@ -55,17 +55,25 @@
55 return (char*)builtin_file(zFilename, 0);
56 }
57
58 /*
59 ** COMMAND: test-builtin-list
60 **
61 ** If -verbose is used, it outputs a line at the end
62 ** with the total item count and size.
63 **
64 ** List the names and sizes of all built-in resources.
65 */
66 void test_builtin_list(void){
67 int i, size = 0;;
68 for(i=0; i<count(aBuiltinFiles); i++){
69 const int n = aBuiltinFiles[i].nByte;
70 fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,n);
71 size += n;
72 }
73 if(find_option("verbose","v",0)!=0){
74 fossil_print("%d entries totaling %d bytes\n", i, size);
75 }
76 }
77
78 /*
79 ** WEBPAGE: test-builtin-files
80
+17 -31
--- src/comformat.c
+++ src/comformat.c
@@ -19,16 +19,10 @@
1919
** text on a TTY.
2020
*/
2121
#include "config.h"
2222
#include "comformat.h"
2323
#include <assert.h>
24
-#ifdef _WIN32
25
-# include <windows.h>
26
-#else
27
-# include <termios.h>
28
-# include <sys/ioctl.h>
29
-#endif
3024
3125
#if INTERFACE
3226
#define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags = non-legacy. */
3327
#define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */
3428
#define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
@@ -67,35 +61,27 @@
6761
*/
6862
static int comment_set_maxchars(
6963
int indent,
7064
int *pMaxChars
7165
){
72
-#if defined(_WIN32)
73
- CONSOLE_SCREEN_BUFFER_INFO csbi;
74
- memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO));
75
- if( GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) ){
76
- *pMaxChars = csbi.srWindow.Right - csbi.srWindow.Left - indent;
77
- return 1;
78
- }
79
- return 0;
80
-#elif defined(TIOCGWINSZ)
81
- struct winsize w;
82
- memset(&w, 0, sizeof(struct winsize));
83
- if( ioctl(0, TIOCGWINSZ, &w)!=-1 ){
84
- *pMaxChars = w.ws_col - indent;
85
- return 1;
86
- }
87
- return 0;
88
-#else
89
- /*
90
- ** Fallback to using more-or-less the "legacy semantics" of hard-coding
91
- ** the maximum line length to a value reasonable for the vast majority
92
- ** of supported systems.
93
- */
94
- *pMaxChars = COMMENT_LEGACY_LINE_LENGTH - indent;
95
- return -1;
96
-#endif
66
+ struct TerminalSize ts;
67
+ if ( !terminal_get_size(&ts) ){
68
+ return 0;
69
+ }
70
+
71
+ if( ts.nColumns ){
72
+ *pMaxChars = ts.nColumns - indent;
73
+ return 1;
74
+ }else{
75
+ /*
76
+ ** Fallback to using more-or-less the "legacy semantics" of hard-coding
77
+ ** the maximum line length to a value reasonable for the vast majority
78
+ ** of supported systems.
79
+ */
80
+ *pMaxChars = COMMENT_LEGACY_LINE_LENGTH - indent;
81
+ return -1;
82
+ }
9783
}
9884
9985
/*
10086
** This function checks the current line being printed against the original
10187
** comment text. Upon matching, it updates the provided character and line
10288
--- src/comformat.c
+++ src/comformat.c
@@ -19,16 +19,10 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
24 #ifdef _WIN32
25 # include <windows.h>
26 #else
27 # include <termios.h>
28 # include <sys/ioctl.h>
29 #endif
30
31 #if INTERFACE
32 #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags = non-legacy. */
33 #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */
34 #define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
@@ -67,35 +61,27 @@
67 */
68 static int comment_set_maxchars(
69 int indent,
70 int *pMaxChars
71 ){
72 #if defined(_WIN32)
73 CONSOLE_SCREEN_BUFFER_INFO csbi;
74 memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO));
75 if( GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) ){
76 *pMaxChars = csbi.srWindow.Right - csbi.srWindow.Left - indent;
77 return 1;
78 }
79 return 0;
80 #elif defined(TIOCGWINSZ)
81 struct winsize w;
82 memset(&w, 0, sizeof(struct winsize));
83 if( ioctl(0, TIOCGWINSZ, &w)!=-1 ){
84 *pMaxChars = w.ws_col - indent;
85 return 1;
86 }
87 return 0;
88 #else
89 /*
90 ** Fallback to using more-or-less the "legacy semantics" of hard-coding
91 ** the maximum line length to a value reasonable for the vast majority
92 ** of supported systems.
93 */
94 *pMaxChars = COMMENT_LEGACY_LINE_LENGTH - indent;
95 return -1;
96 #endif
97 }
98
99 /*
100 ** This function checks the current line being printed against the original
101 ** comment text. Upon matching, it updates the provided character and line
102
--- src/comformat.c
+++ src/comformat.c
@@ -19,16 +19,10 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
 
 
 
 
 
 
24
25 #if INTERFACE
26 #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags = non-legacy. */
27 #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */
28 #define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
@@ -67,35 +61,27 @@
61 */
62 static int comment_set_maxchars(
63 int indent,
64 int *pMaxChars
65 ){
66 struct TerminalSize ts;
67 if ( !terminal_get_size(&ts) ){
68 return 0;
69 }
70
71 if( ts.nColumns ){
72 *pMaxChars = ts.nColumns - indent;
73 return 1;
74 }else{
75 /*
76 ** Fallback to using more-or-less the "legacy semantics" of hard-coding
77 ** the maximum line length to a value reasonable for the vast majority
78 ** of supported systems.
79 */
80 *pMaxChars = COMMENT_LEGACY_LINE_LENGTH - indent;
81 return -1;
82 }
 
 
 
 
 
 
 
 
83 }
84
85 /*
86 ** This function checks the current line being printed against the original
87 ** comment text. Upon matching, it updates the provided character and line
88
+26 -1
--- src/diff.c
+++ src/diff.c
@@ -1826,14 +1826,39 @@
18261826
}
18271827
18281828
/*
18291829
** Extract the width of columns for side-by-side diff. Supply an
18301830
** appropriate default if no width is given.
1831
+**
1832
+** Calculate the default automatically, based on terminal's current width:
1833
+** term-width = 2*diff-col + diff-marker + 1
1834
+** diff-col = lineno + lmargin + text-width + rmargin
1835
+**
1836
+** text-width = (term-width - diff-marker - 1)/2 - lineno - lmargin - rmargin
18311837
*/
18321838
int diff_width(u64 diffFlags){
18331839
int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1);
1834
- if( w==0 ) w = 80;
1840
+ if( w==0 ){
1841
+ static struct {
1842
+ unsigned int lineno, lmargin, text, rmargin, marker;
1843
+ } sbsW = { 5, 2, 0, 0, 3 };
1844
+ const unsigned int wMin = 24, wMax = 132;
1845
+ unsigned int tw = terminal_get_width(80);
1846
+ unsigned int twMin =
1847
+ (wMin + sbsW.lineno + sbsW.lmargin + sbsW.rmargin)*2 + sbsW.marker + 1;
1848
+ unsigned int twMax =
1849
+ (wMax + sbsW.lineno + sbsW.lmargin + sbsW.rmargin)*2 + sbsW.marker + 1;
1850
+
1851
+ if( tw<twMin ){
1852
+ tw = twMin;
1853
+ }else if( tw>twMax ){
1854
+ tw = twMax;
1855
+ }
1856
+ sbsW.text =
1857
+ (tw - sbsW.marker - 1)/2 - sbsW.lineno - sbsW.lmargin - sbsW.rmargin;
1858
+ w = sbsW.text;
1859
+ }
18351860
return w;
18361861
}
18371862
18381863
/*
18391864
** Append the error message to pOut.
18401865
--- src/diff.c
+++ src/diff.c
@@ -1826,14 +1826,39 @@
1826 }
1827
1828 /*
1829 ** Extract the width of columns for side-by-side diff. Supply an
1830 ** appropriate default if no width is given.
 
 
 
 
 
 
1831 */
1832 int diff_width(u64 diffFlags){
1833 int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1);
1834 if( w==0 ) w = 80;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1835 return w;
1836 }
1837
1838 /*
1839 ** Append the error message to pOut.
1840
--- src/diff.c
+++ src/diff.c
@@ -1826,14 +1826,39 @@
1826 }
1827
1828 /*
1829 ** Extract the width of columns for side-by-side diff. Supply an
1830 ** appropriate default if no width is given.
1831 **
1832 ** Calculate the default automatically, based on terminal's current width:
1833 ** term-width = 2*diff-col + diff-marker + 1
1834 ** diff-col = lineno + lmargin + text-width + rmargin
1835 **
1836 ** text-width = (term-width - diff-marker - 1)/2 - lineno - lmargin - rmargin
1837 */
1838 int diff_width(u64 diffFlags){
1839 int w = (diffFlags & DIFF_WIDTH_MASK)/(DIFF_CONTEXT_MASK+1);
1840 if( w==0 ){
1841 static struct {
1842 unsigned int lineno, lmargin, text, rmargin, marker;
1843 } sbsW = { 5, 2, 0, 0, 3 };
1844 const unsigned int wMin = 24, wMax = 132;
1845 unsigned int tw = terminal_get_width(80);
1846 unsigned int twMin =
1847 (wMin + sbsW.lineno + sbsW.lmargin + sbsW.rmargin)*2 + sbsW.marker + 1;
1848 unsigned int twMax =
1849 (wMax + sbsW.lineno + sbsW.lmargin + sbsW.rmargin)*2 + sbsW.marker + 1;
1850
1851 if( tw<twMin ){
1852 tw = twMin;
1853 }else if( tw>twMax ){
1854 tw = twMax;
1855 }
1856 sbsW.text =
1857 (tw - sbsW.marker - 1)/2 - sbsW.lineno - sbsW.lmargin - sbsW.rmargin;
1858 w = sbsW.text;
1859 }
1860 return w;
1861 }
1862
1863 /*
1864 ** Append the error message to pOut.
1865
+13
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132132
$(SRCDIR)/statrep.c \
133133
$(SRCDIR)/style.c \
134134
$(SRCDIR)/sync.c \
135135
$(SRCDIR)/tag.c \
136136
$(SRCDIR)/tar.c \
137
+ $(SRCDIR)/terminal.c \
137138
$(SRCDIR)/th_main.c \
138139
$(SRCDIR)/timeline.c \
139140
$(SRCDIR)/tkt.c \
140141
$(SRCDIR)/tktsetup.c \
141142
$(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
217218
$(SRCDIR)/../skins/xekri/header.txt \
218219
$(SRCDIR)/accordion.js \
219220
$(SRCDIR)/ci_edit.js \
220221
$(SRCDIR)/copybtn.js \
221222
$(SRCDIR)/diff.tcl \
223
+ $(SRCDIR)/foo.js \
222224
$(SRCDIR)/forum.js \
223225
$(SRCDIR)/fossil.bootstrap.js \
224226
$(SRCDIR)/fossil.confirmer.js \
225227
$(SRCDIR)/fossil.dom.js \
226228
$(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
372374
$(OBJDIR)/statrep_.c \
373375
$(OBJDIR)/style_.c \
374376
$(OBJDIR)/sync_.c \
375377
$(OBJDIR)/tag_.c \
376378
$(OBJDIR)/tar_.c \
379
+ $(OBJDIR)/terminal_.c \
377380
$(OBJDIR)/th_main_.c \
378381
$(OBJDIR)/timeline_.c \
379382
$(OBJDIR)/tkt_.c \
380383
$(OBJDIR)/tktsetup_.c \
381384
$(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
515518
$(OBJDIR)/statrep.o \
516519
$(OBJDIR)/style.o \
517520
$(OBJDIR)/sync.o \
518521
$(OBJDIR)/tag.o \
519522
$(OBJDIR)/tar.o \
523
+ $(OBJDIR)/terminal.o \
520524
$(OBJDIR)/th_main.o \
521525
$(OBJDIR)/timeline.o \
522526
$(OBJDIR)/tkt.o \
523527
$(OBJDIR)/tktsetup.o \
524528
$(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
853857
$(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
854858
$(OBJDIR)/style_.c:$(OBJDIR)/style.h \
855859
$(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
856860
$(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
857861
$(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
862
+ $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
858863
$(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
859864
$(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
860865
$(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
861866
$(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
862867
$(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
18261831
18271832
$(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
18281833
$(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
18291834
18301835
$(OBJDIR)/tar.h: $(OBJDIR)/headers
1836
+
1837
+$(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(OBJDIR)/translate
1838
+ $(OBJDIR)/translate $(SRCDIR)/terminal.c >$@
1839
+
1840
+$(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
1841
+ $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
1842
+
1843
+$(OBJDIR)/terminal.h: $(OBJDIR)/headers
18311844
18321845
$(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
18331846
$(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
18341847
18351848
$(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
18361849
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132 $(SRCDIR)/statrep.c \
133 $(SRCDIR)/style.c \
134 $(SRCDIR)/sync.c \
135 $(SRCDIR)/tag.c \
136 $(SRCDIR)/tar.c \
 
137 $(SRCDIR)/th_main.c \
138 $(SRCDIR)/timeline.c \
139 $(SRCDIR)/tkt.c \
140 $(SRCDIR)/tktsetup.c \
141 $(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
217 $(SRCDIR)/../skins/xekri/header.txt \
218 $(SRCDIR)/accordion.js \
219 $(SRCDIR)/ci_edit.js \
220 $(SRCDIR)/copybtn.js \
221 $(SRCDIR)/diff.tcl \
 
222 $(SRCDIR)/forum.js \
223 $(SRCDIR)/fossil.bootstrap.js \
224 $(SRCDIR)/fossil.confirmer.js \
225 $(SRCDIR)/fossil.dom.js \
226 $(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
372 $(OBJDIR)/statrep_.c \
373 $(OBJDIR)/style_.c \
374 $(OBJDIR)/sync_.c \
375 $(OBJDIR)/tag_.c \
376 $(OBJDIR)/tar_.c \
 
377 $(OBJDIR)/th_main_.c \
378 $(OBJDIR)/timeline_.c \
379 $(OBJDIR)/tkt_.c \
380 $(OBJDIR)/tktsetup_.c \
381 $(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
515 $(OBJDIR)/statrep.o \
516 $(OBJDIR)/style.o \
517 $(OBJDIR)/sync.o \
518 $(OBJDIR)/tag.o \
519 $(OBJDIR)/tar.o \
 
520 $(OBJDIR)/th_main.o \
521 $(OBJDIR)/timeline.o \
522 $(OBJDIR)/tkt.o \
523 $(OBJDIR)/tktsetup.o \
524 $(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
853 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
854 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
855 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
856 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
857 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
 
858 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
859 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
860 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
861 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
862 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
1826
1827 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
1828 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
1829
1830 $(OBJDIR)/tar.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
1831
1832 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
1833 $(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
1834
1835 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
1836
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132 $(SRCDIR)/statrep.c \
133 $(SRCDIR)/style.c \
134 $(SRCDIR)/sync.c \
135 $(SRCDIR)/tag.c \
136 $(SRCDIR)/tar.c \
137 $(SRCDIR)/terminal.c \
138 $(SRCDIR)/th_main.c \
139 $(SRCDIR)/timeline.c \
140 $(SRCDIR)/tkt.c \
141 $(SRCDIR)/tktsetup.c \
142 $(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
218 $(SRCDIR)/../skins/xekri/header.txt \
219 $(SRCDIR)/accordion.js \
220 $(SRCDIR)/ci_edit.js \
221 $(SRCDIR)/copybtn.js \
222 $(SRCDIR)/diff.tcl \
223 $(SRCDIR)/foo.js \
224 $(SRCDIR)/forum.js \
225 $(SRCDIR)/fossil.bootstrap.js \
226 $(SRCDIR)/fossil.confirmer.js \
227 $(SRCDIR)/fossil.dom.js \
228 $(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
374 $(OBJDIR)/statrep_.c \
375 $(OBJDIR)/style_.c \
376 $(OBJDIR)/sync_.c \
377 $(OBJDIR)/tag_.c \
378 $(OBJDIR)/tar_.c \
379 $(OBJDIR)/terminal_.c \
380 $(OBJDIR)/th_main_.c \
381 $(OBJDIR)/timeline_.c \
382 $(OBJDIR)/tkt_.c \
383 $(OBJDIR)/tktsetup_.c \
384 $(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
518 $(OBJDIR)/statrep.o \
519 $(OBJDIR)/style.o \
520 $(OBJDIR)/sync.o \
521 $(OBJDIR)/tag.o \
522 $(OBJDIR)/tar.o \
523 $(OBJDIR)/terminal.o \
524 $(OBJDIR)/th_main.o \
525 $(OBJDIR)/timeline.o \
526 $(OBJDIR)/tkt.o \
527 $(OBJDIR)/tktsetup.o \
528 $(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
857 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
858 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
859 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
860 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
861 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
862 $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
863 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
864 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
865 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
866 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
867 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
1831
1832 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
1833 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
1834
1835 $(OBJDIR)/tar.h: $(OBJDIR)/headers
1836
1837 $(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(OBJDIR)/translate
1838 $(OBJDIR)/translate $(SRCDIR)/terminal.c >$@
1839
1840 $(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
1841 $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
1842
1843 $(OBJDIR)/terminal.h: $(OBJDIR)/headers
1844
1845 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
1846 $(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
1847
1848 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
1849
+13
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132132
$(SRCDIR)/statrep.c \
133133
$(SRCDIR)/style.c \
134134
$(SRCDIR)/sync.c \
135135
$(SRCDIR)/tag.c \
136136
$(SRCDIR)/tar.c \
137
+ $(SRCDIR)/terminal.c \
137138
$(SRCDIR)/th_main.c \
138139
$(SRCDIR)/timeline.c \
139140
$(SRCDIR)/tkt.c \
140141
$(SRCDIR)/tktsetup.c \
141142
$(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
217218
$(SRCDIR)/../skins/xekri/header.txt \
218219
$(SRCDIR)/accordion.js \
219220
$(SRCDIR)/ci_edit.js \
220221
$(SRCDIR)/copybtn.js \
221222
$(SRCDIR)/diff.tcl \
223
+ $(SRCDIR)/foo.js \
222224
$(SRCDIR)/forum.js \
223225
$(SRCDIR)/fossil.bootstrap.js \
224226
$(SRCDIR)/fossil.confirmer.js \
225227
$(SRCDIR)/fossil.dom.js \
226228
$(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
372374
$(OBJDIR)/statrep_.c \
373375
$(OBJDIR)/style_.c \
374376
$(OBJDIR)/sync_.c \
375377
$(OBJDIR)/tag_.c \
376378
$(OBJDIR)/tar_.c \
379
+ $(OBJDIR)/terminal_.c \
377380
$(OBJDIR)/th_main_.c \
378381
$(OBJDIR)/timeline_.c \
379382
$(OBJDIR)/tkt_.c \
380383
$(OBJDIR)/tktsetup_.c \
381384
$(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
515518
$(OBJDIR)/statrep.o \
516519
$(OBJDIR)/style.o \
517520
$(OBJDIR)/sync.o \
518521
$(OBJDIR)/tag.o \
519522
$(OBJDIR)/tar.o \
523
+ $(OBJDIR)/terminal.o \
520524
$(OBJDIR)/th_main.o \
521525
$(OBJDIR)/timeline.o \
522526
$(OBJDIR)/tkt.o \
523527
$(OBJDIR)/tktsetup.o \
524528
$(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
853857
$(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
854858
$(OBJDIR)/style_.c:$(OBJDIR)/style.h \
855859
$(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
856860
$(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
857861
$(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
862
+ $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
858863
$(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
859864
$(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
860865
$(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
861866
$(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
862867
$(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
18261831
18271832
$(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
18281833
$(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
18291834
18301835
$(OBJDIR)/tar.h: $(OBJDIR)/headers
1836
+
1837
+$(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(OBJDIR)/translate
1838
+ $(OBJDIR)/translate $(SRCDIR)/terminal.c >$@
1839
+
1840
+$(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
1841
+ $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
1842
+
1843
+$(OBJDIR)/terminal.h: $(OBJDIR)/headers
18311844
18321845
$(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
18331846
$(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
18341847
18351848
$(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
18361849
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132 $(SRCDIR)/statrep.c \
133 $(SRCDIR)/style.c \
134 $(SRCDIR)/sync.c \
135 $(SRCDIR)/tag.c \
136 $(SRCDIR)/tar.c \
 
137 $(SRCDIR)/th_main.c \
138 $(SRCDIR)/timeline.c \
139 $(SRCDIR)/tkt.c \
140 $(SRCDIR)/tktsetup.c \
141 $(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
217 $(SRCDIR)/../skins/xekri/header.txt \
218 $(SRCDIR)/accordion.js \
219 $(SRCDIR)/ci_edit.js \
220 $(SRCDIR)/copybtn.js \
221 $(SRCDIR)/diff.tcl \
 
222 $(SRCDIR)/forum.js \
223 $(SRCDIR)/fossil.bootstrap.js \
224 $(SRCDIR)/fossil.confirmer.js \
225 $(SRCDIR)/fossil.dom.js \
226 $(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
372 $(OBJDIR)/statrep_.c \
373 $(OBJDIR)/style_.c \
374 $(OBJDIR)/sync_.c \
375 $(OBJDIR)/tag_.c \
376 $(OBJDIR)/tar_.c \
 
377 $(OBJDIR)/th_main_.c \
378 $(OBJDIR)/timeline_.c \
379 $(OBJDIR)/tkt_.c \
380 $(OBJDIR)/tktsetup_.c \
381 $(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
515 $(OBJDIR)/statrep.o \
516 $(OBJDIR)/style.o \
517 $(OBJDIR)/sync.o \
518 $(OBJDIR)/tag.o \
519 $(OBJDIR)/tar.o \
 
520 $(OBJDIR)/th_main.o \
521 $(OBJDIR)/timeline.o \
522 $(OBJDIR)/tkt.o \
523 $(OBJDIR)/tktsetup.o \
524 $(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
853 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
854 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
855 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
856 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
857 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
 
858 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
859 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
860 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
861 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
862 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
1826
1827 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
1828 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
1829
1830 $(OBJDIR)/tar.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
1831
1832 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
1833 $(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
1834
1835 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
1836
--- src/main.mk
+++ src/main.mk
@@ -132,10 +132,11 @@
132 $(SRCDIR)/statrep.c \
133 $(SRCDIR)/style.c \
134 $(SRCDIR)/sync.c \
135 $(SRCDIR)/tag.c \
136 $(SRCDIR)/tar.c \
137 $(SRCDIR)/terminal.c \
138 $(SRCDIR)/th_main.c \
139 $(SRCDIR)/timeline.c \
140 $(SRCDIR)/tkt.c \
141 $(SRCDIR)/tktsetup.c \
142 $(SRCDIR)/undo.c \
@@ -217,10 +218,11 @@
218 $(SRCDIR)/../skins/xekri/header.txt \
219 $(SRCDIR)/accordion.js \
220 $(SRCDIR)/ci_edit.js \
221 $(SRCDIR)/copybtn.js \
222 $(SRCDIR)/diff.tcl \
223 $(SRCDIR)/foo.js \
224 $(SRCDIR)/forum.js \
225 $(SRCDIR)/fossil.bootstrap.js \
226 $(SRCDIR)/fossil.confirmer.js \
227 $(SRCDIR)/fossil.dom.js \
228 $(SRCDIR)/fossil.fetch.js \
@@ -372,10 +374,11 @@
374 $(OBJDIR)/statrep_.c \
375 $(OBJDIR)/style_.c \
376 $(OBJDIR)/sync_.c \
377 $(OBJDIR)/tag_.c \
378 $(OBJDIR)/tar_.c \
379 $(OBJDIR)/terminal_.c \
380 $(OBJDIR)/th_main_.c \
381 $(OBJDIR)/timeline_.c \
382 $(OBJDIR)/tkt_.c \
383 $(OBJDIR)/tktsetup_.c \
384 $(OBJDIR)/undo_.c \
@@ -515,10 +518,11 @@
518 $(OBJDIR)/statrep.o \
519 $(OBJDIR)/style.o \
520 $(OBJDIR)/sync.o \
521 $(OBJDIR)/tag.o \
522 $(OBJDIR)/tar.o \
523 $(OBJDIR)/terminal.o \
524 $(OBJDIR)/th_main.o \
525 $(OBJDIR)/timeline.o \
526 $(OBJDIR)/tkt.o \
527 $(OBJDIR)/tktsetup.o \
528 $(OBJDIR)/undo.o \
@@ -853,10 +857,11 @@
857 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
858 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
859 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
860 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
861 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
862 $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
863 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
864 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
865 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
866 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
867 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -1826,10 +1831,18 @@
1831
1832 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
1833 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
1834
1835 $(OBJDIR)/tar.h: $(OBJDIR)/headers
1836
1837 $(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(OBJDIR)/translate
1838 $(OBJDIR)/translate $(SRCDIR)/terminal.c >$@
1839
1840 $(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
1841 $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
1842
1843 $(OBJDIR)/terminal.h: $(OBJDIR)/headers
1844
1845 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(OBJDIR)/translate
1846 $(OBJDIR)/translate $(SRCDIR)/th_main.c >$@
1847
1848 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
1849
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142142
statrep
143143
style
144144
sync
145145
tag
146146
tar
147
+ terminal
147148
th_main
148149
timeline
149150
tkt
150151
tktsetup
151152
undo
152153
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142 statrep
143 style
144 sync
145 tag
146 tar
 
147 th_main
148 timeline
149 tkt
150 tktsetup
151 undo
152
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142 statrep
143 style
144 sync
145 tag
146 tar
147 terminal
148 th_main
149 timeline
150 tkt
151 tktsetup
152 undo
153
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142142
statrep
143143
style
144144
sync
145145
tag
146146
tar
147
+ terminal
147148
th_main
148149
timeline
149150
tkt
150151
tktsetup
151152
undo
152153
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142 statrep
143 style
144 sync
145 tag
146 tar
 
147 th_main
148 timeline
149 tkt
150 tktsetup
151 undo
152
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -142,10 +142,11 @@
142 statrep
143 style
144 sync
145 tag
146 tar
147 terminal
148 th_main
149 timeline
150 tkt
151 tktsetup
152 undo
153
+11 -6
--- src/setup.c
+++ src/setup.c
@@ -876,25 +876,30 @@
876876
}
877877
}
878878
}
879879
@ <br /><input type="submit" name="submit" value="Apply Changes" />
880880
@ </td><td style="width:50px;"></td><td valign="top">
881
+ @ <table>
881882
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
882883
if( pSet->width>0 && !pSet->forceTextArea ){
883884
int hasVersionableValue = pSet->versionable &&
884885
(db_get_versioned(pSet->name, NULL)!=0);
886
+ @ <tr><td>
887
+ @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
888
+ if( pSet->versionable ){
889
+ @ (v)
890
+ } else {
891
+ @
892
+ }
893
+ @</td><td>
885894
entry_attribute("", /*pSet->width*/ 25, pSet->name,
886895
pSet->var!=0 ? pSet->var : pSet->name,
887896
(char*)pSet->def, hasVersionableValue);
888
- @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
889
- if( pSet->versionable ){
890
- @ (v)<br />
891
- } else {
892
- @ <br />
893
- }
897
+ @</td></tr>
894898
}
895899
}
900
+ @</table>
896901
@ </td><td style="width:50px;"></td><td valign="top">
897902
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
898903
if( pSet->width>0 && pSet->forceTextArea ){
899904
int hasVersionableValue = db_get_versioned(pSet->name, NULL)!=0;
900905
@ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
901906
--- src/setup.c
+++ src/setup.c
@@ -876,25 +876,30 @@
876 }
877 }
878 }
879 @ <br /><input type="submit" name="submit" value="Apply Changes" />
880 @ </td><td style="width:50px;"></td><td valign="top">
 
881 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
882 if( pSet->width>0 && !pSet->forceTextArea ){
883 int hasVersionableValue = pSet->versionable &&
884 (db_get_versioned(pSet->name, NULL)!=0);
 
 
 
 
 
 
 
 
885 entry_attribute("", /*pSet->width*/ 25, pSet->name,
886 pSet->var!=0 ? pSet->var : pSet->name,
887 (char*)pSet->def, hasVersionableValue);
888 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
889 if( pSet->versionable ){
890 @ (v)<br />
891 } else {
892 @ <br />
893 }
894 }
895 }
 
896 @ </td><td style="width:50px;"></td><td valign="top">
897 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
898 if( pSet->width>0 && pSet->forceTextArea ){
899 int hasVersionableValue = db_get_versioned(pSet->name, NULL)!=0;
900 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
901
--- src/setup.c
+++ src/setup.c
@@ -876,25 +876,30 @@
876 }
877 }
878 }
879 @ <br /><input type="submit" name="submit" value="Apply Changes" />
880 @ </td><td style="width:50px;"></td><td valign="top">
881 @ <table>
882 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
883 if( pSet->width>0 && !pSet->forceTextArea ){
884 int hasVersionableValue = pSet->versionable &&
885 (db_get_versioned(pSet->name, NULL)!=0);
886 @ <tr><td>
887 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
888 if( pSet->versionable ){
889 @ (v)
890 } else {
891 @
892 }
893 @</td><td>
894 entry_attribute("", /*pSet->width*/ 25, pSet->name,
895 pSet->var!=0 ? pSet->var : pSet->name,
896 (char*)pSet->def, hasVersionableValue);
897 @</td></tr>
 
 
 
 
 
898 }
899 }
900 @</table>
901 @ </td><td style="width:50px;"></td><td valign="top">
902 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
903 if( pSet->width>0 && pSet->forceTextArea ){
904 int hasVersionableValue = db_get_versioned(pSet->name, NULL)!=0;
905 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
906
+4 -7
--- src/shell.c
+++ src/shell.c
@@ -4330,10 +4330,11 @@
43304330
int nKey2, const void *pKey2
43314331
){
43324332
const unsigned char *zA = (const unsigned char*)pKey1;
43334333
const unsigned char *zB = (const unsigned char*)pKey2;
43344334
int i=0, j=0, x;
4335
+ (void)notUsed;
43354336
while( i<nKey1 && j<nKey2 ){
43364337
x = zA[i] - zB[j];
43374338
if( isdigit(zA[i]) ){
43384339
int k;
43394340
if( !isdigit(zB[j]) ) return x;
@@ -11816,10 +11817,11 @@
1181611817
if( rc==SQLITE_OK ){
1181711818
while( sqlite3_step(pExplain)==SQLITE_ROW ){
1181811819
const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
1181911820
int iEqpId = sqlite3_column_int(pExplain, 0);
1182011821
int iParentId = sqlite3_column_int(pExplain, 1);
11822
+ if( zEQPLine==0 ) zEQPLine = "";
1182111823
if( zEQPLine[0]=='-' ) eqp_render(pArg);
1182211824
eqp_append(pArg, iEqpId, iParentId, zEQPLine);
1182311825
}
1182411826
eqp_render(pArg);
1182511827
}
@@ -13725,16 +13727,11 @@
1372513727
if( p->db==0 ) return 1;
1372613728
rc = sqlite3_prepare_v2(p->db,
1372713729
"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
1372813730
-1, &pStmt, 0);
1372913731
if( rc ){
13730
- if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){
13731
- utf8_printf(stderr, "the \".dbinfo\" command requires the "
13732
- "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n");
13733
- }else{
13734
- utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
13735
- }
13732
+ utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
1373613733
sqlite3_finalize(pStmt);
1373713734
return 1;
1373813735
}
1373913736
sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
1374013737
if( sqlite3_step(pStmt)==SQLITE_ROW
@@ -17004,11 +17001,11 @@
1700417001
const char *zFile = 0;
1700517002
int bTxtMode = 0;
1700617003
int i;
1700717004
int eMode = 0;
1700817005
int bBOM = 0;
17009
- int bOnce;
17006
+ int bOnce = 0; /* 0: .output, 1: .once, 2: .excel */
1701017007
1701117008
if( c=='e' ){
1701217009
eMode = 'x';
1701317010
bOnce = 2;
1701417011
}else if( strncmp(azArg[0],"once",n)==0 ){
1701517012
--- src/shell.c
+++ src/shell.c
@@ -4330,10 +4330,11 @@
4330 int nKey2, const void *pKey2
4331 ){
4332 const unsigned char *zA = (const unsigned char*)pKey1;
4333 const unsigned char *zB = (const unsigned char*)pKey2;
4334 int i=0, j=0, x;
 
4335 while( i<nKey1 && j<nKey2 ){
4336 x = zA[i] - zB[j];
4337 if( isdigit(zA[i]) ){
4338 int k;
4339 if( !isdigit(zB[j]) ) return x;
@@ -11816,10 +11817,11 @@
11816 if( rc==SQLITE_OK ){
11817 while( sqlite3_step(pExplain)==SQLITE_ROW ){
11818 const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
11819 int iEqpId = sqlite3_column_int(pExplain, 0);
11820 int iParentId = sqlite3_column_int(pExplain, 1);
 
11821 if( zEQPLine[0]=='-' ) eqp_render(pArg);
11822 eqp_append(pArg, iEqpId, iParentId, zEQPLine);
11823 }
11824 eqp_render(pArg);
11825 }
@@ -13725,16 +13727,11 @@
13725 if( p->db==0 ) return 1;
13726 rc = sqlite3_prepare_v2(p->db,
13727 "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
13728 -1, &pStmt, 0);
13729 if( rc ){
13730 if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){
13731 utf8_printf(stderr, "the \".dbinfo\" command requires the "
13732 "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n");
13733 }else{
13734 utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
13735 }
13736 sqlite3_finalize(pStmt);
13737 return 1;
13738 }
13739 sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
13740 if( sqlite3_step(pStmt)==SQLITE_ROW
@@ -17004,11 +17001,11 @@
17004 const char *zFile = 0;
17005 int bTxtMode = 0;
17006 int i;
17007 int eMode = 0;
17008 int bBOM = 0;
17009 int bOnce;
17010
17011 if( c=='e' ){
17012 eMode = 'x';
17013 bOnce = 2;
17014 }else if( strncmp(azArg[0],"once",n)==0 ){
17015
--- src/shell.c
+++ src/shell.c
@@ -4330,10 +4330,11 @@
4330 int nKey2, const void *pKey2
4331 ){
4332 const unsigned char *zA = (const unsigned char*)pKey1;
4333 const unsigned char *zB = (const unsigned char*)pKey2;
4334 int i=0, j=0, x;
4335 (void)notUsed;
4336 while( i<nKey1 && j<nKey2 ){
4337 x = zA[i] - zB[j];
4338 if( isdigit(zA[i]) ){
4339 int k;
4340 if( !isdigit(zB[j]) ) return x;
@@ -11816,10 +11817,11 @@
11817 if( rc==SQLITE_OK ){
11818 while( sqlite3_step(pExplain)==SQLITE_ROW ){
11819 const char *zEQPLine = (const char*)sqlite3_column_text(pExplain,3);
11820 int iEqpId = sqlite3_column_int(pExplain, 0);
11821 int iParentId = sqlite3_column_int(pExplain, 1);
11822 if( zEQPLine==0 ) zEQPLine = "";
11823 if( zEQPLine[0]=='-' ) eqp_render(pArg);
11824 eqp_append(pArg, iEqpId, iParentId, zEQPLine);
11825 }
11826 eqp_render(pArg);
11827 }
@@ -13725,16 +13727,11 @@
13727 if( p->db==0 ) return 1;
13728 rc = sqlite3_prepare_v2(p->db,
13729 "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
13730 -1, &pStmt, 0);
13731 if( rc ){
13732 utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
 
 
 
 
 
13733 sqlite3_finalize(pStmt);
13734 return 1;
13735 }
13736 sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
13737 if( sqlite3_step(pStmt)==SQLITE_ROW
@@ -17004,11 +17001,11 @@
17001 const char *zFile = 0;
17002 int bTxtMode = 0;
17003 int i;
17004 int eMode = 0;
17005 int bBOM = 0;
17006 int bOnce = 0; /* 0: .output, 1: .once, 2: .excel */
17007
17008 if( c=='e' ){
17009 eMode = 'x';
17010 bOnce = 2;
17011 }else if( strncmp(azArg[0],"once",n)==0 ){
17012
+1064 -459
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -216,10 +216,13 @@
216216
"ENABLE_ATOMIC_WRITE",
217217
#endif
218218
#if SQLITE_ENABLE_BATCH_ATOMIC_WRITE
219219
"ENABLE_BATCH_ATOMIC_WRITE",
220220
#endif
221
+#if SQLITE_ENABLE_BYTECODE_VTAB
222
+ "ENABLE_BYTECODE_VTAB",
223
+#endif
221224
#if SQLITE_ENABLE_CEROD
222225
"ENABLE_CEROD=" CTIMEOPT_VAL(SQLITE_ENABLE_CEROD),
223226
#endif
224227
#if SQLITE_ENABLE_COLUMN_METADATA
225228
"ENABLE_COLUMN_METADATA",
@@ -534,13 +537,10 @@
534537
"OMIT_BETWEEN_OPTIMIZATION",
535538
#endif
536539
#if SQLITE_OMIT_BLOB_LITERAL
537540
"OMIT_BLOB_LITERAL",
538541
#endif
539
-#if SQLITE_OMIT_BTREECOUNT
540
- "OMIT_BTREECOUNT",
541
-#endif
542542
#if SQLITE_OMIT_CAST
543543
"OMIT_CAST",
544544
#endif
545545
#if SQLITE_OMIT_CHECK
546546
"OMIT_CHECK",
@@ -1162,11 +1162,11 @@
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
11651165
#define SQLITE_VERSION "3.32.0"
11661166
#define SQLITE_VERSION_NUMBER 3032000
1167
-#define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0926b"
1167
+#define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -1336,30 +1336,26 @@
13361336
** for the [sqlite3] object.
13371337
** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
13381338
** the [sqlite3] object is successfully destroyed and all associated
13391339
** resources are deallocated.
13401340
**
1341
+** Ideally, applications should [sqlite3_finalize | finalize] all
1342
+** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
1343
+** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
1344
+** with the [sqlite3] object prior to attempting to close the object.
13411345
** ^If the database connection is associated with unfinalized prepared
1342
-** statements or unfinished sqlite3_backup objects then sqlite3_close()
1343
-** will leave the database connection open and return [SQLITE_BUSY].
1344
-** ^If sqlite3_close_v2() is called with unfinalized prepared statements
1345
-** and/or unfinished sqlite3_backups, then the database connection becomes
1346
-** an unusable "zombie" which will automatically be deallocated when the
1347
-** last prepared statement is finalized or the last sqlite3_backup is
1348
-** finished. The sqlite3_close_v2() interface is intended for use with
1349
-** host languages that are garbage collected, and where the order in which
1350
-** destructors are called is arbitrary.
1351
-**
1352
-** Applications should [sqlite3_finalize | finalize] all [prepared statements],
1353
-** [sqlite3_blob_close | close] all [BLOB handles], and
1354
-** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
1355
-** with the [sqlite3] object prior to attempting to close the object. ^If
1356
-** sqlite3_close_v2() is called on a [database connection] that still has
1357
-** outstanding [prepared statements], [BLOB handles], and/or
1358
-** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
1359
-** of resources is deferred until all [prepared statements], [BLOB handles],
1360
-** and [sqlite3_backup] objects are also destroyed.
1346
+** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
1347
+** sqlite3_close() will leave the database connection open and return
1348
+** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
1349
+** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
1350
+** it returns [SQLITE_OK] regardless, but instead of deallocating the database
1351
+** connection immediately, it marks the database connection as an unusable
1352
+** "zombie" and makes arrangements to automatically deallocate the database
1353
+** connection after all prepared statements are finalized, all BLOB handles
1354
+** are closed, and all backups have finished. The sqlite3_close_v2() interface
1355
+** is intended for use with host languages that are garbage collected, and
1356
+** where the order in which destructors are called is arbitrary.
13611357
**
13621358
** ^If an [sqlite3] object is destroyed while a transaction is open,
13631359
** the transaction is automatically rolled back.
13641360
**
13651361
** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -1544,10 +1540,11 @@
15441540
#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
15451541
#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
15461542
#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
15471543
#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
15481544
#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
1545
+#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
15491546
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
15501547
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
15511548
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
15521549
#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
15531550
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -2150,10 +2147,15 @@
21502147
** a single attached database that occur due to other database connections,
21512148
** but omits changes implemented by the database connection on which it is
21522149
** called. This file control is the only mechanism to detect changes that
21532150
** happen either internally or externally and that are associated with
21542151
** a particular attached database.
2152
+**
2153
+** <li>[[SQLITE_FCNTL_CKPT_START]]
2154
+** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
2155
+** in wal mode before the client starts to copy pages from the wal
2156
+** file to the database file.
21552157
**
21562158
** <li>[[SQLITE_FCNTL_CKPT_DONE]]
21572159
** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
21582160
** in wal mode after the client has finished copying pages from the wal
21592161
** file to the database file, but before the *-shm file is updated to
@@ -2195,10 +2197,11 @@
21952197
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
21962198
#define SQLITE_FCNTL_DATA_VERSION 35
21972199
#define SQLITE_FCNTL_SIZE_LIMIT 36
21982200
#define SQLITE_FCNTL_CKPT_DONE 37
21992201
#define SQLITE_FCNTL_RESERVE_BYTES 38
2202
+#define SQLITE_FCNTL_CKPT_START 39
22002203
22012204
/* deprecated names */
22022205
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
22032206
#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
22042207
#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -4573,12 +4576,23 @@
45734576
**
45744577
** These are utility routines, useful to [VFS|custom VFS implementations],
45754578
** that check if a database file was a URI that contained a specific query
45764579
** parameter, and if so obtains the value of that query parameter.
45774580
**
4578
-** If F is the database filename pointer passed into the xOpen() method of
4579
-** a VFS implementation or it is the return value of [sqlite3_db_filename()]
4581
+** The first parameter to these interfaces (hereafter referred to
4582
+** as F) must be one of:
4583
+** <ul>
4584
+** <li> A database filename pointer created by the SQLite core and
4585
+** passed into the xOpen() method of a VFS implemention, or
4586
+** <li> A filename obtained from [sqlite3_db_filename()], or
4587
+** <li> A new filename constructed using [sqlite3_create_filename()].
4588
+** </ul>
4589
+** If the F parameter is not one of the above, then the behavior is
4590
+** undefined and probably undesirable. Older versions of SQLite were
4591
+** more tolerant of invalid F parameters than newer versions.
4592
+**
4593
+** If F is a suitable filename (as described in the previous paragraph)
45804594
** and if P is the name of the query parameter, then
45814595
** sqlite3_uri_parameter(F,P) returns the value of the P
45824596
** parameter if it exists or a NULL pointer if P does not appear as a
45834597
** query parameter on F. If P is a query parameter of F and it
45844598
** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -4657,10 +4671,29 @@
46574671
*/
46584672
SQLITE_API const char *sqlite3_filename_database(const char*);
46594673
SQLITE_API const char *sqlite3_filename_journal(const char*);
46604674
SQLITE_API const char *sqlite3_filename_wal(const char*);
46614675
4676
+/*
4677
+** CAPI3REF: Database File Corresponding To A Journal
4678
+**
4679
+** ^If X is the name of a rollback or WAL-mode journal file that is
4680
+** passed into the xOpen method of [sqlite3_vfs], then
4681
+** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file]
4682
+** object that represents the main database file.
4683
+**
4684
+** This routine is intended for use in custom [VFS] implementations
4685
+** only. It is not a general-purpose interface.
4686
+** The argument sqlite3_file_object(X) must be a filename pointer that
4687
+** has been passed into [sqlite3_vfs].xOpen method where the
4688
+** flags parameter to xOpen contains one of the bits
4689
+** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use
4690
+** of this routine results in undefined and probably undesirable
4691
+** behavior.
4692
+*/
4693
+SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
4694
+
46624695
/*
46634696
** CAPI3REF: Create and Destroy VFS Filenames
46644697
**
46654698
** These interfces are provided for use by [VFS shim] implementations and
46664699
** are not useful outside of that context.
@@ -4691,11 +4724,11 @@
46914724
** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
46924725
** be NULL pointers, though they can be empty strings.
46934726
**
46944727
** The sqlite3_free_filename(Y) routine releases a memory allocation
46954728
** previously obtained from sqlite3_create_filename(). Invoking
4696
-** sqlite3_free_filename(Y) is a NULL pointer is a harmless no-op.
4729
+** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op.
46974730
**
46984731
** If the Y parameter to sqlite3_free_filename(Y) is anything other
46994732
** than a NULL pointer or a pointer previously acquired from
47004733
** sqlite3_create_filename(), then bad things such as heap
47014734
** corruption or segfaults may occur. The value Y should be
@@ -15022,13 +15055,11 @@
1502215055
#ifndef NDEBUG
1502315056
SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*);
1502415057
#endif
1502515058
SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor*);
1502615059
15027
-#ifndef SQLITE_OMIT_BTREECOUNT
1502815060
SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
15029
-#endif
1503015061
1503115062
#ifdef SQLITE_TEST
1503215063
SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
1503315064
SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
1503415065
#endif
@@ -15599,10 +15630,13 @@
1559915630
1560015631
SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
1560115632
SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
1560215633
1560315634
SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
15635
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
15636
+SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
15637
+#endif
1560415638
1560515639
/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
1560615640
** each VDBE opcode.
1560715641
**
1560815642
** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
@@ -16855,10 +16889,11 @@
1685516889
Hash aFunc; /* Hash table of connection functions */
1685616890
Hash aCollSeq; /* All collating sequences */
1685716891
BusyHandler busyHandler; /* Busy callback */
1685816892
Db aDbStatic[2]; /* Static space for the 2 default backends */
1685916893
Savepoint *pSavepoint; /* List of active savepoints */
16894
+ int nAnalysisLimit; /* Number of index rows to ANALYZE */
1686016895
int busyTimeout; /* Busy handler timeout, in msec */
1686116896
int nSavepoint; /* Number of non-transaction savepoints */
1686216897
int nStatement; /* Number of nested statement-transactions */
1686316898
i64 nDeferredCons; /* Net deferred constraints this transaction. */
1686416899
i64 nDeferredImmCons; /* Net deferred immediate constraints */
@@ -20636,11 +20671,12 @@
2063620671
/*
2063720672
** VDBE_DISPLAY_P4 is true or false depending on whether or not the
2063820673
** "explain" P4 display logic is enabled.
2063920674
*/
2064020675
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
20641
- || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
20676
+ || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) \
20677
+ || defined(SQLITE_ENABLE_BYTECODE_VTAB)
2064220678
# define VDBE_DISPLAY_P4 1
2064320679
#else
2064420680
# define VDBE_DISPLAY_P4 0
2064520681
#endif
2064620682
@@ -21101,11 +21137,18 @@
2110121137
2110221138
int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
2110321139
SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*);
2110421140
SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
2110521141
SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
21106
-#ifndef SQLITE_OMIT_EXPLAIN
21142
+#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
21143
+SQLITE_PRIVATE int sqlite3VdbeNextOpcode(Vdbe*,Mem*,int,int*,int*,Op**);
21144
+SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3*,Op*);
21145
+#endif
21146
+#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS)
21147
+SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(sqlite3*,const Op*,const char*);
21148
+#endif
21149
+#if !defined(SQLITE_OMIT_EXPLAIN)
2110721150
SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
2110821151
#endif
2110921152
SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
2111021153
SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
2111121154
SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
@@ -21143,11 +21186,11 @@
2114321186
SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
2114421187
SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
2114521188
#ifndef SQLITE_OMIT_WINDOWFUNC
2114621189
SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem*, Mem*, FuncDef*);
2114721190
#endif
21148
-#ifndef SQLITE_OMIT_EXPLAIN
21191
+#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
2114921192
SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
2115021193
#endif
2115121194
SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
2115221195
SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int n);
2115321196
SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
@@ -27316,11 +27359,11 @@
2731627359
if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
2731727360
n = mem0.hardLimit;
2731827361
}
2731927362
mem0.alarmThreshold = n;
2732027363
nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27321
- mem0.nearlyFull = (n>0 && n<=nUsed);
27364
+ AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
2732227365
sqlite3_mutex_leave(mem0.mutex);
2732327366
excess = sqlite3_memory_used() - n;
2732427367
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
2732527368
return priorLimit;
2732627369
}
@@ -27384,11 +27427,11 @@
2738427427
** Return true if the heap is currently under memory pressure - in other
2738527428
** words if the amount of heap used is close to the limit set by
2738627429
** sqlite3_soft_heap_limit().
2738727430
*/
2738827431
SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
27389
- return mem0.nearlyFull;
27432
+ return AtomicLoad(&mem0.nearlyFull);
2739027433
}
2739127434
2739227435
/*
2739327436
** Deinitialize the memory allocation subsystem.
2739427437
*/
@@ -27448,21 +27491,21 @@
2744827491
2744927492
sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, n);
2745027493
if( mem0.alarmThreshold>0 ){
2745127494
sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
2745227495
if( nUsed >= mem0.alarmThreshold - nFull ){
27453
- mem0.nearlyFull = 1;
27496
+ AtomicStore(&mem0.nearlyFull, 1);
2745427497
sqlite3MallocAlarm(nFull);
2745527498
if( mem0.hardLimit ){
2745627499
nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
2745727500
if( nUsed >= mem0.hardLimit - nFull ){
2745827501
*pp = 0;
2745927502
return;
2746027503
}
2746127504
}
2746227505
}else{
27463
- mem0.nearlyFull = 0;
27506
+ AtomicStore(&mem0.nearlyFull, 0);
2746427507
}
2746527508
}
2746627509
p = sqlite3GlobalConfig.m.xMalloc(nFull);
2746727510
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
2746827511
if( p==0 && mem0.alarmThreshold>0 ){
@@ -54026,13 +54069,16 @@
5402654069
}
5402754070
if( exists ){
5402854071
/* One of the journals pointed to by the master journal exists.
5402954072
** Open it and check if it points at the master journal. If
5403054073
** so, return without deleting the master journal file.
54074
+ ** NB: zJournal is really a MAIN_JOURNAL. But call it a
54075
+ ** MASTER_JOURNAL here so that the VFS will not send the zJournal
54076
+ ** name into sqlite3_database_file_object().
5403154077
*/
5403254078
int c;
54033
- int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL);
54079
+ int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL);
5403454080
rc = sqlite3OsOpen(pVfs, zJournal, pJournal, flags, 0);
5403554081
if( rc!=SQLITE_OK ){
5403654082
goto delmaster_out;
5403754083
}
5403854084
@@ -56232,10 +56278,11 @@
5623256278
** Pager object (sizeof(Pager) bytes)
5623356279
** PCache object (sqlite3PcacheSize() bytes)
5623456280
** Database file handle (pVfs->szOsFile bytes)
5623556281
** Sub-journal file handle (journalFileSize bytes)
5623656282
** Main journal file handle (journalFileSize bytes)
56283
+ ** Ptr back to the Pager (sizeof(Pager*) bytes)
5623756284
** \0\0\0\0 database prefix (4 bytes)
5623856285
** Database file name (nPathname+1 bytes)
5623956286
** URI query parameters (nUriByte bytes)
5624056287
** Journal filename (nPathname+8+1 bytes)
5624156288
** WAL filename (nPathname+4+1 bytes)
@@ -56271,10 +56318,11 @@
5627156318
pPtr = (u8 *)sqlite3MallocZero(
5627256319
ROUND8(sizeof(*pPager)) + /* Pager structure */
5627356320
ROUND8(pcacheSize) + /* PCache object */
5627456321
ROUND8(pVfs->szOsFile) + /* The main db file */
5627556322
journalFileSize * 2 + /* The two journal files */
56323
+ sizeof(pPager) + /* Space to hold a pointer */
5627656324
4 + /* Database prefix */
5627756325
nPathname + 1 + /* database filename */
5627856326
nUriByte + /* query parameters */
5627956327
nPathname + 8 + 1 + /* Journal filename */
5628056328
#ifndef SQLITE_OMIT_WAL
@@ -56291,10 +56339,11 @@
5629156339
pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
5629256340
pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
5629356341
pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
5629456342
pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
5629556343
assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
56344
+ memcpy(pPtr, &pPager, sizeof(pPager)); pPtr += sizeof(pPager);
5629656345
5629756346
/* Fill in the Pager.zFilename and pPager.zQueryParam fields */
5629856347
pPtr += 4; /* Skip zero prefix */
5629956348
pPager->zFilename = (char*)pPtr;
5630056349
if( nPathname>0 ){
@@ -56491,10 +56540,23 @@
5649156540
5649256541
*ppPager = pPager;
5649356542
return SQLITE_OK;
5649456543
}
5649556544
56545
+/*
56546
+** Return the sqlite3_file for the main database given the name
56547
+** of the corresonding WAL or Journal name as passed into
56548
+** xOpen.
56549
+*/
56550
+SQLITE_API sqlite3_file *sqlite3_database_file_object(const char *zName){
56551
+ Pager *pPager;
56552
+ while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){
56553
+ zName--;
56554
+ }
56555
+ pPager = *(Pager**)(zName - 4 - sizeof(Pager*));
56556
+ return pPager->fd;
56557
+}
5649656558
5649756559
5649856560
/*
5649956561
** This function is called after transitioning from PAGER_UNLOCK to
5650056562
** PAGER_SHARED state. It tests if there is a hot journal present in
@@ -61023,10 +61085,11 @@
6102361085
** about the eventual size of the db file to the VFS layer.
6102461086
*/
6102561087
if( rc==SQLITE_OK ){
6102661088
i64 nReq = ((i64)mxPage * szPage);
6102761089
i64 nSize; /* Current size of database file */
61090
+ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
6102861091
rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
6102961092
if( rc==SQLITE_OK && nSize<nReq ){
6103061093
sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
6103161094
}
6103261095
}
@@ -61050,10 +61113,11 @@
6105061113
iOffset = (iDbpage-1)*(i64)szPage;
6105161114
testcase( IS_BIG_INT(iOffset) );
6105261115
rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);
6105361116
if( rc!=SQLITE_OK ) break;
6105461117
}
61118
+ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0);
6105561119
6105661120
/* If work was actually accomplished... */
6105761121
if( rc==SQLITE_OK ){
6105861122
if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
6105961123
i64 szDb = pWal->hdr.nPage*(i64)szPage;
@@ -61061,14 +61125,10 @@
6106161125
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
6106261126
if( rc==SQLITE_OK ){
6106361127
rc = sqlite3OsSync(pWal->pDbFd, CKPT_SYNC_FLAGS(sync_flags));
6106461128
}
6106561129
}
61066
- if( rc==SQLITE_OK ){
61067
- rc = sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0);
61068
- if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
61069
- }
6107061130
if( rc==SQLITE_OK ){
6107161131
pInfo->nBackfill = mxSafeFrame;
6107261132
}
6107361133
}
6107461134
@@ -66965,10 +67025,14 @@
6696567025
6696667026
/*
6696767027
** Return the number of bytes of space at the end of every page that
6696867028
** are intentually left unused. This is the "reserved" space that is
6696967029
** sometimes used by extensions.
67030
+**
67031
+** The value returned is the larger of the current reserve size and
67032
+** the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
67033
+** The amount of reserve can only grow - never shrink.
6697067034
*/
6697167035
SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){
6697267036
int n;
6697367037
sqlite3BtreeEnter(p);
6697467038
n = ((int)p->pBt->nReserveWanted) - 1;
@@ -73560,11 +73624,10 @@
7356073624
}
7356173625
sqlite3BtreeLeave(p);
7356273626
return rc;
7356373627
}
7356473628
73565
-#ifndef SQLITE_OMIT_BTREECOUNT
7356673629
/*
7356773630
** The first argument, pCur, is a cursor opened on some b-tree. Count the
7356873631
** number of entries in the b-tree and write the result to *pnEntry.
7356973632
**
7357073633
** SQLITE_OK is returned if the operation is successfully executed.
@@ -73633,11 +73696,10 @@
7363373696
}
7363473697
7363573698
/* An error has occurred. Return an error code. */
7363673699
return rc;
7363773700
}
73638
-#endif
7363973701
7364073702
/*
7364173703
** Return the pager associated with a BTree. This routine is used for
7364273704
** testing and debugging only.
7364373705
*/
@@ -78709,24 +78771,23 @@
7870978771
** "PX" -> "r[X]"
7871078772
** "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1
7871178773
** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0
7871278774
** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x
7871378775
*/
78714
-static int displayComment(
78776
+SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(
78777
+ sqlite3 *db, /* Optional - Oom error reporting only */
7871578778
const Op *pOp, /* The opcode to be commented */
78716
- const char *zP4, /* Previously obtained value for P4 */
78717
- char *zTemp, /* Write result here */
78718
- int nTemp /* Space available in zTemp[] */
78779
+ const char *zP4 /* Previously obtained value for P4 */
7871978780
){
7872078781
const char *zOpName;
7872178782
const char *zSynopsis;
7872278783
int nOpName;
7872378784
int ii;
7872478785
char zAlt[50];
7872578786
StrAccum x;
78726
- sqlite3StrAccumInit(&x, 0, zTemp, nTemp, 0);
7872778787
78788
+ sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH);
7872878789
zOpName = sqlite3OpcodeName(pOp->opcode);
7872978790
nOpName = sqlite3Strlen30(zOpName);
7873078791
if( zOpName[nOpName+1] ){
7873178792
int seenCom = 0;
7873278793
char c;
@@ -78789,14 +78850,16 @@
7878978850
sqlite3_str_appendf(&x, "; %s", pOp->zComment);
7879078851
}
7879178852
}else if( pOp->zComment ){
7879278853
sqlite3_str_appendall(&x, pOp->zComment);
7879378854
}
78794
- sqlite3StrAccumFinish(&x);
78795
- return x.nChar;
78855
+ if( (x.accError & SQLITE_NOMEM)!=0 && db!=0 ){
78856
+ sqlite3OomFault(db);
78857
+ }
78858
+ return sqlite3StrAccumFinish(&x);
7879678859
}
78797
-#endif /* SQLITE_DEBUG */
78860
+#endif /* SQLITE_ENABLE_EXPLAIN_COMMENTS */
7879878861
7879978862
#if VDBE_DISPLAY_P4 && defined(SQLITE_ENABLE_CURSOR_HINTS)
7880078863
/*
7880178864
** Translate the P4.pExpr value for an OP_CursorHint opcode into text
7880278865
** that can be displayed in the P4 column of EXPLAIN output.
@@ -78873,15 +78936,15 @@
7887378936
#if VDBE_DISPLAY_P4
7887478937
/*
7887578938
** Compute a string that describes the P4 parameter for an opcode.
7887678939
** Use zTemp for any required temporary buffer space.
7887778940
*/
78878
-static char *displayP4(Op *pOp, char *zTemp, int nTemp){
78879
- char *zP4 = zTemp;
78941
+SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3 *db, Op *pOp){
78942
+ char *zP4 = 0;
7888078943
StrAccum x;
78881
- assert( nTemp>=20 );
78882
- sqlite3StrAccumInit(&x, 0, zTemp, nTemp, 0);
78944
+
78945
+ sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH);
7888378946
switch( pOp->p4type ){
7888478947
case P4_KEYINFO: {
7888578948
int j;
7888678949
KeyInfo *pKeyInfo = pOp->p4.pKeyInfo;
7888778950
assert( pKeyInfo->aSortFlags!=0 );
@@ -78961,40 +79024,36 @@
7896179024
int i;
7896279025
int *ai = pOp->p4.ai;
7896379026
int n = ai[0]; /* The first element of an INTARRAY is always the
7896479027
** count of the number of elements to follow */
7896579028
for(i=1; i<=n; i++){
78966
- sqlite3_str_appendf(&x, ",%d", ai[i]);
79029
+ sqlite3_str_appendf(&x, "%c%d", (i==1 ? '[' : ','), ai[i]);
7896779030
}
78968
- zTemp[0] = '[';
7896979031
sqlite3_str_append(&x, "]", 1);
7897079032
break;
7897179033
}
7897279034
case P4_SUBPROGRAM: {
78973
- sqlite3_str_appendf(&x, "program");
79035
+ zP4 = "program";
7897479036
break;
7897579037
}
7897679038
case P4_DYNBLOB:
7897779039
case P4_ADVANCE: {
78978
- zTemp[0] = 0;
7897979040
break;
7898079041
}
7898179042
case P4_TABLE: {
78982
- sqlite3_str_appendf(&x, "%s", pOp->p4.pTab->zName);
79043
+ zP4 = pOp->p4.pTab->zName;
7898379044
break;
7898479045
}
7898579046
default: {
7898679047
zP4 = pOp->p4.z;
78987
- if( zP4==0 ){
78988
- zP4 = zTemp;
78989
- zTemp[0] = 0;
78990
- }
7899179048
}
7899279049
}
78993
- sqlite3StrAccumFinish(&x);
78994
- assert( zP4!=0 );
78995
- return zP4;
79050
+ if( zP4 ) sqlite3_str_appendall(&x, zP4);
79051
+ if( (x.accError & SQLITE_NOMEM)!=0 ){
79052
+ sqlite3OomFault(db);
79053
+ }
79054
+ return sqlite3StrAccumFinish(&x);
7899679055
}
7899779056
#endif /* VDBE_DISPLAY_P4 */
7899879057
7899979058
/*
7900079059
** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
@@ -79080,28 +79139,32 @@
7908079139
/*
7908179140
** Print a single opcode. This routine is used for debugging only.
7908279141
*/
7908379142
SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, VdbeOp *pOp){
7908479143
char *zP4;
79085
- char zPtr[50];
79086
- char zCom[100];
79144
+ char *zCom;
79145
+ sqlite3 dummyDb;
7908779146
static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
7908879147
if( pOut==0 ) pOut = stdout;
79089
- zP4 = displayP4(pOp, zPtr, sizeof(zPtr));
79148
+ dummyDb.mallocFailed = 1;
79149
+ zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp);
7909079150
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79091
- displayComment(pOp, zP4, zCom, sizeof(zCom));
79151
+ zCom = sqlite3VdbeDisplayComment(0, pOp, zP4);
7909279152
#else
79093
- zCom[0] = 0;
79153
+ zCom = 0;
7909479154
#endif
7909579155
/* NB: The sqlite3OpcodeName() function is implemented by code created
7909679156
** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the
7909779157
** information from the vdbe.c source text */
7909879158
fprintf(pOut, zFormat1, pc,
79099
- sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5,
79100
- zCom
79159
+ sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3,
79160
+ zP4 ? zP4 : "", pOp->p5,
79161
+ zCom ? zCom : ""
7910179162
);
7910279163
fflush(pOut);
79164
+ sqlite3_free(zP4);
79165
+ sqlite3_free(zCom);
7910379166
}
7910479167
#endif
7910579168
7910679169
/*
7910779170
** Initialize an array of N Mem element.
@@ -79188,10 +79251,125 @@
7918879251
assert( sqlite3VdbeFrameIsValid(pFrame) );
7918979252
pFrame->pParent = pFrame->v->pDelFrame;
7919079253
pFrame->v->pDelFrame = pFrame;
7919179254
}
7919279255
79256
+#if defined(SQLITE_ENABLE_BYTECODE_VTAB) || !defined(SQLITE_OMIT_EXPLAIN)
79257
+/*
79258
+** Locate the next opcode to be displayed in EXPLAIN or EXPLAIN
79259
+** QUERY PLAN output.
79260
+**
79261
+** Return SQLITE_ROW on success. Return SQLITE_DONE if there are no
79262
+** more opcodes to be displayed.
79263
+*/
79264
+SQLITE_PRIVATE int sqlite3VdbeNextOpcode(
79265
+ Vdbe *p, /* The statement being explained */
79266
+ Mem *pSub, /* Storage for keeping track of subprogram nesting */
79267
+ int eMode, /* 0: normal. 1: EQP. 2: TablesUsed */
79268
+ int *piPc, /* IN/OUT: Current rowid. Overwritten with next rowid */
79269
+ int *piAddr, /* OUT: Write index into (*paOp)[] here */
79270
+ Op **paOp /* OUT: Write the opcode array here */
79271
+){
79272
+ int nRow; /* Stop when row count reaches this */
79273
+ int nSub = 0; /* Number of sub-vdbes seen so far */
79274
+ SubProgram **apSub = 0; /* Array of sub-vdbes */
79275
+ int i; /* Next instruction address */
79276
+ int rc = SQLITE_OK; /* Result code */
79277
+ Op *aOp = 0; /* Opcode array */
79278
+ int iPc; /* Rowid. Copy of value in *piPc */
79279
+
79280
+ /* When the number of output rows reaches nRow, that means the
79281
+ ** listing has finished and sqlite3_step() should return SQLITE_DONE.
79282
+ ** nRow is the sum of the number of rows in the main program, plus
79283
+ ** the sum of the number of rows in all trigger subprograms encountered
79284
+ ** so far. The nRow value will increase as new trigger subprograms are
79285
+ ** encountered, but p->pc will eventually catch up to nRow.
79286
+ */
79287
+ nRow = p->nOp;
79288
+ if( pSub!=0 ){
79289
+ if( pSub->flags&MEM_Blob ){
79290
+ /* pSub is initiallly NULL. It is initialized to a BLOB by
79291
+ ** the P4_SUBPROGRAM processing logic below */
79292
+ nSub = pSub->n/sizeof(Vdbe*);
79293
+ apSub = (SubProgram **)pSub->z;
79294
+ }
79295
+ for(i=0; i<nSub; i++){
79296
+ nRow += apSub[i]->nOp;
79297
+ }
79298
+ }
79299
+ iPc = *piPc;
79300
+ while(1){ /* Loop exits via break */
79301
+ i = iPc++;
79302
+ if( i>=nRow ){
79303
+ p->rc = SQLITE_OK;
79304
+ rc = SQLITE_DONE;
79305
+ break;
79306
+ }
79307
+ if( i<p->nOp ){
79308
+ /* The rowid is small enough that we are still in the
79309
+ ** main program. */
79310
+ aOp = p->aOp;
79311
+ }else{
79312
+ /* We are currently listing subprograms. Figure out which one and
79313
+ ** pick up the appropriate opcode. */
79314
+ int j;
79315
+ i -= p->nOp;
79316
+ assert( apSub!=0 );
79317
+ assert( nSub>0 );
79318
+ for(j=0; i>=apSub[j]->nOp; j++){
79319
+ i -= apSub[j]->nOp;
79320
+ assert( i<apSub[j]->nOp || j+1<nSub );
79321
+ }
79322
+ aOp = apSub[j]->aOp;
79323
+ }
79324
+
79325
+ /* When an OP_Program opcode is encounter (the only opcode that has
79326
+ ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms
79327
+ ** kept in p->aMem[9].z to hold the new program - assuming this subprogram
79328
+ ** has not already been seen.
79329
+ */
79330
+ if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){
79331
+ int nByte = (nSub+1)*sizeof(SubProgram*);
79332
+ int j;
79333
+ for(j=0; j<nSub; j++){
79334
+ if( apSub[j]==aOp[i].p4.pProgram ) break;
79335
+ }
79336
+ if( j==nSub ){
79337
+ p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
79338
+ if( p->rc!=SQLITE_OK ){
79339
+ rc = SQLITE_ERROR;
79340
+ break;
79341
+ }
79342
+ apSub = (SubProgram **)pSub->z;
79343
+ apSub[nSub++] = aOp[i].p4.pProgram;
79344
+ MemSetTypeFlag(pSub, MEM_Blob);
79345
+ pSub->n = nSub*sizeof(SubProgram*);
79346
+ nRow += aOp[i].p4.pProgram->nOp;
79347
+ }
79348
+ }
79349
+ if( eMode==0 ) break;
79350
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
79351
+ if( eMode==2 ){
79352
+ Op *pOp = aOp + i;
79353
+ if( pOp->opcode==OP_OpenRead ) break;
79354
+ if( pOp->opcode==OP_OpenWrite && (pOp->p5 & OPFLAG_P2ISREG)==0 ) break;
79355
+ if( pOp->opcode==OP_ReopenIdx ) break;
79356
+ }else
79357
+#endif
79358
+ {
79359
+ assert( eMode==1 );
79360
+ if( aOp[i].opcode==OP_Explain ) break;
79361
+ if( aOp[i].opcode==OP_Init && iPc>1 ) break;
79362
+ }
79363
+ }
79364
+ *piPc = iPc;
79365
+ *piAddr = i;
79366
+ *paOp = aOp;
79367
+ return rc;
79368
+}
79369
+#endif /* SQLITE_ENABLE_BYTECODE_VTAB || !SQLITE_OMIT_EXPLAIN */
79370
+
7919379371
7919479372
/*
7919579373
** Delete a VdbeFrame object and its contents. VdbeFrame objects are
7919679374
** allocated by the OP_Program opcode in sqlite3VdbeExec().
7919779375
*/
@@ -79228,20 +79406,18 @@
7922879406
** the trigger subprograms are listed one by one.
7922979407
*/
7923079408
SQLITE_PRIVATE int sqlite3VdbeList(
7923179409
Vdbe *p /* The VDBE */
7923279410
){
79233
- int nRow; /* Stop when row count reaches this */
79234
- int nSub = 0; /* Number of sub-vdbes seen so far */
79235
- SubProgram **apSub = 0; /* Array of sub-vdbes */
7923679411
Mem *pSub = 0; /* Memory cell hold array of subprogs */
7923779412
sqlite3 *db = p->db; /* The database connection */
7923879413
int i; /* Loop counter */
7923979414
int rc = SQLITE_OK; /* Return code */
7924079415
Mem *pMem = &p->aMem[1]; /* First Mem of result set */
7924179416
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0);
79242
- Op *pOp = 0;
79417
+ Op *aOp; /* Array of opcodes */
79418
+ Op *pOp; /* Current opcode */
7924379419
7924479420
assert( p->explain );
7924579421
assert( p->magic==VDBE_MAGIC_RUN );
7924679422
assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM );
7924779423
@@ -79257,166 +79433,66 @@
7925779433
** sqlite3_column_text16() failed. */
7925879434
sqlite3OomFault(db);
7925979435
return SQLITE_ERROR;
7926079436
}
7926179437
79262
- /* When the number of output rows reaches nRow, that means the
79263
- ** listing has finished and sqlite3_step() should return SQLITE_DONE.
79264
- ** nRow is the sum of the number of rows in the main program, plus
79265
- ** the sum of the number of rows in all trigger subprograms encountered
79266
- ** so far. The nRow value will increase as new trigger subprograms are
79267
- ** encountered, but p->pc will eventually catch up to nRow.
79268
- */
79269
- nRow = p->nOp;
7927079438
if( bListSubprogs ){
7927179439
/* The first 8 memory cells are used for the result set. So we will
7927279440
** commandeer the 9th cell to use as storage for an array of pointers
7927379441
** to trigger subprograms. The VDBE is guaranteed to have at least 9
7927479442
** cells. */
7927579443
assert( p->nMem>9 );
7927679444
pSub = &p->aMem[9];
79277
- if( pSub->flags&MEM_Blob ){
79278
- /* On the first call to sqlite3_step(), pSub will hold a NULL. It is
79279
- ** initialized to a BLOB by the P4_SUBPROGRAM processing logic below */
79280
- nSub = pSub->n/sizeof(Vdbe*);
79281
- apSub = (SubProgram **)pSub->z;
79282
- }
79283
- for(i=0; i<nSub; i++){
79284
- nRow += apSub[i]->nOp;
79285
- }
79286
- }
79287
-
79288
- while(1){ /* Loop exits via break */
79289
- i = p->pc++;
79290
- if( i>=nRow ){
79291
- p->rc = SQLITE_OK;
79292
- rc = SQLITE_DONE;
79293
- break;
79294
- }
79295
- if( i<p->nOp ){
79296
- /* The output line number is small enough that we are still in the
79297
- ** main program. */
79298
- pOp = &p->aOp[i];
79299
- }else{
79300
- /* We are currently listing subprograms. Figure out which one and
79301
- ** pick up the appropriate opcode. */
79302
- int j;
79303
- i -= p->nOp;
79304
- assert( apSub!=0 );
79305
- assert( nSub>0 );
79306
- for(j=0; i>=apSub[j]->nOp; j++){
79307
- i -= apSub[j]->nOp;
79308
- assert( i<apSub[j]->nOp || j+1<nSub );
79309
- }
79310
- pOp = &apSub[j]->aOp[i];
79311
- }
79312
-
79313
- /* When an OP_Program opcode is encounter (the only opcode that has
79314
- ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms
79315
- ** kept in p->aMem[9].z to hold the new program - assuming this subprogram
79316
- ** has not already been seen.
79317
- */
79318
- if( bListSubprogs && pOp->p4type==P4_SUBPROGRAM ){
79319
- int nByte = (nSub+1)*sizeof(SubProgram*);
79320
- int j;
79321
- for(j=0; j<nSub; j++){
79322
- if( apSub[j]==pOp->p4.pProgram ) break;
79323
- }
79324
- if( j==nSub ){
79325
- p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
79326
- if( p->rc!=SQLITE_OK ){
79327
- rc = SQLITE_ERROR;
79328
- break;
79329
- }
79330
- apSub = (SubProgram **)pSub->z;
79331
- apSub[nSub++] = pOp->p4.pProgram;
79332
- pSub->flags |= MEM_Blob;
79333
- pSub->n = nSub*sizeof(SubProgram*);
79334
- nRow += pOp->p4.pProgram->nOp;
79335
- }
79336
- }
79337
- if( p->explain<2 ) break;
79338
- if( pOp->opcode==OP_Explain ) break;
79339
- if( pOp->opcode==OP_Init && p->pc>1 ) break;
79340
- }
79341
-
79342
- if( rc==SQLITE_OK ){
79445
+ }else{
79446
+ pSub = 0;
79447
+ }
79448
+
79449
+ /* Figure out which opcode is next to display */
79450
+ rc = sqlite3VdbeNextOpcode(p, pSub, p->explain==2, &p->pc, &i, &aOp);
79451
+
79452
+ if( rc==SQLITE_OK ){
79453
+ pOp = aOp + i;
7934379454
if( AtomicLoad(&db->u1.isInterrupted) ){
7934479455
p->rc = SQLITE_INTERRUPT;
7934579456
rc = SQLITE_ERROR;
7934679457
sqlite3VdbeError(p, sqlite3ErrStr(p->rc));
7934779458
}else{
79348
- char *zP4;
79349
- if( p->explain==1 ){
79350
- pMem->flags = MEM_Int;
79351
- pMem->u.i = i; /* Program counter */
79352
- pMem++;
79353
-
79354
- pMem->flags = MEM_Static|MEM_Str|MEM_Term;
79355
- pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
79356
- assert( pMem->z!=0 );
79357
- pMem->n = sqlite3Strlen30(pMem->z);
79358
- pMem->enc = SQLITE_UTF8;
79359
- pMem++;
79360
- }
79361
-
79362
- pMem->flags = MEM_Int;
79363
- pMem->u.i = pOp->p1; /* P1 */
79364
- pMem++;
79365
-
79366
- pMem->flags = MEM_Int;
79367
- pMem->u.i = pOp->p2; /* P2 */
79368
- pMem++;
79369
-
79370
- pMem->flags = MEM_Int;
79371
- pMem->u.i = pOp->p3; /* P3 */
79372
- pMem++;
79373
-
79374
- if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */
79375
- assert( p->db->mallocFailed );
79376
- return SQLITE_ERROR;
79377
- }
79378
- pMem->flags = MEM_Str|MEM_Term;
79379
- zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
79380
- if( zP4!=pMem->z ){
79381
- pMem->n = 0;
79382
- sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
79459
+ char *zP4 = sqlite3VdbeDisplayP4(db, pOp);
79460
+ if( p->explain==2 ){
79461
+ sqlite3VdbeMemSetInt64(pMem, pOp->p1);
79462
+ sqlite3VdbeMemSetInt64(pMem+1, pOp->p2);
79463
+ sqlite3VdbeMemSetInt64(pMem+2, pOp->p3);
79464
+ sqlite3VdbeMemSetStr(pMem+3, zP4, -1, SQLITE_UTF8, sqlite3_free);
79465
+ p->nResColumn = 4;
7938379466
}else{
79384
- assert( pMem->z!=0 );
79385
- pMem->n = sqlite3Strlen30(pMem->z);
79386
- pMem->enc = SQLITE_UTF8;
79387
- }
79388
- pMem++;
79389
-
79390
- if( p->explain==1 ){
79391
- if( sqlite3VdbeMemClearAndResize(pMem, 4) ){
79392
- assert( p->db->mallocFailed );
79393
- return SQLITE_ERROR;
79394
- }
79395
- pMem->flags = MEM_Str|MEM_Term;
79396
- pMem->n = 2;
79397
- sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
79398
- pMem->enc = SQLITE_UTF8;
79399
- pMem++;
79400
-
79467
+ sqlite3VdbeMemSetInt64(pMem+0, i);
79468
+ sqlite3VdbeMemSetStr(pMem+1, (char*)sqlite3OpcodeName(pOp->opcode),
79469
+ -1, SQLITE_UTF8, SQLITE_STATIC);
79470
+ sqlite3VdbeMemSetInt64(pMem+2, pOp->p1);
79471
+ sqlite3VdbeMemSetInt64(pMem+3, pOp->p2);
79472
+ sqlite3VdbeMemSetInt64(pMem+4, pOp->p3);
79473
+ /* pMem+5 for p4 is done last */
79474
+ sqlite3VdbeMemSetInt64(pMem+6, pOp->p5);
7940179475
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79402
- if( sqlite3VdbeMemClearAndResize(pMem, 500) ){
79403
- assert( p->db->mallocFailed );
79404
- return SQLITE_ERROR;
79405
- }
79406
- pMem->flags = MEM_Str|MEM_Term;
79407
- pMem->n = displayComment(pOp, zP4, pMem->z, 500);
79408
- pMem->enc = SQLITE_UTF8;
79409
-#else
79410
- pMem->flags = MEM_Null; /* Comment */
79411
-#endif
79412
- }
79413
-
79414
- p->nResColumn = 8 - 4*(p->explain-1);
79415
- p->pResultSet = &p->aMem[1];
79416
- p->rc = SQLITE_OK;
79417
- rc = SQLITE_ROW;
79476
+ {
79477
+ char *zCom = sqlite3VdbeDisplayComment(db, pOp, zP4);
79478
+ sqlite3VdbeMemSetStr(pMem+7, zCom, -1, SQLITE_UTF8, sqlite3_free);
79479
+ }
79480
+#else
79481
+ sqlite3VdbeMemSetNull(pMem+7);
79482
+#endif
79483
+ sqlite3VdbeMemSetStr(pMem+5, zP4, -1, SQLITE_UTF8, sqlite3_free);
79484
+ p->nResColumn = 8;
79485
+ }
79486
+ p->pResultSet = pMem;
79487
+ if( db->mallocFailed ){
79488
+ p->rc = SQLITE_NOMEM;
79489
+ rc = SQLITE_ERROR;
79490
+ }else{
79491
+ p->rc = SQLITE_OK;
79492
+ rc = SQLITE_ROW;
79493
+ }
7941879494
}
7941979495
}
7942079496
return rc;
7942179497
}
7942279498
#endif /* SQLITE_OMIT_EXPLAIN */
@@ -79982,12 +80058,13 @@
7998280058
int retryCount = 0;
7998380059
int nMainFile;
7998480060
7998580061
/* Select a master journal file name */
7998680062
nMainFile = sqlite3Strlen30(zMainFile);
79987
- zMaster = sqlite3MPrintf(db, "%s-mjXXXXXX9XXz%c%c", zMainFile, 0, 0);
80063
+ zMaster = sqlite3MPrintf(db, "%.4c%s%.16c", 0,zMainFile,0);
7998880064
if( zMaster==0 ) return SQLITE_NOMEM_BKPT;
80065
+ zMaster += 4;
7998980066
do {
7999080067
u32 iRandom;
7999180068
if( retryCount ){
7999280069
if( retryCount>100 ){
7999380070
sqlite3_log(SQLITE_FULL, "MJ delete: %s", zMaster);
@@ -80013,11 +80090,11 @@
8001380090
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|
8001480091
SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_MASTER_JOURNAL, 0
8001580092
);
8001680093
}
8001780094
if( rc!=SQLITE_OK ){
80018
- sqlite3DbFree(db, zMaster);
80095
+ sqlite3DbFree(db, zMaster-4);
8001980096
return rc;
8002080097
}
8002180098
8002280099
/* Write the name of each database file in the transaction into the new
8002380100
** master journal file. If an error occurs at this point close
@@ -80036,11 +80113,11 @@
8003680113
rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset);
8003780114
offset += sqlite3Strlen30(zFile)+1;
8003880115
if( rc!=SQLITE_OK ){
8003980116
sqlite3OsCloseFree(pMaster);
8004080117
sqlite3OsDelete(pVfs, zMaster, 0);
80041
- sqlite3DbFree(db, zMaster);
80118
+ sqlite3DbFree(db, zMaster-4);
8004280119
return rc;
8004380120
}
8004480121
}
8004580122
}
8004680123
@@ -80050,11 +80127,11 @@
8005080127
if( 0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL)
8005180128
&& SQLITE_OK!=(rc = sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL))
8005280129
){
8005380130
sqlite3OsCloseFree(pMaster);
8005480131
sqlite3OsDelete(pVfs, zMaster, 0);
80055
- sqlite3DbFree(db, zMaster);
80132
+ sqlite3DbFree(db, zMaster-4);
8005680133
return rc;
8005780134
}
8005880135
8005980136
/* Sync all the db files involved in the transaction. The same call
8006080137
** sets the master journal pointer in each individual journal. If
@@ -80073,20 +80150,20 @@
8007380150
}
8007480151
}
8007580152
sqlite3OsCloseFree(pMaster);
8007680153
assert( rc!=SQLITE_BUSY );
8007780154
if( rc!=SQLITE_OK ){
80078
- sqlite3DbFree(db, zMaster);
80155
+ sqlite3DbFree(db, zMaster-4);
8007980156
return rc;
8008080157
}
8008180158
8008280159
/* Delete the master journal file. This commits the transaction. After
8008380160
** doing this the directory is synced again before any individual
8008480161
** transaction files are deleted.
8008580162
*/
8008680163
rc = sqlite3OsDelete(pVfs, zMaster, 1);
80087
- sqlite3DbFree(db, zMaster);
80164
+ sqlite3DbFree(db, zMaster-4);
8008880165
zMaster = 0;
8008980166
if( rc ){
8009080167
return rc;
8009180168
}
8009280169
@@ -87998,32 +88075,38 @@
8799888075
assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
8799988076
REGISTER_TRACE(pOp->p3, pOut);
8800088077
break;
8800188078
}
8800288079
88003
-/* Opcode: Count P1 P2 * * *
88080
+/* Opcode: Count P1 P2 p3 * *
8800488081
** Synopsis: r[P2]=count()
8800588082
**
8800688083
** Store the number of entries (an integer value) in the table or index
88007
-** opened by cursor P1 in register P2
88084
+** opened by cursor P1 in register P2.
88085
+**
88086
+** If P3==0, then an exact count is obtained, which involves visiting
88087
+** every btree page of the table. But if P3 is non-zero, an estimate
88088
+** is returned based on the current cursor position.
8800888089
*/
88009
-#ifndef SQLITE_OMIT_BTREECOUNT
8801088090
case OP_Count: { /* out2 */
8801188091
i64 nEntry;
8801288092
BtCursor *pCrsr;
8801388093
8801488094
assert( p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE );
8801588095
pCrsr = p->apCsr[pOp->p1]->uc.pCursor;
8801688096
assert( pCrsr );
88017
- nEntry = 0; /* Not needed. Only used to silence a warning. */
88018
- rc = sqlite3BtreeCount(db, pCrsr, &nEntry);
88019
- if( rc ) goto abort_due_to_error;
88097
+ if( pOp->p3 ){
88098
+ nEntry = sqlite3BtreeRowCountEst(pCrsr);
88099
+ }else{
88100
+ nEntry = 0; /* Not needed. Only used to silence a warning. */
88101
+ rc = sqlite3BtreeCount(db, pCrsr, &nEntry);
88102
+ if( rc ) goto abort_due_to_error;
88103
+ }
8802088104
pOut = out2Prerelease(p, pOp);
8802188105
pOut->u.i = nEntry;
8802288106
goto check_for_interrupt;
8802388107
}
88024
-#endif
8802588108
8802688109
/* Opcode: Savepoint P1 * * P4 *
8802788110
**
8802888111
** Open, release or rollback the savepoint named by parameter P4, depending
8802988112
** on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN).
@@ -96093,10 +96176,435 @@
9609396176
*pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
9609496177
return SQLITE_OK;
9609596178
}
9609696179
9609796180
/************** End of vdbesort.c ********************************************/
96181
+/************** Begin file vdbevtab.c ****************************************/
96182
+/*
96183
+** 2020-03-23
96184
+**
96185
+** The author disclaims copyright to this source code. In place of
96186
+** a legal notice, here is a blessing:
96187
+**
96188
+** May you do good and not evil.
96189
+** May you find forgiveness for yourself and forgive others.
96190
+** May you share freely, never taking more than you give.
96191
+**
96192
+*************************************************************************
96193
+**
96194
+** This file implements virtual-tables for examining the bytecode content
96195
+** of a prepared statement.
96196
+*/
96197
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
96198
+/* #include "sqliteInt.h" */
96199
+/* #include "vdbeInt.h" */
96200
+
96201
+/* An instance of the bytecode() table-valued function.
96202
+*/
96203
+typedef struct bytecodevtab bytecodevtab;
96204
+struct bytecodevtab {
96205
+ sqlite3_vtab base; /* Base class - must be first */
96206
+ sqlite3 *db; /* Database connection */
96207
+ int bTablesUsed; /* 2 for tables_used(). 0 for bytecode(). */
96208
+};
96209
+
96210
+/* A cursor for scanning through the bytecode
96211
+*/
96212
+typedef struct bytecodevtab_cursor bytecodevtab_cursor;
96213
+struct bytecodevtab_cursor {
96214
+ sqlite3_vtab_cursor base; /* Base class - must be first */
96215
+ sqlite3_stmt *pStmt; /* The statement whose bytecode is displayed */
96216
+ int iRowid; /* The rowid of the output table */
96217
+ int iAddr; /* Address */
96218
+ int needFinalize; /* Cursors owns pStmt and must finalize it */
96219
+ int showSubprograms; /* Provide a listing of subprograms */
96220
+ Op *aOp; /* Operand array */
96221
+ char *zP4; /* Rendered P4 value */
96222
+ const char *zType; /* tables_used.type */
96223
+ const char *zSchema; /* tables_used.schema */
96224
+ const char *zName; /* tables_used.name */
96225
+ Mem sub; /* Subprograms */
96226
+};
96227
+
96228
+/*
96229
+** Create a new bytecode() table-valued function.
96230
+*/
96231
+static int bytecodevtabConnect(
96232
+ sqlite3 *db,
96233
+ void *pAux,
96234
+ int argc, const char *const*argv,
96235
+ sqlite3_vtab **ppVtab,
96236
+ char **pzErr
96237
+){
96238
+ bytecodevtab *pNew;
96239
+ int rc;
96240
+ int isTabUsed = pAux!=0;
96241
+ const char *azSchema[2] = {
96242
+ /* bytecode() schema */
96243
+ "CREATE TABLE x("
96244
+ "addr INT,"
96245
+ "opcode TEXT,"
96246
+ "p1 INT,"
96247
+ "p2 INT,"
96248
+ "p3 INT,"
96249
+ "p4 TEXT,"
96250
+ "p5 INT,"
96251
+ "comment TEXT,"
96252
+ "subprog TEXT,"
96253
+ "stmt HIDDEN"
96254
+ ");",
96255
+
96256
+ /* Tables_used() schema */
96257
+ "CREATE TABLE x("
96258
+ "type TEXT,"
96259
+ "schema TEXT,"
96260
+ "name TEXT,"
96261
+ "wr INT,"
96262
+ "subprog TEXT,"
96263
+ "stmt HIDDEN"
96264
+ ");"
96265
+ };
96266
+
96267
+ rc = sqlite3_declare_vtab(db, azSchema[isTabUsed]);
96268
+ if( rc==SQLITE_OK ){
96269
+ pNew = sqlite3_malloc( sizeof(*pNew) );
96270
+ *ppVtab = (sqlite3_vtab*)pNew;
96271
+ if( pNew==0 ) return SQLITE_NOMEM;
96272
+ memset(pNew, 0, sizeof(*pNew));
96273
+ pNew->db = db;
96274
+ pNew->bTablesUsed = isTabUsed*2;
96275
+ }
96276
+ return rc;
96277
+}
96278
+
96279
+/*
96280
+** This method is the destructor for bytecodevtab objects.
96281
+*/
96282
+static int bytecodevtabDisconnect(sqlite3_vtab *pVtab){
96283
+ bytecodevtab *p = (bytecodevtab*)pVtab;
96284
+ sqlite3_free(p);
96285
+ return SQLITE_OK;
96286
+}
96287
+
96288
+/*
96289
+** Constructor for a new bytecodevtab_cursor object.
96290
+*/
96291
+static int bytecodevtabOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
96292
+ bytecodevtab *pVTab = (bytecodevtab*)p;
96293
+ bytecodevtab_cursor *pCur;
96294
+ pCur = sqlite3_malloc( sizeof(*pCur) );
96295
+ if( pCur==0 ) return SQLITE_NOMEM;
96296
+ memset(pCur, 0, sizeof(*pCur));
96297
+ sqlite3VdbeMemInit(&pCur->sub, pVTab->db, 1);
96298
+ *ppCursor = &pCur->base;
96299
+ return SQLITE_OK;
96300
+}
96301
+
96302
+/*
96303
+** Clear all internal content from a bytecodevtab cursor.
96304
+*/
96305
+static void bytecodevtabCursorClear(bytecodevtab_cursor *pCur){
96306
+ sqlite3_free(pCur->zP4);
96307
+ pCur->zP4 = 0;
96308
+ sqlite3VdbeMemRelease(&pCur->sub);
96309
+ sqlite3VdbeMemSetNull(&pCur->sub);
96310
+ if( pCur->needFinalize ){
96311
+ sqlite3_finalize(pCur->pStmt);
96312
+ }
96313
+ pCur->pStmt = 0;
96314
+ pCur->needFinalize = 0;
96315
+ pCur->zType = 0;
96316
+ pCur->zSchema = 0;
96317
+ pCur->zName = 0;
96318
+}
96319
+
96320
+/*
96321
+** Destructor for a bytecodevtab_cursor.
96322
+*/
96323
+static int bytecodevtabClose(sqlite3_vtab_cursor *cur){
96324
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96325
+ bytecodevtabCursorClear(pCur);
96326
+ sqlite3_free(pCur);
96327
+ return SQLITE_OK;
96328
+}
96329
+
96330
+
96331
+/*
96332
+** Advance a bytecodevtab_cursor to its next row of output.
96333
+*/
96334
+static int bytecodevtabNext(sqlite3_vtab_cursor *cur){
96335
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96336
+ bytecodevtab *pTab = (bytecodevtab*)cur->pVtab;
96337
+ int rc;
96338
+ if( pCur->zP4 ){
96339
+ sqlite3_free(pCur->zP4);
96340
+ pCur->zP4 = 0;
96341
+ }
96342
+ if( pCur->zName ){
96343
+ pCur->zName = 0;
96344
+ pCur->zType = 0;
96345
+ pCur->zSchema = 0;
96346
+ }
96347
+ rc = sqlite3VdbeNextOpcode(
96348
+ (Vdbe*)pCur->pStmt,
96349
+ pCur->showSubprograms ? &pCur->sub : 0,
96350
+ pTab->bTablesUsed,
96351
+ &pCur->iRowid,
96352
+ &pCur->iAddr,
96353
+ &pCur->aOp);
96354
+ if( rc!=SQLITE_OK ){
96355
+ sqlite3VdbeMemSetNull(&pCur->sub);
96356
+ pCur->aOp = 0;
96357
+ }
96358
+ return SQLITE_OK;
96359
+}
96360
+
96361
+/*
96362
+** Return TRUE if the cursor has been moved off of the last
96363
+** row of output.
96364
+*/
96365
+static int bytecodevtabEof(sqlite3_vtab_cursor *cur){
96366
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96367
+ return pCur->aOp==0;
96368
+}
96369
+
96370
+/*
96371
+** Return values of columns for the row at which the bytecodevtab_cursor
96372
+** is currently pointing.
96373
+*/
96374
+static int bytecodevtabColumn(
96375
+ sqlite3_vtab_cursor *cur, /* The cursor */
96376
+ sqlite3_context *ctx, /* First argument to sqlite3_result_...() */
96377
+ int i /* Which column to return */
96378
+){
96379
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96380
+ bytecodevtab *pVTab = (bytecodevtab*)cur->pVtab;
96381
+ Op *pOp = pCur->aOp + pCur->iAddr;
96382
+ if( pVTab->bTablesUsed ){
96383
+ if( i==4 ){
96384
+ i = 8;
96385
+ }else{
96386
+ if( i<=2 && pCur->zType==0 ){
96387
+ Schema *pSchema;
96388
+ HashElem *k;
96389
+ int iDb = pOp->p3;
96390
+ int iRoot = pOp->p2;
96391
+ sqlite3 *db = pVTab->db;
96392
+ pSchema = db->aDb[iDb].pSchema;
96393
+ pCur->zSchema = db->aDb[iDb].zDbSName;
96394
+ for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
96395
+ Table *pTab = (Table*)sqliteHashData(k);
96396
+ if( !IsVirtual(pTab) && pTab->tnum==iRoot ){
96397
+ pCur->zName = pTab->zName;
96398
+ pCur->zType = "table";
96399
+ break;
96400
+ }
96401
+ }
96402
+ if( pCur->zName==0 ){
96403
+ for(k=sqliteHashFirst(&pSchema->idxHash); k; k=sqliteHashNext(k)){
96404
+ Index *pIdx = (Index*)sqliteHashData(k);
96405
+ if( pIdx->tnum==iRoot ){
96406
+ pCur->zName = pIdx->zName;
96407
+ pCur->zType = "index";
96408
+ }
96409
+ }
96410
+ }
96411
+ }
96412
+ i += 10;
96413
+ }
96414
+ }
96415
+ switch( i ){
96416
+ case 0: /* addr */
96417
+ sqlite3_result_int(ctx, pCur->iAddr);
96418
+ break;
96419
+ case 1: /* opcode */
96420
+ sqlite3_result_text(ctx, (char*)sqlite3OpcodeName(pOp->opcode),
96421
+ -1, SQLITE_STATIC);
96422
+ break;
96423
+ case 2: /* p1 */
96424
+ sqlite3_result_int(ctx, pOp->p1);
96425
+ break;
96426
+ case 3: /* p2 */
96427
+ sqlite3_result_int(ctx, pOp->p2);
96428
+ break;
96429
+ case 4: /* p3 */
96430
+ sqlite3_result_int(ctx, pOp->p3);
96431
+ break;
96432
+ case 5: /* p4 */
96433
+ case 7: /* comment */
96434
+ if( pCur->zP4==0 ){
96435
+ pCur->zP4 = sqlite3VdbeDisplayP4(pVTab->db, pOp);
96436
+ }
96437
+ if( i==5 ){
96438
+ sqlite3_result_text(ctx, pCur->zP4, -1, SQLITE_STATIC);
96439
+ }else{
96440
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
96441
+ char *zCom = sqlite3VdbeDisplayComment(pVTab->db, pOp, pCur->zP4);
96442
+ sqlite3_result_text(ctx, zCom, -1, sqlite3_free);
96443
+#endif
96444
+ }
96445
+ break;
96446
+ case 6: /* p5 */
96447
+ sqlite3_result_int(ctx, pOp->p5);
96448
+ break;
96449
+ case 8: { /* subprog */
96450
+ Op *aOp = pCur->aOp;
96451
+ assert( aOp[0].opcode==OP_Init );
96452
+ assert( aOp[0].p4.z==0 || strncmp(aOp[0].p4.z,"-" "- ",3)==0 );
96453
+ if( pCur->iRowid==pCur->iAddr+1 ){
96454
+ break; /* Result is NULL for the main program */
96455
+ }else if( aOp[0].p4.z!=0 ){
96456
+ sqlite3_result_text(ctx, aOp[0].p4.z+3, -1, SQLITE_STATIC);
96457
+ }else{
96458
+ sqlite3_result_text(ctx, "(FK)", 4, SQLITE_STATIC);
96459
+ }
96460
+ break;
96461
+ }
96462
+ case 10: /* tables_used.type */
96463
+ sqlite3_result_text(ctx, pCur->zType, -1, SQLITE_STATIC);
96464
+ break;
96465
+ case 11: /* tables_used.schema */
96466
+ sqlite3_result_text(ctx, pCur->zSchema, -1, SQLITE_STATIC);
96467
+ break;
96468
+ case 12: /* tables_used.name */
96469
+ sqlite3_result_text(ctx, pCur->zName, -1, SQLITE_STATIC);
96470
+ break;
96471
+ case 13: /* tables_used.wr */
96472
+ sqlite3_result_int(ctx, pOp->opcode==OP_OpenWrite);
96473
+ break;
96474
+ }
96475
+ return SQLITE_OK;
96476
+}
96477
+
96478
+/*
96479
+** Return the rowid for the current row. In this implementation, the
96480
+** rowid is the same as the output value.
96481
+*/
96482
+static int bytecodevtabRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
96483
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96484
+ *pRowid = pCur->iRowid;
96485
+ return SQLITE_OK;
96486
+}
96487
+
96488
+/*
96489
+** Initialize a cursor.
96490
+**
96491
+** idxNum==0 means show all subprograms
96492
+** idxNum==1 means show only the main bytecode and omit subprograms.
96493
+*/
96494
+static int bytecodevtabFilter(
96495
+ sqlite3_vtab_cursor *pVtabCursor,
96496
+ int idxNum, const char *idxStr,
96497
+ int argc, sqlite3_value **argv
96498
+){
96499
+ bytecodevtab_cursor *pCur = (bytecodevtab_cursor *)pVtabCursor;
96500
+ bytecodevtab *pVTab = (bytecodevtab *)pVtabCursor->pVtab;
96501
+ int rc = SQLITE_OK;
96502
+
96503
+ bytecodevtabCursorClear(pCur);
96504
+ pCur->iRowid = 0;
96505
+ pCur->iAddr = 0;
96506
+ pCur->showSubprograms = idxNum==0;
96507
+ assert( argc==1 );
96508
+ if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){
96509
+ const char *zSql = (const char*)sqlite3_value_text(argv[0]);
96510
+ if( zSql==0 ){
96511
+ rc = SQLITE_NOMEM;
96512
+ }else{
96513
+ rc = sqlite3_prepare_v2(pVTab->db, zSql, -1, &pCur->pStmt, 0);
96514
+ pCur->needFinalize = 1;
96515
+ }
96516
+ }else{
96517
+ pCur->pStmt = (sqlite3_stmt*)sqlite3_value_pointer(argv[0],"stmt-pointer");
96518
+ }
96519
+ if( pCur->pStmt==0 ){
96520
+ pVTab->base.zErrMsg = sqlite3_mprintf(
96521
+ "argument to %s() is not a valid SQL statement",
96522
+ pVTab->bTablesUsed ? "tables_used" : "bytecode"
96523
+ );
96524
+ rc = SQLITE_ERROR;
96525
+ }else{
96526
+ bytecodevtabNext(pVtabCursor);
96527
+ }
96528
+ return rc;
96529
+}
96530
+
96531
+/*
96532
+** We must have a single stmt=? constraint that will be passed through
96533
+** into the xFilter method. If there is no valid stmt=? constraint,
96534
+** then return an SQLITE_CONSTRAINT error.
96535
+*/
96536
+static int bytecodevtabBestIndex(
96537
+ sqlite3_vtab *tab,
96538
+ sqlite3_index_info *pIdxInfo
96539
+){
96540
+ int i;
96541
+ int rc = SQLITE_CONSTRAINT;
96542
+ struct sqlite3_index_constraint *p;
96543
+ bytecodevtab *pVTab = (bytecodevtab*)tab;
96544
+ int iBaseCol = pVTab->bTablesUsed ? 4 : 8;
96545
+ pIdxInfo->estimatedCost = (double)100;
96546
+ pIdxInfo->estimatedRows = 100;
96547
+ pIdxInfo->idxNum = 0;
96548
+ for(i=0, p=pIdxInfo->aConstraint; i<pIdxInfo->nConstraint; i++, p++){
96549
+ if( p->usable==0 ) continue;
96550
+ if( p->op==SQLITE_INDEX_CONSTRAINT_EQ && p->iColumn==iBaseCol+1 ){
96551
+ rc = SQLITE_OK;
96552
+ pIdxInfo->aConstraintUsage[i].omit = 1;
96553
+ pIdxInfo->aConstraintUsage[i].argvIndex = 1;
96554
+ }
96555
+ if( p->op==SQLITE_INDEX_CONSTRAINT_ISNULL && p->iColumn==iBaseCol ){
96556
+ pIdxInfo->aConstraintUsage[i].omit = 1;
96557
+ pIdxInfo->idxNum = 1;
96558
+ }
96559
+ }
96560
+ return rc;
96561
+}
96562
+
96563
+/*
96564
+** This following structure defines all the methods for the
96565
+** virtual table.
96566
+*/
96567
+static sqlite3_module bytecodevtabModule = {
96568
+ /* iVersion */ 0,
96569
+ /* xCreate */ 0,
96570
+ /* xConnect */ bytecodevtabConnect,
96571
+ /* xBestIndex */ bytecodevtabBestIndex,
96572
+ /* xDisconnect */ bytecodevtabDisconnect,
96573
+ /* xDestroy */ 0,
96574
+ /* xOpen */ bytecodevtabOpen,
96575
+ /* xClose */ bytecodevtabClose,
96576
+ /* xFilter */ bytecodevtabFilter,
96577
+ /* xNext */ bytecodevtabNext,
96578
+ /* xEof */ bytecodevtabEof,
96579
+ /* xColumn */ bytecodevtabColumn,
96580
+ /* xRowid */ bytecodevtabRowid,
96581
+ /* xUpdate */ 0,
96582
+ /* xBegin */ 0,
96583
+ /* xSync */ 0,
96584
+ /* xCommit */ 0,
96585
+ /* xRollback */ 0,
96586
+ /* xFindMethod */ 0,
96587
+ /* xRename */ 0,
96588
+ /* xSavepoint */ 0,
96589
+ /* xRelease */ 0,
96590
+ /* xRollbackTo */ 0,
96591
+ /* xShadowName */ 0
96592
+};
96593
+
96594
+
96595
+SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){
96596
+ int rc;
96597
+ rc = sqlite3_create_module(db, "bytecode", &bytecodevtabModule, 0);
96598
+ if( rc==SQLITE_OK ){
96599
+ rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db);
96600
+ }
96601
+ return rc;
96602
+}
96603
+#endif /* SQLITE_ENABLE_BYTECODE_VTAB */
96604
+
96605
+/************** End of vdbevtab.c ********************************************/
9609896606
/************** Begin file memjournal.c **************************************/
9609996607
/*
9610096608
** 2008 October 7
9610196609
**
9610296610
** The author disclaims copyright to this source code. In place of
@@ -98739,11 +99247,11 @@
9873999247
** SELECT * FROM t1 WHERE (select a from t1);
9874099248
*/
9874199249
SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){
9874299250
int op;
9874399251
while( ExprHasProperty(pExpr, EP_Skip) ){
98744
- assert( pExpr->op==TK_COLLATE );
99252
+ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
9874599253
pExpr = pExpr->pLeft;
9874699254
assert( pExpr!=0 );
9874799255
}
9874899256
op = pExpr->op;
9874999257
if( op==TK_SELECT ){
@@ -98806,11 +99314,11 @@
9880699314
/*
9880799315
** Skip over any TK_COLLATE operators.
9880899316
*/
9880999317
SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
9881099318
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
98811
- assert( pExpr->op==TK_COLLATE );
99319
+ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
9881299320
pExpr = pExpr->pLeft;
9881399321
}
9881499322
return pExpr;
9881599323
}
9881699324
@@ -98825,11 +99333,11 @@
9882599333
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
9882699334
assert( pExpr->x.pList->nExpr>0 );
9882799335
assert( pExpr->op==TK_FUNCTION );
9882899336
pExpr = pExpr->x.pList->a[0].pExpr;
9882999337
}else{
98830
- assert( pExpr->op==TK_COLLATE );
99338
+ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
9883199339
pExpr = pExpr->pLeft;
9883299340
}
9883399341
}
9883499342
return pExpr;
9883599343
}
@@ -106605,10 +107113,15 @@
106605107113
sqlite3 *db = pParse->db;
106606107114
Db *pDb;
106607107115
Vdbe *v = sqlite3GetVdbe(pParse);
106608107116
int aRoot[ArraySize(aTable)];
106609107117
u8 aCreateTbl[ArraySize(aTable)];
107118
+#ifdef SQLITE_ENABLE_STAT4
107119
+ const int nToOpen = OptimizationEnabled(db,SQLITE_Stat4) ? 2 : 1;
107120
+#else
107121
+ const int nToOpen = 1;
107122
+#endif
106610107123
106611107124
if( v==0 ) return;
106612107125
assert( sqlite3BtreeHoldsAllMutexes(db) );
106613107126
assert( sqlite3VdbeDb(v)==db );
106614107127
pDb = &db->aDb[iDb];
@@ -106617,12 +107130,13 @@
106617107130
** if they do already exist.
106618107131
*/
106619107132
for(i=0; i<ArraySize(aTable); i++){
106620107133
const char *zTab = aTable[i].zName;
106621107134
Table *pStat;
107135
+ aCreateTbl[i] = 0;
106622107136
if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){
106623
- if( aTable[i].zCols ){
107137
+ if( i<nToOpen ){
106624107138
/* The sqlite_statN table does not exist. Create it. Note that a
106625107139
** side-effect of the CREATE TABLE statement is to leave the rootpage
106626107140
** of the new table in register pParse->regRoot. This is important
106627107141
** because the OpenWrite opcode below will be needing it. */
106628107142
sqlite3NestedParse(pParse,
@@ -106634,11 +107148,10 @@
106634107148
}else{
106635107149
/* The table already exists. If zWhere is not NULL, delete all entries
106636107150
** associated with the table zWhere. If zWhere is NULL, delete the
106637107151
** entire contents of the table. */
106638107152
aRoot[i] = pStat->tnum;
106639
- aCreateTbl[i] = 0;
106640107153
sqlite3TableLock(pParse, iDb, aRoot[i], 1, zTab);
106641107154
if( zWhere ){
106642107155
sqlite3NestedParse(pParse,
106643107156
"DELETE FROM %Q.%s WHERE %s=%Q",
106644107157
pDb->zDbSName, zTab, zWhereType, zWhere
@@ -106653,11 +107166,11 @@
106653107166
}
106654107167
}
106655107168
}
106656107169
106657107170
/* Open the sqlite_stat[134] tables for writing. */
106658
- for(i=0; aTable[i].zCols; i++){
107171
+ for(i=0; i<nToOpen; i++){
106659107172
assert( i<ArraySize(aTable) );
106660107173
sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3);
106661107174
sqlite3VdbeChangeP5(v, aCreateTbl[i]);
106662107175
VdbeComment((v, aTable[i].zName));
106663107176
}
@@ -106692,13 +107205,16 @@
106692107205
u32 iHash; /* Tiebreaker hash */
106693107206
#endif
106694107207
};
106695107208
struct StatAccum {
106696107209
sqlite3 *db; /* Database connection, for malloc() */
106697
- tRowcnt nRow; /* Number of rows in the entire table */
107210
+ tRowcnt nEst; /* Estimated number of rows */
107211
+ tRowcnt nRow; /* Number of rows visited so far */
107212
+ int nLimit; /* Analysis row-scan limit */
106698107213
int nCol; /* Number of columns in index + pk/rowid */
106699107214
int nKeyCol; /* Number of index columns w/o the pk/rowid */
107215
+ u8 nSkipAhead; /* Number of times of skip-ahead */
106700107216
StatSample current; /* Current row as a StatSample */
106701107217
#ifdef SQLITE_ENABLE_STAT4
106702107218
tRowcnt nPSample; /* How often to do a periodic sample */
106703107219
int mxSample; /* Maximum number of samples to accumulate */
106704107220
u32 iPrn; /* Pseudo-random number used for sampling */
@@ -106774,31 +107290,32 @@
106774107290
** Reclaim all memory of a StatAccum structure.
106775107291
*/
106776107292
static void statAccumDestructor(void *pOld){
106777107293
StatAccum *p = (StatAccum*)pOld;
106778107294
#ifdef SQLITE_ENABLE_STAT4
106779
- int i;
106780
- for(i=0; i<p->nCol; i++) sampleClear(p->db, p->aBest+i);
106781
- for(i=0; i<p->mxSample; i++) sampleClear(p->db, p->a+i);
106782
- sampleClear(p->db, &p->current);
107295
+ if( p->mxSample ){
107296
+ int i;
107297
+ for(i=0; i<p->nCol; i++) sampleClear(p->db, p->aBest+i);
107298
+ for(i=0; i<p->mxSample; i++) sampleClear(p->db, p->a+i);
107299
+ sampleClear(p->db, &p->current);
107300
+ }
106783107301
#endif
106784107302
sqlite3DbFree(p->db, p);
106785107303
}
106786107304
106787107305
/*
106788
-** Implementation of the stat_init(N,K,C) SQL function. The three parameters
107306
+** Implementation of the stat_init(N,K,C,L) SQL function. The four parameters
106789107307
** are:
106790107308
** N: The number of columns in the index including the rowid/pk (note 1)
106791107309
** K: The number of columns in the index excluding the rowid/pk.
106792
-** C: The number of rows in the index (note 2)
107310
+** C: Estimated number of rows in the index
107311
+** L: A limit on the number of rows to scan, or 0 for no-limit
106793107312
**
106794107313
** Note 1: In the special case of the covering index that implements a
106795107314
** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
106796107315
** total number of columns in the table.
106797107316
**
106798
-** Note 2: C is only used for STAT4.
106799
-**
106800107317
** For indexes on ordinary rowid tables, N==K+1. But for indexes on
106801107318
** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
106802107319
** PRIMARY KEY of the table. The covering index that implements the
106803107320
** original WITHOUT ROWID table as N==K as a special case.
106804107321
**
@@ -106815,13 +107332,14 @@
106815107332
StatAccum *p;
106816107333
int nCol; /* Number of columns in index being sampled */
106817107334
int nKeyCol; /* Number of key columns */
106818107335
int nColUp; /* nCol rounded up for alignment */
106819107336
int n; /* Bytes of space to allocate */
106820
- sqlite3 *db; /* Database connection */
107337
+ sqlite3 *db = sqlite3_context_db_handle(context); /* Database connection */
106821107338
#ifdef SQLITE_ENABLE_STAT4
106822
- int mxSample = SQLITE_STAT4_SAMPLES;
107339
+ /* Maximum number of samples. 0 if STAT4 data is not collected */
107340
+ int mxSample = OptimizationEnabled(db,SQLITE_Stat4) ?SQLITE_STAT4_SAMPLES :0;
106823107341
#endif
106824107342
106825107343
/* Decode the three function arguments */
106826107344
UNUSED_PARAMETER(argc);
106827107345
nCol = sqlite3_value_int(argv[0]);
@@ -106832,39 +107350,43 @@
106832107350
assert( nKeyCol>0 );
106833107351
106834107352
/* Allocate the space required for the StatAccum object */
106835107353
n = sizeof(*p)
106836107354
+ sizeof(tRowcnt)*nColUp /* StatAccum.anEq */
106837
- + sizeof(tRowcnt)*nColUp /* StatAccum.anDLt */
107355
+ + sizeof(tRowcnt)*nColUp; /* StatAccum.anDLt */
106838107356
#ifdef SQLITE_ENABLE_STAT4
106839
- + sizeof(tRowcnt)*nColUp /* StatAccum.anLt */
106840
- + sizeof(StatSample)*(nCol+mxSample) /* StatAccum.aBest[], a[] */
106841
- + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample)
107357
+ if( mxSample ){
107358
+ n += sizeof(tRowcnt)*nColUp /* StatAccum.anLt */
107359
+ + sizeof(StatSample)*(nCol+mxSample) /* StatAccum.aBest[], a[] */
107360
+ + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample);
107361
+ }
106842107362
#endif
106843
- ;
106844107363
db = sqlite3_context_db_handle(context);
106845107364
p = sqlite3DbMallocZero(db, n);
106846107365
if( p==0 ){
106847107366
sqlite3_result_error_nomem(context);
106848107367
return;
106849107368
}
106850107369
106851107370
p->db = db;
107371
+ p->nEst = sqlite3_value_int64(argv[2]);
106852107372
p->nRow = 0;
107373
+ p->nLimit = sqlite3_value_int64(argv[3]);
106853107374
p->nCol = nCol;
106854107375
p->nKeyCol = nKeyCol;
107376
+ p->nSkipAhead = 0;
106855107377
p->current.anDLt = (tRowcnt*)&p[1];
106856107378
p->current.anEq = &p->current.anDLt[nColUp];
106857107379
106858107380
#ifdef SQLITE_ENABLE_STAT4
106859
- {
107381
+ p->mxSample = p->nLimit==0 ? mxSample : 0;
107382
+ if( mxSample ){
106860107383
u8 *pSpace; /* Allocated space not yet assigned */
106861107384
int i; /* Used to iterate through p->aSample[] */
106862107385
106863107386
p->iGet = -1;
106864
- p->mxSample = mxSample;
106865
- p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1);
107387
+ p->nPSample = (tRowcnt)(p->nEst/(mxSample/3+1) + 1);
106866107388
p->current.anLt = &p->current.anEq[nColUp];
106867107389
p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
106868107390
106869107391
/* Set up the StatAccum.a[] and aBest[] arrays */
106870107392
p->a = (struct StatSample*)&p->current.anLt[nColUp];
@@ -106888,11 +107410,11 @@
106888107410
** (given by the 3rd parameter) is never used and can be any positive
106889107411
** value. */
106890107412
sqlite3_result_blob(context, p, sizeof(*p), statAccumDestructor);
106891107413
}
106892107414
static const FuncDef statInitFuncdef = {
106893
- 2+IsStat4, /* nArg */
107415
+ 4, /* nArg */
106894107416
SQLITE_UTF8, /* funcFlags */
106895107417
0, /* pUserData */
106896107418
0, /* pNext */
106897107419
statInit, /* xSFunc */
106898107420
0, /* xFinalize */
@@ -107092,14 +107614,17 @@
107092107614
** P Pointer to the StatAccum object created by stat_init()
107093107615
** C Index of left-most column to differ from previous row
107094107616
** R Rowid for the current row. Might be a key record for
107095107617
** WITHOUT ROWID tables.
107096107618
**
107097
-** This SQL function always returns NULL. It's purpose it to accumulate
107098
-** statistical data and/or samples in the StatAccum object about the
107099
-** index being analyzed. The stat_get() SQL function will later be used to
107100
-** extract relevant information for constructing the sqlite_statN tables.
107619
+** The purpose of this routine is to collect statistical data and/or
107620
+** samples from the index being analyzed into the StatAccum object.
107621
+** The stat_get() SQL function will be used afterwards to
107622
+** retrieve the information gathered.
107623
+**
107624
+** This SQL function usually returns NULL, but might return an integer
107625
+** if it wants the byte-code to do special processing.
107101107626
**
107102107627
** The R parameter is only used for STAT4
107103107628
*/
107104107629
static void statPush(
107105107630
sqlite3_context *context,
@@ -107121,11 +107646,11 @@
107121107646
/* This is the first call to this function. Do initialization. */
107122107647
for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1;
107123107648
}else{
107124107649
/* Second and subsequent calls get processed here */
107125107650
#ifdef SQLITE_ENABLE_STAT4
107126
- samplePushPrevious(p, iChng);
107651
+ if( p->mxSample ) samplePushPrevious(p, iChng);
107127107652
#endif
107128107653
107129107654
/* Update anDLt[], anLt[] and anEq[] to reflect the values that apply
107130107655
** to the current row of the index. */
107131107656
for(i=0; i<iChng; i++){
@@ -107132,30 +107657,29 @@
107132107657
p->current.anEq[i]++;
107133107658
}
107134107659
for(i=iChng; i<p->nCol; i++){
107135107660
p->current.anDLt[i]++;
107136107661
#ifdef SQLITE_ENABLE_STAT4
107137
- p->current.anLt[i] += p->current.anEq[i];
107662
+ if( p->mxSample ) p->current.anLt[i] += p->current.anEq[i];
107138107663
#endif
107139107664
p->current.anEq[i] = 1;
107140107665
}
107141107666
}
107667
+
107142107668
p->nRow++;
107143107669
#ifdef SQLITE_ENABLE_STAT4
107144
- if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
107145
- sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
107146
- }else{
107147
- sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]),
107148
- sqlite3_value_blob(argv[2]));
107149
- }
107150
- p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345;
107151
-#endif
107152
-
107153
-#ifdef SQLITE_ENABLE_STAT4
107154
- {
107155
- tRowcnt nLt = p->current.anLt[p->nCol-1];
107156
-
107670
+ if( p->mxSample ){
107671
+ tRowcnt nLt;
107672
+ if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
107673
+ sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
107674
+ }else{
107675
+ sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]),
107676
+ sqlite3_value_blob(argv[2]));
107677
+ }
107678
+ p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345;
107679
+
107680
+ nLt = p->current.anLt[p->nCol-1];
107157107681
/* Check if this is to be a periodic sample. If so, add it. */
107158107682
if( (nLt/p->nPSample)!=(nLt+1)/p->nPSample ){
107159107683
p->current.isPSample = 1;
107160107684
p->current.iCol = 0;
107161107685
sampleInsert(p, &p->current, p->nCol-1);
@@ -107167,13 +107691,18 @@
107167107691
p->current.iCol = i;
107168107692
if( i>=iChng || sampleIsBetterPost(p, &p->current, &p->aBest[i]) ){
107169107693
sampleCopy(p, &p->aBest[i], &p->current);
107170107694
}
107171107695
}
107696
+ }else
107697
+#endif
107698
+ if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){
107699
+ p->nSkipAhead++;
107700
+ sqlite3_result_int(context, p->current.anDLt[0]>0);
107172107701
}
107173
-#endif
107174107702
}
107703
+
107175107704
static const FuncDef statPushFuncdef = {
107176107705
2+IsStat4, /* nArg */
107177107706
SQLITE_UTF8, /* funcFlags */
107178107707
0, /* pUserData */
107179107708
0, /* pNext */
@@ -107221,10 +107750,11 @@
107221107750
assert( argc==2 );
107222107751
assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ
107223107752
|| eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT
107224107753
|| eCall==STAT_GET_NDLT
107225107754
);
107755
+ assert( eCall==STAT_GET_STAT1 || p->mxSample );
107226107756
if( eCall==STAT_GET_STAT1 )
107227107757
#else
107228107758
assert( argc==1 );
107229107759
#endif
107230107760
{
@@ -107256,11 +107786,12 @@
107256107786
if( zRet==0 ){
107257107787
sqlite3_result_error_nomem(context);
107258107788
return;
107259107789
}
107260107790
107261
- sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow);
107791
+ sqlite3_snprintf(24, zRet, "%llu",
107792
+ p->nSkipAhead ? (u64)p->nEst : (u64)p->nRow);
107262107793
z = zRet + sqlite3Strlen30(zRet);
107263107794
for(i=0; i<p->nKeyCol; i++){
107264107795
u64 nDistinct = p->current.anDLt[i] + 1;
107265107796
u64 iVal = (p->nRow + nDistinct - 1) / nDistinct;
107266107797
sqlite3_snprintf(24, z, " %llu", iVal);
@@ -107332,20 +107863,20 @@
107332107863
0, 0, /* xValue, xInverse */
107333107864
"stat_get", /* zName */
107334107865
{0}
107335107866
};
107336107867
107337
-static void callStatGet(Parse *pParse, int regStat4, int iParam, int regOut){
107868
+static void callStatGet(Parse *pParse, int regStat, int iParam, int regOut){
107338107869
#ifdef SQLITE_ENABLE_STAT4
107339
- sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat4+1);
107870
+ sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat+1);
107340107871
#elif SQLITE_DEBUG
107341107872
assert( iParam==STAT_GET_STAT1 );
107342107873
#else
107343107874
UNUSED_PARAMETER( iParam );
107344107875
#endif
107345
- assert( regOut!=regStat4 && regOut!=regStat4+1 );
107346
- sqlite3VdbeAddFunctionCall(pParse, 0, regStat4, regOut, 1+IsStat4,
107876
+ assert( regOut!=regStat && regOut!=regStat+1 );
107877
+ sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4,
107347107878
&statGetFuncdef, 0);
107348107879
}
107349107880
107350107881
/*
107351107882
** Generate code to do an analysis of all indices associated with
@@ -107367,16 +107898,15 @@
107367107898
int i; /* Loop counter */
107368107899
int jZeroRows = -1; /* Jump from here if number of rows is zero */
107369107900
int iDb; /* Index of database containing pTab */
107370107901
u8 needTableCnt = 1; /* True to count the table */
107371107902
int regNewRowid = iMem++; /* Rowid for the inserted record */
107372
- int regStat4 = iMem++; /* Register to hold StatAccum object */
107903
+ int regStat = iMem++; /* Register to hold StatAccum object */
107373107904
int regChng = iMem++; /* Index of changed index field */
107374
-#ifdef SQLITE_ENABLE_STAT4
107375107905
int regRowid = iMem++; /* Rowid argument passed to stat_push() */
107376
-#endif
107377107906
int regTemp = iMem++; /* Temporary use register */
107907
+ int regTemp2 = iMem++; /* Second temporary use register */
107378107908
int regTabname = iMem++; /* Register containing table name */
107379107909
int regIdxname = iMem++; /* Register containing index name */
107380107910
int regStat1 = iMem++; /* Value for the stat column of sqlite_stat1 */
107381107911
int regPrev = iMem; /* MUST BE LAST (see below) */
107382107912
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107500,21 +108030,30 @@
107500108030
/* Invoke the stat_init() function. The arguments are:
107501108031
**
107502108032
** (1) the number of columns in the index including the rowid
107503108033
** (or for a WITHOUT ROWID table, the number of PK columns),
107504108034
** (2) the number of columns in the key without the rowid/pk
107505
- ** (3) the number of rows in the index,
107506
- **
107507
- **
107508
- ** The third argument is only used for STAT4
108035
+ ** (3) estimated number of rows in the index,
107509108036
*/
108037
+ sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat+1);
108038
+ assert( regRowid==regStat+2 );
108039
+ sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regRowid);
107510108040
#ifdef SQLITE_ENABLE_STAT4
107511
- sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3);
108041
+ if( OptimizationEnabled(db, SQLITE_Stat4) ){
108042
+ sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regTemp);
108043
+ addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
108044
+ VdbeCoverage(v);
108045
+ }else
107512108046
#endif
107513
- sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1);
107514
- sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2);
107515
- sqlite3VdbeAddFunctionCall(pParse, 0, regStat4+1, regStat4, 2+IsStat4,
108047
+ {
108048
+ addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
108049
+ VdbeCoverage(v);
108050
+ sqlite3VdbeAddOp3(v, OP_Count, iIdxCur, regTemp, 1);
108051
+ }
108052
+ assert( regTemp2==regStat+4 );
108053
+ sqlite3VdbeAddOp2(v, OP_Integer, db->nAnalysisLimit, regTemp2);
108054
+ sqlite3VdbeAddFunctionCall(pParse, 0, regStat+1, regStat, 4,
107516108055
&statInitFuncdef, 0);
107517108056
107518108057
/* Implementation of the following:
107519108058
**
107520108059
** Rewind csr
@@ -107521,12 +108060,10 @@
107521108060
** if eof(csr) goto end_of_scan;
107522108061
** regChng = 0
107523108062
** goto next_push_0;
107524108063
**
107525108064
*/
107526
- addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
107527
- VdbeCoverage(v);
107528108065
sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng);
107529108066
addrNextRow = sqlite3VdbeCurrentAddr(v);
107530108067
107531108068
if( nColTest>0 ){
107532108069
int endDistinctTest = sqlite3VdbeMakeLabel(pParse);
@@ -107555,10 +108092,11 @@
107555108092
}
107556108093
for(i=0; i<nColTest; i++){
107557108094
char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
107558108095
sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
107559108096
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
108097
+ VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
107560108098
aGotoChng[i] =
107561108099
sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
107562108100
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
107563108101
VdbeCoverage(v);
107564108102
}
@@ -107575,10 +108113,11 @@
107575108113
*/
107576108114
sqlite3VdbeJumpHere(v, addrNextRow-1);
107577108115
for(i=0; i<nColTest; i++){
107578108116
sqlite3VdbeJumpHere(v, aGotoChng[i]);
107579108117
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
108118
+ VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
107580108119
}
107581108120
sqlite3VdbeResolveLabel(v, endDistinctTest);
107582108121
sqlite3DbFree(db, aGotoChng);
107583108122
}
107584108123
@@ -107588,34 +108127,50 @@
107588108127
** stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
107589108128
** Next csr
107590108129
** if !eof(csr) goto next_row;
107591108130
*/
107592108131
#ifdef SQLITE_ENABLE_STAT4
107593
- assert( regRowid==(regStat4+2) );
107594
- if( HasRowid(pTab) ){
107595
- sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
107596
- }else{
107597
- Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
107598
- int j, k, regKey;
107599
- regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
107600
- for(j=0; j<pPk->nKeyCol; j++){
107601
- k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
107602
- assert( k>=0 && k<pIdx->nColumn );
107603
- sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
107604
- VdbeComment((v, "%s", pTab->aCol[pPk->aiColumn[j]].zName));
107605
- }
107606
- sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
107607
- sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108132
+ if( OptimizationEnabled(db, SQLITE_Stat4) ){
108133
+ assert( regRowid==(regStat+2) );
108134
+ if( HasRowid(pTab) ){
108135
+ sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
108136
+ }else{
108137
+ Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
108138
+ int j, k, regKey;
108139
+ regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
108140
+ for(j=0; j<pPk->nKeyCol; j++){
108141
+ k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
108142
+ assert( k>=0 && k<pIdx->nColumn );
108143
+ sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
108144
+ VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108145
+ }
108146
+ sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
108147
+ sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108148
+ }
107608108149
}
107609108150
#endif
107610
- assert( regChng==(regStat4+1) );
107611
- sqlite3VdbeAddFunctionCall(pParse, 1, regStat4, regTemp, 2+IsStat4,
107612
- &statPushFuncdef, 0);
107613
- sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
108151
+ assert( regChng==(regStat+1) );
108152
+ {
108153
+ sqlite3VdbeAddFunctionCall(pParse, 1, regStat, regTemp, 2+IsStat4,
108154
+ &statPushFuncdef, 0);
108155
+ if( db->nAnalysisLimit ){
108156
+ int j1, j2, j3;
108157
+ j1 = sqlite3VdbeAddOp1(v, OP_IsNull, regTemp); VdbeCoverage(v);
108158
+ j2 = sqlite3VdbeAddOp1(v, OP_If, regTemp); VdbeCoverage(v);
108159
+ j3 = sqlite3VdbeAddOp4Int(v, OP_SeekGT, iIdxCur, 0, regPrev, 1);
108160
+ VdbeCoverage(v);
108161
+ sqlite3VdbeJumpHere(v, j1);
108162
+ sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
108163
+ sqlite3VdbeJumpHere(v, j2);
108164
+ sqlite3VdbeJumpHere(v, j3);
108165
+ }else{
108166
+ sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
108167
+ }
108168
+ }
107614108169
107615108170
/* Add the entry to the stat1 table. */
107616
- callStatGet(pParse, regStat4, STAT_GET_STAT1, regStat1);
108171
+ callStatGet(pParse, regStat, STAT_GET_STAT1, regStat1);
107617108172
assert( "BBB"[0]==SQLITE_AFF_TEXT );
107618108173
sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0);
107619108174
sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
107620108175
sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
107621108176
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107623,11 +108178,11 @@
107623108178
#endif
107624108179
sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
107625108180
107626108181
/* Add the entries to the stat4 table. */
107627108182
#ifdef SQLITE_ENABLE_STAT4
107628
- {
108183
+ if( OptimizationEnabled(db, SQLITE_Stat4) && db->nAnalysisLimit==0 ){
107629108184
int regEq = regStat1;
107630108185
int regLt = regStat1+1;
107631108186
int regDLt = regStat1+2;
107632108187
int regSample = regStat1+3;
107633108188
int regCol = regStat1+4;
@@ -107637,16 +108192,16 @@
107637108192
u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
107638108193
107639108194
pParse->nMem = MAX(pParse->nMem, regCol+nCol);
107640108195
107641108196
addrNext = sqlite3VdbeCurrentAddr(v);
107642
- callStatGet(pParse, regStat4, STAT_GET_ROWID, regSampleRowid);
108197
+ callStatGet(pParse, regStat, STAT_GET_ROWID, regSampleRowid);
107643108198
addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid);
107644108199
VdbeCoverage(v);
107645
- callStatGet(pParse, regStat4, STAT_GET_NEQ, regEq);
107646
- callStatGet(pParse, regStat4, STAT_GET_NLT, regLt);
107647
- callStatGet(pParse, regStat4, STAT_GET_NDLT, regDLt);
108200
+ callStatGet(pParse, regStat, STAT_GET_NEQ, regEq);
108201
+ callStatGet(pParse, regStat, STAT_GET_NLT, regLt);
108202
+ callStatGet(pParse, regStat, STAT_GET_NDLT, regDLt);
107648108203
sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
107649108204
VdbeCoverage(v);
107650108205
for(i=0; i<nCol; i++){
107651108206
sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i);
107652108207
}
@@ -122629,10 +123184,11 @@
122629123184
const char *(*filename_wal)(const char*);
122630123185
/* Version 3.32.0 and later */
122631123186
char *(*create_filename)(const char*,const char*,const char*,
122632123187
int,const char**);
122633123188
void (*free_filename)(char*);
123189
+ sqlite3_file *(*database_file_object)(const char*);
122634123190
};
122635123191
122636123192
/*
122637123193
** This is the function signature used for all extension entry points. It
122638123194
** is also defined in the file "loadext.c".
@@ -122932,10 +123488,11 @@
122932123488
#define sqlite3_filename_journal sqlite3_api->filename_journal
122933123489
#define sqlite3_filename_wal sqlite3_api->filename_wal
122934123490
/* Version 3.32.0 and later */
122935123491
#define sqlite3_create_filename sqlite3_api->create_filename
122936123492
#define sqlite3_free_filename sqlite3_api->free_filename
123493
+#define sqlite3_database_file_object sqlite3_api->database_file_object
122937123494
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
122938123495
122939123496
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
122940123497
/* This case when the file really is being compiled as a loadable
122941123498
** extension */
@@ -123413,11 +123970,20 @@
123413123970
sqlite3_filename_journal,
123414123971
sqlite3_filename_wal,
123415123972
/* Version 3.32.0 and later */
123416123973
sqlite3_create_filename,
123417123974
sqlite3_free_filename,
123975
+ sqlite3_database_file_object,
123418123976
};
123977
+
123978
+/* True if x is the directory separator character
123979
+*/
123980
+#if SQLITE_OS_WIN
123981
+# define DirSep(X) ((X)=='/'||(X)=='\\')
123982
+#else
123983
+# define DirSep(X) ((X)=='/')
123984
+#endif
123419123985
123420123986
/*
123421123987
** Attempt to load an SQLite extension library contained in the file
123422123988
** zFile. The entry point is zProc. zProc may be 0 in which case a
123423123989
** default entry point name (sqlite3_extension_init) is used. Use
@@ -123516,11 +124082,11 @@
123516124082
if( zAltEntry==0 ){
123517124083
sqlite3OsDlClose(pVfs, handle);
123518124084
return SQLITE_NOMEM_BKPT;
123519124085
}
123520124086
memcpy(zAltEntry, "sqlite3_", 8);
123521
- for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){}
124087
+ for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){}
123522124088
iFile++;
123523124089
if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
123524124090
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
123525124091
if( sqlite3Isalpha(c) ){
123526124092
zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
@@ -123820,53 +124386,54 @@
123820124386
** that script and rerun it.
123821124387
*/
123822124388
123823124389
/* The various pragma types */
123824124390
#define PragTyp_ACTIVATE_EXTENSIONS 0
123825
-#define PragTyp_HEADER_VALUE 1
123826
-#define PragTyp_AUTO_VACUUM 2
123827
-#define PragTyp_FLAG 3
123828
-#define PragTyp_BUSY_TIMEOUT 4
123829
-#define PragTyp_CACHE_SIZE 5
123830
-#define PragTyp_CACHE_SPILL 6
123831
-#define PragTyp_CASE_SENSITIVE_LIKE 7
123832
-#define PragTyp_COLLATION_LIST 8
123833
-#define PragTyp_COMPILE_OPTIONS 9
123834
-#define PragTyp_DATA_STORE_DIRECTORY 10
123835
-#define PragTyp_DATABASE_LIST 11
123836
-#define PragTyp_DEFAULT_CACHE_SIZE 12
123837
-#define PragTyp_ENCODING 13
123838
-#define PragTyp_FOREIGN_KEY_CHECK 14
123839
-#define PragTyp_FOREIGN_KEY_LIST 15
123840
-#define PragTyp_FUNCTION_LIST 16
123841
-#define PragTyp_HARD_HEAP_LIMIT 17
123842
-#define PragTyp_INCREMENTAL_VACUUM 18
123843
-#define PragTyp_INDEX_INFO 19
123844
-#define PragTyp_INDEX_LIST 20
123845
-#define PragTyp_INTEGRITY_CHECK 21
123846
-#define PragTyp_JOURNAL_MODE 22
123847
-#define PragTyp_JOURNAL_SIZE_LIMIT 23
123848
-#define PragTyp_LOCK_PROXY_FILE 24
123849
-#define PragTyp_LOCKING_MODE 25
123850
-#define PragTyp_PAGE_COUNT 26
123851
-#define PragTyp_MMAP_SIZE 27
123852
-#define PragTyp_MODULE_LIST 28
123853
-#define PragTyp_OPTIMIZE 29
123854
-#define PragTyp_PAGE_SIZE 30
123855
-#define PragTyp_PRAGMA_LIST 31
123856
-#define PragTyp_SECURE_DELETE 32
123857
-#define PragTyp_SHRINK_MEMORY 33
123858
-#define PragTyp_SOFT_HEAP_LIMIT 34
123859
-#define PragTyp_SYNCHRONOUS 35
123860
-#define PragTyp_TABLE_INFO 36
123861
-#define PragTyp_TEMP_STORE 37
123862
-#define PragTyp_TEMP_STORE_DIRECTORY 38
123863
-#define PragTyp_THREADS 39
123864
-#define PragTyp_WAL_AUTOCHECKPOINT 40
123865
-#define PragTyp_WAL_CHECKPOINT 41
123866
-#define PragTyp_LOCK_STATUS 42
123867
-#define PragTyp_STATS 43
124391
+#define PragTyp_ANALYSIS_LIMIT 1
124392
+#define PragTyp_HEADER_VALUE 2
124393
+#define PragTyp_AUTO_VACUUM 3
124394
+#define PragTyp_FLAG 4
124395
+#define PragTyp_BUSY_TIMEOUT 5
124396
+#define PragTyp_CACHE_SIZE 6
124397
+#define PragTyp_CACHE_SPILL 7
124398
+#define PragTyp_CASE_SENSITIVE_LIKE 8
124399
+#define PragTyp_COLLATION_LIST 9
124400
+#define PragTyp_COMPILE_OPTIONS 10
124401
+#define PragTyp_DATA_STORE_DIRECTORY 11
124402
+#define PragTyp_DATABASE_LIST 12
124403
+#define PragTyp_DEFAULT_CACHE_SIZE 13
124404
+#define PragTyp_ENCODING 14
124405
+#define PragTyp_FOREIGN_KEY_CHECK 15
124406
+#define PragTyp_FOREIGN_KEY_LIST 16
124407
+#define PragTyp_FUNCTION_LIST 17
124408
+#define PragTyp_HARD_HEAP_LIMIT 18
124409
+#define PragTyp_INCREMENTAL_VACUUM 19
124410
+#define PragTyp_INDEX_INFO 20
124411
+#define PragTyp_INDEX_LIST 21
124412
+#define PragTyp_INTEGRITY_CHECK 22
124413
+#define PragTyp_JOURNAL_MODE 23
124414
+#define PragTyp_JOURNAL_SIZE_LIMIT 24
124415
+#define PragTyp_LOCK_PROXY_FILE 25
124416
+#define PragTyp_LOCKING_MODE 26
124417
+#define PragTyp_PAGE_COUNT 27
124418
+#define PragTyp_MMAP_SIZE 28
124419
+#define PragTyp_MODULE_LIST 29
124420
+#define PragTyp_OPTIMIZE 30
124421
+#define PragTyp_PAGE_SIZE 31
124422
+#define PragTyp_PRAGMA_LIST 32
124423
+#define PragTyp_SECURE_DELETE 33
124424
+#define PragTyp_SHRINK_MEMORY 34
124425
+#define PragTyp_SOFT_HEAP_LIMIT 35
124426
+#define PragTyp_SYNCHRONOUS 36
124427
+#define PragTyp_TABLE_INFO 37
124428
+#define PragTyp_TEMP_STORE 38
124429
+#define PragTyp_TEMP_STORE_DIRECTORY 39
124430
+#define PragTyp_THREADS 40
124431
+#define PragTyp_WAL_AUTOCHECKPOINT 41
124432
+#define PragTyp_WAL_CHECKPOINT 42
124433
+#define PragTyp_LOCK_STATUS 43
124434
+#define PragTyp_STATS 44
123868124435
123869124436
/* Property flags associated with various pragma. */
123870124437
#define PragFlg_NeedSchema 0x01 /* Force schema load before running */
123871124438
#define PragFlg_NoColumns 0x02 /* OP_ResultRow called with zero columns */
123872124439
#define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
@@ -123953,10 +124520,15 @@
123953124520
/* ePragTyp: */ PragTyp_ACTIVATE_EXTENSIONS,
123954124521
/* ePragFlg: */ 0,
123955124522
/* ColNames: */ 0, 0,
123956124523
/* iArg: */ 0 },
123957124524
#endif
124525
+ {/* zName: */ "analysis_limit",
124526
+ /* ePragTyp: */ PragTyp_ANALYSIS_LIMIT,
124527
+ /* ePragFlg: */ PragFlg_Result0,
124528
+ /* ColNames: */ 0, 0,
124529
+ /* iArg: */ 0 },
123958124530
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
123959124531
{/* zName: */ "application_id",
123960124532
/* ePragTyp: */ PragTyp_HEADER_VALUE,
123961124533
/* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
123962124534
/* ColNames: */ 0, 0,
@@ -124453,11 +125025,11 @@
124453125025
/* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
124454125026
/* ColNames: */ 0, 0,
124455125027
/* iArg: */ SQLITE_WriteSchema|SQLITE_NoSchemaError },
124456125028
#endif
124457125029
};
124458
-/* Number of pragmas: 66 on by default, 76 total. */
125030
+/* Number of pragmas: 67 on by default, 77 total. */
124459125031
124460125032
/************** End of pragma.h **********************************************/
124461125033
/************** Continuing where we left off in pragma.c *********************/
124462125034
124463125035
/*
@@ -126157,11 +126729,10 @@
126157126729
sqlite3ResolvePartIdxLabel(pParse, jmp3);
126158126730
}
126159126731
}
126160126732
sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
126161126733
sqlite3VdbeJumpHere(v, loopTop-1);
126162
-#ifndef SQLITE_OMIT_BTREECOUNT
126163126734
if( !isQuick ){
126164126735
sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
126165126736
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
126166126737
if( pPk==pIdx ) continue;
126167126738
sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
@@ -126171,11 +126742,10 @@
126171126742
sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
126172126743
integrityCheckResultRow(v);
126173126744
sqlite3VdbeJumpHere(v, addr);
126174126745
}
126175126746
}
126176
-#endif /* SQLITE_OMIT_BTREECOUNT */
126177126747
}
126178126748
}
126179126749
{
126180126750
static const int iLn = VDBE_OFFSET_LINENO(2);
126181126751
static const VdbeOpList endCode[] = {
@@ -126605,10 +127175,29 @@
126605127175
sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, (int)(N&0x7fffffff));
126606127176
}
126607127177
returnSingleInt(v, sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, -1));
126608127178
break;
126609127179
}
127180
+
127181
+ /*
127182
+ ** PRAGMA analysis_limit
127183
+ ** PRAGMA analysis_limit = N
127184
+ **
127185
+ ** Configure the maximum number of rows that ANALYZE will examine
127186
+ ** in each index that it looks at. Return the new limit.
127187
+ */
127188
+ case PragTyp_ANALYSIS_LIMIT: {
127189
+ sqlite3_int64 N;
127190
+ if( zRight
127191
+ && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK
127192
+ && N>=0
127193
+ ){
127194
+ db->nAnalysisLimit = (int)(N&0x7fffffff);
127195
+ }
127196
+ returnSingleInt(v, db->nAnalysisLimit);
127197
+ break;
127198
+ }
126610127199
126611127200
#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
126612127201
/*
126613127202
** Report the current state of file logs for all databases
126614127203
*/
@@ -131404,10 +131993,11 @@
131404131993
if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){
131405131994
memset(&ifNullRow, 0, sizeof(ifNullRow));
131406131995
ifNullRow.op = TK_IF_NULL_ROW;
131407131996
ifNullRow.pLeft = pCopy;
131408131997
ifNullRow.iTable = pSubst->iNewTable;
131998
+ ifNullRow.flags = EP_Skip;
131409131999
pCopy = &ifNullRow;
131410132000
}
131411132001
testcase( ExprHasProperty(pCopy, EP_Subquery) );
131412132002
pNew = sqlite3ExprDup(db, pCopy, 0);
131413132003
if( pNew && pSubst->isLeftJoin ){
@@ -134568,11 +135158,10 @@
134568135158
VdbeComment((v, "indicate accumulator empty"));
134569135159
sqlite3VdbeAddOp1(v, OP_Return, regReset);
134570135160
134571135161
} /* endif pGroupBy. Begin aggregate queries without GROUP BY: */
134572135162
else {
134573
-#ifndef SQLITE_OMIT_BTREECOUNT
134574135163
Table *pTab;
134575135164
if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){
134576135165
/* If isSimpleCount() returns a pointer to a Table structure, then
134577135166
** the SQL statement is of the form:
134578135167
**
@@ -134626,13 +135215,11 @@
134626135215
sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO);
134627135216
}
134628135217
sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem);
134629135218
sqlite3VdbeAddOp1(v, OP_Close, iCsr);
134630135219
explainSimpleCount(pParse, pTab, pBest);
134631
- }else
134632
-#endif /* SQLITE_OMIT_BTREECOUNT */
134633
- {
135220
+ }else{
134634135221
int regAcc = 0; /* "populate accumulators" flag */
134635135222
134636135223
/* If there are accumulator registers but no min() or max() functions
134637135224
** without FILTER clauses, allocate register regAcc. Register regAcc
134638135225
** will contain 0 the first time the inner loop runs, and 1 thereafter.
@@ -159255,19 +159842,82 @@
159255159842
159256159843
159257159844
/************** End of sqliteicu.h *******************************************/
159258159845
/************** Continuing where we left off in main.c ***********************/
159259159846
#endif
159847
+
159848
+/*
159849
+** This is an extension initializer that is a no-op and always
159850
+** succeeds, except that it fails if the fault-simulation is set
159851
+** to 500.
159852
+*/
159853
+static int sqlite3TestExtInit(sqlite3 *db){
159854
+ (void)db;
159855
+ return sqlite3FaultSim(500);
159856
+}
159857
+
159858
+
159859
+/*
159860
+** Forward declarations of external module initializer functions
159861
+** for modules that need them.
159862
+*/
159863
+#ifdef SQLITE_ENABLE_FTS1
159864
+SQLITE_PRIVATE int sqlite3Fts1Init(sqlite3*);
159865
+#endif
159866
+#ifdef SQLITE_ENABLE_FTS2
159867
+SQLITE_PRIVATE int sqlite3Fts2Init(sqlite3*);
159868
+#endif
159869
+#ifdef SQLITE_ENABLE_FTS5
159870
+SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*);
159871
+#endif
159260159872
#ifdef SQLITE_ENABLE_JSON1
159261159873
SQLITE_PRIVATE int sqlite3Json1Init(sqlite3*);
159262159874
#endif
159263159875
#ifdef SQLITE_ENABLE_STMTVTAB
159264159876
SQLITE_PRIVATE int sqlite3StmtVtabInit(sqlite3*);
159265159877
#endif
159878
+
159879
+/*
159880
+** An array of pointers to extension initializer functions for
159881
+** built-in extensions.
159882
+*/
159883
+static int (*const sqlite3BuiltinExtensions[])(sqlite3*) = {
159884
+#ifdef SQLITE_ENABLE_FTS1
159885
+ sqlite3Fts1Init,
159886
+#endif
159887
+#ifdef SQLITE_ENABLE_FTS2
159888
+ sqlite3Fts2Init,
159889
+#endif
159890
+#ifdef SQLITE_ENABLE_FTS3
159891
+ sqlite3Fts3Init,
159892
+#endif
159266159893
#ifdef SQLITE_ENABLE_FTS5
159267
-SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*);
159894
+ sqlite3Fts5Init,
159268159895
#endif
159896
+#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
159897
+ sqlite3IcuInit,
159898
+#endif
159899
+#ifdef SQLITE_ENABLE_RTREE
159900
+ sqlite3RtreeInit,
159901
+#endif
159902
+#ifdef SQLITE_ENABLE_DBPAGE_VTAB
159903
+ sqlite3DbpageRegister,
159904
+#endif
159905
+#ifdef SQLITE_ENABLE_DBSTAT_VTAB
159906
+ sqlite3DbstatRegister,
159907
+#endif
159908
+ sqlite3TestExtInit,
159909
+#ifdef SQLITE_ENABLE_JSON1
159910
+ sqlite3Json1Init,
159911
+#endif
159912
+#ifdef SQLITE_ENABLE_STMTVTAB
159913
+ sqlite3StmtVtabInit,
159914
+#endif
159915
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
159916
+ sqlite3VdbeBytecodeVtabInit,
159917
+#endif
159918
+};
159269159919
159270159920
#ifndef SQLITE_AMALGAMATION
159271159921
/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
159272159922
** contains the text of SQLITE_VERSION macro.
159273159923
*/
@@ -162272,10 +162922,11 @@
162272162922
sqlite3 *db; /* Store allocated handle here */
162273162923
int rc; /* Return code */
162274162924
int isThreadsafe; /* True for threadsafe connections */
162275162925
char *zOpen = 0; /* Filename argument to pass to BtreeOpen() */
162276162926
char *zErrMsg = 0; /* Error message from sqlite3ParseUri() */
162927
+ int i; /* Loop counter */
162277162928
162278162929
#ifdef SQLITE_ENABLE_API_ARMOR
162279162930
if( ppDb==0 ) return SQLITE_MISUSE_BKPT;
162280162931
#endif
162281162932
*ppDb = 0;
@@ -162512,18 +163163,15 @@
162512163163
*/
162513163164
sqlite3Error(db, SQLITE_OK);
162514163165
sqlite3RegisterPerConnectionBuiltinFunctions(db);
162515163166
rc = sqlite3_errcode(db);
162516163167
162517
-#ifdef SQLITE_ENABLE_FTS5
162518
- /* Register any built-in FTS5 module before loading the automatic
162519
- ** extensions. This allows automatic extensions to register FTS5
162520
- ** tokenizers and auxiliary functions. */
162521
- if( !db->mallocFailed && rc==SQLITE_OK ){
162522
- rc = sqlite3Fts5Init(db);
162523
- }
162524
-#endif
163168
+
163169
+ /* Load compiled-in extensions */
163170
+ for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
163171
+ rc = sqlite3BuiltinExtensions[i](db);
163172
+ }
162525163173
162526163174
/* Load automatic extensions - extensions that have been registered
162527163175
** using the sqlite3_automatic_extension() API.
162528163176
*/
162529163177
if( rc==SQLITE_OK ){
@@ -162532,66 +163180,10 @@
162532163180
if( rc!=SQLITE_OK ){
162533163181
goto opendb_out;
162534163182
}
162535163183
}
162536163184
162537
-#ifdef SQLITE_ENABLE_FTS1
162538
- if( !db->mallocFailed ){
162539
- extern int sqlite3Fts1Init(sqlite3*);
162540
- rc = sqlite3Fts1Init(db);
162541
- }
162542
-#endif
162543
-
162544
-#ifdef SQLITE_ENABLE_FTS2
162545
- if( !db->mallocFailed && rc==SQLITE_OK ){
162546
- extern int sqlite3Fts2Init(sqlite3*);
162547
- rc = sqlite3Fts2Init(db);
162548
- }
162549
-#endif
162550
-
162551
-#ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */
162552
- if( !db->mallocFailed && rc==SQLITE_OK ){
162553
- rc = sqlite3Fts3Init(db);
162554
- }
162555
-#endif
162556
-
162557
-#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
162558
- if( !db->mallocFailed && rc==SQLITE_OK ){
162559
- rc = sqlite3IcuInit(db);
162560
- }
162561
-#endif
162562
-
162563
-#ifdef SQLITE_ENABLE_RTREE
162564
- if( !db->mallocFailed && rc==SQLITE_OK){
162565
- rc = sqlite3RtreeInit(db);
162566
- }
162567
-#endif
162568
-
162569
-#ifdef SQLITE_ENABLE_DBPAGE_VTAB
162570
- if( !db->mallocFailed && rc==SQLITE_OK){
162571
- rc = sqlite3DbpageRegister(db);
162572
- }
162573
-#endif
162574
-
162575
-#ifdef SQLITE_ENABLE_DBSTAT_VTAB
162576
- if( !db->mallocFailed && rc==SQLITE_OK){
162577
- rc = sqlite3DbstatRegister(db);
162578
- }
162579
-#endif
162580
-
162581
-#ifdef SQLITE_ENABLE_JSON1
162582
- if( !db->mallocFailed && rc==SQLITE_OK){
162583
- rc = sqlite3Json1Init(db);
162584
- }
162585
-#endif
162586
-
162587
-#ifdef SQLITE_ENABLE_STMTVTAB
162588
- if( !db->mallocFailed && rc==SQLITE_OK){
162589
- rc = sqlite3StmtVtabInit(db);
162590
- }
162591
-#endif
162592
-
162593163185
#ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS
162594163186
/* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time
162595163187
** option gives access to internal functions by default.
162596163188
** Testing use only!!! */
162597163189
db->mDbFlags |= DBFLAG_InternalFunc;
@@ -165357,10 +165949,11 @@
165357165949
SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*);
165358165950
SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *);
165359165951
SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *);
165360165952
SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int*, Fts3Table*);
165361165953
SQLITE_PRIVATE int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc);
165954
+SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut);
165362165955
165363165956
/* fts3_tokenizer.c */
165364165957
SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *);
165365165958
SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *);
165366165959
SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *,
@@ -166088,10 +166681,26 @@
166088166681
fts3Appendf(pRc, &zRet, ", ?");
166089166682
}
166090166683
sqlite3_free(zFree);
166091166684
return zRet;
166092166685
}
166686
+
166687
+/*
166688
+** Buffer z contains a positive integer value encoded as utf-8 text.
166689
+** Decode this value and store it in *pnOut, returning the number of bytes
166690
+** consumed. If an overflow error occurs return a negative value.
166691
+*/
166692
+SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut){
166693
+ u64 iVal = 0;
166694
+ int i;
166695
+ for(i=0; z[i]>='0' && z[i]<='9'; i++){
166696
+ iVal = iVal*10 + (z[i] - '0');
166697
+ if( iVal>0x7FFFFFFF ) return -1;
166698
+ }
166699
+ *pnOut = (int)iVal;
166700
+ return i;
166701
+}
166093166702
166094166703
/*
166095166704
** This function interprets the string at (*pp) as a non-negative integer
166096166705
** value. It reads the integer and sets *pnOut to the value read, then
166097166706
** sets *pp to point to the byte immediately following the last byte of
@@ -166104,23 +166713,21 @@
166104166713
**
166105166714
** This function is used when parsing the "prefix=" FTS4 parameter.
166106166715
*/
166107166716
static int fts3GobbleInt(const char **pp, int *pnOut){
166108166717
const int MAX_NPREFIX = 10000000;
166109
- const char *p; /* Iterator pointer */
166110166718
int nInt = 0; /* Output value */
166111
-
166112
- for(p=*pp; p[0]>='0' && p[0]<='9'; p++){
166113
- nInt = nInt * 10 + (p[0] - '0');
166114
- if( nInt>MAX_NPREFIX ){
166115
- nInt = 0;
166116
- break;
166117
- }
166118
- }
166119
- if( p==*pp ) return SQLITE_ERROR;
166719
+ int nByte;
166720
+ nByte = sqlite3Fts3ReadInt(*pp, &nInt);
166721
+ if( nInt>MAX_NPREFIX ){
166722
+ nInt = 0;
166723
+ }
166724
+ if( nByte==0 ){
166725
+ return SQLITE_ERROR;
166726
+ }
166120166727
*pnOut = nInt;
166121
- *pp = p;
166728
+ *pp += nByte;
166122166729
return SQLITE_OK;
166123166730
}
166124166731
166125166732
/*
166126166733
** This function is called to allocate an array of Fts3Index structures
@@ -172198,14 +172805,11 @@
172198172805
172199172806
/* If this is a "NEAR" keyword, check for an explicit nearness. */
172200172807
if( pKey->eType==FTSQUERY_NEAR ){
172201172808
assert( nKey==4 );
172202172809
if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){
172203
- nNear = 0;
172204
- for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){
172205
- nNear = nNear * 10 + (zInput[nKey] - '0');
172206
- }
172810
+ nKey += 1+sqlite3Fts3ReadInt(&zInput[nKey+1], &nNear);
172207172811
}
172208172812
}
172209172813
172210172814
/* At this point this is probably a keyword. But for that to be true,
172211172815
** the next byte must contain either whitespace, an open or close
@@ -178384,25 +178988,25 @@
178384178988
){
178385178989
const unsigned char *zText = sqlite3_column_text(pStmt, iCol);
178386178990
if( zText ){
178387178991
int i;
178388178992
int iMul = 1;
178389
- i64 iVal = 0;
178993
+ u64 iVal = 0;
178390178994
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){
178391178995
iVal = iVal*10 + (zText[i] - '0');
178392178996
}
178393
- *piEndBlock = iVal;
178997
+ *piEndBlock = (i64)iVal;
178394178998
while( zText[i]==' ' ) i++;
178395178999
iVal = 0;
178396179000
if( zText[i]=='-' ){
178397179001
i++;
178398179002
iMul = -1;
178399179003
}
178400179004
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){
178401179005
iVal = iVal*10 + (zText[i] - '0');
178402179006
}
178403
- *pnByte = (iVal * (i64)iMul);
179007
+ *pnByte = ((i64)iVal * (i64)iMul);
178404179008
}
178405179009
}
178406179010
178407179011
178408179012
/*
@@ -223901,11 +224505,11 @@
223901224505
int nArg, /* Number of args */
223902224506
sqlite3_value **apUnused /* Function arguments */
223903224507
){
223904224508
assert( nArg==0 );
223905224509
UNUSED_PARAM2(nArg, apUnused);
223906
- sqlite3_result_text(pCtx, "fts5: 2020-03-03 20:04:29 bd94d7d052734460904c687756231f8aa243a2252f07f742dd1e437aa940f536", -1, SQLITE_TRANSIENT);
224510
+ sqlite3_result_text(pCtx, "fts5: 2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda", -1, SQLITE_TRANSIENT);
223907224511
}
223908224512
223909224513
/*
223910224514
** Return true if zName is the extension on one of the shadow tables used
223911224515
** by this module.
@@ -228552,11 +229156,12 @@
228552229156
}
228553229157
case STMT_COLUMN_BUSY: {
228554229158
sqlite3_result_int(ctx, sqlite3_stmt_busy(pCur->pStmt));
228555229159
break;
228556229160
}
228557
- case STMT_COLUMN_MEM: {
229161
+ default: {
229162
+ assert( i==STMT_COLUMN_MEM );
228558229163
i = SQLITE_STMTSTATUS_MEMUSED +
228559229164
STMT_COLUMN_NSCAN - SQLITE_STMTSTATUS_FULLSCAN_STEP;
228560229165
/* Fall thru */
228561229166
}
228562229167
case STMT_COLUMN_NSCAN:
@@ -228683,12 +229288,12 @@
228683229288
}
228684229289
#endif /* SQLITE_CORE */
228685229290
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
228686229291
228687229292
/************** End of stmt.c ************************************************/
228688
-#if __LINE__!=228688
229293
+#if __LINE__!=229293
228689229294
#undef SQLITE_SOURCE_ID
228690
-#define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0alt2"
229295
+#define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb21alt2"
228691229296
#endif
228692229297
/* Return the source-id for this library */
228693229298
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
228694229299
/************************** End of sqlite3.c ******************************/
228695229300
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -216,10 +216,13 @@
216 "ENABLE_ATOMIC_WRITE",
217 #endif
218 #if SQLITE_ENABLE_BATCH_ATOMIC_WRITE
219 "ENABLE_BATCH_ATOMIC_WRITE",
220 #endif
 
 
 
221 #if SQLITE_ENABLE_CEROD
222 "ENABLE_CEROD=" CTIMEOPT_VAL(SQLITE_ENABLE_CEROD),
223 #endif
224 #if SQLITE_ENABLE_COLUMN_METADATA
225 "ENABLE_COLUMN_METADATA",
@@ -534,13 +537,10 @@
534 "OMIT_BETWEEN_OPTIMIZATION",
535 #endif
536 #if SQLITE_OMIT_BLOB_LITERAL
537 "OMIT_BLOB_LITERAL",
538 #endif
539 #if SQLITE_OMIT_BTREECOUNT
540 "OMIT_BTREECOUNT",
541 #endif
542 #if SQLITE_OMIT_CAST
543 "OMIT_CAST",
544 #endif
545 #if SQLITE_OMIT_CHECK
546 "OMIT_CHECK",
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.32.0"
1166 #define SQLITE_VERSION_NUMBER 3032000
1167 #define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0926b"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -1336,30 +1336,26 @@
1336 ** for the [sqlite3] object.
1337 ** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
1338 ** the [sqlite3] object is successfully destroyed and all associated
1339 ** resources are deallocated.
1340 **
 
 
 
 
1341 ** ^If the database connection is associated with unfinalized prepared
1342 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
1343 ** will leave the database connection open and return [SQLITE_BUSY].
1344 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
1345 ** and/or unfinished sqlite3_backups, then the database connection becomes
1346 ** an unusable "zombie" which will automatically be deallocated when the
1347 ** last prepared statement is finalized or the last sqlite3_backup is
1348 ** finished. The sqlite3_close_v2() interface is intended for use with
1349 ** host languages that are garbage collected, and where the order in which
1350 ** destructors are called is arbitrary.
1351 **
1352 ** Applications should [sqlite3_finalize | finalize] all [prepared statements],
1353 ** [sqlite3_blob_close | close] all [BLOB handles], and
1354 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
1355 ** with the [sqlite3] object prior to attempting to close the object. ^If
1356 ** sqlite3_close_v2() is called on a [database connection] that still has
1357 ** outstanding [prepared statements], [BLOB handles], and/or
1358 ** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
1359 ** of resources is deferred until all [prepared statements], [BLOB handles],
1360 ** and [sqlite3_backup] objects are also destroyed.
1361 **
1362 ** ^If an [sqlite3] object is destroyed while a transaction is open,
1363 ** the transaction is automatically rolled back.
1364 **
1365 ** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -1544,10 +1540,11 @@
1544 #define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
1545 #define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
1546 #define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
1547 #define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
1548 #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
 
1549 #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
1550 #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
1551 #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
1552 #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
1553 #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -2150,10 +2147,15 @@
2150 ** a single attached database that occur due to other database connections,
2151 ** but omits changes implemented by the database connection on which it is
2152 ** called. This file control is the only mechanism to detect changes that
2153 ** happen either internally or externally and that are associated with
2154 ** a particular attached database.
 
 
 
 
 
2155 **
2156 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
2157 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
2158 ** in wal mode after the client has finished copying pages from the wal
2159 ** file to the database file, but before the *-shm file is updated to
@@ -2195,10 +2197,11 @@
2195 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
2196 #define SQLITE_FCNTL_DATA_VERSION 35
2197 #define SQLITE_FCNTL_SIZE_LIMIT 36
2198 #define SQLITE_FCNTL_CKPT_DONE 37
2199 #define SQLITE_FCNTL_RESERVE_BYTES 38
 
2200
2201 /* deprecated names */
2202 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
2203 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
2204 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -4573,12 +4576,23 @@
4573 **
4574 ** These are utility routines, useful to [VFS|custom VFS implementations],
4575 ** that check if a database file was a URI that contained a specific query
4576 ** parameter, and if so obtains the value of that query parameter.
4577 **
4578 ** If F is the database filename pointer passed into the xOpen() method of
4579 ** a VFS implementation or it is the return value of [sqlite3_db_filename()]
 
 
 
 
 
 
 
 
 
 
 
4580 ** and if P is the name of the query parameter, then
4581 ** sqlite3_uri_parameter(F,P) returns the value of the P
4582 ** parameter if it exists or a NULL pointer if P does not appear as a
4583 ** query parameter on F. If P is a query parameter of F and it
4584 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -4657,10 +4671,29 @@
4657 */
4658 SQLITE_API const char *sqlite3_filename_database(const char*);
4659 SQLITE_API const char *sqlite3_filename_journal(const char*);
4660 SQLITE_API const char *sqlite3_filename_wal(const char*);
4661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4662 /*
4663 ** CAPI3REF: Create and Destroy VFS Filenames
4664 **
4665 ** These interfces are provided for use by [VFS shim] implementations and
4666 ** are not useful outside of that context.
@@ -4691,11 +4724,11 @@
4691 ** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
4692 ** be NULL pointers, though they can be empty strings.
4693 **
4694 ** The sqlite3_free_filename(Y) routine releases a memory allocation
4695 ** previously obtained from sqlite3_create_filename(). Invoking
4696 ** sqlite3_free_filename(Y) is a NULL pointer is a harmless no-op.
4697 **
4698 ** If the Y parameter to sqlite3_free_filename(Y) is anything other
4699 ** than a NULL pointer or a pointer previously acquired from
4700 ** sqlite3_create_filename(), then bad things such as heap
4701 ** corruption or segfaults may occur. The value Y should be
@@ -15022,13 +15055,11 @@
15022 #ifndef NDEBUG
15023 SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*);
15024 #endif
15025 SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor*);
15026
15027 #ifndef SQLITE_OMIT_BTREECOUNT
15028 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
15029 #endif
15030
15031 #ifdef SQLITE_TEST
15032 SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
15033 SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
15034 #endif
@@ -15599,10 +15630,13 @@
15599
15600 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
15601 SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
15602
15603 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
 
 
 
15604
15605 /* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
15606 ** each VDBE opcode.
15607 **
15608 ** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
@@ -16855,10 +16889,11 @@
16855 Hash aFunc; /* Hash table of connection functions */
16856 Hash aCollSeq; /* All collating sequences */
16857 BusyHandler busyHandler; /* Busy callback */
16858 Db aDbStatic[2]; /* Static space for the 2 default backends */
16859 Savepoint *pSavepoint; /* List of active savepoints */
 
16860 int busyTimeout; /* Busy handler timeout, in msec */
16861 int nSavepoint; /* Number of non-transaction savepoints */
16862 int nStatement; /* Number of nested statement-transactions */
16863 i64 nDeferredCons; /* Net deferred constraints this transaction. */
16864 i64 nDeferredImmCons; /* Net deferred immediate constraints */
@@ -20636,11 +20671,12 @@
20636 /*
20637 ** VDBE_DISPLAY_P4 is true or false depending on whether or not the
20638 ** "explain" P4 display logic is enabled.
20639 */
20640 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
20641 || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
 
20642 # define VDBE_DISPLAY_P4 1
20643 #else
20644 # define VDBE_DISPLAY_P4 0
20645 #endif
20646
@@ -21101,11 +21137,18 @@
21101
21102 int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
21103 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*);
21104 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
21105 SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
21106 #ifndef SQLITE_OMIT_EXPLAIN
 
 
 
 
 
 
 
21107 SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
21108 #endif
21109 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
21110 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
21111 SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
@@ -21143,11 +21186,11 @@
21143 SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
21144 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
21145 #ifndef SQLITE_OMIT_WINDOWFUNC
21146 SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem*, Mem*, FuncDef*);
21147 #endif
21148 #ifndef SQLITE_OMIT_EXPLAIN
21149 SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
21150 #endif
21151 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
21152 SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int n);
21153 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
@@ -27316,11 +27359,11 @@
27316 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
27317 n = mem0.hardLimit;
27318 }
27319 mem0.alarmThreshold = n;
27320 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27321 mem0.nearlyFull = (n>0 && n<=nUsed);
27322 sqlite3_mutex_leave(mem0.mutex);
27323 excess = sqlite3_memory_used() - n;
27324 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
27325 return priorLimit;
27326 }
@@ -27384,11 +27427,11 @@
27384 ** Return true if the heap is currently under memory pressure - in other
27385 ** words if the amount of heap used is close to the limit set by
27386 ** sqlite3_soft_heap_limit().
27387 */
27388 SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
27389 return mem0.nearlyFull;
27390 }
27391
27392 /*
27393 ** Deinitialize the memory allocation subsystem.
27394 */
@@ -27448,21 +27491,21 @@
27448
27449 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, n);
27450 if( mem0.alarmThreshold>0 ){
27451 sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27452 if( nUsed >= mem0.alarmThreshold - nFull ){
27453 mem0.nearlyFull = 1;
27454 sqlite3MallocAlarm(nFull);
27455 if( mem0.hardLimit ){
27456 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27457 if( nUsed >= mem0.hardLimit - nFull ){
27458 *pp = 0;
27459 return;
27460 }
27461 }
27462 }else{
27463 mem0.nearlyFull = 0;
27464 }
27465 }
27466 p = sqlite3GlobalConfig.m.xMalloc(nFull);
27467 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
27468 if( p==0 && mem0.alarmThreshold>0 ){
@@ -54026,13 +54069,16 @@
54026 }
54027 if( exists ){
54028 /* One of the journals pointed to by the master journal exists.
54029 ** Open it and check if it points at the master journal. If
54030 ** so, return without deleting the master journal file.
 
 
 
54031 */
54032 int c;
54033 int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL);
54034 rc = sqlite3OsOpen(pVfs, zJournal, pJournal, flags, 0);
54035 if( rc!=SQLITE_OK ){
54036 goto delmaster_out;
54037 }
54038
@@ -56232,10 +56278,11 @@
56232 ** Pager object (sizeof(Pager) bytes)
56233 ** PCache object (sqlite3PcacheSize() bytes)
56234 ** Database file handle (pVfs->szOsFile bytes)
56235 ** Sub-journal file handle (journalFileSize bytes)
56236 ** Main journal file handle (journalFileSize bytes)
 
56237 ** \0\0\0\0 database prefix (4 bytes)
56238 ** Database file name (nPathname+1 bytes)
56239 ** URI query parameters (nUriByte bytes)
56240 ** Journal filename (nPathname+8+1 bytes)
56241 ** WAL filename (nPathname+4+1 bytes)
@@ -56271,10 +56318,11 @@
56271 pPtr = (u8 *)sqlite3MallocZero(
56272 ROUND8(sizeof(*pPager)) + /* Pager structure */
56273 ROUND8(pcacheSize) + /* PCache object */
56274 ROUND8(pVfs->szOsFile) + /* The main db file */
56275 journalFileSize * 2 + /* The two journal files */
 
56276 4 + /* Database prefix */
56277 nPathname + 1 + /* database filename */
56278 nUriByte + /* query parameters */
56279 nPathname + 8 + 1 + /* Journal filename */
56280 #ifndef SQLITE_OMIT_WAL
@@ -56291,10 +56339,11 @@
56291 pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
56292 pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
56293 pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
56294 pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
56295 assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
 
56296
56297 /* Fill in the Pager.zFilename and pPager.zQueryParam fields */
56298 pPtr += 4; /* Skip zero prefix */
56299 pPager->zFilename = (char*)pPtr;
56300 if( nPathname>0 ){
@@ -56491,10 +56540,23 @@
56491
56492 *ppPager = pPager;
56493 return SQLITE_OK;
56494 }
56495
 
 
 
 
 
 
 
 
 
 
 
 
 
56496
56497
56498 /*
56499 ** This function is called after transitioning from PAGER_UNLOCK to
56500 ** PAGER_SHARED state. It tests if there is a hot journal present in
@@ -61023,10 +61085,11 @@
61023 ** about the eventual size of the db file to the VFS layer.
61024 */
61025 if( rc==SQLITE_OK ){
61026 i64 nReq = ((i64)mxPage * szPage);
61027 i64 nSize; /* Current size of database file */
 
61028 rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
61029 if( rc==SQLITE_OK && nSize<nReq ){
61030 sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
61031 }
61032 }
@@ -61050,10 +61113,11 @@
61050 iOffset = (iDbpage-1)*(i64)szPage;
61051 testcase( IS_BIG_INT(iOffset) );
61052 rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);
61053 if( rc!=SQLITE_OK ) break;
61054 }
 
61055
61056 /* If work was actually accomplished... */
61057 if( rc==SQLITE_OK ){
61058 if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
61059 i64 szDb = pWal->hdr.nPage*(i64)szPage;
@@ -61061,14 +61125,10 @@
61061 rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
61062 if( rc==SQLITE_OK ){
61063 rc = sqlite3OsSync(pWal->pDbFd, CKPT_SYNC_FLAGS(sync_flags));
61064 }
61065 }
61066 if( rc==SQLITE_OK ){
61067 rc = sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0);
61068 if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
61069 }
61070 if( rc==SQLITE_OK ){
61071 pInfo->nBackfill = mxSafeFrame;
61072 }
61073 }
61074
@@ -66965,10 +67025,14 @@
66965
66966 /*
66967 ** Return the number of bytes of space at the end of every page that
66968 ** are intentually left unused. This is the "reserved" space that is
66969 ** sometimes used by extensions.
 
 
 
 
66970 */
66971 SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){
66972 int n;
66973 sqlite3BtreeEnter(p);
66974 n = ((int)p->pBt->nReserveWanted) - 1;
@@ -73560,11 +73624,10 @@
73560 }
73561 sqlite3BtreeLeave(p);
73562 return rc;
73563 }
73564
73565 #ifndef SQLITE_OMIT_BTREECOUNT
73566 /*
73567 ** The first argument, pCur, is a cursor opened on some b-tree. Count the
73568 ** number of entries in the b-tree and write the result to *pnEntry.
73569 **
73570 ** SQLITE_OK is returned if the operation is successfully executed.
@@ -73633,11 +73696,10 @@
73633 }
73634
73635 /* An error has occurred. Return an error code. */
73636 return rc;
73637 }
73638 #endif
73639
73640 /*
73641 ** Return the pager associated with a BTree. This routine is used for
73642 ** testing and debugging only.
73643 */
@@ -78709,24 +78771,23 @@
78709 ** "PX" -> "r[X]"
78710 ** "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1
78711 ** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0
78712 ** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x
78713 */
78714 static int displayComment(
 
78715 const Op *pOp, /* The opcode to be commented */
78716 const char *zP4, /* Previously obtained value for P4 */
78717 char *zTemp, /* Write result here */
78718 int nTemp /* Space available in zTemp[] */
78719 ){
78720 const char *zOpName;
78721 const char *zSynopsis;
78722 int nOpName;
78723 int ii;
78724 char zAlt[50];
78725 StrAccum x;
78726 sqlite3StrAccumInit(&x, 0, zTemp, nTemp, 0);
78727
 
78728 zOpName = sqlite3OpcodeName(pOp->opcode);
78729 nOpName = sqlite3Strlen30(zOpName);
78730 if( zOpName[nOpName+1] ){
78731 int seenCom = 0;
78732 char c;
@@ -78789,14 +78850,16 @@
78789 sqlite3_str_appendf(&x, "; %s", pOp->zComment);
78790 }
78791 }else if( pOp->zComment ){
78792 sqlite3_str_appendall(&x, pOp->zComment);
78793 }
78794 sqlite3StrAccumFinish(&x);
78795 return x.nChar;
 
 
78796 }
78797 #endif /* SQLITE_DEBUG */
78798
78799 #if VDBE_DISPLAY_P4 && defined(SQLITE_ENABLE_CURSOR_HINTS)
78800 /*
78801 ** Translate the P4.pExpr value for an OP_CursorHint opcode into text
78802 ** that can be displayed in the P4 column of EXPLAIN output.
@@ -78873,15 +78936,15 @@
78873 #if VDBE_DISPLAY_P4
78874 /*
78875 ** Compute a string that describes the P4 parameter for an opcode.
78876 ** Use zTemp for any required temporary buffer space.
78877 */
78878 static char *displayP4(Op *pOp, char *zTemp, int nTemp){
78879 char *zP4 = zTemp;
78880 StrAccum x;
78881 assert( nTemp>=20 );
78882 sqlite3StrAccumInit(&x, 0, zTemp, nTemp, 0);
78883 switch( pOp->p4type ){
78884 case P4_KEYINFO: {
78885 int j;
78886 KeyInfo *pKeyInfo = pOp->p4.pKeyInfo;
78887 assert( pKeyInfo->aSortFlags!=0 );
@@ -78961,40 +79024,36 @@
78961 int i;
78962 int *ai = pOp->p4.ai;
78963 int n = ai[0]; /* The first element of an INTARRAY is always the
78964 ** count of the number of elements to follow */
78965 for(i=1; i<=n; i++){
78966 sqlite3_str_appendf(&x, ",%d", ai[i]);
78967 }
78968 zTemp[0] = '[';
78969 sqlite3_str_append(&x, "]", 1);
78970 break;
78971 }
78972 case P4_SUBPROGRAM: {
78973 sqlite3_str_appendf(&x, "program");
78974 break;
78975 }
78976 case P4_DYNBLOB:
78977 case P4_ADVANCE: {
78978 zTemp[0] = 0;
78979 break;
78980 }
78981 case P4_TABLE: {
78982 sqlite3_str_appendf(&x, "%s", pOp->p4.pTab->zName);
78983 break;
78984 }
78985 default: {
78986 zP4 = pOp->p4.z;
78987 if( zP4==0 ){
78988 zP4 = zTemp;
78989 zTemp[0] = 0;
78990 }
78991 }
78992 }
78993 sqlite3StrAccumFinish(&x);
78994 assert( zP4!=0 );
78995 return zP4;
 
 
78996 }
78997 #endif /* VDBE_DISPLAY_P4 */
78998
78999 /*
79000 ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
@@ -79080,28 +79139,32 @@
79080 /*
79081 ** Print a single opcode. This routine is used for debugging only.
79082 */
79083 SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, VdbeOp *pOp){
79084 char *zP4;
79085 char zPtr[50];
79086 char zCom[100];
79087 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
79088 if( pOut==0 ) pOut = stdout;
79089 zP4 = displayP4(pOp, zPtr, sizeof(zPtr));
 
79090 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79091 displayComment(pOp, zP4, zCom, sizeof(zCom));
79092 #else
79093 zCom[0] = 0;
79094 #endif
79095 /* NB: The sqlite3OpcodeName() function is implemented by code created
79096 ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the
79097 ** information from the vdbe.c source text */
79098 fprintf(pOut, zFormat1, pc,
79099 sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5,
79100 zCom
 
79101 );
79102 fflush(pOut);
 
 
79103 }
79104 #endif
79105
79106 /*
79107 ** Initialize an array of N Mem element.
@@ -79188,10 +79251,125 @@
79188 assert( sqlite3VdbeFrameIsValid(pFrame) );
79189 pFrame->pParent = pFrame->v->pDelFrame;
79190 pFrame->v->pDelFrame = pFrame;
79191 }
79192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79193
79194 /*
79195 ** Delete a VdbeFrame object and its contents. VdbeFrame objects are
79196 ** allocated by the OP_Program opcode in sqlite3VdbeExec().
79197 */
@@ -79228,20 +79406,18 @@
79228 ** the trigger subprograms are listed one by one.
79229 */
79230 SQLITE_PRIVATE int sqlite3VdbeList(
79231 Vdbe *p /* The VDBE */
79232 ){
79233 int nRow; /* Stop when row count reaches this */
79234 int nSub = 0; /* Number of sub-vdbes seen so far */
79235 SubProgram **apSub = 0; /* Array of sub-vdbes */
79236 Mem *pSub = 0; /* Memory cell hold array of subprogs */
79237 sqlite3 *db = p->db; /* The database connection */
79238 int i; /* Loop counter */
79239 int rc = SQLITE_OK; /* Return code */
79240 Mem *pMem = &p->aMem[1]; /* First Mem of result set */
79241 int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0);
79242 Op *pOp = 0;
 
79243
79244 assert( p->explain );
79245 assert( p->magic==VDBE_MAGIC_RUN );
79246 assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM );
79247
@@ -79257,166 +79433,66 @@
79257 ** sqlite3_column_text16() failed. */
79258 sqlite3OomFault(db);
79259 return SQLITE_ERROR;
79260 }
79261
79262 /* When the number of output rows reaches nRow, that means the
79263 ** listing has finished and sqlite3_step() should return SQLITE_DONE.
79264 ** nRow is the sum of the number of rows in the main program, plus
79265 ** the sum of the number of rows in all trigger subprograms encountered
79266 ** so far. The nRow value will increase as new trigger subprograms are
79267 ** encountered, but p->pc will eventually catch up to nRow.
79268 */
79269 nRow = p->nOp;
79270 if( bListSubprogs ){
79271 /* The first 8 memory cells are used for the result set. So we will
79272 ** commandeer the 9th cell to use as storage for an array of pointers
79273 ** to trigger subprograms. The VDBE is guaranteed to have at least 9
79274 ** cells. */
79275 assert( p->nMem>9 );
79276 pSub = &p->aMem[9];
79277 if( pSub->flags&MEM_Blob ){
79278 /* On the first call to sqlite3_step(), pSub will hold a NULL. It is
79279 ** initialized to a BLOB by the P4_SUBPROGRAM processing logic below */
79280 nSub = pSub->n/sizeof(Vdbe*);
79281 apSub = (SubProgram **)pSub->z;
79282 }
79283 for(i=0; i<nSub; i++){
79284 nRow += apSub[i]->nOp;
79285 }
79286 }
79287
79288 while(1){ /* Loop exits via break */
79289 i = p->pc++;
79290 if( i>=nRow ){
79291 p->rc = SQLITE_OK;
79292 rc = SQLITE_DONE;
79293 break;
79294 }
79295 if( i<p->nOp ){
79296 /* The output line number is small enough that we are still in the
79297 ** main program. */
79298 pOp = &p->aOp[i];
79299 }else{
79300 /* We are currently listing subprograms. Figure out which one and
79301 ** pick up the appropriate opcode. */
79302 int j;
79303 i -= p->nOp;
79304 assert( apSub!=0 );
79305 assert( nSub>0 );
79306 for(j=0; i>=apSub[j]->nOp; j++){
79307 i -= apSub[j]->nOp;
79308 assert( i<apSub[j]->nOp || j+1<nSub );
79309 }
79310 pOp = &apSub[j]->aOp[i];
79311 }
79312
79313 /* When an OP_Program opcode is encounter (the only opcode that has
79314 ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms
79315 ** kept in p->aMem[9].z to hold the new program - assuming this subprogram
79316 ** has not already been seen.
79317 */
79318 if( bListSubprogs && pOp->p4type==P4_SUBPROGRAM ){
79319 int nByte = (nSub+1)*sizeof(SubProgram*);
79320 int j;
79321 for(j=0; j<nSub; j++){
79322 if( apSub[j]==pOp->p4.pProgram ) break;
79323 }
79324 if( j==nSub ){
79325 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
79326 if( p->rc!=SQLITE_OK ){
79327 rc = SQLITE_ERROR;
79328 break;
79329 }
79330 apSub = (SubProgram **)pSub->z;
79331 apSub[nSub++] = pOp->p4.pProgram;
79332 pSub->flags |= MEM_Blob;
79333 pSub->n = nSub*sizeof(SubProgram*);
79334 nRow += pOp->p4.pProgram->nOp;
79335 }
79336 }
79337 if( p->explain<2 ) break;
79338 if( pOp->opcode==OP_Explain ) break;
79339 if( pOp->opcode==OP_Init && p->pc>1 ) break;
79340 }
79341
79342 if( rc==SQLITE_OK ){
79343 if( AtomicLoad(&db->u1.isInterrupted) ){
79344 p->rc = SQLITE_INTERRUPT;
79345 rc = SQLITE_ERROR;
79346 sqlite3VdbeError(p, sqlite3ErrStr(p->rc));
79347 }else{
79348 char *zP4;
79349 if( p->explain==1 ){
79350 pMem->flags = MEM_Int;
79351 pMem->u.i = i; /* Program counter */
79352 pMem++;
79353
79354 pMem->flags = MEM_Static|MEM_Str|MEM_Term;
79355 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
79356 assert( pMem->z!=0 );
79357 pMem->n = sqlite3Strlen30(pMem->z);
79358 pMem->enc = SQLITE_UTF8;
79359 pMem++;
79360 }
79361
79362 pMem->flags = MEM_Int;
79363 pMem->u.i = pOp->p1; /* P1 */
79364 pMem++;
79365
79366 pMem->flags = MEM_Int;
79367 pMem->u.i = pOp->p2; /* P2 */
79368 pMem++;
79369
79370 pMem->flags = MEM_Int;
79371 pMem->u.i = pOp->p3; /* P3 */
79372 pMem++;
79373
79374 if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */
79375 assert( p->db->mallocFailed );
79376 return SQLITE_ERROR;
79377 }
79378 pMem->flags = MEM_Str|MEM_Term;
79379 zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
79380 if( zP4!=pMem->z ){
79381 pMem->n = 0;
79382 sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
79383 }else{
79384 assert( pMem->z!=0 );
79385 pMem->n = sqlite3Strlen30(pMem->z);
79386 pMem->enc = SQLITE_UTF8;
79387 }
79388 pMem++;
79389
79390 if( p->explain==1 ){
79391 if( sqlite3VdbeMemClearAndResize(pMem, 4) ){
79392 assert( p->db->mallocFailed );
79393 return SQLITE_ERROR;
79394 }
79395 pMem->flags = MEM_Str|MEM_Term;
79396 pMem->n = 2;
79397 sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
79398 pMem->enc = SQLITE_UTF8;
79399 pMem++;
79400
79401 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79402 if( sqlite3VdbeMemClearAndResize(pMem, 500) ){
79403 assert( p->db->mallocFailed );
79404 return SQLITE_ERROR;
79405 }
79406 pMem->flags = MEM_Str|MEM_Term;
79407 pMem->n = displayComment(pOp, zP4, pMem->z, 500);
79408 pMem->enc = SQLITE_UTF8;
79409 #else
79410 pMem->flags = MEM_Null; /* Comment */
79411 #endif
79412 }
79413
79414 p->nResColumn = 8 - 4*(p->explain-1);
79415 p->pResultSet = &p->aMem[1];
79416 p->rc = SQLITE_OK;
79417 rc = SQLITE_ROW;
 
 
79418 }
79419 }
79420 return rc;
79421 }
79422 #endif /* SQLITE_OMIT_EXPLAIN */
@@ -79982,12 +80058,13 @@
79982 int retryCount = 0;
79983 int nMainFile;
79984
79985 /* Select a master journal file name */
79986 nMainFile = sqlite3Strlen30(zMainFile);
79987 zMaster = sqlite3MPrintf(db, "%s-mjXXXXXX9XXz%c%c", zMainFile, 0, 0);
79988 if( zMaster==0 ) return SQLITE_NOMEM_BKPT;
 
79989 do {
79990 u32 iRandom;
79991 if( retryCount ){
79992 if( retryCount>100 ){
79993 sqlite3_log(SQLITE_FULL, "MJ delete: %s", zMaster);
@@ -80013,11 +80090,11 @@
80013 SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|
80014 SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_MASTER_JOURNAL, 0
80015 );
80016 }
80017 if( rc!=SQLITE_OK ){
80018 sqlite3DbFree(db, zMaster);
80019 return rc;
80020 }
80021
80022 /* Write the name of each database file in the transaction into the new
80023 ** master journal file. If an error occurs at this point close
@@ -80036,11 +80113,11 @@
80036 rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset);
80037 offset += sqlite3Strlen30(zFile)+1;
80038 if( rc!=SQLITE_OK ){
80039 sqlite3OsCloseFree(pMaster);
80040 sqlite3OsDelete(pVfs, zMaster, 0);
80041 sqlite3DbFree(db, zMaster);
80042 return rc;
80043 }
80044 }
80045 }
80046
@@ -80050,11 +80127,11 @@
80050 if( 0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL)
80051 && SQLITE_OK!=(rc = sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL))
80052 ){
80053 sqlite3OsCloseFree(pMaster);
80054 sqlite3OsDelete(pVfs, zMaster, 0);
80055 sqlite3DbFree(db, zMaster);
80056 return rc;
80057 }
80058
80059 /* Sync all the db files involved in the transaction. The same call
80060 ** sets the master journal pointer in each individual journal. If
@@ -80073,20 +80150,20 @@
80073 }
80074 }
80075 sqlite3OsCloseFree(pMaster);
80076 assert( rc!=SQLITE_BUSY );
80077 if( rc!=SQLITE_OK ){
80078 sqlite3DbFree(db, zMaster);
80079 return rc;
80080 }
80081
80082 /* Delete the master journal file. This commits the transaction. After
80083 ** doing this the directory is synced again before any individual
80084 ** transaction files are deleted.
80085 */
80086 rc = sqlite3OsDelete(pVfs, zMaster, 1);
80087 sqlite3DbFree(db, zMaster);
80088 zMaster = 0;
80089 if( rc ){
80090 return rc;
80091 }
80092
@@ -87998,32 +88075,38 @@
87998 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
87999 REGISTER_TRACE(pOp->p3, pOut);
88000 break;
88001 }
88002
88003 /* Opcode: Count P1 P2 * * *
88004 ** Synopsis: r[P2]=count()
88005 **
88006 ** Store the number of entries (an integer value) in the table or index
88007 ** opened by cursor P1 in register P2
 
 
 
 
88008 */
88009 #ifndef SQLITE_OMIT_BTREECOUNT
88010 case OP_Count: { /* out2 */
88011 i64 nEntry;
88012 BtCursor *pCrsr;
88013
88014 assert( p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE );
88015 pCrsr = p->apCsr[pOp->p1]->uc.pCursor;
88016 assert( pCrsr );
88017 nEntry = 0; /* Not needed. Only used to silence a warning. */
88018 rc = sqlite3BtreeCount(db, pCrsr, &nEntry);
88019 if( rc ) goto abort_due_to_error;
 
 
 
 
88020 pOut = out2Prerelease(p, pOp);
88021 pOut->u.i = nEntry;
88022 goto check_for_interrupt;
88023 }
88024 #endif
88025
88026 /* Opcode: Savepoint P1 * * P4 *
88027 **
88028 ** Open, release or rollback the savepoint named by parameter P4, depending
88029 ** on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN).
@@ -96093,10 +96176,435 @@
96093 *pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
96094 return SQLITE_OK;
96095 }
96096
96097 /************** End of vdbesort.c ********************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96098 /************** Begin file memjournal.c **************************************/
96099 /*
96100 ** 2008 October 7
96101 **
96102 ** The author disclaims copyright to this source code. In place of
@@ -98739,11 +99247,11 @@
98739 ** SELECT * FROM t1 WHERE (select a from t1);
98740 */
98741 SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){
98742 int op;
98743 while( ExprHasProperty(pExpr, EP_Skip) ){
98744 assert( pExpr->op==TK_COLLATE );
98745 pExpr = pExpr->pLeft;
98746 assert( pExpr!=0 );
98747 }
98748 op = pExpr->op;
98749 if( op==TK_SELECT ){
@@ -98806,11 +99314,11 @@
98806 /*
98807 ** Skip over any TK_COLLATE operators.
98808 */
98809 SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
98810 while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
98811 assert( pExpr->op==TK_COLLATE );
98812 pExpr = pExpr->pLeft;
98813 }
98814 return pExpr;
98815 }
98816
@@ -98825,11 +99333,11 @@
98825 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
98826 assert( pExpr->x.pList->nExpr>0 );
98827 assert( pExpr->op==TK_FUNCTION );
98828 pExpr = pExpr->x.pList->a[0].pExpr;
98829 }else{
98830 assert( pExpr->op==TK_COLLATE );
98831 pExpr = pExpr->pLeft;
98832 }
98833 }
98834 return pExpr;
98835 }
@@ -106605,10 +107113,15 @@
106605 sqlite3 *db = pParse->db;
106606 Db *pDb;
106607 Vdbe *v = sqlite3GetVdbe(pParse);
106608 int aRoot[ArraySize(aTable)];
106609 u8 aCreateTbl[ArraySize(aTable)];
 
 
 
 
 
106610
106611 if( v==0 ) return;
106612 assert( sqlite3BtreeHoldsAllMutexes(db) );
106613 assert( sqlite3VdbeDb(v)==db );
106614 pDb = &db->aDb[iDb];
@@ -106617,12 +107130,13 @@
106617 ** if they do already exist.
106618 */
106619 for(i=0; i<ArraySize(aTable); i++){
106620 const char *zTab = aTable[i].zName;
106621 Table *pStat;
 
106622 if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){
106623 if( aTable[i].zCols ){
106624 /* The sqlite_statN table does not exist. Create it. Note that a
106625 ** side-effect of the CREATE TABLE statement is to leave the rootpage
106626 ** of the new table in register pParse->regRoot. This is important
106627 ** because the OpenWrite opcode below will be needing it. */
106628 sqlite3NestedParse(pParse,
@@ -106634,11 +107148,10 @@
106634 }else{
106635 /* The table already exists. If zWhere is not NULL, delete all entries
106636 ** associated with the table zWhere. If zWhere is NULL, delete the
106637 ** entire contents of the table. */
106638 aRoot[i] = pStat->tnum;
106639 aCreateTbl[i] = 0;
106640 sqlite3TableLock(pParse, iDb, aRoot[i], 1, zTab);
106641 if( zWhere ){
106642 sqlite3NestedParse(pParse,
106643 "DELETE FROM %Q.%s WHERE %s=%Q",
106644 pDb->zDbSName, zTab, zWhereType, zWhere
@@ -106653,11 +107166,11 @@
106653 }
106654 }
106655 }
106656
106657 /* Open the sqlite_stat[134] tables for writing. */
106658 for(i=0; aTable[i].zCols; i++){
106659 assert( i<ArraySize(aTable) );
106660 sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3);
106661 sqlite3VdbeChangeP5(v, aCreateTbl[i]);
106662 VdbeComment((v, aTable[i].zName));
106663 }
@@ -106692,13 +107205,16 @@
106692 u32 iHash; /* Tiebreaker hash */
106693 #endif
106694 };
106695 struct StatAccum {
106696 sqlite3 *db; /* Database connection, for malloc() */
106697 tRowcnt nRow; /* Number of rows in the entire table */
 
 
106698 int nCol; /* Number of columns in index + pk/rowid */
106699 int nKeyCol; /* Number of index columns w/o the pk/rowid */
 
106700 StatSample current; /* Current row as a StatSample */
106701 #ifdef SQLITE_ENABLE_STAT4
106702 tRowcnt nPSample; /* How often to do a periodic sample */
106703 int mxSample; /* Maximum number of samples to accumulate */
106704 u32 iPrn; /* Pseudo-random number used for sampling */
@@ -106774,31 +107290,32 @@
106774 ** Reclaim all memory of a StatAccum structure.
106775 */
106776 static void statAccumDestructor(void *pOld){
106777 StatAccum *p = (StatAccum*)pOld;
106778 #ifdef SQLITE_ENABLE_STAT4
106779 int i;
106780 for(i=0; i<p->nCol; i++) sampleClear(p->db, p->aBest+i);
106781 for(i=0; i<p->mxSample; i++) sampleClear(p->db, p->a+i);
106782 sampleClear(p->db, &p->current);
 
 
106783 #endif
106784 sqlite3DbFree(p->db, p);
106785 }
106786
106787 /*
106788 ** Implementation of the stat_init(N,K,C) SQL function. The three parameters
106789 ** are:
106790 ** N: The number of columns in the index including the rowid/pk (note 1)
106791 ** K: The number of columns in the index excluding the rowid/pk.
106792 ** C: The number of rows in the index (note 2)
 
106793 **
106794 ** Note 1: In the special case of the covering index that implements a
106795 ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
106796 ** total number of columns in the table.
106797 **
106798 ** Note 2: C is only used for STAT4.
106799 **
106800 ** For indexes on ordinary rowid tables, N==K+1. But for indexes on
106801 ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
106802 ** PRIMARY KEY of the table. The covering index that implements the
106803 ** original WITHOUT ROWID table as N==K as a special case.
106804 **
@@ -106815,13 +107332,14 @@
106815 StatAccum *p;
106816 int nCol; /* Number of columns in index being sampled */
106817 int nKeyCol; /* Number of key columns */
106818 int nColUp; /* nCol rounded up for alignment */
106819 int n; /* Bytes of space to allocate */
106820 sqlite3 *db; /* Database connection */
106821 #ifdef SQLITE_ENABLE_STAT4
106822 int mxSample = SQLITE_STAT4_SAMPLES;
 
106823 #endif
106824
106825 /* Decode the three function arguments */
106826 UNUSED_PARAMETER(argc);
106827 nCol = sqlite3_value_int(argv[0]);
@@ -106832,39 +107350,43 @@
106832 assert( nKeyCol>0 );
106833
106834 /* Allocate the space required for the StatAccum object */
106835 n = sizeof(*p)
106836 + sizeof(tRowcnt)*nColUp /* StatAccum.anEq */
106837 + sizeof(tRowcnt)*nColUp /* StatAccum.anDLt */
106838 #ifdef SQLITE_ENABLE_STAT4
106839 + sizeof(tRowcnt)*nColUp /* StatAccum.anLt */
106840 + sizeof(StatSample)*(nCol+mxSample) /* StatAccum.aBest[], a[] */
106841 + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample)
 
 
106842 #endif
106843 ;
106844 db = sqlite3_context_db_handle(context);
106845 p = sqlite3DbMallocZero(db, n);
106846 if( p==0 ){
106847 sqlite3_result_error_nomem(context);
106848 return;
106849 }
106850
106851 p->db = db;
 
106852 p->nRow = 0;
 
106853 p->nCol = nCol;
106854 p->nKeyCol = nKeyCol;
 
106855 p->current.anDLt = (tRowcnt*)&p[1];
106856 p->current.anEq = &p->current.anDLt[nColUp];
106857
106858 #ifdef SQLITE_ENABLE_STAT4
106859 {
 
106860 u8 *pSpace; /* Allocated space not yet assigned */
106861 int i; /* Used to iterate through p->aSample[] */
106862
106863 p->iGet = -1;
106864 p->mxSample = mxSample;
106865 p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1);
106866 p->current.anLt = &p->current.anEq[nColUp];
106867 p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
106868
106869 /* Set up the StatAccum.a[] and aBest[] arrays */
106870 p->a = (struct StatSample*)&p->current.anLt[nColUp];
@@ -106888,11 +107410,11 @@
106888 ** (given by the 3rd parameter) is never used and can be any positive
106889 ** value. */
106890 sqlite3_result_blob(context, p, sizeof(*p), statAccumDestructor);
106891 }
106892 static const FuncDef statInitFuncdef = {
106893 2+IsStat4, /* nArg */
106894 SQLITE_UTF8, /* funcFlags */
106895 0, /* pUserData */
106896 0, /* pNext */
106897 statInit, /* xSFunc */
106898 0, /* xFinalize */
@@ -107092,14 +107614,17 @@
107092 ** P Pointer to the StatAccum object created by stat_init()
107093 ** C Index of left-most column to differ from previous row
107094 ** R Rowid for the current row. Might be a key record for
107095 ** WITHOUT ROWID tables.
107096 **
107097 ** This SQL function always returns NULL. It's purpose it to accumulate
107098 ** statistical data and/or samples in the StatAccum object about the
107099 ** index being analyzed. The stat_get() SQL function will later be used to
107100 ** extract relevant information for constructing the sqlite_statN tables.
 
 
 
107101 **
107102 ** The R parameter is only used for STAT4
107103 */
107104 static void statPush(
107105 sqlite3_context *context,
@@ -107121,11 +107646,11 @@
107121 /* This is the first call to this function. Do initialization. */
107122 for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1;
107123 }else{
107124 /* Second and subsequent calls get processed here */
107125 #ifdef SQLITE_ENABLE_STAT4
107126 samplePushPrevious(p, iChng);
107127 #endif
107128
107129 /* Update anDLt[], anLt[] and anEq[] to reflect the values that apply
107130 ** to the current row of the index. */
107131 for(i=0; i<iChng; i++){
@@ -107132,30 +107657,29 @@
107132 p->current.anEq[i]++;
107133 }
107134 for(i=iChng; i<p->nCol; i++){
107135 p->current.anDLt[i]++;
107136 #ifdef SQLITE_ENABLE_STAT4
107137 p->current.anLt[i] += p->current.anEq[i];
107138 #endif
107139 p->current.anEq[i] = 1;
107140 }
107141 }
 
107142 p->nRow++;
107143 #ifdef SQLITE_ENABLE_STAT4
107144 if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
107145 sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
107146 }else{
107147 sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]),
107148 sqlite3_value_blob(argv[2]));
107149 }
107150 p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345;
107151 #endif
107152
107153 #ifdef SQLITE_ENABLE_STAT4
107154 {
107155 tRowcnt nLt = p->current.anLt[p->nCol-1];
107156
107157 /* Check if this is to be a periodic sample. If so, add it. */
107158 if( (nLt/p->nPSample)!=(nLt+1)/p->nPSample ){
107159 p->current.isPSample = 1;
107160 p->current.iCol = 0;
107161 sampleInsert(p, &p->current, p->nCol-1);
@@ -107167,13 +107691,18 @@
107167 p->current.iCol = i;
107168 if( i>=iChng || sampleIsBetterPost(p, &p->current, &p->aBest[i]) ){
107169 sampleCopy(p, &p->aBest[i], &p->current);
107170 }
107171 }
 
 
 
 
 
107172 }
107173 #endif
107174 }
 
107175 static const FuncDef statPushFuncdef = {
107176 2+IsStat4, /* nArg */
107177 SQLITE_UTF8, /* funcFlags */
107178 0, /* pUserData */
107179 0, /* pNext */
@@ -107221,10 +107750,11 @@
107221 assert( argc==2 );
107222 assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ
107223 || eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT
107224 || eCall==STAT_GET_NDLT
107225 );
 
107226 if( eCall==STAT_GET_STAT1 )
107227 #else
107228 assert( argc==1 );
107229 #endif
107230 {
@@ -107256,11 +107786,12 @@
107256 if( zRet==0 ){
107257 sqlite3_result_error_nomem(context);
107258 return;
107259 }
107260
107261 sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow);
 
107262 z = zRet + sqlite3Strlen30(zRet);
107263 for(i=0; i<p->nKeyCol; i++){
107264 u64 nDistinct = p->current.anDLt[i] + 1;
107265 u64 iVal = (p->nRow + nDistinct - 1) / nDistinct;
107266 sqlite3_snprintf(24, z, " %llu", iVal);
@@ -107332,20 +107863,20 @@
107332 0, 0, /* xValue, xInverse */
107333 "stat_get", /* zName */
107334 {0}
107335 };
107336
107337 static void callStatGet(Parse *pParse, int regStat4, int iParam, int regOut){
107338 #ifdef SQLITE_ENABLE_STAT4
107339 sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat4+1);
107340 #elif SQLITE_DEBUG
107341 assert( iParam==STAT_GET_STAT1 );
107342 #else
107343 UNUSED_PARAMETER( iParam );
107344 #endif
107345 assert( regOut!=regStat4 && regOut!=regStat4+1 );
107346 sqlite3VdbeAddFunctionCall(pParse, 0, regStat4, regOut, 1+IsStat4,
107347 &statGetFuncdef, 0);
107348 }
107349
107350 /*
107351 ** Generate code to do an analysis of all indices associated with
@@ -107367,16 +107898,15 @@
107367 int i; /* Loop counter */
107368 int jZeroRows = -1; /* Jump from here if number of rows is zero */
107369 int iDb; /* Index of database containing pTab */
107370 u8 needTableCnt = 1; /* True to count the table */
107371 int regNewRowid = iMem++; /* Rowid for the inserted record */
107372 int regStat4 = iMem++; /* Register to hold StatAccum object */
107373 int regChng = iMem++; /* Index of changed index field */
107374 #ifdef SQLITE_ENABLE_STAT4
107375 int regRowid = iMem++; /* Rowid argument passed to stat_push() */
107376 #endif
107377 int regTemp = iMem++; /* Temporary use register */
 
107378 int regTabname = iMem++; /* Register containing table name */
107379 int regIdxname = iMem++; /* Register containing index name */
107380 int regStat1 = iMem++; /* Value for the stat column of sqlite_stat1 */
107381 int regPrev = iMem; /* MUST BE LAST (see below) */
107382 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107500,21 +108030,30 @@
107500 /* Invoke the stat_init() function. The arguments are:
107501 **
107502 ** (1) the number of columns in the index including the rowid
107503 ** (or for a WITHOUT ROWID table, the number of PK columns),
107504 ** (2) the number of columns in the key without the rowid/pk
107505 ** (3) the number of rows in the index,
107506 **
107507 **
107508 ** The third argument is only used for STAT4
107509 */
 
 
 
107510 #ifdef SQLITE_ENABLE_STAT4
107511 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3);
 
 
 
 
107512 #endif
107513 sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1);
107514 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2);
107515 sqlite3VdbeAddFunctionCall(pParse, 0, regStat4+1, regStat4, 2+IsStat4,
 
 
 
 
 
107516 &statInitFuncdef, 0);
107517
107518 /* Implementation of the following:
107519 **
107520 ** Rewind csr
@@ -107521,12 +108060,10 @@
107521 ** if eof(csr) goto end_of_scan;
107522 ** regChng = 0
107523 ** goto next_push_0;
107524 **
107525 */
107526 addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
107527 VdbeCoverage(v);
107528 sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng);
107529 addrNextRow = sqlite3VdbeCurrentAddr(v);
107530
107531 if( nColTest>0 ){
107532 int endDistinctTest = sqlite3VdbeMakeLabel(pParse);
@@ -107555,10 +108092,11 @@
107555 }
107556 for(i=0; i<nColTest; i++){
107557 char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
107558 sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
107559 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
 
107560 aGotoChng[i] =
107561 sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
107562 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
107563 VdbeCoverage(v);
107564 }
@@ -107575,10 +108113,11 @@
107575 */
107576 sqlite3VdbeJumpHere(v, addrNextRow-1);
107577 for(i=0; i<nColTest; i++){
107578 sqlite3VdbeJumpHere(v, aGotoChng[i]);
107579 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
 
107580 }
107581 sqlite3VdbeResolveLabel(v, endDistinctTest);
107582 sqlite3DbFree(db, aGotoChng);
107583 }
107584
@@ -107588,34 +108127,50 @@
107588 ** stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
107589 ** Next csr
107590 ** if !eof(csr) goto next_row;
107591 */
107592 #ifdef SQLITE_ENABLE_STAT4
107593 assert( regRowid==(regStat4+2) );
107594 if( HasRowid(pTab) ){
107595 sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
107596 }else{
107597 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
107598 int j, k, regKey;
107599 regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
107600 for(j=0; j<pPk->nKeyCol; j++){
107601 k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
107602 assert( k>=0 && k<pIdx->nColumn );
107603 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
107604 VdbeComment((v, "%s", pTab->aCol[pPk->aiColumn[j]].zName));
107605 }
107606 sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
107607 sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
 
 
107608 }
107609 #endif
107610 assert( regChng==(regStat4+1) );
107611 sqlite3VdbeAddFunctionCall(pParse, 1, regStat4, regTemp, 2+IsStat4,
107612 &statPushFuncdef, 0);
107613 sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107614
107615 /* Add the entry to the stat1 table. */
107616 callStatGet(pParse, regStat4, STAT_GET_STAT1, regStat1);
107617 assert( "BBB"[0]==SQLITE_AFF_TEXT );
107618 sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0);
107619 sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
107620 sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
107621 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107623,11 +108178,11 @@
107623 #endif
107624 sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
107625
107626 /* Add the entries to the stat4 table. */
107627 #ifdef SQLITE_ENABLE_STAT4
107628 {
107629 int regEq = regStat1;
107630 int regLt = regStat1+1;
107631 int regDLt = regStat1+2;
107632 int regSample = regStat1+3;
107633 int regCol = regStat1+4;
@@ -107637,16 +108192,16 @@
107637 u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
107638
107639 pParse->nMem = MAX(pParse->nMem, regCol+nCol);
107640
107641 addrNext = sqlite3VdbeCurrentAddr(v);
107642 callStatGet(pParse, regStat4, STAT_GET_ROWID, regSampleRowid);
107643 addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid);
107644 VdbeCoverage(v);
107645 callStatGet(pParse, regStat4, STAT_GET_NEQ, regEq);
107646 callStatGet(pParse, regStat4, STAT_GET_NLT, regLt);
107647 callStatGet(pParse, regStat4, STAT_GET_NDLT, regDLt);
107648 sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
107649 VdbeCoverage(v);
107650 for(i=0; i<nCol; i++){
107651 sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i);
107652 }
@@ -122629,10 +123184,11 @@
122629 const char *(*filename_wal)(const char*);
122630 /* Version 3.32.0 and later */
122631 char *(*create_filename)(const char*,const char*,const char*,
122632 int,const char**);
122633 void (*free_filename)(char*);
 
122634 };
122635
122636 /*
122637 ** This is the function signature used for all extension entry points. It
122638 ** is also defined in the file "loadext.c".
@@ -122932,10 +123488,11 @@
122932 #define sqlite3_filename_journal sqlite3_api->filename_journal
122933 #define sqlite3_filename_wal sqlite3_api->filename_wal
122934 /* Version 3.32.0 and later */
122935 #define sqlite3_create_filename sqlite3_api->create_filename
122936 #define sqlite3_free_filename sqlite3_api->free_filename
 
122937 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
122938
122939 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
122940 /* This case when the file really is being compiled as a loadable
122941 ** extension */
@@ -123413,11 +123970,20 @@
123413 sqlite3_filename_journal,
123414 sqlite3_filename_wal,
123415 /* Version 3.32.0 and later */
123416 sqlite3_create_filename,
123417 sqlite3_free_filename,
 
123418 };
 
 
 
 
 
 
 
 
123419
123420 /*
123421 ** Attempt to load an SQLite extension library contained in the file
123422 ** zFile. The entry point is zProc. zProc may be 0 in which case a
123423 ** default entry point name (sqlite3_extension_init) is used. Use
@@ -123516,11 +124082,11 @@
123516 if( zAltEntry==0 ){
123517 sqlite3OsDlClose(pVfs, handle);
123518 return SQLITE_NOMEM_BKPT;
123519 }
123520 memcpy(zAltEntry, "sqlite3_", 8);
123521 for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){}
123522 iFile++;
123523 if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
123524 for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
123525 if( sqlite3Isalpha(c) ){
123526 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
@@ -123820,53 +124386,54 @@
123820 ** that script and rerun it.
123821 */
123822
123823 /* The various pragma types */
123824 #define PragTyp_ACTIVATE_EXTENSIONS 0
123825 #define PragTyp_HEADER_VALUE 1
123826 #define PragTyp_AUTO_VACUUM 2
123827 #define PragTyp_FLAG 3
123828 #define PragTyp_BUSY_TIMEOUT 4
123829 #define PragTyp_CACHE_SIZE 5
123830 #define PragTyp_CACHE_SPILL 6
123831 #define PragTyp_CASE_SENSITIVE_LIKE 7
123832 #define PragTyp_COLLATION_LIST 8
123833 #define PragTyp_COMPILE_OPTIONS 9
123834 #define PragTyp_DATA_STORE_DIRECTORY 10
123835 #define PragTyp_DATABASE_LIST 11
123836 #define PragTyp_DEFAULT_CACHE_SIZE 12
123837 #define PragTyp_ENCODING 13
123838 #define PragTyp_FOREIGN_KEY_CHECK 14
123839 #define PragTyp_FOREIGN_KEY_LIST 15
123840 #define PragTyp_FUNCTION_LIST 16
123841 #define PragTyp_HARD_HEAP_LIMIT 17
123842 #define PragTyp_INCREMENTAL_VACUUM 18
123843 #define PragTyp_INDEX_INFO 19
123844 #define PragTyp_INDEX_LIST 20
123845 #define PragTyp_INTEGRITY_CHECK 21
123846 #define PragTyp_JOURNAL_MODE 22
123847 #define PragTyp_JOURNAL_SIZE_LIMIT 23
123848 #define PragTyp_LOCK_PROXY_FILE 24
123849 #define PragTyp_LOCKING_MODE 25
123850 #define PragTyp_PAGE_COUNT 26
123851 #define PragTyp_MMAP_SIZE 27
123852 #define PragTyp_MODULE_LIST 28
123853 #define PragTyp_OPTIMIZE 29
123854 #define PragTyp_PAGE_SIZE 30
123855 #define PragTyp_PRAGMA_LIST 31
123856 #define PragTyp_SECURE_DELETE 32
123857 #define PragTyp_SHRINK_MEMORY 33
123858 #define PragTyp_SOFT_HEAP_LIMIT 34
123859 #define PragTyp_SYNCHRONOUS 35
123860 #define PragTyp_TABLE_INFO 36
123861 #define PragTyp_TEMP_STORE 37
123862 #define PragTyp_TEMP_STORE_DIRECTORY 38
123863 #define PragTyp_THREADS 39
123864 #define PragTyp_WAL_AUTOCHECKPOINT 40
123865 #define PragTyp_WAL_CHECKPOINT 41
123866 #define PragTyp_LOCK_STATUS 42
123867 #define PragTyp_STATS 43
 
123868
123869 /* Property flags associated with various pragma. */
123870 #define PragFlg_NeedSchema 0x01 /* Force schema load before running */
123871 #define PragFlg_NoColumns 0x02 /* OP_ResultRow called with zero columns */
123872 #define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
@@ -123953,10 +124520,15 @@
123953 /* ePragTyp: */ PragTyp_ACTIVATE_EXTENSIONS,
123954 /* ePragFlg: */ 0,
123955 /* ColNames: */ 0, 0,
123956 /* iArg: */ 0 },
123957 #endif
 
 
 
 
 
123958 #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
123959 {/* zName: */ "application_id",
123960 /* ePragTyp: */ PragTyp_HEADER_VALUE,
123961 /* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
123962 /* ColNames: */ 0, 0,
@@ -124453,11 +125025,11 @@
124453 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
124454 /* ColNames: */ 0, 0,
124455 /* iArg: */ SQLITE_WriteSchema|SQLITE_NoSchemaError },
124456 #endif
124457 };
124458 /* Number of pragmas: 66 on by default, 76 total. */
124459
124460 /************** End of pragma.h **********************************************/
124461 /************** Continuing where we left off in pragma.c *********************/
124462
124463 /*
@@ -126157,11 +126729,10 @@
126157 sqlite3ResolvePartIdxLabel(pParse, jmp3);
126158 }
126159 }
126160 sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
126161 sqlite3VdbeJumpHere(v, loopTop-1);
126162 #ifndef SQLITE_OMIT_BTREECOUNT
126163 if( !isQuick ){
126164 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
126165 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
126166 if( pPk==pIdx ) continue;
126167 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
@@ -126171,11 +126742,10 @@
126171 sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
126172 integrityCheckResultRow(v);
126173 sqlite3VdbeJumpHere(v, addr);
126174 }
126175 }
126176 #endif /* SQLITE_OMIT_BTREECOUNT */
126177 }
126178 }
126179 {
126180 static const int iLn = VDBE_OFFSET_LINENO(2);
126181 static const VdbeOpList endCode[] = {
@@ -126605,10 +127175,29 @@
126605 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, (int)(N&0x7fffffff));
126606 }
126607 returnSingleInt(v, sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, -1));
126608 break;
126609 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126610
126611 #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
126612 /*
126613 ** Report the current state of file logs for all databases
126614 */
@@ -131404,10 +131993,11 @@
131404 if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){
131405 memset(&ifNullRow, 0, sizeof(ifNullRow));
131406 ifNullRow.op = TK_IF_NULL_ROW;
131407 ifNullRow.pLeft = pCopy;
131408 ifNullRow.iTable = pSubst->iNewTable;
 
131409 pCopy = &ifNullRow;
131410 }
131411 testcase( ExprHasProperty(pCopy, EP_Subquery) );
131412 pNew = sqlite3ExprDup(db, pCopy, 0);
131413 if( pNew && pSubst->isLeftJoin ){
@@ -134568,11 +135158,10 @@
134568 VdbeComment((v, "indicate accumulator empty"));
134569 sqlite3VdbeAddOp1(v, OP_Return, regReset);
134570
134571 } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */
134572 else {
134573 #ifndef SQLITE_OMIT_BTREECOUNT
134574 Table *pTab;
134575 if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){
134576 /* If isSimpleCount() returns a pointer to a Table structure, then
134577 ** the SQL statement is of the form:
134578 **
@@ -134626,13 +135215,11 @@
134626 sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO);
134627 }
134628 sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem);
134629 sqlite3VdbeAddOp1(v, OP_Close, iCsr);
134630 explainSimpleCount(pParse, pTab, pBest);
134631 }else
134632 #endif /* SQLITE_OMIT_BTREECOUNT */
134633 {
134634 int regAcc = 0; /* "populate accumulators" flag */
134635
134636 /* If there are accumulator registers but no min() or max() functions
134637 ** without FILTER clauses, allocate register regAcc. Register regAcc
134638 ** will contain 0 the first time the inner loop runs, and 1 thereafter.
@@ -159255,19 +159842,82 @@
159255
159256
159257 /************** End of sqliteicu.h *******************************************/
159258 /************** Continuing where we left off in main.c ***********************/
159259 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159260 #ifdef SQLITE_ENABLE_JSON1
159261 SQLITE_PRIVATE int sqlite3Json1Init(sqlite3*);
159262 #endif
159263 #ifdef SQLITE_ENABLE_STMTVTAB
159264 SQLITE_PRIVATE int sqlite3StmtVtabInit(sqlite3*);
159265 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159266 #ifdef SQLITE_ENABLE_FTS5
159267 SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*);
159268 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159269
159270 #ifndef SQLITE_AMALGAMATION
159271 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
159272 ** contains the text of SQLITE_VERSION macro.
159273 */
@@ -162272,10 +162922,11 @@
162272 sqlite3 *db; /* Store allocated handle here */
162273 int rc; /* Return code */
162274 int isThreadsafe; /* True for threadsafe connections */
162275 char *zOpen = 0; /* Filename argument to pass to BtreeOpen() */
162276 char *zErrMsg = 0; /* Error message from sqlite3ParseUri() */
 
162277
162278 #ifdef SQLITE_ENABLE_API_ARMOR
162279 if( ppDb==0 ) return SQLITE_MISUSE_BKPT;
162280 #endif
162281 *ppDb = 0;
@@ -162512,18 +163163,15 @@
162512 */
162513 sqlite3Error(db, SQLITE_OK);
162514 sqlite3RegisterPerConnectionBuiltinFunctions(db);
162515 rc = sqlite3_errcode(db);
162516
162517 #ifdef SQLITE_ENABLE_FTS5
162518 /* Register any built-in FTS5 module before loading the automatic
162519 ** extensions. This allows automatic extensions to register FTS5
162520 ** tokenizers and auxiliary functions. */
162521 if( !db->mallocFailed && rc==SQLITE_OK ){
162522 rc = sqlite3Fts5Init(db);
162523 }
162524 #endif
162525
162526 /* Load automatic extensions - extensions that have been registered
162527 ** using the sqlite3_automatic_extension() API.
162528 */
162529 if( rc==SQLITE_OK ){
@@ -162532,66 +163180,10 @@
162532 if( rc!=SQLITE_OK ){
162533 goto opendb_out;
162534 }
162535 }
162536
162537 #ifdef SQLITE_ENABLE_FTS1
162538 if( !db->mallocFailed ){
162539 extern int sqlite3Fts1Init(sqlite3*);
162540 rc = sqlite3Fts1Init(db);
162541 }
162542 #endif
162543
162544 #ifdef SQLITE_ENABLE_FTS2
162545 if( !db->mallocFailed && rc==SQLITE_OK ){
162546 extern int sqlite3Fts2Init(sqlite3*);
162547 rc = sqlite3Fts2Init(db);
162548 }
162549 #endif
162550
162551 #ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */
162552 if( !db->mallocFailed && rc==SQLITE_OK ){
162553 rc = sqlite3Fts3Init(db);
162554 }
162555 #endif
162556
162557 #if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
162558 if( !db->mallocFailed && rc==SQLITE_OK ){
162559 rc = sqlite3IcuInit(db);
162560 }
162561 #endif
162562
162563 #ifdef SQLITE_ENABLE_RTREE
162564 if( !db->mallocFailed && rc==SQLITE_OK){
162565 rc = sqlite3RtreeInit(db);
162566 }
162567 #endif
162568
162569 #ifdef SQLITE_ENABLE_DBPAGE_VTAB
162570 if( !db->mallocFailed && rc==SQLITE_OK){
162571 rc = sqlite3DbpageRegister(db);
162572 }
162573 #endif
162574
162575 #ifdef SQLITE_ENABLE_DBSTAT_VTAB
162576 if( !db->mallocFailed && rc==SQLITE_OK){
162577 rc = sqlite3DbstatRegister(db);
162578 }
162579 #endif
162580
162581 #ifdef SQLITE_ENABLE_JSON1
162582 if( !db->mallocFailed && rc==SQLITE_OK){
162583 rc = sqlite3Json1Init(db);
162584 }
162585 #endif
162586
162587 #ifdef SQLITE_ENABLE_STMTVTAB
162588 if( !db->mallocFailed && rc==SQLITE_OK){
162589 rc = sqlite3StmtVtabInit(db);
162590 }
162591 #endif
162592
162593 #ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS
162594 /* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time
162595 ** option gives access to internal functions by default.
162596 ** Testing use only!!! */
162597 db->mDbFlags |= DBFLAG_InternalFunc;
@@ -165357,10 +165949,11 @@
165357 SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*);
165358 SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *);
165359 SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *);
165360 SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int*, Fts3Table*);
165361 SQLITE_PRIVATE int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc);
 
165362
165363 /* fts3_tokenizer.c */
165364 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *);
165365 SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *);
165366 SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *,
@@ -166088,10 +166681,26 @@
166088 fts3Appendf(pRc, &zRet, ", ?");
166089 }
166090 sqlite3_free(zFree);
166091 return zRet;
166092 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166093
166094 /*
166095 ** This function interprets the string at (*pp) as a non-negative integer
166096 ** value. It reads the integer and sets *pnOut to the value read, then
166097 ** sets *pp to point to the byte immediately following the last byte of
@@ -166104,23 +166713,21 @@
166104 **
166105 ** This function is used when parsing the "prefix=" FTS4 parameter.
166106 */
166107 static int fts3GobbleInt(const char **pp, int *pnOut){
166108 const int MAX_NPREFIX = 10000000;
166109 const char *p; /* Iterator pointer */
166110 int nInt = 0; /* Output value */
166111
166112 for(p=*pp; p[0]>='0' && p[0]<='9'; p++){
166113 nInt = nInt * 10 + (p[0] - '0');
166114 if( nInt>MAX_NPREFIX ){
166115 nInt = 0;
166116 break;
166117 }
166118 }
166119 if( p==*pp ) return SQLITE_ERROR;
166120 *pnOut = nInt;
166121 *pp = p;
166122 return SQLITE_OK;
166123 }
166124
166125 /*
166126 ** This function is called to allocate an array of Fts3Index structures
@@ -172198,14 +172805,11 @@
172198
172199 /* If this is a "NEAR" keyword, check for an explicit nearness. */
172200 if( pKey->eType==FTSQUERY_NEAR ){
172201 assert( nKey==4 );
172202 if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){
172203 nNear = 0;
172204 for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){
172205 nNear = nNear * 10 + (zInput[nKey] - '0');
172206 }
172207 }
172208 }
172209
172210 /* At this point this is probably a keyword. But for that to be true,
172211 ** the next byte must contain either whitespace, an open or close
@@ -178384,25 +178988,25 @@
178384 ){
178385 const unsigned char *zText = sqlite3_column_text(pStmt, iCol);
178386 if( zText ){
178387 int i;
178388 int iMul = 1;
178389 i64 iVal = 0;
178390 for(i=0; zText[i]>='0' && zText[i]<='9'; i++){
178391 iVal = iVal*10 + (zText[i] - '0');
178392 }
178393 *piEndBlock = iVal;
178394 while( zText[i]==' ' ) i++;
178395 iVal = 0;
178396 if( zText[i]=='-' ){
178397 i++;
178398 iMul = -1;
178399 }
178400 for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){
178401 iVal = iVal*10 + (zText[i] - '0');
178402 }
178403 *pnByte = (iVal * (i64)iMul);
178404 }
178405 }
178406
178407
178408 /*
@@ -223901,11 +224505,11 @@
223901 int nArg, /* Number of args */
223902 sqlite3_value **apUnused /* Function arguments */
223903 ){
223904 assert( nArg==0 );
223905 UNUSED_PARAM2(nArg, apUnused);
223906 sqlite3_result_text(pCtx, "fts5: 2020-03-03 20:04:29 bd94d7d052734460904c687756231f8aa243a2252f07f742dd1e437aa940f536", -1, SQLITE_TRANSIENT);
223907 }
223908
223909 /*
223910 ** Return true if zName is the extension on one of the shadow tables used
223911 ** by this module.
@@ -228552,11 +229156,12 @@
228552 }
228553 case STMT_COLUMN_BUSY: {
228554 sqlite3_result_int(ctx, sqlite3_stmt_busy(pCur->pStmt));
228555 break;
228556 }
228557 case STMT_COLUMN_MEM: {
 
228558 i = SQLITE_STMTSTATUS_MEMUSED +
228559 STMT_COLUMN_NSCAN - SQLITE_STMTSTATUS_FULLSCAN_STEP;
228560 /* Fall thru */
228561 }
228562 case STMT_COLUMN_NSCAN:
@@ -228683,12 +229288,12 @@
228683 }
228684 #endif /* SQLITE_CORE */
228685 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
228686
228687 /************** End of stmt.c ************************************************/
228688 #if __LINE__!=228688
228689 #undef SQLITE_SOURCE_ID
228690 #define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0alt2"
228691 #endif
228692 /* Return the source-id for this library */
228693 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
228694 /************************** End of sqlite3.c ******************************/
228695
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -216,10 +216,13 @@
216 "ENABLE_ATOMIC_WRITE",
217 #endif
218 #if SQLITE_ENABLE_BATCH_ATOMIC_WRITE
219 "ENABLE_BATCH_ATOMIC_WRITE",
220 #endif
221 #if SQLITE_ENABLE_BYTECODE_VTAB
222 "ENABLE_BYTECODE_VTAB",
223 #endif
224 #if SQLITE_ENABLE_CEROD
225 "ENABLE_CEROD=" CTIMEOPT_VAL(SQLITE_ENABLE_CEROD),
226 #endif
227 #if SQLITE_ENABLE_COLUMN_METADATA
228 "ENABLE_COLUMN_METADATA",
@@ -534,13 +537,10 @@
537 "OMIT_BETWEEN_OPTIMIZATION",
538 #endif
539 #if SQLITE_OMIT_BLOB_LITERAL
540 "OMIT_BLOB_LITERAL",
541 #endif
 
 
 
542 #if SQLITE_OMIT_CAST
543 "OMIT_CAST",
544 #endif
545 #if SQLITE_OMIT_CHECK
546 "OMIT_CHECK",
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.32.0"
1166 #define SQLITE_VERSION_NUMBER 3032000
1167 #define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -1336,30 +1336,26 @@
1336 ** for the [sqlite3] object.
1337 ** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
1338 ** the [sqlite3] object is successfully destroyed and all associated
1339 ** resources are deallocated.
1340 **
1341 ** Ideally, applications should [sqlite3_finalize | finalize] all
1342 ** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
1343 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
1344 ** with the [sqlite3] object prior to attempting to close the object.
1345 ** ^If the database connection is associated with unfinalized prepared
1346 ** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
1347 ** sqlite3_close() will leave the database connection open and return
1348 ** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
1349 ** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
1350 ** it returns [SQLITE_OK] regardless, but instead of deallocating the database
1351 ** connection immediately, it marks the database connection as an unusable
1352 ** "zombie" and makes arrangements to automatically deallocate the database
1353 ** connection after all prepared statements are finalized, all BLOB handles
1354 ** are closed, and all backups have finished. The sqlite3_close_v2() interface
1355 ** is intended for use with host languages that are garbage collected, and
1356 ** where the order in which destructors are called is arbitrary.
 
 
 
 
 
 
 
 
1357 **
1358 ** ^If an [sqlite3] object is destroyed while a transaction is open,
1359 ** the transaction is automatically rolled back.
1360 **
1361 ** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -1544,10 +1540,11 @@
1540 #define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
1541 #define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
1542 #define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
1543 #define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
1544 #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
1545 #define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
1546 #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
1547 #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
1548 #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
1549 #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
1550 #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -2150,10 +2147,15 @@
2147 ** a single attached database that occur due to other database connections,
2148 ** but omits changes implemented by the database connection on which it is
2149 ** called. This file control is the only mechanism to detect changes that
2150 ** happen either internally or externally and that are associated with
2151 ** a particular attached database.
2152 **
2153 ** <li>[[SQLITE_FCNTL_CKPT_START]]
2154 ** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
2155 ** in wal mode before the client starts to copy pages from the wal
2156 ** file to the database file.
2157 **
2158 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
2159 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
2160 ** in wal mode after the client has finished copying pages from the wal
2161 ** file to the database file, but before the *-shm file is updated to
@@ -2195,10 +2197,11 @@
2197 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
2198 #define SQLITE_FCNTL_DATA_VERSION 35
2199 #define SQLITE_FCNTL_SIZE_LIMIT 36
2200 #define SQLITE_FCNTL_CKPT_DONE 37
2201 #define SQLITE_FCNTL_RESERVE_BYTES 38
2202 #define SQLITE_FCNTL_CKPT_START 39
2203
2204 /* deprecated names */
2205 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
2206 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
2207 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -4573,12 +4576,23 @@
4576 **
4577 ** These are utility routines, useful to [VFS|custom VFS implementations],
4578 ** that check if a database file was a URI that contained a specific query
4579 ** parameter, and if so obtains the value of that query parameter.
4580 **
4581 ** The first parameter to these interfaces (hereafter referred to
4582 ** as F) must be one of:
4583 ** <ul>
4584 ** <li> A database filename pointer created by the SQLite core and
4585 ** passed into the xOpen() method of a VFS implemention, or
4586 ** <li> A filename obtained from [sqlite3_db_filename()], or
4587 ** <li> A new filename constructed using [sqlite3_create_filename()].
4588 ** </ul>
4589 ** If the F parameter is not one of the above, then the behavior is
4590 ** undefined and probably undesirable. Older versions of SQLite were
4591 ** more tolerant of invalid F parameters than newer versions.
4592 **
4593 ** If F is a suitable filename (as described in the previous paragraph)
4594 ** and if P is the name of the query parameter, then
4595 ** sqlite3_uri_parameter(F,P) returns the value of the P
4596 ** parameter if it exists or a NULL pointer if P does not appear as a
4597 ** query parameter on F. If P is a query parameter of F and it
4598 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -4657,10 +4671,29 @@
4671 */
4672 SQLITE_API const char *sqlite3_filename_database(const char*);
4673 SQLITE_API const char *sqlite3_filename_journal(const char*);
4674 SQLITE_API const char *sqlite3_filename_wal(const char*);
4675
4676 /*
4677 ** CAPI3REF: Database File Corresponding To A Journal
4678 **
4679 ** ^If X is the name of a rollback or WAL-mode journal file that is
4680 ** passed into the xOpen method of [sqlite3_vfs], then
4681 ** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file]
4682 ** object that represents the main database file.
4683 **
4684 ** This routine is intended for use in custom [VFS] implementations
4685 ** only. It is not a general-purpose interface.
4686 ** The argument sqlite3_file_object(X) must be a filename pointer that
4687 ** has been passed into [sqlite3_vfs].xOpen method where the
4688 ** flags parameter to xOpen contains one of the bits
4689 ** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use
4690 ** of this routine results in undefined and probably undesirable
4691 ** behavior.
4692 */
4693 SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
4694
4695 /*
4696 ** CAPI3REF: Create and Destroy VFS Filenames
4697 **
4698 ** These interfces are provided for use by [VFS shim] implementations and
4699 ** are not useful outside of that context.
@@ -4691,11 +4724,11 @@
4724 ** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
4725 ** be NULL pointers, though they can be empty strings.
4726 **
4727 ** The sqlite3_free_filename(Y) routine releases a memory allocation
4728 ** previously obtained from sqlite3_create_filename(). Invoking
4729 ** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op.
4730 **
4731 ** If the Y parameter to sqlite3_free_filename(Y) is anything other
4732 ** than a NULL pointer or a pointer previously acquired from
4733 ** sqlite3_create_filename(), then bad things such as heap
4734 ** corruption or segfaults may occur. The value Y should be
@@ -15022,13 +15055,11 @@
15055 #ifndef NDEBUG
15056 SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*);
15057 #endif
15058 SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor*);
15059
 
15060 SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
 
15061
15062 #ifdef SQLITE_TEST
15063 SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
15064 SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
15065 #endif
@@ -15599,10 +15630,13 @@
15630
15631 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
15632 SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
15633
15634 SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
15635 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
15636 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
15637 #endif
15638
15639 /* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
15640 ** each VDBE opcode.
15641 **
15642 ** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
@@ -16855,10 +16889,11 @@
16889 Hash aFunc; /* Hash table of connection functions */
16890 Hash aCollSeq; /* All collating sequences */
16891 BusyHandler busyHandler; /* Busy callback */
16892 Db aDbStatic[2]; /* Static space for the 2 default backends */
16893 Savepoint *pSavepoint; /* List of active savepoints */
16894 int nAnalysisLimit; /* Number of index rows to ANALYZE */
16895 int busyTimeout; /* Busy handler timeout, in msec */
16896 int nSavepoint; /* Number of non-transaction savepoints */
16897 int nStatement; /* Number of nested statement-transactions */
16898 i64 nDeferredCons; /* Net deferred constraints this transaction. */
16899 i64 nDeferredImmCons; /* Net deferred immediate constraints */
@@ -20636,11 +20671,12 @@
20671 /*
20672 ** VDBE_DISPLAY_P4 is true or false depending on whether or not the
20673 ** "explain" P4 display logic is enabled.
20674 */
20675 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
20676 || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) \
20677 || defined(SQLITE_ENABLE_BYTECODE_VTAB)
20678 # define VDBE_DISPLAY_P4 1
20679 #else
20680 # define VDBE_DISPLAY_P4 0
20681 #endif
20682
@@ -21101,11 +21137,18 @@
21137
21138 int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
21139 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*);
21140 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
21141 SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
21142 #if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
21143 SQLITE_PRIVATE int sqlite3VdbeNextOpcode(Vdbe*,Mem*,int,int*,int*,Op**);
21144 SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3*,Op*);
21145 #endif
21146 #if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS)
21147 SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(sqlite3*,const Op*,const char*);
21148 #endif
21149 #if !defined(SQLITE_OMIT_EXPLAIN)
21150 SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
21151 #endif
21152 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
21153 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
21154 SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
@@ -21143,11 +21186,11 @@
21186 SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
21187 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
21188 #ifndef SQLITE_OMIT_WINDOWFUNC
21189 SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem*, Mem*, FuncDef*);
21190 #endif
21191 #if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
21192 SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
21193 #endif
21194 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
21195 SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int n);
21196 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
@@ -27316,11 +27359,11 @@
27359 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
27360 n = mem0.hardLimit;
27361 }
27362 mem0.alarmThreshold = n;
27363 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27364 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
27365 sqlite3_mutex_leave(mem0.mutex);
27366 excess = sqlite3_memory_used() - n;
27367 if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
27368 return priorLimit;
27369 }
@@ -27384,11 +27427,11 @@
27427 ** Return true if the heap is currently under memory pressure - in other
27428 ** words if the amount of heap used is close to the limit set by
27429 ** sqlite3_soft_heap_limit().
27430 */
27431 SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
27432 return AtomicLoad(&mem0.nearlyFull);
27433 }
27434
27435 /*
27436 ** Deinitialize the memory allocation subsystem.
27437 */
@@ -27448,21 +27491,21 @@
27491
27492 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, n);
27493 if( mem0.alarmThreshold>0 ){
27494 sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27495 if( nUsed >= mem0.alarmThreshold - nFull ){
27496 AtomicStore(&mem0.nearlyFull, 1);
27497 sqlite3MallocAlarm(nFull);
27498 if( mem0.hardLimit ){
27499 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
27500 if( nUsed >= mem0.hardLimit - nFull ){
27501 *pp = 0;
27502 return;
27503 }
27504 }
27505 }else{
27506 AtomicStore(&mem0.nearlyFull, 0);
27507 }
27508 }
27509 p = sqlite3GlobalConfig.m.xMalloc(nFull);
27510 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
27511 if( p==0 && mem0.alarmThreshold>0 ){
@@ -54026,13 +54069,16 @@
54069 }
54070 if( exists ){
54071 /* One of the journals pointed to by the master journal exists.
54072 ** Open it and check if it points at the master journal. If
54073 ** so, return without deleting the master journal file.
54074 ** NB: zJournal is really a MAIN_JOURNAL. But call it a
54075 ** MASTER_JOURNAL here so that the VFS will not send the zJournal
54076 ** name into sqlite3_database_file_object().
54077 */
54078 int c;
54079 int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL);
54080 rc = sqlite3OsOpen(pVfs, zJournal, pJournal, flags, 0);
54081 if( rc!=SQLITE_OK ){
54082 goto delmaster_out;
54083 }
54084
@@ -56232,10 +56278,11 @@
56278 ** Pager object (sizeof(Pager) bytes)
56279 ** PCache object (sqlite3PcacheSize() bytes)
56280 ** Database file handle (pVfs->szOsFile bytes)
56281 ** Sub-journal file handle (journalFileSize bytes)
56282 ** Main journal file handle (journalFileSize bytes)
56283 ** Ptr back to the Pager (sizeof(Pager*) bytes)
56284 ** \0\0\0\0 database prefix (4 bytes)
56285 ** Database file name (nPathname+1 bytes)
56286 ** URI query parameters (nUriByte bytes)
56287 ** Journal filename (nPathname+8+1 bytes)
56288 ** WAL filename (nPathname+4+1 bytes)
@@ -56271,10 +56318,11 @@
56318 pPtr = (u8 *)sqlite3MallocZero(
56319 ROUND8(sizeof(*pPager)) + /* Pager structure */
56320 ROUND8(pcacheSize) + /* PCache object */
56321 ROUND8(pVfs->szOsFile) + /* The main db file */
56322 journalFileSize * 2 + /* The two journal files */
56323 sizeof(pPager) + /* Space to hold a pointer */
56324 4 + /* Database prefix */
56325 nPathname + 1 + /* database filename */
56326 nUriByte + /* query parameters */
56327 nPathname + 8 + 1 + /* Journal filename */
56328 #ifndef SQLITE_OMIT_WAL
@@ -56291,10 +56339,11 @@
56339 pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
56340 pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
56341 pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
56342 pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
56343 assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
56344 memcpy(pPtr, &pPager, sizeof(pPager)); pPtr += sizeof(pPager);
56345
56346 /* Fill in the Pager.zFilename and pPager.zQueryParam fields */
56347 pPtr += 4; /* Skip zero prefix */
56348 pPager->zFilename = (char*)pPtr;
56349 if( nPathname>0 ){
@@ -56491,10 +56540,23 @@
56540
56541 *ppPager = pPager;
56542 return SQLITE_OK;
56543 }
56544
56545 /*
56546 ** Return the sqlite3_file for the main database given the name
56547 ** of the corresonding WAL or Journal name as passed into
56548 ** xOpen.
56549 */
56550 SQLITE_API sqlite3_file *sqlite3_database_file_object(const char *zName){
56551 Pager *pPager;
56552 while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){
56553 zName--;
56554 }
56555 pPager = *(Pager**)(zName - 4 - sizeof(Pager*));
56556 return pPager->fd;
56557 }
56558
56559
56560 /*
56561 ** This function is called after transitioning from PAGER_UNLOCK to
56562 ** PAGER_SHARED state. It tests if there is a hot journal present in
@@ -61023,10 +61085,11 @@
61085 ** about the eventual size of the db file to the VFS layer.
61086 */
61087 if( rc==SQLITE_OK ){
61088 i64 nReq = ((i64)mxPage * szPage);
61089 i64 nSize; /* Current size of database file */
61090 sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
61091 rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
61092 if( rc==SQLITE_OK && nSize<nReq ){
61093 sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
61094 }
61095 }
@@ -61050,10 +61113,11 @@
61113 iOffset = (iDbpage-1)*(i64)szPage;
61114 testcase( IS_BIG_INT(iOffset) );
61115 rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);
61116 if( rc!=SQLITE_OK ) break;
61117 }
61118 sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0);
61119
61120 /* If work was actually accomplished... */
61121 if( rc==SQLITE_OK ){
61122 if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
61123 i64 szDb = pWal->hdr.nPage*(i64)szPage;
@@ -61061,14 +61125,10 @@
61125 rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
61126 if( rc==SQLITE_OK ){
61127 rc = sqlite3OsSync(pWal->pDbFd, CKPT_SYNC_FLAGS(sync_flags));
61128 }
61129 }
 
 
 
 
61130 if( rc==SQLITE_OK ){
61131 pInfo->nBackfill = mxSafeFrame;
61132 }
61133 }
61134
@@ -66965,10 +67025,14 @@
67025
67026 /*
67027 ** Return the number of bytes of space at the end of every page that
67028 ** are intentually left unused. This is the "reserved" space that is
67029 ** sometimes used by extensions.
67030 **
67031 ** The value returned is the larger of the current reserve size and
67032 ** the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
67033 ** The amount of reserve can only grow - never shrink.
67034 */
67035 SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){
67036 int n;
67037 sqlite3BtreeEnter(p);
67038 n = ((int)p->pBt->nReserveWanted) - 1;
@@ -73560,11 +73624,10 @@
73624 }
73625 sqlite3BtreeLeave(p);
73626 return rc;
73627 }
73628
 
73629 /*
73630 ** The first argument, pCur, is a cursor opened on some b-tree. Count the
73631 ** number of entries in the b-tree and write the result to *pnEntry.
73632 **
73633 ** SQLITE_OK is returned if the operation is successfully executed.
@@ -73633,11 +73696,10 @@
73696 }
73697
73698 /* An error has occurred. Return an error code. */
73699 return rc;
73700 }
 
73701
73702 /*
73703 ** Return the pager associated with a BTree. This routine is used for
73704 ** testing and debugging only.
73705 */
@@ -78709,24 +78771,23 @@
78771 ** "PX" -> "r[X]"
78772 ** "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1
78773 ** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0
78774 ** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x
78775 */
78776 SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(
78777 sqlite3 *db, /* Optional - Oom error reporting only */
78778 const Op *pOp, /* The opcode to be commented */
78779 const char *zP4 /* Previously obtained value for P4 */
 
 
78780 ){
78781 const char *zOpName;
78782 const char *zSynopsis;
78783 int nOpName;
78784 int ii;
78785 char zAlt[50];
78786 StrAccum x;
 
78787
78788 sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH);
78789 zOpName = sqlite3OpcodeName(pOp->opcode);
78790 nOpName = sqlite3Strlen30(zOpName);
78791 if( zOpName[nOpName+1] ){
78792 int seenCom = 0;
78793 char c;
@@ -78789,14 +78850,16 @@
78850 sqlite3_str_appendf(&x, "; %s", pOp->zComment);
78851 }
78852 }else if( pOp->zComment ){
78853 sqlite3_str_appendall(&x, pOp->zComment);
78854 }
78855 if( (x.accError & SQLITE_NOMEM)!=0 && db!=0 ){
78856 sqlite3OomFault(db);
78857 }
78858 return sqlite3StrAccumFinish(&x);
78859 }
78860 #endif /* SQLITE_ENABLE_EXPLAIN_COMMENTS */
78861
78862 #if VDBE_DISPLAY_P4 && defined(SQLITE_ENABLE_CURSOR_HINTS)
78863 /*
78864 ** Translate the P4.pExpr value for an OP_CursorHint opcode into text
78865 ** that can be displayed in the P4 column of EXPLAIN output.
@@ -78873,15 +78936,15 @@
78936 #if VDBE_DISPLAY_P4
78937 /*
78938 ** Compute a string that describes the P4 parameter for an opcode.
78939 ** Use zTemp for any required temporary buffer space.
78940 */
78941 SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3 *db, Op *pOp){
78942 char *zP4 = 0;
78943 StrAccum x;
78944
78945 sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH);
78946 switch( pOp->p4type ){
78947 case P4_KEYINFO: {
78948 int j;
78949 KeyInfo *pKeyInfo = pOp->p4.pKeyInfo;
78950 assert( pKeyInfo->aSortFlags!=0 );
@@ -78961,40 +79024,36 @@
79024 int i;
79025 int *ai = pOp->p4.ai;
79026 int n = ai[0]; /* The first element of an INTARRAY is always the
79027 ** count of the number of elements to follow */
79028 for(i=1; i<=n; i++){
79029 sqlite3_str_appendf(&x, "%c%d", (i==1 ? '[' : ','), ai[i]);
79030 }
 
79031 sqlite3_str_append(&x, "]", 1);
79032 break;
79033 }
79034 case P4_SUBPROGRAM: {
79035 zP4 = "program";
79036 break;
79037 }
79038 case P4_DYNBLOB:
79039 case P4_ADVANCE: {
 
79040 break;
79041 }
79042 case P4_TABLE: {
79043 zP4 = pOp->p4.pTab->zName;
79044 break;
79045 }
79046 default: {
79047 zP4 = pOp->p4.z;
 
 
 
 
79048 }
79049 }
79050 if( zP4 ) sqlite3_str_appendall(&x, zP4);
79051 if( (x.accError & SQLITE_NOMEM)!=0 ){
79052 sqlite3OomFault(db);
79053 }
79054 return sqlite3StrAccumFinish(&x);
79055 }
79056 #endif /* VDBE_DISPLAY_P4 */
79057
79058 /*
79059 ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
@@ -79080,28 +79139,32 @@
79139 /*
79140 ** Print a single opcode. This routine is used for debugging only.
79141 */
79142 SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, VdbeOp *pOp){
79143 char *zP4;
79144 char *zCom;
79145 sqlite3 dummyDb;
79146 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n";
79147 if( pOut==0 ) pOut = stdout;
79148 dummyDb.mallocFailed = 1;
79149 zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp);
79150 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79151 zCom = sqlite3VdbeDisplayComment(0, pOp, zP4);
79152 #else
79153 zCom = 0;
79154 #endif
79155 /* NB: The sqlite3OpcodeName() function is implemented by code created
79156 ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the
79157 ** information from the vdbe.c source text */
79158 fprintf(pOut, zFormat1, pc,
79159 sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3,
79160 zP4 ? zP4 : "", pOp->p5,
79161 zCom ? zCom : ""
79162 );
79163 fflush(pOut);
79164 sqlite3_free(zP4);
79165 sqlite3_free(zCom);
79166 }
79167 #endif
79168
79169 /*
79170 ** Initialize an array of N Mem element.
@@ -79188,10 +79251,125 @@
79251 assert( sqlite3VdbeFrameIsValid(pFrame) );
79252 pFrame->pParent = pFrame->v->pDelFrame;
79253 pFrame->v->pDelFrame = pFrame;
79254 }
79255
79256 #if defined(SQLITE_ENABLE_BYTECODE_VTAB) || !defined(SQLITE_OMIT_EXPLAIN)
79257 /*
79258 ** Locate the next opcode to be displayed in EXPLAIN or EXPLAIN
79259 ** QUERY PLAN output.
79260 **
79261 ** Return SQLITE_ROW on success. Return SQLITE_DONE if there are no
79262 ** more opcodes to be displayed.
79263 */
79264 SQLITE_PRIVATE int sqlite3VdbeNextOpcode(
79265 Vdbe *p, /* The statement being explained */
79266 Mem *pSub, /* Storage for keeping track of subprogram nesting */
79267 int eMode, /* 0: normal. 1: EQP. 2: TablesUsed */
79268 int *piPc, /* IN/OUT: Current rowid. Overwritten with next rowid */
79269 int *piAddr, /* OUT: Write index into (*paOp)[] here */
79270 Op **paOp /* OUT: Write the opcode array here */
79271 ){
79272 int nRow; /* Stop when row count reaches this */
79273 int nSub = 0; /* Number of sub-vdbes seen so far */
79274 SubProgram **apSub = 0; /* Array of sub-vdbes */
79275 int i; /* Next instruction address */
79276 int rc = SQLITE_OK; /* Result code */
79277 Op *aOp = 0; /* Opcode array */
79278 int iPc; /* Rowid. Copy of value in *piPc */
79279
79280 /* When the number of output rows reaches nRow, that means the
79281 ** listing has finished and sqlite3_step() should return SQLITE_DONE.
79282 ** nRow is the sum of the number of rows in the main program, plus
79283 ** the sum of the number of rows in all trigger subprograms encountered
79284 ** so far. The nRow value will increase as new trigger subprograms are
79285 ** encountered, but p->pc will eventually catch up to nRow.
79286 */
79287 nRow = p->nOp;
79288 if( pSub!=0 ){
79289 if( pSub->flags&MEM_Blob ){
79290 /* pSub is initiallly NULL. It is initialized to a BLOB by
79291 ** the P4_SUBPROGRAM processing logic below */
79292 nSub = pSub->n/sizeof(Vdbe*);
79293 apSub = (SubProgram **)pSub->z;
79294 }
79295 for(i=0; i<nSub; i++){
79296 nRow += apSub[i]->nOp;
79297 }
79298 }
79299 iPc = *piPc;
79300 while(1){ /* Loop exits via break */
79301 i = iPc++;
79302 if( i>=nRow ){
79303 p->rc = SQLITE_OK;
79304 rc = SQLITE_DONE;
79305 break;
79306 }
79307 if( i<p->nOp ){
79308 /* The rowid is small enough that we are still in the
79309 ** main program. */
79310 aOp = p->aOp;
79311 }else{
79312 /* We are currently listing subprograms. Figure out which one and
79313 ** pick up the appropriate opcode. */
79314 int j;
79315 i -= p->nOp;
79316 assert( apSub!=0 );
79317 assert( nSub>0 );
79318 for(j=0; i>=apSub[j]->nOp; j++){
79319 i -= apSub[j]->nOp;
79320 assert( i<apSub[j]->nOp || j+1<nSub );
79321 }
79322 aOp = apSub[j]->aOp;
79323 }
79324
79325 /* When an OP_Program opcode is encounter (the only opcode that has
79326 ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms
79327 ** kept in p->aMem[9].z to hold the new program - assuming this subprogram
79328 ** has not already been seen.
79329 */
79330 if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){
79331 int nByte = (nSub+1)*sizeof(SubProgram*);
79332 int j;
79333 for(j=0; j<nSub; j++){
79334 if( apSub[j]==aOp[i].p4.pProgram ) break;
79335 }
79336 if( j==nSub ){
79337 p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0);
79338 if( p->rc!=SQLITE_OK ){
79339 rc = SQLITE_ERROR;
79340 break;
79341 }
79342 apSub = (SubProgram **)pSub->z;
79343 apSub[nSub++] = aOp[i].p4.pProgram;
79344 MemSetTypeFlag(pSub, MEM_Blob);
79345 pSub->n = nSub*sizeof(SubProgram*);
79346 nRow += aOp[i].p4.pProgram->nOp;
79347 }
79348 }
79349 if( eMode==0 ) break;
79350 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
79351 if( eMode==2 ){
79352 Op *pOp = aOp + i;
79353 if( pOp->opcode==OP_OpenRead ) break;
79354 if( pOp->opcode==OP_OpenWrite && (pOp->p5 & OPFLAG_P2ISREG)==0 ) break;
79355 if( pOp->opcode==OP_ReopenIdx ) break;
79356 }else
79357 #endif
79358 {
79359 assert( eMode==1 );
79360 if( aOp[i].opcode==OP_Explain ) break;
79361 if( aOp[i].opcode==OP_Init && iPc>1 ) break;
79362 }
79363 }
79364 *piPc = iPc;
79365 *piAddr = i;
79366 *paOp = aOp;
79367 return rc;
79368 }
79369 #endif /* SQLITE_ENABLE_BYTECODE_VTAB || !SQLITE_OMIT_EXPLAIN */
79370
79371
79372 /*
79373 ** Delete a VdbeFrame object and its contents. VdbeFrame objects are
79374 ** allocated by the OP_Program opcode in sqlite3VdbeExec().
79375 */
@@ -79228,20 +79406,18 @@
79406 ** the trigger subprograms are listed one by one.
79407 */
79408 SQLITE_PRIVATE int sqlite3VdbeList(
79409 Vdbe *p /* The VDBE */
79410 ){
 
 
 
79411 Mem *pSub = 0; /* Memory cell hold array of subprogs */
79412 sqlite3 *db = p->db; /* The database connection */
79413 int i; /* Loop counter */
79414 int rc = SQLITE_OK; /* Return code */
79415 Mem *pMem = &p->aMem[1]; /* First Mem of result set */
79416 int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0);
79417 Op *aOp; /* Array of opcodes */
79418 Op *pOp; /* Current opcode */
79419
79420 assert( p->explain );
79421 assert( p->magic==VDBE_MAGIC_RUN );
79422 assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM );
79423
@@ -79257,166 +79433,66 @@
79433 ** sqlite3_column_text16() failed. */
79434 sqlite3OomFault(db);
79435 return SQLITE_ERROR;
79436 }
79437
 
 
 
 
 
 
 
 
79438 if( bListSubprogs ){
79439 /* The first 8 memory cells are used for the result set. So we will
79440 ** commandeer the 9th cell to use as storage for an array of pointers
79441 ** to trigger subprograms. The VDBE is guaranteed to have at least 9
79442 ** cells. */
79443 assert( p->nMem>9 );
79444 pSub = &p->aMem[9];
79445 }else{
79446 pSub = 0;
79447 }
79448
79449 /* Figure out which opcode is next to display */
79450 rc = sqlite3VdbeNextOpcode(p, pSub, p->explain==2, &p->pc, &i, &aOp);
79451
79452 if( rc==SQLITE_OK ){
79453 pOp = aOp + i;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79454 if( AtomicLoad(&db->u1.isInterrupted) ){
79455 p->rc = SQLITE_INTERRUPT;
79456 rc = SQLITE_ERROR;
79457 sqlite3VdbeError(p, sqlite3ErrStr(p->rc));
79458 }else{
79459 char *zP4 = sqlite3VdbeDisplayP4(db, pOp);
79460 if( p->explain==2 ){
79461 sqlite3VdbeMemSetInt64(pMem, pOp->p1);
79462 sqlite3VdbeMemSetInt64(pMem+1, pOp->p2);
79463 sqlite3VdbeMemSetInt64(pMem+2, pOp->p3);
79464 sqlite3VdbeMemSetStr(pMem+3, zP4, -1, SQLITE_UTF8, sqlite3_free);
79465 p->nResColumn = 4;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79466 }else{
79467 sqlite3VdbeMemSetInt64(pMem+0, i);
79468 sqlite3VdbeMemSetStr(pMem+1, (char*)sqlite3OpcodeName(pOp->opcode),
79469 -1, SQLITE_UTF8, SQLITE_STATIC);
79470 sqlite3VdbeMemSetInt64(pMem+2, pOp->p1);
79471 sqlite3VdbeMemSetInt64(pMem+3, pOp->p2);
79472 sqlite3VdbeMemSetInt64(pMem+4, pOp->p3);
79473 /* pMem+5 for p4 is done last */
79474 sqlite3VdbeMemSetInt64(pMem+6, pOp->p5);
 
 
 
 
 
 
 
 
 
79475 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
79476 {
79477 char *zCom = sqlite3VdbeDisplayComment(db, pOp, zP4);
79478 sqlite3VdbeMemSetStr(pMem+7, zCom, -1, SQLITE_UTF8, sqlite3_free);
79479 }
79480 #else
79481 sqlite3VdbeMemSetNull(pMem+7);
79482 #endif
79483 sqlite3VdbeMemSetStr(pMem+5, zP4, -1, SQLITE_UTF8, sqlite3_free);
79484 p->nResColumn = 8;
79485 }
79486 p->pResultSet = pMem;
79487 if( db->mallocFailed ){
79488 p->rc = SQLITE_NOMEM;
79489 rc = SQLITE_ERROR;
79490 }else{
79491 p->rc = SQLITE_OK;
79492 rc = SQLITE_ROW;
79493 }
79494 }
79495 }
79496 return rc;
79497 }
79498 #endif /* SQLITE_OMIT_EXPLAIN */
@@ -79982,12 +80058,13 @@
80058 int retryCount = 0;
80059 int nMainFile;
80060
80061 /* Select a master journal file name */
80062 nMainFile = sqlite3Strlen30(zMainFile);
80063 zMaster = sqlite3MPrintf(db, "%.4c%s%.16c", 0,zMainFile,0);
80064 if( zMaster==0 ) return SQLITE_NOMEM_BKPT;
80065 zMaster += 4;
80066 do {
80067 u32 iRandom;
80068 if( retryCount ){
80069 if( retryCount>100 ){
80070 sqlite3_log(SQLITE_FULL, "MJ delete: %s", zMaster);
@@ -80013,11 +80090,11 @@
80090 SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|
80091 SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_MASTER_JOURNAL, 0
80092 );
80093 }
80094 if( rc!=SQLITE_OK ){
80095 sqlite3DbFree(db, zMaster-4);
80096 return rc;
80097 }
80098
80099 /* Write the name of each database file in the transaction into the new
80100 ** master journal file. If an error occurs at this point close
@@ -80036,11 +80113,11 @@
80113 rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset);
80114 offset += sqlite3Strlen30(zFile)+1;
80115 if( rc!=SQLITE_OK ){
80116 sqlite3OsCloseFree(pMaster);
80117 sqlite3OsDelete(pVfs, zMaster, 0);
80118 sqlite3DbFree(db, zMaster-4);
80119 return rc;
80120 }
80121 }
80122 }
80123
@@ -80050,11 +80127,11 @@
80127 if( 0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL)
80128 && SQLITE_OK!=(rc = sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL))
80129 ){
80130 sqlite3OsCloseFree(pMaster);
80131 sqlite3OsDelete(pVfs, zMaster, 0);
80132 sqlite3DbFree(db, zMaster-4);
80133 return rc;
80134 }
80135
80136 /* Sync all the db files involved in the transaction. The same call
80137 ** sets the master journal pointer in each individual journal. If
@@ -80073,20 +80150,20 @@
80150 }
80151 }
80152 sqlite3OsCloseFree(pMaster);
80153 assert( rc!=SQLITE_BUSY );
80154 if( rc!=SQLITE_OK ){
80155 sqlite3DbFree(db, zMaster-4);
80156 return rc;
80157 }
80158
80159 /* Delete the master journal file. This commits the transaction. After
80160 ** doing this the directory is synced again before any individual
80161 ** transaction files are deleted.
80162 */
80163 rc = sqlite3OsDelete(pVfs, zMaster, 1);
80164 sqlite3DbFree(db, zMaster-4);
80165 zMaster = 0;
80166 if( rc ){
80167 return rc;
80168 }
80169
@@ -87998,32 +88075,38 @@
88075 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
88076 REGISTER_TRACE(pOp->p3, pOut);
88077 break;
88078 }
88079
88080 /* Opcode: Count P1 P2 p3 * *
88081 ** Synopsis: r[P2]=count()
88082 **
88083 ** Store the number of entries (an integer value) in the table or index
88084 ** opened by cursor P1 in register P2.
88085 **
88086 ** If P3==0, then an exact count is obtained, which involves visiting
88087 ** every btree page of the table. But if P3 is non-zero, an estimate
88088 ** is returned based on the current cursor position.
88089 */
 
88090 case OP_Count: { /* out2 */
88091 i64 nEntry;
88092 BtCursor *pCrsr;
88093
88094 assert( p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE );
88095 pCrsr = p->apCsr[pOp->p1]->uc.pCursor;
88096 assert( pCrsr );
88097 if( pOp->p3 ){
88098 nEntry = sqlite3BtreeRowCountEst(pCrsr);
88099 }else{
88100 nEntry = 0; /* Not needed. Only used to silence a warning. */
88101 rc = sqlite3BtreeCount(db, pCrsr, &nEntry);
88102 if( rc ) goto abort_due_to_error;
88103 }
88104 pOut = out2Prerelease(p, pOp);
88105 pOut->u.i = nEntry;
88106 goto check_for_interrupt;
88107 }
 
88108
88109 /* Opcode: Savepoint P1 * * P4 *
88110 **
88111 ** Open, release or rollback the savepoint named by parameter P4, depending
88112 ** on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN).
@@ -96093,10 +96176,435 @@
96176 *pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
96177 return SQLITE_OK;
96178 }
96179
96180 /************** End of vdbesort.c ********************************************/
96181 /************** Begin file vdbevtab.c ****************************************/
96182 /*
96183 ** 2020-03-23
96184 **
96185 ** The author disclaims copyright to this source code. In place of
96186 ** a legal notice, here is a blessing:
96187 **
96188 ** May you do good and not evil.
96189 ** May you find forgiveness for yourself and forgive others.
96190 ** May you share freely, never taking more than you give.
96191 **
96192 *************************************************************************
96193 **
96194 ** This file implements virtual-tables for examining the bytecode content
96195 ** of a prepared statement.
96196 */
96197 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
96198 /* #include "sqliteInt.h" */
96199 /* #include "vdbeInt.h" */
96200
96201 /* An instance of the bytecode() table-valued function.
96202 */
96203 typedef struct bytecodevtab bytecodevtab;
96204 struct bytecodevtab {
96205 sqlite3_vtab base; /* Base class - must be first */
96206 sqlite3 *db; /* Database connection */
96207 int bTablesUsed; /* 2 for tables_used(). 0 for bytecode(). */
96208 };
96209
96210 /* A cursor for scanning through the bytecode
96211 */
96212 typedef struct bytecodevtab_cursor bytecodevtab_cursor;
96213 struct bytecodevtab_cursor {
96214 sqlite3_vtab_cursor base; /* Base class - must be first */
96215 sqlite3_stmt *pStmt; /* The statement whose bytecode is displayed */
96216 int iRowid; /* The rowid of the output table */
96217 int iAddr; /* Address */
96218 int needFinalize; /* Cursors owns pStmt and must finalize it */
96219 int showSubprograms; /* Provide a listing of subprograms */
96220 Op *aOp; /* Operand array */
96221 char *zP4; /* Rendered P4 value */
96222 const char *zType; /* tables_used.type */
96223 const char *zSchema; /* tables_used.schema */
96224 const char *zName; /* tables_used.name */
96225 Mem sub; /* Subprograms */
96226 };
96227
96228 /*
96229 ** Create a new bytecode() table-valued function.
96230 */
96231 static int bytecodevtabConnect(
96232 sqlite3 *db,
96233 void *pAux,
96234 int argc, const char *const*argv,
96235 sqlite3_vtab **ppVtab,
96236 char **pzErr
96237 ){
96238 bytecodevtab *pNew;
96239 int rc;
96240 int isTabUsed = pAux!=0;
96241 const char *azSchema[2] = {
96242 /* bytecode() schema */
96243 "CREATE TABLE x("
96244 "addr INT,"
96245 "opcode TEXT,"
96246 "p1 INT,"
96247 "p2 INT,"
96248 "p3 INT,"
96249 "p4 TEXT,"
96250 "p5 INT,"
96251 "comment TEXT,"
96252 "subprog TEXT,"
96253 "stmt HIDDEN"
96254 ");",
96255
96256 /* Tables_used() schema */
96257 "CREATE TABLE x("
96258 "type TEXT,"
96259 "schema TEXT,"
96260 "name TEXT,"
96261 "wr INT,"
96262 "subprog TEXT,"
96263 "stmt HIDDEN"
96264 ");"
96265 };
96266
96267 rc = sqlite3_declare_vtab(db, azSchema[isTabUsed]);
96268 if( rc==SQLITE_OK ){
96269 pNew = sqlite3_malloc( sizeof(*pNew) );
96270 *ppVtab = (sqlite3_vtab*)pNew;
96271 if( pNew==0 ) return SQLITE_NOMEM;
96272 memset(pNew, 0, sizeof(*pNew));
96273 pNew->db = db;
96274 pNew->bTablesUsed = isTabUsed*2;
96275 }
96276 return rc;
96277 }
96278
96279 /*
96280 ** This method is the destructor for bytecodevtab objects.
96281 */
96282 static int bytecodevtabDisconnect(sqlite3_vtab *pVtab){
96283 bytecodevtab *p = (bytecodevtab*)pVtab;
96284 sqlite3_free(p);
96285 return SQLITE_OK;
96286 }
96287
96288 /*
96289 ** Constructor for a new bytecodevtab_cursor object.
96290 */
96291 static int bytecodevtabOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
96292 bytecodevtab *pVTab = (bytecodevtab*)p;
96293 bytecodevtab_cursor *pCur;
96294 pCur = sqlite3_malloc( sizeof(*pCur) );
96295 if( pCur==0 ) return SQLITE_NOMEM;
96296 memset(pCur, 0, sizeof(*pCur));
96297 sqlite3VdbeMemInit(&pCur->sub, pVTab->db, 1);
96298 *ppCursor = &pCur->base;
96299 return SQLITE_OK;
96300 }
96301
96302 /*
96303 ** Clear all internal content from a bytecodevtab cursor.
96304 */
96305 static void bytecodevtabCursorClear(bytecodevtab_cursor *pCur){
96306 sqlite3_free(pCur->zP4);
96307 pCur->zP4 = 0;
96308 sqlite3VdbeMemRelease(&pCur->sub);
96309 sqlite3VdbeMemSetNull(&pCur->sub);
96310 if( pCur->needFinalize ){
96311 sqlite3_finalize(pCur->pStmt);
96312 }
96313 pCur->pStmt = 0;
96314 pCur->needFinalize = 0;
96315 pCur->zType = 0;
96316 pCur->zSchema = 0;
96317 pCur->zName = 0;
96318 }
96319
96320 /*
96321 ** Destructor for a bytecodevtab_cursor.
96322 */
96323 static int bytecodevtabClose(sqlite3_vtab_cursor *cur){
96324 bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96325 bytecodevtabCursorClear(pCur);
96326 sqlite3_free(pCur);
96327 return SQLITE_OK;
96328 }
96329
96330
96331 /*
96332 ** Advance a bytecodevtab_cursor to its next row of output.
96333 */
96334 static int bytecodevtabNext(sqlite3_vtab_cursor *cur){
96335 bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96336 bytecodevtab *pTab = (bytecodevtab*)cur->pVtab;
96337 int rc;
96338 if( pCur->zP4 ){
96339 sqlite3_free(pCur->zP4);
96340 pCur->zP4 = 0;
96341 }
96342 if( pCur->zName ){
96343 pCur->zName = 0;
96344 pCur->zType = 0;
96345 pCur->zSchema = 0;
96346 }
96347 rc = sqlite3VdbeNextOpcode(
96348 (Vdbe*)pCur->pStmt,
96349 pCur->showSubprograms ? &pCur->sub : 0,
96350 pTab->bTablesUsed,
96351 &pCur->iRowid,
96352 &pCur->iAddr,
96353 &pCur->aOp);
96354 if( rc!=SQLITE_OK ){
96355 sqlite3VdbeMemSetNull(&pCur->sub);
96356 pCur->aOp = 0;
96357 }
96358 return SQLITE_OK;
96359 }
96360
96361 /*
96362 ** Return TRUE if the cursor has been moved off of the last
96363 ** row of output.
96364 */
96365 static int bytecodevtabEof(sqlite3_vtab_cursor *cur){
96366 bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96367 return pCur->aOp==0;
96368 }
96369
96370 /*
96371 ** Return values of columns for the row at which the bytecodevtab_cursor
96372 ** is currently pointing.
96373 */
96374 static int bytecodevtabColumn(
96375 sqlite3_vtab_cursor *cur, /* The cursor */
96376 sqlite3_context *ctx, /* First argument to sqlite3_result_...() */
96377 int i /* Which column to return */
96378 ){
96379 bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96380 bytecodevtab *pVTab = (bytecodevtab*)cur->pVtab;
96381 Op *pOp = pCur->aOp + pCur->iAddr;
96382 if( pVTab->bTablesUsed ){
96383 if( i==4 ){
96384 i = 8;
96385 }else{
96386 if( i<=2 && pCur->zType==0 ){
96387 Schema *pSchema;
96388 HashElem *k;
96389 int iDb = pOp->p3;
96390 int iRoot = pOp->p2;
96391 sqlite3 *db = pVTab->db;
96392 pSchema = db->aDb[iDb].pSchema;
96393 pCur->zSchema = db->aDb[iDb].zDbSName;
96394 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
96395 Table *pTab = (Table*)sqliteHashData(k);
96396 if( !IsVirtual(pTab) && pTab->tnum==iRoot ){
96397 pCur->zName = pTab->zName;
96398 pCur->zType = "table";
96399 break;
96400 }
96401 }
96402 if( pCur->zName==0 ){
96403 for(k=sqliteHashFirst(&pSchema->idxHash); k; k=sqliteHashNext(k)){
96404 Index *pIdx = (Index*)sqliteHashData(k);
96405 if( pIdx->tnum==iRoot ){
96406 pCur->zName = pIdx->zName;
96407 pCur->zType = "index";
96408 }
96409 }
96410 }
96411 }
96412 i += 10;
96413 }
96414 }
96415 switch( i ){
96416 case 0: /* addr */
96417 sqlite3_result_int(ctx, pCur->iAddr);
96418 break;
96419 case 1: /* opcode */
96420 sqlite3_result_text(ctx, (char*)sqlite3OpcodeName(pOp->opcode),
96421 -1, SQLITE_STATIC);
96422 break;
96423 case 2: /* p1 */
96424 sqlite3_result_int(ctx, pOp->p1);
96425 break;
96426 case 3: /* p2 */
96427 sqlite3_result_int(ctx, pOp->p2);
96428 break;
96429 case 4: /* p3 */
96430 sqlite3_result_int(ctx, pOp->p3);
96431 break;
96432 case 5: /* p4 */
96433 case 7: /* comment */
96434 if( pCur->zP4==0 ){
96435 pCur->zP4 = sqlite3VdbeDisplayP4(pVTab->db, pOp);
96436 }
96437 if( i==5 ){
96438 sqlite3_result_text(ctx, pCur->zP4, -1, SQLITE_STATIC);
96439 }else{
96440 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
96441 char *zCom = sqlite3VdbeDisplayComment(pVTab->db, pOp, pCur->zP4);
96442 sqlite3_result_text(ctx, zCom, -1, sqlite3_free);
96443 #endif
96444 }
96445 break;
96446 case 6: /* p5 */
96447 sqlite3_result_int(ctx, pOp->p5);
96448 break;
96449 case 8: { /* subprog */
96450 Op *aOp = pCur->aOp;
96451 assert( aOp[0].opcode==OP_Init );
96452 assert( aOp[0].p4.z==0 || strncmp(aOp[0].p4.z,"-" "- ",3)==0 );
96453 if( pCur->iRowid==pCur->iAddr+1 ){
96454 break; /* Result is NULL for the main program */
96455 }else if( aOp[0].p4.z!=0 ){
96456 sqlite3_result_text(ctx, aOp[0].p4.z+3, -1, SQLITE_STATIC);
96457 }else{
96458 sqlite3_result_text(ctx, "(FK)", 4, SQLITE_STATIC);
96459 }
96460 break;
96461 }
96462 case 10: /* tables_used.type */
96463 sqlite3_result_text(ctx, pCur->zType, -1, SQLITE_STATIC);
96464 break;
96465 case 11: /* tables_used.schema */
96466 sqlite3_result_text(ctx, pCur->zSchema, -1, SQLITE_STATIC);
96467 break;
96468 case 12: /* tables_used.name */
96469 sqlite3_result_text(ctx, pCur->zName, -1, SQLITE_STATIC);
96470 break;
96471 case 13: /* tables_used.wr */
96472 sqlite3_result_int(ctx, pOp->opcode==OP_OpenWrite);
96473 break;
96474 }
96475 return SQLITE_OK;
96476 }
96477
96478 /*
96479 ** Return the rowid for the current row. In this implementation, the
96480 ** rowid is the same as the output value.
96481 */
96482 static int bytecodevtabRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
96483 bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur;
96484 *pRowid = pCur->iRowid;
96485 return SQLITE_OK;
96486 }
96487
96488 /*
96489 ** Initialize a cursor.
96490 **
96491 ** idxNum==0 means show all subprograms
96492 ** idxNum==1 means show only the main bytecode and omit subprograms.
96493 */
96494 static int bytecodevtabFilter(
96495 sqlite3_vtab_cursor *pVtabCursor,
96496 int idxNum, const char *idxStr,
96497 int argc, sqlite3_value **argv
96498 ){
96499 bytecodevtab_cursor *pCur = (bytecodevtab_cursor *)pVtabCursor;
96500 bytecodevtab *pVTab = (bytecodevtab *)pVtabCursor->pVtab;
96501 int rc = SQLITE_OK;
96502
96503 bytecodevtabCursorClear(pCur);
96504 pCur->iRowid = 0;
96505 pCur->iAddr = 0;
96506 pCur->showSubprograms = idxNum==0;
96507 assert( argc==1 );
96508 if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){
96509 const char *zSql = (const char*)sqlite3_value_text(argv[0]);
96510 if( zSql==0 ){
96511 rc = SQLITE_NOMEM;
96512 }else{
96513 rc = sqlite3_prepare_v2(pVTab->db, zSql, -1, &pCur->pStmt, 0);
96514 pCur->needFinalize = 1;
96515 }
96516 }else{
96517 pCur->pStmt = (sqlite3_stmt*)sqlite3_value_pointer(argv[0],"stmt-pointer");
96518 }
96519 if( pCur->pStmt==0 ){
96520 pVTab->base.zErrMsg = sqlite3_mprintf(
96521 "argument to %s() is not a valid SQL statement",
96522 pVTab->bTablesUsed ? "tables_used" : "bytecode"
96523 );
96524 rc = SQLITE_ERROR;
96525 }else{
96526 bytecodevtabNext(pVtabCursor);
96527 }
96528 return rc;
96529 }
96530
96531 /*
96532 ** We must have a single stmt=? constraint that will be passed through
96533 ** into the xFilter method. If there is no valid stmt=? constraint,
96534 ** then return an SQLITE_CONSTRAINT error.
96535 */
96536 static int bytecodevtabBestIndex(
96537 sqlite3_vtab *tab,
96538 sqlite3_index_info *pIdxInfo
96539 ){
96540 int i;
96541 int rc = SQLITE_CONSTRAINT;
96542 struct sqlite3_index_constraint *p;
96543 bytecodevtab *pVTab = (bytecodevtab*)tab;
96544 int iBaseCol = pVTab->bTablesUsed ? 4 : 8;
96545 pIdxInfo->estimatedCost = (double)100;
96546 pIdxInfo->estimatedRows = 100;
96547 pIdxInfo->idxNum = 0;
96548 for(i=0, p=pIdxInfo->aConstraint; i<pIdxInfo->nConstraint; i++, p++){
96549 if( p->usable==0 ) continue;
96550 if( p->op==SQLITE_INDEX_CONSTRAINT_EQ && p->iColumn==iBaseCol+1 ){
96551 rc = SQLITE_OK;
96552 pIdxInfo->aConstraintUsage[i].omit = 1;
96553 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
96554 }
96555 if( p->op==SQLITE_INDEX_CONSTRAINT_ISNULL && p->iColumn==iBaseCol ){
96556 pIdxInfo->aConstraintUsage[i].omit = 1;
96557 pIdxInfo->idxNum = 1;
96558 }
96559 }
96560 return rc;
96561 }
96562
96563 /*
96564 ** This following structure defines all the methods for the
96565 ** virtual table.
96566 */
96567 static sqlite3_module bytecodevtabModule = {
96568 /* iVersion */ 0,
96569 /* xCreate */ 0,
96570 /* xConnect */ bytecodevtabConnect,
96571 /* xBestIndex */ bytecodevtabBestIndex,
96572 /* xDisconnect */ bytecodevtabDisconnect,
96573 /* xDestroy */ 0,
96574 /* xOpen */ bytecodevtabOpen,
96575 /* xClose */ bytecodevtabClose,
96576 /* xFilter */ bytecodevtabFilter,
96577 /* xNext */ bytecodevtabNext,
96578 /* xEof */ bytecodevtabEof,
96579 /* xColumn */ bytecodevtabColumn,
96580 /* xRowid */ bytecodevtabRowid,
96581 /* xUpdate */ 0,
96582 /* xBegin */ 0,
96583 /* xSync */ 0,
96584 /* xCommit */ 0,
96585 /* xRollback */ 0,
96586 /* xFindMethod */ 0,
96587 /* xRename */ 0,
96588 /* xSavepoint */ 0,
96589 /* xRelease */ 0,
96590 /* xRollbackTo */ 0,
96591 /* xShadowName */ 0
96592 };
96593
96594
96595 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){
96596 int rc;
96597 rc = sqlite3_create_module(db, "bytecode", &bytecodevtabModule, 0);
96598 if( rc==SQLITE_OK ){
96599 rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db);
96600 }
96601 return rc;
96602 }
96603 #endif /* SQLITE_ENABLE_BYTECODE_VTAB */
96604
96605 /************** End of vdbevtab.c ********************************************/
96606 /************** Begin file memjournal.c **************************************/
96607 /*
96608 ** 2008 October 7
96609 **
96610 ** The author disclaims copyright to this source code. In place of
@@ -98739,11 +99247,11 @@
99247 ** SELECT * FROM t1 WHERE (select a from t1);
99248 */
99249 SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){
99250 int op;
99251 while( ExprHasProperty(pExpr, EP_Skip) ){
99252 assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
99253 pExpr = pExpr->pLeft;
99254 assert( pExpr!=0 );
99255 }
99256 op = pExpr->op;
99257 if( op==TK_SELECT ){
@@ -98806,11 +99314,11 @@
99314 /*
99315 ** Skip over any TK_COLLATE operators.
99316 */
99317 SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
99318 while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
99319 assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
99320 pExpr = pExpr->pLeft;
99321 }
99322 return pExpr;
99323 }
99324
@@ -98825,11 +99333,11 @@
99333 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
99334 assert( pExpr->x.pList->nExpr>0 );
99335 assert( pExpr->op==TK_FUNCTION );
99336 pExpr = pExpr->x.pList->a[0].pExpr;
99337 }else{
99338 assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW );
99339 pExpr = pExpr->pLeft;
99340 }
99341 }
99342 return pExpr;
99343 }
@@ -106605,10 +107113,15 @@
107113 sqlite3 *db = pParse->db;
107114 Db *pDb;
107115 Vdbe *v = sqlite3GetVdbe(pParse);
107116 int aRoot[ArraySize(aTable)];
107117 u8 aCreateTbl[ArraySize(aTable)];
107118 #ifdef SQLITE_ENABLE_STAT4
107119 const int nToOpen = OptimizationEnabled(db,SQLITE_Stat4) ? 2 : 1;
107120 #else
107121 const int nToOpen = 1;
107122 #endif
107123
107124 if( v==0 ) return;
107125 assert( sqlite3BtreeHoldsAllMutexes(db) );
107126 assert( sqlite3VdbeDb(v)==db );
107127 pDb = &db->aDb[iDb];
@@ -106617,12 +107130,13 @@
107130 ** if they do already exist.
107131 */
107132 for(i=0; i<ArraySize(aTable); i++){
107133 const char *zTab = aTable[i].zName;
107134 Table *pStat;
107135 aCreateTbl[i] = 0;
107136 if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){
107137 if( i<nToOpen ){
107138 /* The sqlite_statN table does not exist. Create it. Note that a
107139 ** side-effect of the CREATE TABLE statement is to leave the rootpage
107140 ** of the new table in register pParse->regRoot. This is important
107141 ** because the OpenWrite opcode below will be needing it. */
107142 sqlite3NestedParse(pParse,
@@ -106634,11 +107148,10 @@
107148 }else{
107149 /* The table already exists. If zWhere is not NULL, delete all entries
107150 ** associated with the table zWhere. If zWhere is NULL, delete the
107151 ** entire contents of the table. */
107152 aRoot[i] = pStat->tnum;
 
107153 sqlite3TableLock(pParse, iDb, aRoot[i], 1, zTab);
107154 if( zWhere ){
107155 sqlite3NestedParse(pParse,
107156 "DELETE FROM %Q.%s WHERE %s=%Q",
107157 pDb->zDbSName, zTab, zWhereType, zWhere
@@ -106653,11 +107166,11 @@
107166 }
107167 }
107168 }
107169
107170 /* Open the sqlite_stat[134] tables for writing. */
107171 for(i=0; i<nToOpen; i++){
107172 assert( i<ArraySize(aTable) );
107173 sqlite3VdbeAddOp4Int(v, OP_OpenWrite, iStatCur+i, aRoot[i], iDb, 3);
107174 sqlite3VdbeChangeP5(v, aCreateTbl[i]);
107175 VdbeComment((v, aTable[i].zName));
107176 }
@@ -106692,13 +107205,16 @@
107205 u32 iHash; /* Tiebreaker hash */
107206 #endif
107207 };
107208 struct StatAccum {
107209 sqlite3 *db; /* Database connection, for malloc() */
107210 tRowcnt nEst; /* Estimated number of rows */
107211 tRowcnt nRow; /* Number of rows visited so far */
107212 int nLimit; /* Analysis row-scan limit */
107213 int nCol; /* Number of columns in index + pk/rowid */
107214 int nKeyCol; /* Number of index columns w/o the pk/rowid */
107215 u8 nSkipAhead; /* Number of times of skip-ahead */
107216 StatSample current; /* Current row as a StatSample */
107217 #ifdef SQLITE_ENABLE_STAT4
107218 tRowcnt nPSample; /* How often to do a periodic sample */
107219 int mxSample; /* Maximum number of samples to accumulate */
107220 u32 iPrn; /* Pseudo-random number used for sampling */
@@ -106774,31 +107290,32 @@
107290 ** Reclaim all memory of a StatAccum structure.
107291 */
107292 static void statAccumDestructor(void *pOld){
107293 StatAccum *p = (StatAccum*)pOld;
107294 #ifdef SQLITE_ENABLE_STAT4
107295 if( p->mxSample ){
107296 int i;
107297 for(i=0; i<p->nCol; i++) sampleClear(p->db, p->aBest+i);
107298 for(i=0; i<p->mxSample; i++) sampleClear(p->db, p->a+i);
107299 sampleClear(p->db, &p->current);
107300 }
107301 #endif
107302 sqlite3DbFree(p->db, p);
107303 }
107304
107305 /*
107306 ** Implementation of the stat_init(N,K,C,L) SQL function. The four parameters
107307 ** are:
107308 ** N: The number of columns in the index including the rowid/pk (note 1)
107309 ** K: The number of columns in the index excluding the rowid/pk.
107310 ** C: Estimated number of rows in the index
107311 ** L: A limit on the number of rows to scan, or 0 for no-limit
107312 **
107313 ** Note 1: In the special case of the covering index that implements a
107314 ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
107315 ** total number of columns in the table.
107316 **
 
 
107317 ** For indexes on ordinary rowid tables, N==K+1. But for indexes on
107318 ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
107319 ** PRIMARY KEY of the table. The covering index that implements the
107320 ** original WITHOUT ROWID table as N==K as a special case.
107321 **
@@ -106815,13 +107332,14 @@
107332 StatAccum *p;
107333 int nCol; /* Number of columns in index being sampled */
107334 int nKeyCol; /* Number of key columns */
107335 int nColUp; /* nCol rounded up for alignment */
107336 int n; /* Bytes of space to allocate */
107337 sqlite3 *db = sqlite3_context_db_handle(context); /* Database connection */
107338 #ifdef SQLITE_ENABLE_STAT4
107339 /* Maximum number of samples. 0 if STAT4 data is not collected */
107340 int mxSample = OptimizationEnabled(db,SQLITE_Stat4) ?SQLITE_STAT4_SAMPLES :0;
107341 #endif
107342
107343 /* Decode the three function arguments */
107344 UNUSED_PARAMETER(argc);
107345 nCol = sqlite3_value_int(argv[0]);
@@ -106832,39 +107350,43 @@
107350 assert( nKeyCol>0 );
107351
107352 /* Allocate the space required for the StatAccum object */
107353 n = sizeof(*p)
107354 + sizeof(tRowcnt)*nColUp /* StatAccum.anEq */
107355 + sizeof(tRowcnt)*nColUp; /* StatAccum.anDLt */
107356 #ifdef SQLITE_ENABLE_STAT4
107357 if( mxSample ){
107358 n += sizeof(tRowcnt)*nColUp /* StatAccum.anLt */
107359 + sizeof(StatSample)*(nCol+mxSample) /* StatAccum.aBest[], a[] */
107360 + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample);
107361 }
107362 #endif
 
107363 db = sqlite3_context_db_handle(context);
107364 p = sqlite3DbMallocZero(db, n);
107365 if( p==0 ){
107366 sqlite3_result_error_nomem(context);
107367 return;
107368 }
107369
107370 p->db = db;
107371 p->nEst = sqlite3_value_int64(argv[2]);
107372 p->nRow = 0;
107373 p->nLimit = sqlite3_value_int64(argv[3]);
107374 p->nCol = nCol;
107375 p->nKeyCol = nKeyCol;
107376 p->nSkipAhead = 0;
107377 p->current.anDLt = (tRowcnt*)&p[1];
107378 p->current.anEq = &p->current.anDLt[nColUp];
107379
107380 #ifdef SQLITE_ENABLE_STAT4
107381 p->mxSample = p->nLimit==0 ? mxSample : 0;
107382 if( mxSample ){
107383 u8 *pSpace; /* Allocated space not yet assigned */
107384 int i; /* Used to iterate through p->aSample[] */
107385
107386 p->iGet = -1;
107387 p->nPSample = (tRowcnt)(p->nEst/(mxSample/3+1) + 1);
 
107388 p->current.anLt = &p->current.anEq[nColUp];
107389 p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
107390
107391 /* Set up the StatAccum.a[] and aBest[] arrays */
107392 p->a = (struct StatSample*)&p->current.anLt[nColUp];
@@ -106888,11 +107410,11 @@
107410 ** (given by the 3rd parameter) is never used and can be any positive
107411 ** value. */
107412 sqlite3_result_blob(context, p, sizeof(*p), statAccumDestructor);
107413 }
107414 static const FuncDef statInitFuncdef = {
107415 4, /* nArg */
107416 SQLITE_UTF8, /* funcFlags */
107417 0, /* pUserData */
107418 0, /* pNext */
107419 statInit, /* xSFunc */
107420 0, /* xFinalize */
@@ -107092,14 +107614,17 @@
107614 ** P Pointer to the StatAccum object created by stat_init()
107615 ** C Index of left-most column to differ from previous row
107616 ** R Rowid for the current row. Might be a key record for
107617 ** WITHOUT ROWID tables.
107618 **
107619 ** The purpose of this routine is to collect statistical data and/or
107620 ** samples from the index being analyzed into the StatAccum object.
107621 ** The stat_get() SQL function will be used afterwards to
107622 ** retrieve the information gathered.
107623 **
107624 ** This SQL function usually returns NULL, but might return an integer
107625 ** if it wants the byte-code to do special processing.
107626 **
107627 ** The R parameter is only used for STAT4
107628 */
107629 static void statPush(
107630 sqlite3_context *context,
@@ -107121,11 +107646,11 @@
107646 /* This is the first call to this function. Do initialization. */
107647 for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1;
107648 }else{
107649 /* Second and subsequent calls get processed here */
107650 #ifdef SQLITE_ENABLE_STAT4
107651 if( p->mxSample ) samplePushPrevious(p, iChng);
107652 #endif
107653
107654 /* Update anDLt[], anLt[] and anEq[] to reflect the values that apply
107655 ** to the current row of the index. */
107656 for(i=0; i<iChng; i++){
@@ -107132,30 +107657,29 @@
107657 p->current.anEq[i]++;
107658 }
107659 for(i=iChng; i<p->nCol; i++){
107660 p->current.anDLt[i]++;
107661 #ifdef SQLITE_ENABLE_STAT4
107662 if( p->mxSample ) p->current.anLt[i] += p->current.anEq[i];
107663 #endif
107664 p->current.anEq[i] = 1;
107665 }
107666 }
107667
107668 p->nRow++;
107669 #ifdef SQLITE_ENABLE_STAT4
107670 if( p->mxSample ){
107671 tRowcnt nLt;
107672 if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
107673 sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
107674 }else{
107675 sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]),
107676 sqlite3_value_blob(argv[2]));
107677 }
107678 p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345;
107679
107680 nLt = p->current.anLt[p->nCol-1];
 
 
107681 /* Check if this is to be a periodic sample. If so, add it. */
107682 if( (nLt/p->nPSample)!=(nLt+1)/p->nPSample ){
107683 p->current.isPSample = 1;
107684 p->current.iCol = 0;
107685 sampleInsert(p, &p->current, p->nCol-1);
@@ -107167,13 +107691,18 @@
107691 p->current.iCol = i;
107692 if( i>=iChng || sampleIsBetterPost(p, &p->current, &p->aBest[i]) ){
107693 sampleCopy(p, &p->aBest[i], &p->current);
107694 }
107695 }
107696 }else
107697 #endif
107698 if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){
107699 p->nSkipAhead++;
107700 sqlite3_result_int(context, p->current.anDLt[0]>0);
107701 }
 
107702 }
107703
107704 static const FuncDef statPushFuncdef = {
107705 2+IsStat4, /* nArg */
107706 SQLITE_UTF8, /* funcFlags */
107707 0, /* pUserData */
107708 0, /* pNext */
@@ -107221,10 +107750,11 @@
107750 assert( argc==2 );
107751 assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ
107752 || eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT
107753 || eCall==STAT_GET_NDLT
107754 );
107755 assert( eCall==STAT_GET_STAT1 || p->mxSample );
107756 if( eCall==STAT_GET_STAT1 )
107757 #else
107758 assert( argc==1 );
107759 #endif
107760 {
@@ -107256,11 +107786,12 @@
107786 if( zRet==0 ){
107787 sqlite3_result_error_nomem(context);
107788 return;
107789 }
107790
107791 sqlite3_snprintf(24, zRet, "%llu",
107792 p->nSkipAhead ? (u64)p->nEst : (u64)p->nRow);
107793 z = zRet + sqlite3Strlen30(zRet);
107794 for(i=0; i<p->nKeyCol; i++){
107795 u64 nDistinct = p->current.anDLt[i] + 1;
107796 u64 iVal = (p->nRow + nDistinct - 1) / nDistinct;
107797 sqlite3_snprintf(24, z, " %llu", iVal);
@@ -107332,20 +107863,20 @@
107863 0, 0, /* xValue, xInverse */
107864 "stat_get", /* zName */
107865 {0}
107866 };
107867
107868 static void callStatGet(Parse *pParse, int regStat, int iParam, int regOut){
107869 #ifdef SQLITE_ENABLE_STAT4
107870 sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat+1);
107871 #elif SQLITE_DEBUG
107872 assert( iParam==STAT_GET_STAT1 );
107873 #else
107874 UNUSED_PARAMETER( iParam );
107875 #endif
107876 assert( regOut!=regStat && regOut!=regStat+1 );
107877 sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4,
107878 &statGetFuncdef, 0);
107879 }
107880
107881 /*
107882 ** Generate code to do an analysis of all indices associated with
@@ -107367,16 +107898,15 @@
107898 int i; /* Loop counter */
107899 int jZeroRows = -1; /* Jump from here if number of rows is zero */
107900 int iDb; /* Index of database containing pTab */
107901 u8 needTableCnt = 1; /* True to count the table */
107902 int regNewRowid = iMem++; /* Rowid for the inserted record */
107903 int regStat = iMem++; /* Register to hold StatAccum object */
107904 int regChng = iMem++; /* Index of changed index field */
 
107905 int regRowid = iMem++; /* Rowid argument passed to stat_push() */
 
107906 int regTemp = iMem++; /* Temporary use register */
107907 int regTemp2 = iMem++; /* Second temporary use register */
107908 int regTabname = iMem++; /* Register containing table name */
107909 int regIdxname = iMem++; /* Register containing index name */
107910 int regStat1 = iMem++; /* Value for the stat column of sqlite_stat1 */
107911 int regPrev = iMem; /* MUST BE LAST (see below) */
107912 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107500,21 +108030,30 @@
108030 /* Invoke the stat_init() function. The arguments are:
108031 **
108032 ** (1) the number of columns in the index including the rowid
108033 ** (or for a WITHOUT ROWID table, the number of PK columns),
108034 ** (2) the number of columns in the key without the rowid/pk
108035 ** (3) estimated number of rows in the index,
 
 
 
108036 */
108037 sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat+1);
108038 assert( regRowid==regStat+2 );
108039 sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regRowid);
108040 #ifdef SQLITE_ENABLE_STAT4
108041 if( OptimizationEnabled(db, SQLITE_Stat4) ){
108042 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regTemp);
108043 addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
108044 VdbeCoverage(v);
108045 }else
108046 #endif
108047 {
108048 addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
108049 VdbeCoverage(v);
108050 sqlite3VdbeAddOp3(v, OP_Count, iIdxCur, regTemp, 1);
108051 }
108052 assert( regTemp2==regStat+4 );
108053 sqlite3VdbeAddOp2(v, OP_Integer, db->nAnalysisLimit, regTemp2);
108054 sqlite3VdbeAddFunctionCall(pParse, 0, regStat+1, regStat, 4,
108055 &statInitFuncdef, 0);
108056
108057 /* Implementation of the following:
108058 **
108059 ** Rewind csr
@@ -107521,12 +108060,10 @@
108060 ** if eof(csr) goto end_of_scan;
108061 ** regChng = 0
108062 ** goto next_push_0;
108063 **
108064 */
 
 
108065 sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng);
108066 addrNextRow = sqlite3VdbeCurrentAddr(v);
108067
108068 if( nColTest>0 ){
108069 int endDistinctTest = sqlite3VdbeMakeLabel(pParse);
@@ -107555,10 +108092,11 @@
108092 }
108093 for(i=0; i<nColTest; i++){
108094 char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
108095 sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
108096 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
108097 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108098 aGotoChng[i] =
108099 sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
108100 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
108101 VdbeCoverage(v);
108102 }
@@ -107575,10 +108113,11 @@
108113 */
108114 sqlite3VdbeJumpHere(v, addrNextRow-1);
108115 for(i=0; i<nColTest; i++){
108116 sqlite3VdbeJumpHere(v, aGotoChng[i]);
108117 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
108118 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108119 }
108120 sqlite3VdbeResolveLabel(v, endDistinctTest);
108121 sqlite3DbFree(db, aGotoChng);
108122 }
108123
@@ -107588,34 +108127,50 @@
108127 ** stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
108128 ** Next csr
108129 ** if !eof(csr) goto next_row;
108130 */
108131 #ifdef SQLITE_ENABLE_STAT4
108132 if( OptimizationEnabled(db, SQLITE_Stat4) ){
108133 assert( regRowid==(regStat+2) );
108134 if( HasRowid(pTab) ){
108135 sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
108136 }else{
108137 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
108138 int j, k, regKey;
108139 regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
108140 for(j=0; j<pPk->nKeyCol; j++){
108141 k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
108142 assert( k>=0 && k<pIdx->nColumn );
108143 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
108144 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108145 }
108146 sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
108147 sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108148 }
108149 }
108150 #endif
108151 assert( regChng==(regStat+1) );
108152 {
108153 sqlite3VdbeAddFunctionCall(pParse, 1, regStat, regTemp, 2+IsStat4,
108154 &statPushFuncdef, 0);
108155 if( db->nAnalysisLimit ){
108156 int j1, j2, j3;
108157 j1 = sqlite3VdbeAddOp1(v, OP_IsNull, regTemp); VdbeCoverage(v);
108158 j2 = sqlite3VdbeAddOp1(v, OP_If, regTemp); VdbeCoverage(v);
108159 j3 = sqlite3VdbeAddOp4Int(v, OP_SeekGT, iIdxCur, 0, regPrev, 1);
108160 VdbeCoverage(v);
108161 sqlite3VdbeJumpHere(v, j1);
108162 sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
108163 sqlite3VdbeJumpHere(v, j2);
108164 sqlite3VdbeJumpHere(v, j3);
108165 }else{
108166 sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
108167 }
108168 }
108169
108170 /* Add the entry to the stat1 table. */
108171 callStatGet(pParse, regStat, STAT_GET_STAT1, regStat1);
108172 assert( "BBB"[0]==SQLITE_AFF_TEXT );
108173 sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0);
108174 sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
108175 sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
108176 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
@@ -107623,11 +108178,11 @@
108178 #endif
108179 sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
108180
108181 /* Add the entries to the stat4 table. */
108182 #ifdef SQLITE_ENABLE_STAT4
108183 if( OptimizationEnabled(db, SQLITE_Stat4) && db->nAnalysisLimit==0 ){
108184 int regEq = regStat1;
108185 int regLt = regStat1+1;
108186 int regDLt = regStat1+2;
108187 int regSample = regStat1+3;
108188 int regCol = regStat1+4;
@@ -107637,16 +108192,16 @@
108192 u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
108193
108194 pParse->nMem = MAX(pParse->nMem, regCol+nCol);
108195
108196 addrNext = sqlite3VdbeCurrentAddr(v);
108197 callStatGet(pParse, regStat, STAT_GET_ROWID, regSampleRowid);
108198 addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid);
108199 VdbeCoverage(v);
108200 callStatGet(pParse, regStat, STAT_GET_NEQ, regEq);
108201 callStatGet(pParse, regStat, STAT_GET_NLT, regLt);
108202 callStatGet(pParse, regStat, STAT_GET_NDLT, regDLt);
108203 sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
108204 VdbeCoverage(v);
108205 for(i=0; i<nCol; i++){
108206 sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i);
108207 }
@@ -122629,10 +123184,11 @@
123184 const char *(*filename_wal)(const char*);
123185 /* Version 3.32.0 and later */
123186 char *(*create_filename)(const char*,const char*,const char*,
123187 int,const char**);
123188 void (*free_filename)(char*);
123189 sqlite3_file *(*database_file_object)(const char*);
123190 };
123191
123192 /*
123193 ** This is the function signature used for all extension entry points. It
123194 ** is also defined in the file "loadext.c".
@@ -122932,10 +123488,11 @@
123488 #define sqlite3_filename_journal sqlite3_api->filename_journal
123489 #define sqlite3_filename_wal sqlite3_api->filename_wal
123490 /* Version 3.32.0 and later */
123491 #define sqlite3_create_filename sqlite3_api->create_filename
123492 #define sqlite3_free_filename sqlite3_api->free_filename
123493 #define sqlite3_database_file_object sqlite3_api->database_file_object
123494 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
123495
123496 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
123497 /* This case when the file really is being compiled as a loadable
123498 ** extension */
@@ -123413,11 +123970,20 @@
123970 sqlite3_filename_journal,
123971 sqlite3_filename_wal,
123972 /* Version 3.32.0 and later */
123973 sqlite3_create_filename,
123974 sqlite3_free_filename,
123975 sqlite3_database_file_object,
123976 };
123977
123978 /* True if x is the directory separator character
123979 */
123980 #if SQLITE_OS_WIN
123981 # define DirSep(X) ((X)=='/'||(X)=='\\')
123982 #else
123983 # define DirSep(X) ((X)=='/')
123984 #endif
123985
123986 /*
123987 ** Attempt to load an SQLite extension library contained in the file
123988 ** zFile. The entry point is zProc. zProc may be 0 in which case a
123989 ** default entry point name (sqlite3_extension_init) is used. Use
@@ -123516,11 +124082,11 @@
124082 if( zAltEntry==0 ){
124083 sqlite3OsDlClose(pVfs, handle);
124084 return SQLITE_NOMEM_BKPT;
124085 }
124086 memcpy(zAltEntry, "sqlite3_", 8);
124087 for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){}
124088 iFile++;
124089 if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
124090 for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
124091 if( sqlite3Isalpha(c) ){
124092 zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
@@ -123820,53 +124386,54 @@
124386 ** that script and rerun it.
124387 */
124388
124389 /* The various pragma types */
124390 #define PragTyp_ACTIVATE_EXTENSIONS 0
124391 #define PragTyp_ANALYSIS_LIMIT 1
124392 #define PragTyp_HEADER_VALUE 2
124393 #define PragTyp_AUTO_VACUUM 3
124394 #define PragTyp_FLAG 4
124395 #define PragTyp_BUSY_TIMEOUT 5
124396 #define PragTyp_CACHE_SIZE 6
124397 #define PragTyp_CACHE_SPILL 7
124398 #define PragTyp_CASE_SENSITIVE_LIKE 8
124399 #define PragTyp_COLLATION_LIST 9
124400 #define PragTyp_COMPILE_OPTIONS 10
124401 #define PragTyp_DATA_STORE_DIRECTORY 11
124402 #define PragTyp_DATABASE_LIST 12
124403 #define PragTyp_DEFAULT_CACHE_SIZE 13
124404 #define PragTyp_ENCODING 14
124405 #define PragTyp_FOREIGN_KEY_CHECK 15
124406 #define PragTyp_FOREIGN_KEY_LIST 16
124407 #define PragTyp_FUNCTION_LIST 17
124408 #define PragTyp_HARD_HEAP_LIMIT 18
124409 #define PragTyp_INCREMENTAL_VACUUM 19
124410 #define PragTyp_INDEX_INFO 20
124411 #define PragTyp_INDEX_LIST 21
124412 #define PragTyp_INTEGRITY_CHECK 22
124413 #define PragTyp_JOURNAL_MODE 23
124414 #define PragTyp_JOURNAL_SIZE_LIMIT 24
124415 #define PragTyp_LOCK_PROXY_FILE 25
124416 #define PragTyp_LOCKING_MODE 26
124417 #define PragTyp_PAGE_COUNT 27
124418 #define PragTyp_MMAP_SIZE 28
124419 #define PragTyp_MODULE_LIST 29
124420 #define PragTyp_OPTIMIZE 30
124421 #define PragTyp_PAGE_SIZE 31
124422 #define PragTyp_PRAGMA_LIST 32
124423 #define PragTyp_SECURE_DELETE 33
124424 #define PragTyp_SHRINK_MEMORY 34
124425 #define PragTyp_SOFT_HEAP_LIMIT 35
124426 #define PragTyp_SYNCHRONOUS 36
124427 #define PragTyp_TABLE_INFO 37
124428 #define PragTyp_TEMP_STORE 38
124429 #define PragTyp_TEMP_STORE_DIRECTORY 39
124430 #define PragTyp_THREADS 40
124431 #define PragTyp_WAL_AUTOCHECKPOINT 41
124432 #define PragTyp_WAL_CHECKPOINT 42
124433 #define PragTyp_LOCK_STATUS 43
124434 #define PragTyp_STATS 44
124435
124436 /* Property flags associated with various pragma. */
124437 #define PragFlg_NeedSchema 0x01 /* Force schema load before running */
124438 #define PragFlg_NoColumns 0x02 /* OP_ResultRow called with zero columns */
124439 #define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
@@ -123953,10 +124520,15 @@
124520 /* ePragTyp: */ PragTyp_ACTIVATE_EXTENSIONS,
124521 /* ePragFlg: */ 0,
124522 /* ColNames: */ 0, 0,
124523 /* iArg: */ 0 },
124524 #endif
124525 {/* zName: */ "analysis_limit",
124526 /* ePragTyp: */ PragTyp_ANALYSIS_LIMIT,
124527 /* ePragFlg: */ PragFlg_Result0,
124528 /* ColNames: */ 0, 0,
124529 /* iArg: */ 0 },
124530 #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
124531 {/* zName: */ "application_id",
124532 /* ePragTyp: */ PragTyp_HEADER_VALUE,
124533 /* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
124534 /* ColNames: */ 0, 0,
@@ -124453,11 +125025,11 @@
125025 /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
125026 /* ColNames: */ 0, 0,
125027 /* iArg: */ SQLITE_WriteSchema|SQLITE_NoSchemaError },
125028 #endif
125029 };
125030 /* Number of pragmas: 67 on by default, 77 total. */
125031
125032 /************** End of pragma.h **********************************************/
125033 /************** Continuing where we left off in pragma.c *********************/
125034
125035 /*
@@ -126157,11 +126729,10 @@
126729 sqlite3ResolvePartIdxLabel(pParse, jmp3);
126730 }
126731 }
126732 sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v);
126733 sqlite3VdbeJumpHere(v, loopTop-1);
 
126734 if( !isQuick ){
126735 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
126736 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
126737 if( pPk==pIdx ) continue;
126738 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
@@ -126171,11 +126742,10 @@
126742 sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3);
126743 integrityCheckResultRow(v);
126744 sqlite3VdbeJumpHere(v, addr);
126745 }
126746 }
 
126747 }
126748 }
126749 {
126750 static const int iLn = VDBE_OFFSET_LINENO(2);
126751 static const VdbeOpList endCode[] = {
@@ -126605,10 +127175,29 @@
127175 sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, (int)(N&0x7fffffff));
127176 }
127177 returnSingleInt(v, sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, -1));
127178 break;
127179 }
127180
127181 /*
127182 ** PRAGMA analysis_limit
127183 ** PRAGMA analysis_limit = N
127184 **
127185 ** Configure the maximum number of rows that ANALYZE will examine
127186 ** in each index that it looks at. Return the new limit.
127187 */
127188 case PragTyp_ANALYSIS_LIMIT: {
127189 sqlite3_int64 N;
127190 if( zRight
127191 && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK
127192 && N>=0
127193 ){
127194 db->nAnalysisLimit = (int)(N&0x7fffffff);
127195 }
127196 returnSingleInt(v, db->nAnalysisLimit);
127197 break;
127198 }
127199
127200 #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
127201 /*
127202 ** Report the current state of file logs for all databases
127203 */
@@ -131404,10 +131993,11 @@
131993 if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){
131994 memset(&ifNullRow, 0, sizeof(ifNullRow));
131995 ifNullRow.op = TK_IF_NULL_ROW;
131996 ifNullRow.pLeft = pCopy;
131997 ifNullRow.iTable = pSubst->iNewTable;
131998 ifNullRow.flags = EP_Skip;
131999 pCopy = &ifNullRow;
132000 }
132001 testcase( ExprHasProperty(pCopy, EP_Subquery) );
132002 pNew = sqlite3ExprDup(db, pCopy, 0);
132003 if( pNew && pSubst->isLeftJoin ){
@@ -134568,11 +135158,10 @@
135158 VdbeComment((v, "indicate accumulator empty"));
135159 sqlite3VdbeAddOp1(v, OP_Return, regReset);
135160
135161 } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */
135162 else {
 
135163 Table *pTab;
135164 if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){
135165 /* If isSimpleCount() returns a pointer to a Table structure, then
135166 ** the SQL statement is of the form:
135167 **
@@ -134626,13 +135215,11 @@
135215 sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO);
135216 }
135217 sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem);
135218 sqlite3VdbeAddOp1(v, OP_Close, iCsr);
135219 explainSimpleCount(pParse, pTab, pBest);
135220 }else{
 
 
135221 int regAcc = 0; /* "populate accumulators" flag */
135222
135223 /* If there are accumulator registers but no min() or max() functions
135224 ** without FILTER clauses, allocate register regAcc. Register regAcc
135225 ** will contain 0 the first time the inner loop runs, and 1 thereafter.
@@ -159255,19 +159842,82 @@
159842
159843
159844 /************** End of sqliteicu.h *******************************************/
159845 /************** Continuing where we left off in main.c ***********************/
159846 #endif
159847
159848 /*
159849 ** This is an extension initializer that is a no-op and always
159850 ** succeeds, except that it fails if the fault-simulation is set
159851 ** to 500.
159852 */
159853 static int sqlite3TestExtInit(sqlite3 *db){
159854 (void)db;
159855 return sqlite3FaultSim(500);
159856 }
159857
159858
159859 /*
159860 ** Forward declarations of external module initializer functions
159861 ** for modules that need them.
159862 */
159863 #ifdef SQLITE_ENABLE_FTS1
159864 SQLITE_PRIVATE int sqlite3Fts1Init(sqlite3*);
159865 #endif
159866 #ifdef SQLITE_ENABLE_FTS2
159867 SQLITE_PRIVATE int sqlite3Fts2Init(sqlite3*);
159868 #endif
159869 #ifdef SQLITE_ENABLE_FTS5
159870 SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*);
159871 #endif
159872 #ifdef SQLITE_ENABLE_JSON1
159873 SQLITE_PRIVATE int sqlite3Json1Init(sqlite3*);
159874 #endif
159875 #ifdef SQLITE_ENABLE_STMTVTAB
159876 SQLITE_PRIVATE int sqlite3StmtVtabInit(sqlite3*);
159877 #endif
159878
159879 /*
159880 ** An array of pointers to extension initializer functions for
159881 ** built-in extensions.
159882 */
159883 static int (*const sqlite3BuiltinExtensions[])(sqlite3*) = {
159884 #ifdef SQLITE_ENABLE_FTS1
159885 sqlite3Fts1Init,
159886 #endif
159887 #ifdef SQLITE_ENABLE_FTS2
159888 sqlite3Fts2Init,
159889 #endif
159890 #ifdef SQLITE_ENABLE_FTS3
159891 sqlite3Fts3Init,
159892 #endif
159893 #ifdef SQLITE_ENABLE_FTS5
159894 sqlite3Fts5Init,
159895 #endif
159896 #if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
159897 sqlite3IcuInit,
159898 #endif
159899 #ifdef SQLITE_ENABLE_RTREE
159900 sqlite3RtreeInit,
159901 #endif
159902 #ifdef SQLITE_ENABLE_DBPAGE_VTAB
159903 sqlite3DbpageRegister,
159904 #endif
159905 #ifdef SQLITE_ENABLE_DBSTAT_VTAB
159906 sqlite3DbstatRegister,
159907 #endif
159908 sqlite3TestExtInit,
159909 #ifdef SQLITE_ENABLE_JSON1
159910 sqlite3Json1Init,
159911 #endif
159912 #ifdef SQLITE_ENABLE_STMTVTAB
159913 sqlite3StmtVtabInit,
159914 #endif
159915 #ifdef SQLITE_ENABLE_BYTECODE_VTAB
159916 sqlite3VdbeBytecodeVtabInit,
159917 #endif
159918 };
159919
159920 #ifndef SQLITE_AMALGAMATION
159921 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
159922 ** contains the text of SQLITE_VERSION macro.
159923 */
@@ -162272,10 +162922,11 @@
162922 sqlite3 *db; /* Store allocated handle here */
162923 int rc; /* Return code */
162924 int isThreadsafe; /* True for threadsafe connections */
162925 char *zOpen = 0; /* Filename argument to pass to BtreeOpen() */
162926 char *zErrMsg = 0; /* Error message from sqlite3ParseUri() */
162927 int i; /* Loop counter */
162928
162929 #ifdef SQLITE_ENABLE_API_ARMOR
162930 if( ppDb==0 ) return SQLITE_MISUSE_BKPT;
162931 #endif
162932 *ppDb = 0;
@@ -162512,18 +163163,15 @@
163163 */
163164 sqlite3Error(db, SQLITE_OK);
163165 sqlite3RegisterPerConnectionBuiltinFunctions(db);
163166 rc = sqlite3_errcode(db);
163167
163168
163169 /* Load compiled-in extensions */
163170 for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
163171 rc = sqlite3BuiltinExtensions[i](db);
163172 }
 
 
 
163173
163174 /* Load automatic extensions - extensions that have been registered
163175 ** using the sqlite3_automatic_extension() API.
163176 */
163177 if( rc==SQLITE_OK ){
@@ -162532,66 +163180,10 @@
163180 if( rc!=SQLITE_OK ){
163181 goto opendb_out;
163182 }
163183 }
163184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163185 #ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS
163186 /* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time
163187 ** option gives access to internal functions by default.
163188 ** Testing use only!!! */
163189 db->mDbFlags |= DBFLAG_InternalFunc;
@@ -165357,10 +165949,11 @@
165949 SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*);
165950 SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *);
165951 SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *);
165952 SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int*, Fts3Table*);
165953 SQLITE_PRIVATE int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc);
165954 SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut);
165955
165956 /* fts3_tokenizer.c */
165957 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *);
165958 SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *);
165959 SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *,
@@ -166088,10 +166681,26 @@
166681 fts3Appendf(pRc, &zRet, ", ?");
166682 }
166683 sqlite3_free(zFree);
166684 return zRet;
166685 }
166686
166687 /*
166688 ** Buffer z contains a positive integer value encoded as utf-8 text.
166689 ** Decode this value and store it in *pnOut, returning the number of bytes
166690 ** consumed. If an overflow error occurs return a negative value.
166691 */
166692 SQLITE_PRIVATE int sqlite3Fts3ReadInt(const char *z, int *pnOut){
166693 u64 iVal = 0;
166694 int i;
166695 for(i=0; z[i]>='0' && z[i]<='9'; i++){
166696 iVal = iVal*10 + (z[i] - '0');
166697 if( iVal>0x7FFFFFFF ) return -1;
166698 }
166699 *pnOut = (int)iVal;
166700 return i;
166701 }
166702
166703 /*
166704 ** This function interprets the string at (*pp) as a non-negative integer
166705 ** value. It reads the integer and sets *pnOut to the value read, then
166706 ** sets *pp to point to the byte immediately following the last byte of
@@ -166104,23 +166713,21 @@
166713 **
166714 ** This function is used when parsing the "prefix=" FTS4 parameter.
166715 */
166716 static int fts3GobbleInt(const char **pp, int *pnOut){
166717 const int MAX_NPREFIX = 10000000;
 
166718 int nInt = 0; /* Output value */
166719 int nByte;
166720 nByte = sqlite3Fts3ReadInt(*pp, &nInt);
166721 if( nInt>MAX_NPREFIX ){
166722 nInt = 0;
166723 }
166724 if( nByte==0 ){
166725 return SQLITE_ERROR;
166726 }
 
166727 *pnOut = nInt;
166728 *pp += nByte;
166729 return SQLITE_OK;
166730 }
166731
166732 /*
166733 ** This function is called to allocate an array of Fts3Index structures
@@ -172198,14 +172805,11 @@
172805
172806 /* If this is a "NEAR" keyword, check for an explicit nearness. */
172807 if( pKey->eType==FTSQUERY_NEAR ){
172808 assert( nKey==4 );
172809 if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){
172810 nKey += 1+sqlite3Fts3ReadInt(&zInput[nKey+1], &nNear);
 
 
 
172811 }
172812 }
172813
172814 /* At this point this is probably a keyword. But for that to be true,
172815 ** the next byte must contain either whitespace, an open or close
@@ -178384,25 +178988,25 @@
178988 ){
178989 const unsigned char *zText = sqlite3_column_text(pStmt, iCol);
178990 if( zText ){
178991 int i;
178992 int iMul = 1;
178993 u64 iVal = 0;
178994 for(i=0; zText[i]>='0' && zText[i]<='9'; i++){
178995 iVal = iVal*10 + (zText[i] - '0');
178996 }
178997 *piEndBlock = (i64)iVal;
178998 while( zText[i]==' ' ) i++;
178999 iVal = 0;
179000 if( zText[i]=='-' ){
179001 i++;
179002 iMul = -1;
179003 }
179004 for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){
179005 iVal = iVal*10 + (zText[i] - '0');
179006 }
179007 *pnByte = ((i64)iVal * (i64)iMul);
179008 }
179009 }
179010
179011
179012 /*
@@ -223901,11 +224505,11 @@
224505 int nArg, /* Number of args */
224506 sqlite3_value **apUnused /* Function arguments */
224507 ){
224508 assert( nArg==0 );
224509 UNUSED_PARAM2(nArg, apUnused);
224510 sqlite3_result_text(pCtx, "fts5: 2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda", -1, SQLITE_TRANSIENT);
224511 }
224512
224513 /*
224514 ** Return true if zName is the extension on one of the shadow tables used
224515 ** by this module.
@@ -228552,11 +229156,12 @@
229156 }
229157 case STMT_COLUMN_BUSY: {
229158 sqlite3_result_int(ctx, sqlite3_stmt_busy(pCur->pStmt));
229159 break;
229160 }
229161 default: {
229162 assert( i==STMT_COLUMN_MEM );
229163 i = SQLITE_STMTSTATUS_MEMUSED +
229164 STMT_COLUMN_NSCAN - SQLITE_STMTSTATUS_FULLSCAN_STEP;
229165 /* Fall thru */
229166 }
229167 case STMT_COLUMN_NSCAN:
@@ -228683,12 +229288,12 @@
229288 }
229289 #endif /* SQLITE_CORE */
229290 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229291
229292 /************** End of stmt.c ************************************************/
229293 #if __LINE__!=229293
229294 #undef SQLITE_SOURCE_ID
229295 #define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb21alt2"
229296 #endif
229297 /* Return the source-id for this library */
229298 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229299 /************************** End of sqlite3.c ******************************/
229300
+56 -23
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.32.0"
127127
#define SQLITE_VERSION_NUMBER 3032000
128
-#define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0926b"
128
+#define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -297,30 +297,26 @@
297297
** for the [sqlite3] object.
298298
** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
299299
** the [sqlite3] object is successfully destroyed and all associated
300300
** resources are deallocated.
301301
**
302
+** Ideally, applications should [sqlite3_finalize | finalize] all
303
+** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
304
+** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
305
+** with the [sqlite3] object prior to attempting to close the object.
302306
** ^If the database connection is associated with unfinalized prepared
303
-** statements or unfinished sqlite3_backup objects then sqlite3_close()
304
-** will leave the database connection open and return [SQLITE_BUSY].
305
-** ^If sqlite3_close_v2() is called with unfinalized prepared statements
306
-** and/or unfinished sqlite3_backups, then the database connection becomes
307
-** an unusable "zombie" which will automatically be deallocated when the
308
-** last prepared statement is finalized or the last sqlite3_backup is
309
-** finished. The sqlite3_close_v2() interface is intended for use with
310
-** host languages that are garbage collected, and where the order in which
311
-** destructors are called is arbitrary.
312
-**
313
-** Applications should [sqlite3_finalize | finalize] all [prepared statements],
314
-** [sqlite3_blob_close | close] all [BLOB handles], and
315
-** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
316
-** with the [sqlite3] object prior to attempting to close the object. ^If
317
-** sqlite3_close_v2() is called on a [database connection] that still has
318
-** outstanding [prepared statements], [BLOB handles], and/or
319
-** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
320
-** of resources is deferred until all [prepared statements], [BLOB handles],
321
-** and [sqlite3_backup] objects are also destroyed.
307
+** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
308
+** sqlite3_close() will leave the database connection open and return
309
+** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
310
+** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
311
+** it returns [SQLITE_OK] regardless, but instead of deallocating the database
312
+** connection immediately, it marks the database connection as an unusable
313
+** "zombie" and makes arrangements to automatically deallocate the database
314
+** connection after all prepared statements are finalized, all BLOB handles
315
+** are closed, and all backups have finished. The sqlite3_close_v2() interface
316
+** is intended for use with host languages that are garbage collected, and
317
+** where the order in which destructors are called is arbitrary.
322318
**
323319
** ^If an [sqlite3] object is destroyed while a transaction is open,
324320
** the transaction is automatically rolled back.
325321
**
326322
** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -505,10 +501,11 @@
505501
#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
506502
#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
507503
#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
508504
#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
509505
#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
506
+#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
510507
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
511508
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
512509
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
513510
#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
514511
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -1111,10 +1108,15 @@
11111108
** a single attached database that occur due to other database connections,
11121109
** but omits changes implemented by the database connection on which it is
11131110
** called. This file control is the only mechanism to detect changes that
11141111
** happen either internally or externally and that are associated with
11151112
** a particular attached database.
1113
+**
1114
+** <li>[[SQLITE_FCNTL_CKPT_START]]
1115
+** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
1116
+** in wal mode before the client starts to copy pages from the wal
1117
+** file to the database file.
11161118
**
11171119
** <li>[[SQLITE_FCNTL_CKPT_DONE]]
11181120
** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
11191121
** in wal mode after the client has finished copying pages from the wal
11201122
** file to the database file, but before the *-shm file is updated to
@@ -1156,10 +1158,11 @@
11561158
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
11571159
#define SQLITE_FCNTL_DATA_VERSION 35
11581160
#define SQLITE_FCNTL_SIZE_LIMIT 36
11591161
#define SQLITE_FCNTL_CKPT_DONE 37
11601162
#define SQLITE_FCNTL_RESERVE_BYTES 38
1163
+#define SQLITE_FCNTL_CKPT_START 39
11611164
11621165
/* deprecated names */
11631166
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
11641167
#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
11651168
#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -3534,12 +3537,23 @@
35343537
**
35353538
** These are utility routines, useful to [VFS|custom VFS implementations],
35363539
** that check if a database file was a URI that contained a specific query
35373540
** parameter, and if so obtains the value of that query parameter.
35383541
**
3539
-** If F is the database filename pointer passed into the xOpen() method of
3540
-** a VFS implementation or it is the return value of [sqlite3_db_filename()]
3542
+** The first parameter to these interfaces (hereafter referred to
3543
+** as F) must be one of:
3544
+** <ul>
3545
+** <li> A database filename pointer created by the SQLite core and
3546
+** passed into the xOpen() method of a VFS implemention, or
3547
+** <li> A filename obtained from [sqlite3_db_filename()], or
3548
+** <li> A new filename constructed using [sqlite3_create_filename()].
3549
+** </ul>
3550
+** If the F parameter is not one of the above, then the behavior is
3551
+** undefined and probably undesirable. Older versions of SQLite were
3552
+** more tolerant of invalid F parameters than newer versions.
3553
+**
3554
+** If F is a suitable filename (as described in the previous paragraph)
35413555
** and if P is the name of the query parameter, then
35423556
** sqlite3_uri_parameter(F,P) returns the value of the P
35433557
** parameter if it exists or a NULL pointer if P does not appear as a
35443558
** query parameter on F. If P is a query parameter of F and it
35453559
** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -3618,10 +3632,29 @@
36183632
*/
36193633
SQLITE_API const char *sqlite3_filename_database(const char*);
36203634
SQLITE_API const char *sqlite3_filename_journal(const char*);
36213635
SQLITE_API const char *sqlite3_filename_wal(const char*);
36223636
3637
+/*
3638
+** CAPI3REF: Database File Corresponding To A Journal
3639
+**
3640
+** ^If X is the name of a rollback or WAL-mode journal file that is
3641
+** passed into the xOpen method of [sqlite3_vfs], then
3642
+** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file]
3643
+** object that represents the main database file.
3644
+**
3645
+** This routine is intended for use in custom [VFS] implementations
3646
+** only. It is not a general-purpose interface.
3647
+** The argument sqlite3_file_object(X) must be a filename pointer that
3648
+** has been passed into [sqlite3_vfs].xOpen method where the
3649
+** flags parameter to xOpen contains one of the bits
3650
+** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use
3651
+** of this routine results in undefined and probably undesirable
3652
+** behavior.
3653
+*/
3654
+SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
3655
+
36233656
/*
36243657
** CAPI3REF: Create and Destroy VFS Filenames
36253658
**
36263659
** These interfces are provided for use by [VFS shim] implementations and
36273660
** are not useful outside of that context.
@@ -3652,11 +3685,11 @@
36523685
** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
36533686
** be NULL pointers, though they can be empty strings.
36543687
**
36553688
** The sqlite3_free_filename(Y) routine releases a memory allocation
36563689
** previously obtained from sqlite3_create_filename(). Invoking
3657
-** sqlite3_free_filename(Y) is a NULL pointer is a harmless no-op.
3690
+** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op.
36583691
**
36593692
** If the Y parameter to sqlite3_free_filename(Y) is anything other
36603693
** than a NULL pointer or a pointer previously acquired from
36613694
** sqlite3_create_filename(), then bad things such as heap
36623695
** corruption or segfaults may occur. The value Y should be
36633696
36643697
ADDED src/terminal.c
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.32.0"
127 #define SQLITE_VERSION_NUMBER 3032000
128 #define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0926b"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -297,30 +297,26 @@
297 ** for the [sqlite3] object.
298 ** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
299 ** the [sqlite3] object is successfully destroyed and all associated
300 ** resources are deallocated.
301 **
 
 
 
 
302 ** ^If the database connection is associated with unfinalized prepared
303 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
304 ** will leave the database connection open and return [SQLITE_BUSY].
305 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
306 ** and/or unfinished sqlite3_backups, then the database connection becomes
307 ** an unusable "zombie" which will automatically be deallocated when the
308 ** last prepared statement is finalized or the last sqlite3_backup is
309 ** finished. The sqlite3_close_v2() interface is intended for use with
310 ** host languages that are garbage collected, and where the order in which
311 ** destructors are called is arbitrary.
312 **
313 ** Applications should [sqlite3_finalize | finalize] all [prepared statements],
314 ** [sqlite3_blob_close | close] all [BLOB handles], and
315 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
316 ** with the [sqlite3] object prior to attempting to close the object. ^If
317 ** sqlite3_close_v2() is called on a [database connection] that still has
318 ** outstanding [prepared statements], [BLOB handles], and/or
319 ** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
320 ** of resources is deferred until all [prepared statements], [BLOB handles],
321 ** and [sqlite3_backup] objects are also destroyed.
322 **
323 ** ^If an [sqlite3] object is destroyed while a transaction is open,
324 ** the transaction is automatically rolled back.
325 **
326 ** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -505,10 +501,11 @@
505 #define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
506 #define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
507 #define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
508 #define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
509 #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
 
510 #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
511 #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
512 #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
513 #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
514 #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -1111,10 +1108,15 @@
1111 ** a single attached database that occur due to other database connections,
1112 ** but omits changes implemented by the database connection on which it is
1113 ** called. This file control is the only mechanism to detect changes that
1114 ** happen either internally or externally and that are associated with
1115 ** a particular attached database.
 
 
 
 
 
1116 **
1117 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1118 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1119 ** in wal mode after the client has finished copying pages from the wal
1120 ** file to the database file, but before the *-shm file is updated to
@@ -1156,10 +1158,11 @@
1156 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
1157 #define SQLITE_FCNTL_DATA_VERSION 35
1158 #define SQLITE_FCNTL_SIZE_LIMIT 36
1159 #define SQLITE_FCNTL_CKPT_DONE 37
1160 #define SQLITE_FCNTL_RESERVE_BYTES 38
 
1161
1162 /* deprecated names */
1163 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
1164 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
1165 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -3534,12 +3537,23 @@
3534 **
3535 ** These are utility routines, useful to [VFS|custom VFS implementations],
3536 ** that check if a database file was a URI that contained a specific query
3537 ** parameter, and if so obtains the value of that query parameter.
3538 **
3539 ** If F is the database filename pointer passed into the xOpen() method of
3540 ** a VFS implementation or it is the return value of [sqlite3_db_filename()]
 
 
 
 
 
 
 
 
 
 
 
3541 ** and if P is the name of the query parameter, then
3542 ** sqlite3_uri_parameter(F,P) returns the value of the P
3543 ** parameter if it exists or a NULL pointer if P does not appear as a
3544 ** query parameter on F. If P is a query parameter of F and it
3545 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -3618,10 +3632,29 @@
3618 */
3619 SQLITE_API const char *sqlite3_filename_database(const char*);
3620 SQLITE_API const char *sqlite3_filename_journal(const char*);
3621 SQLITE_API const char *sqlite3_filename_wal(const char*);
3622
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3623 /*
3624 ** CAPI3REF: Create and Destroy VFS Filenames
3625 **
3626 ** These interfces are provided for use by [VFS shim] implementations and
3627 ** are not useful outside of that context.
@@ -3652,11 +3685,11 @@
3652 ** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
3653 ** be NULL pointers, though they can be empty strings.
3654 **
3655 ** The sqlite3_free_filename(Y) routine releases a memory allocation
3656 ** previously obtained from sqlite3_create_filename(). Invoking
3657 ** sqlite3_free_filename(Y) is a NULL pointer is a harmless no-op.
3658 **
3659 ** If the Y parameter to sqlite3_free_filename(Y) is anything other
3660 ** than a NULL pointer or a pointer previously acquired from
3661 ** sqlite3_create_filename(), then bad things such as heap
3662 ** corruption or segfaults may occur. The value Y should be
3663
3664 DDED src/terminal.c
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.32.0"
127 #define SQLITE_VERSION_NUMBER 3032000
128 #define SQLITE_SOURCE_ID "2020-05-04 19:52:00 8eee591d3cb9fadfd5cac5543bd66ef9cb371a72d3ad3241fb3bfd67fb216eda"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -297,30 +297,26 @@
297 ** for the [sqlite3] object.
298 ** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
299 ** the [sqlite3] object is successfully destroyed and all associated
300 ** resources are deallocated.
301 **
302 ** Ideally, applications should [sqlite3_finalize | finalize] all
303 ** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
304 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
305 ** with the [sqlite3] object prior to attempting to close the object.
306 ** ^If the database connection is associated with unfinalized prepared
307 ** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
308 ** sqlite3_close() will leave the database connection open and return
309 ** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
310 ** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
311 ** it returns [SQLITE_OK] regardless, but instead of deallocating the database
312 ** connection immediately, it marks the database connection as an unusable
313 ** "zombie" and makes arrangements to automatically deallocate the database
314 ** connection after all prepared statements are finalized, all BLOB handles
315 ** are closed, and all backups have finished. The sqlite3_close_v2() interface
316 ** is intended for use with host languages that are garbage collected, and
317 ** where the order in which destructors are called is arbitrary.
 
 
 
 
 
 
 
 
318 **
319 ** ^If an [sqlite3] object is destroyed while a transaction is open,
320 ** the transaction is automatically rolled back.
321 **
322 ** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
@@ -505,10 +501,11 @@
501 #define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
502 #define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
503 #define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
504 #define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
505 #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
506 #define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
507 #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
508 #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
509 #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
510 #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
511 #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -1111,10 +1108,15 @@
1108 ** a single attached database that occur due to other database connections,
1109 ** but omits changes implemented by the database connection on which it is
1110 ** called. This file control is the only mechanism to detect changes that
1111 ** happen either internally or externally and that are associated with
1112 ** a particular attached database.
1113 **
1114 ** <li>[[SQLITE_FCNTL_CKPT_START]]
1115 ** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
1116 ** in wal mode before the client starts to copy pages from the wal
1117 ** file to the database file.
1118 **
1119 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1120 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1121 ** in wal mode after the client has finished copying pages from the wal
1122 ** file to the database file, but before the *-shm file is updated to
@@ -1156,10 +1158,11 @@
1158 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
1159 #define SQLITE_FCNTL_DATA_VERSION 35
1160 #define SQLITE_FCNTL_SIZE_LIMIT 36
1161 #define SQLITE_FCNTL_CKPT_DONE 37
1162 #define SQLITE_FCNTL_RESERVE_BYTES 38
1163 #define SQLITE_FCNTL_CKPT_START 39
1164
1165 /* deprecated names */
1166 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
1167 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
1168 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -3534,12 +3537,23 @@
3537 **
3538 ** These are utility routines, useful to [VFS|custom VFS implementations],
3539 ** that check if a database file was a URI that contained a specific query
3540 ** parameter, and if so obtains the value of that query parameter.
3541 **
3542 ** The first parameter to these interfaces (hereafter referred to
3543 ** as F) must be one of:
3544 ** <ul>
3545 ** <li> A database filename pointer created by the SQLite core and
3546 ** passed into the xOpen() method of a VFS implemention, or
3547 ** <li> A filename obtained from [sqlite3_db_filename()], or
3548 ** <li> A new filename constructed using [sqlite3_create_filename()].
3549 ** </ul>
3550 ** If the F parameter is not one of the above, then the behavior is
3551 ** undefined and probably undesirable. Older versions of SQLite were
3552 ** more tolerant of invalid F parameters than newer versions.
3553 **
3554 ** If F is a suitable filename (as described in the previous paragraph)
3555 ** and if P is the name of the query parameter, then
3556 ** sqlite3_uri_parameter(F,P) returns the value of the P
3557 ** parameter if it exists or a NULL pointer if P does not appear as a
3558 ** query parameter on F. If P is a query parameter of F and it
3559 ** has no explicit value, then sqlite3_uri_parameter(F,P) returns
@@ -3618,10 +3632,29 @@
3632 */
3633 SQLITE_API const char *sqlite3_filename_database(const char*);
3634 SQLITE_API const char *sqlite3_filename_journal(const char*);
3635 SQLITE_API const char *sqlite3_filename_wal(const char*);
3636
3637 /*
3638 ** CAPI3REF: Database File Corresponding To A Journal
3639 **
3640 ** ^If X is the name of a rollback or WAL-mode journal file that is
3641 ** passed into the xOpen method of [sqlite3_vfs], then
3642 ** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file]
3643 ** object that represents the main database file.
3644 **
3645 ** This routine is intended for use in custom [VFS] implementations
3646 ** only. It is not a general-purpose interface.
3647 ** The argument sqlite3_file_object(X) must be a filename pointer that
3648 ** has been passed into [sqlite3_vfs].xOpen method where the
3649 ** flags parameter to xOpen contains one of the bits
3650 ** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use
3651 ** of this routine results in undefined and probably undesirable
3652 ** behavior.
3653 */
3654 SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
3655
3656 /*
3657 ** CAPI3REF: Create and Destroy VFS Filenames
3658 **
3659 ** These interfces are provided for use by [VFS shim] implementations and
3660 ** are not useful outside of that context.
@@ -3652,11 +3685,11 @@
3685 ** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
3686 ** be NULL pointers, though they can be empty strings.
3687 **
3688 ** The sqlite3_free_filename(Y) routine releases a memory allocation
3689 ** previously obtained from sqlite3_create_filename(). Invoking
3690 ** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op.
3691 **
3692 ** If the Y parameter to sqlite3_free_filename(Y) is anything other
3693 ** than a NULL pointer or a pointer previously acquired from
3694 ** sqlite3_create_filename(), then bad things such as heap
3695 ** corruption or segfaults may occur. The value Y should be
3696
3697 DDED src/terminal.c
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -0,0 +1,14 @@
1
+COMMAND: test-terminal-size
2
+**
3
+** Show the size of the terminal window from which the command is launched
4
+** as two integers, the width in characters and the height in lines.
5
+**
6
+** If the size cannot be determined, two zeros are shown.
7
+*/
8
+void test_terminal_size_cmd(void* Technically, this infosuch is supported; set;
9
+ fossil_print("%d %d\nchar *zNoC!=-1!=-1struct TSize *t)
10
+
11
+{
12
+ struct
13
+{
14
+ struct
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -0,0 +1,14 @@
1 COMMAND: test-terminal-size
2 **
3 ** Show the size of the terminal window from which the command is launched
4 ** as two integers, the width in characters and the height in lines.
5 **
6 ** If the size cannot be determined, two zeros are shown.
7 */
8 void test_terminal_size_cmd(void* Technically, this infosuch is supported; set;
9 fossil_print("%d %d\nchar *zNoC!=-1!=-1struct TSize *t)
10
11 {
12 struct
13 {
14 struct
+2
--- src/url.c
+++ src/url.c
@@ -377,13 +377,15 @@
377377
*/
378378
void url_proxy_options(void){
379379
zProxyOpt = find_option("proxy", 0, 1);
380380
if( find_option("nosync",0,0) ) g.fNoSync = 1;
381381
if( find_option("ipv4",0,0) ) g.fIPv4 = 1;
382
+#ifdef FOSSIL_ENABLE_SSL
382383
if( find_option("accept-any-cert",0,0) ){
383384
ssl_disable_cert_verification();
384385
}
386
+#endif /* FOSSIL_ENABLE_SSL */
385387
}
386388
387389
/*
388390
** If the "proxy" setting is defined, then change the URL settings
389391
** (initialized by a prior call to url_parse()) so that the HTTP
390392
391393
ADDED tools/fossil-diff-log
--- src/url.c
+++ src/url.c
@@ -377,13 +377,15 @@
377 */
378 void url_proxy_options(void){
379 zProxyOpt = find_option("proxy", 0, 1);
380 if( find_option("nosync",0,0) ) g.fNoSync = 1;
381 if( find_option("ipv4",0,0) ) g.fIPv4 = 1;
 
382 if( find_option("accept-any-cert",0,0) ){
383 ssl_disable_cert_verification();
384 }
 
385 }
386
387 /*
388 ** If the "proxy" setting is defined, then change the URL settings
389 ** (initialized by a prior call to url_parse()) so that the HTTP
390
391 DDED tools/fossil-diff-log
--- src/url.c
+++ src/url.c
@@ -377,13 +377,15 @@
377 */
378 void url_proxy_options(void){
379 zProxyOpt = find_option("proxy", 0, 1);
380 if( find_option("nosync",0,0) ) g.fNoSync = 1;
381 if( find_option("ipv4",0,0) ) g.fIPv4 = 1;
382 #ifdef FOSSIL_ENABLE_SSL
383 if( find_option("accept-any-cert",0,0) ){
384 ssl_disable_cert_verification();
385 }
386 #endif /* FOSSIL_ENABLE_SSL */
387 }
388
389 /*
390 ** If the "proxy" setting is defined, then change the URL settings
391 ** (initialized by a prior call to url_parse()) so that the HTTP
392
393 DDED tools/fossil-diff-log

No diff available

No diff available

No diff available

--- a/tools/fossil-diff-log
+++ b/tools/fossil-diff-log
@@ -0,0 +1,72 @@
1
+#!/usr/bin/env perl
2
+# Fossil emulation of the "git log --patch / -p" feature: emit a stream
3
+# of diffs from one version to the next for each file named on the
4
+# command line.
5
+#
6
+# LIMITATIONS: It does not assume "all files" if you give no args, and
7
+# it cannot take a directory to mean "all files under this parent".
8
+#
9
+# PREREQUISITES: This script needs several CPAN modules to run properly.
10
+# There are multiple methods to install them:
11
+#
12
+# sudo dnf install perl-File-Which perl-IO-Interactive
13
+# sudo apt install libfile-which-perl libio-interactive-perl
14
+# sudo cpanm File::Which IO::Interactive
15
+# ...etc...
16
+
17
+use strict;
18
+use warnings;
19
+
20
+use Carp;
21
+use File::Which;
22
+use IO::Interactive qw(is_interactive);
23
+
24
+die "usage: $0 <files...>\n\n" unless @ARGV;
25
+
26
+my $out;
27
+if (is_interactive()) {
28
+ my $pager = $ENV{PAGER} || which('less') || which('more');
29
+ open $out, '|-', $pager or croak "Cannot pipe to $pager: $!";
30
+}
31
+else {
32
+ $out = *STDOUT;
33
+}
34
+
35
+open my $bcmd, '-|', 'fossil branch current'
36
+ or die "Cannot get branch: $!\n";
37
+my $cbranch = <$bcmd>;
38
+chomp $cbranch;
39
+close $bcmd;
40
+
41
+for my $file (@ARGV) {
42
+ my $lastckid;
43
+ open my $finfo, '-|', "fossil finfo --brief --limit 0 '$file'"
44
+ or die "Failed to get file info: $!\n";
45
+ my @filines = <$finfo>;
46
+ close $finfo;
47
+
48
+ for my $line (@filines) {
49
+ my ($currckid, $date, $user, $branch, @cwords) = split ' ', $line;
50
+ next unless $branch eq $cbranch;
51
+ if (defined $lastckid and defined $branch) {
52
+ my $comment = join ' ', @cwords;
53
+ open my $diff, '-|', 'fossil', 'diff', $file,
54
+ '--from', $currckid,
55
+ '--to', $lastckid,
56
+ or die "Failed to diff $currckid -> $lastckid: $!\n";
57
+ my @dl = <$diff>;
58
+ close $diff;
59
+ my $patch = join '', @dl;
60
+
61
+ print $out <<"OUT"
62
+Checkin ID $currckid to $branch by $user on $date
63
+Comment: $comment
64
+
65
+$patch
66
+
67
+OUT
68
+ }
69
+
70
+ $lastckid = $currckid;
71
+ }
72
+}
--- a/tools/fossil-diff-log
+++ b/tools/fossil-diff-log
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/fossil-diff-log
+++ b/tools/fossil-diff-log
@@ -0,0 +1,72 @@
1 #!/usr/bin/env perl
2 # Fossil emulation of the "git log --patch / -p" feature: emit a stream
3 # of diffs from one version to the next for each file named on the
4 # command line.
5 #
6 # LIMITATIONS: It does not assume "all files" if you give no args, and
7 # it cannot take a directory to mean "all files under this parent".
8 #
9 # PREREQUISITES: This script needs several CPAN modules to run properly.
10 # There are multiple methods to install them:
11 #
12 # sudo dnf install perl-File-Which perl-IO-Interactive
13 # sudo apt install libfile-which-perl libio-interactive-perl
14 # sudo cpanm File::Which IO::Interactive
15 # ...etc...
16
17 use strict;
18 use warnings;
19
20 use Carp;
21 use File::Which;
22 use IO::Interactive qw(is_interactive);
23
24 die "usage: $0 <files...>\n\n" unless @ARGV;
25
26 my $out;
27 if (is_interactive()) {
28 my $pager = $ENV{PAGER} || which('less') || which('more');
29 open $out, '|-', $pager or croak "Cannot pipe to $pager: $!";
30 }
31 else {
32 $out = *STDOUT;
33 }
34
35 open my $bcmd, '-|', 'fossil branch current'
36 or die "Cannot get branch: $!\n";
37 my $cbranch = <$bcmd>;
38 chomp $cbranch;
39 close $bcmd;
40
41 for my $file (@ARGV) {
42 my $lastckid;
43 open my $finfo, '-|', "fossil finfo --brief --limit 0 '$file'"
44 or die "Failed to get file info: $!\n";
45 my @filines = <$finfo>;
46 close $finfo;
47
48 for my $line (@filines) {
49 my ($currckid, $date, $user, $branch, @cwords) = split ' ', $line;
50 next unless $branch eq $cbranch;
51 if (defined $lastckid and defined $branch) {
52 my $comment = join ' ', @cwords;
53 open my $diff, '-|', 'fossil', 'diff', $file,
54 '--from', $currckid,
55 '--to', $lastckid,
56 or die "Failed to diff $currckid -> $lastckid: $!\n";
57 my @dl = <$diff>;
58 close $diff;
59 my $patch = join '', @dl;
60
61 print $out <<"OUT"
62 Checkin ID $currckid to $branch by $user on $date
63 Comment: $comment
64
65 $patch
66
67 OUT
68 }
69
70 $lastckid = $currckid;
71 }
72 }

No diff available

No diff available

+10 -4
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
2828
2929
SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
3030
3131
SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
33
-SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
33
+SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
35
-OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
35
+OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
3838
RC=$(DMDIR)\bin\rcc
3939
RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
4040
@@ -49,11 +49,11 @@
4949
5050
$(OBJDIR)\fossil.res: $B\win\fossil.rc
5151
$(RC) $(RCFLAGS) -o$@ $**
5252
5353
$(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54
- +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54
+ +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar terminal th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
5555
+echo fossil >> $@
5656
+echo fossil >> $@
5757
+echo $(LIBS) >> $@
5858
+echo. >> $@
5959
+echo fossil >> $@
@@ -836,10 +836,16 @@
836836
$(OBJDIR)\tar$O : tar_.c tar.h
837837
$(TCC) -o$@ -c tar_.c
838838
839839
tar_.c : $(SRCDIR)\tar.c
840840
+translate$E $** > $@
841
+
842
+$(OBJDIR)\terminal$O : terminal_.c terminal.h
843
+ $(TCC) -o$@ -c terminal_.c
844
+
845
+terminal_.c : $(SRCDIR)\terminal.c
846
+ +translate$E $** > $@
841847
842848
$(OBJDIR)\th_main$O : th_main_.c th_main.h
843849
$(TCC) -o$@ -c th_main_.c
844850
845851
th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
976982
977983
zip_.c : $(SRCDIR)\zip.c
978984
+translate$E $** > $@
979985
980986
headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
981
- +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
987
+ +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
982988
@copy /Y nul: headers
983989
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -49,11 +49,11 @@
49
50 $(OBJDIR)\fossil.res: $B\win\fossil.rc
51 $(RC) $(RCFLAGS) -o$@ $**
52
53 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54 +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
55 +echo fossil >> $@
56 +echo fossil >> $@
57 +echo $(LIBS) >> $@
58 +echo. >> $@
59 +echo fossil >> $@
@@ -836,10 +836,16 @@
836 $(OBJDIR)\tar$O : tar_.c tar.h
837 $(TCC) -o$@ -c tar_.c
838
839 tar_.c : $(SRCDIR)\tar.c
840 +translate$E $** > $@
 
 
 
 
 
 
841
842 $(OBJDIR)\th_main$O : th_main_.c th_main.h
843 $(TCC) -o$@ -c th_main_.c
844
845 th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
976
977 zip_.c : $(SRCDIR)\zip.c
978 +translate$E $** > $@
979
980 headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
981 +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
982 @copy /Y nul: headers
983
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -49,11 +49,11 @@
49
50 $(OBJDIR)\fossil.res: $B\win\fossil.rc
51 $(RC) $(RCFLAGS) -o$@ $**
52
53 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54 +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar terminal th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
55 +echo fossil >> $@
56 +echo fossil >> $@
57 +echo $(LIBS) >> $@
58 +echo. >> $@
59 +echo fossil >> $@
@@ -836,10 +836,16 @@
836 $(OBJDIR)\tar$O : tar_.c tar.h
837 $(TCC) -o$@ -c tar_.c
838
839 tar_.c : $(SRCDIR)\tar.c
840 +translate$E $** > $@
841
842 $(OBJDIR)\terminal$O : terminal_.c terminal.h
843 $(TCC) -o$@ -c terminal_.c
844
845 terminal_.c : $(SRCDIR)\terminal.c
846 +translate$E $** > $@
847
848 $(OBJDIR)\th_main$O : th_main_.c th_main.h
849 $(TCC) -o$@ -c th_main_.c
850
851 th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
982
983 zip_.c : $(SRCDIR)\zip.c
984 +translate$E $** > $@
985
986 headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
987 +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
988 @copy /Y nul: headers
989
+10 -4
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
2828
2929
SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
3030
3131
SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
33
-SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
33
+SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
35
-OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
35
+OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
3838
RC=$(DMDIR)\bin\rcc
3939
RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
4040
@@ -49,11 +49,11 @@
4949
5050
$(OBJDIR)\fossil.res: $B\win\fossil.rc
5151
$(RC) $(RCFLAGS) -o$@ $**
5252
5353
$(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54
- +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54
+ +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar terminal th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
5555
+echo fossil >> $@
5656
+echo fossil >> $@
5757
+echo $(LIBS) >> $@
5858
+echo. >> $@
5959
+echo fossil >> $@
@@ -836,10 +836,16 @@
836836
$(OBJDIR)\tar$O : tar_.c tar.h
837837
$(TCC) -o$@ -c tar_.c
838838
839839
tar_.c : $(SRCDIR)\tar.c
840840
+translate$E $** > $@
841
+
842
+$(OBJDIR)\terminal$O : terminal_.c terminal.h
843
+ $(TCC) -o$@ -c terminal_.c
844
+
845
+terminal_.c : $(SRCDIR)\terminal.c
846
+ +translate$E $** > $@
841847
842848
$(OBJDIR)\th_main$O : th_main_.c th_main.h
843849
$(TCC) -o$@ -c th_main_.c
844850
845851
th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
976982
977983
zip_.c : $(SRCDIR)\zip.c
978984
+translate$E $** > $@
979985
980986
headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
981
- +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
987
+ +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
982988
@copy /Y nul: headers
983989
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -49,11 +49,11 @@
49
50 $(OBJDIR)\fossil.res: $B\win\fossil.rc
51 $(RC) $(RCFLAGS) -o$@ $**
52
53 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54 +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
55 +echo fossil >> $@
56 +echo fossil >> $@
57 +echo $(LIBS) >> $@
58 +echo. >> $@
59 +echo fossil >> $@
@@ -836,10 +836,16 @@
836 $(OBJDIR)\tar$O : tar_.c tar.h
837 $(TCC) -o$@ -c tar_.c
838
839 tar_.c : $(SRCDIR)\tar.c
840 +translate$E $** > $@
 
 
 
 
 
 
841
842 $(OBJDIR)\th_main$O : th_main_.c th_main.h
843 $(TCC) -o$@ -c th_main_.c
844
845 th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
976
977 zip_.c : $(SRCDIR)\zip.c
978 +translate$E $** > $@
979
980 headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
981 +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
982 @copy /Y nul: headers
983
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -49,11 +49,11 @@
49
50 $(OBJDIR)\fossil.res: $B\win\fossil.rc
51 $(RC) $(RCFLAGS) -o$@ $**
52
53 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
54 +echo add alerts allrepo attach backlink backoffice bag bisect blob branch browse builtin bundle cache capabilities captcha cgi checkin checkout clearsign clone comformat configure content cookies db delta deltacmd deltafunc descendants diff diffcmd dispatch doc encode etag event export extcgi file fileedit finfo foci forum fshell fusefs fuzz glob graph gzip hname http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path piechart pivot popen pqueue printf publish purge rebuild regexp repolist report rss schema search security_audit setup setupuser sha1 sha1hard sha3 shun sitemap skins smtp sqlcmd stash stat statrep style sync tag tar terminal th_main timeline tkt tktsetup undo unicode unversioned update url user utf8 util verify vfile webmail wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
55 +echo fossil >> $@
56 +echo fossil >> $@
57 +echo $(LIBS) >> $@
58 +echo. >> $@
59 +echo fossil >> $@
@@ -836,10 +836,16 @@
836 $(OBJDIR)\tar$O : tar_.c tar.h
837 $(TCC) -o$@ -c tar_.c
838
839 tar_.c : $(SRCDIR)\tar.c
840 +translate$E $** > $@
841
842 $(OBJDIR)\terminal$O : terminal_.c terminal.h
843 $(TCC) -o$@ -c terminal_.c
844
845 terminal_.c : $(SRCDIR)\terminal.c
846 +translate$E $** > $@
847
848 $(OBJDIR)\th_main$O : th_main_.c th_main.h
849 $(TCC) -o$@ -c th_main_.c
850
851 th_main_.c : $(SRCDIR)\th_main.c
@@ -976,7 +982,7 @@
982
983 zip_.c : $(SRCDIR)\zip.c
984 +translate$E $** > $@
985
986 headers: makeheaders$E page_index.h builtin_data.h default_css.h VERSION.h
987 +makeheaders$E add_.c:add.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h piechart_.c:piechart.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h webmail_.c:webmail.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
988 @copy /Y nul: headers
989
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554554
$(SRCDIR)/statrep.c \
555555
$(SRCDIR)/style.c \
556556
$(SRCDIR)/sync.c \
557557
$(SRCDIR)/tag.c \
558558
$(SRCDIR)/tar.c \
559
+ $(SRCDIR)/terminal.c \
559560
$(SRCDIR)/th_main.c \
560561
$(SRCDIR)/timeline.c \
561562
$(SRCDIR)/tkt.c \
562563
$(SRCDIR)/tktsetup.c \
563564
$(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
639640
$(SRCDIR)/../skins/xekri/header.txt \
640641
$(SRCDIR)/accordion.js \
641642
$(SRCDIR)/ci_edit.js \
642643
$(SRCDIR)/copybtn.js \
643644
$(SRCDIR)/diff.tcl \
645
+ $(SRCDIR)/foo.js \
644646
$(SRCDIR)/forum.js \
645647
$(SRCDIR)/fossil.bootstrap.js \
646648
$(SRCDIR)/fossil.confirmer.js \
647649
$(SRCDIR)/fossil.dom.js \
648650
$(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
794796
$(OBJDIR)/statrep_.c \
795797
$(OBJDIR)/style_.c \
796798
$(OBJDIR)/sync_.c \
797799
$(OBJDIR)/tag_.c \
798800
$(OBJDIR)/tar_.c \
801
+ $(OBJDIR)/terminal_.c \
799802
$(OBJDIR)/th_main_.c \
800803
$(OBJDIR)/timeline_.c \
801804
$(OBJDIR)/tkt_.c \
802805
$(OBJDIR)/tktsetup_.c \
803806
$(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
937940
$(OBJDIR)/statrep.o \
938941
$(OBJDIR)/style.o \
939942
$(OBJDIR)/sync.o \
940943
$(OBJDIR)/tag.o \
941944
$(OBJDIR)/tar.o \
945
+ $(OBJDIR)/terminal.o \
942946
$(OBJDIR)/th_main.o \
943947
$(OBJDIR)/timeline.o \
944948
$(OBJDIR)/tkt.o \
945949
$(OBJDIR)/tktsetup.o \
946950
$(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
13001304
$(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
13011305
$(OBJDIR)/style_.c:$(OBJDIR)/style.h \
13021306
$(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
13031307
$(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
13041308
$(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1309
+ $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
13051310
$(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
13061311
$(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
13071312
$(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
13081313
$(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
13091314
$(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
22752280
22762281
$(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
22772282
$(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
22782283
22792284
$(OBJDIR)/tar.h: $(OBJDIR)/headers
2285
+
2286
+$(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2287
+ $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2288
+
2289
+$(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2290
+ $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2291
+
2292
+$(OBJDIR)/terminal.h: $(OBJDIR)/headers
22802293
22812294
$(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
22822295
$(TRANSLATE) $(SRCDIR)/th_main.c >$@
22832296
22842297
$(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
22852298
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554 $(SRCDIR)/statrep.c \
555 $(SRCDIR)/style.c \
556 $(SRCDIR)/sync.c \
557 $(SRCDIR)/tag.c \
558 $(SRCDIR)/tar.c \
 
559 $(SRCDIR)/th_main.c \
560 $(SRCDIR)/timeline.c \
561 $(SRCDIR)/tkt.c \
562 $(SRCDIR)/tktsetup.c \
563 $(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
639 $(SRCDIR)/../skins/xekri/header.txt \
640 $(SRCDIR)/accordion.js \
641 $(SRCDIR)/ci_edit.js \
642 $(SRCDIR)/copybtn.js \
643 $(SRCDIR)/diff.tcl \
 
644 $(SRCDIR)/forum.js \
645 $(SRCDIR)/fossil.bootstrap.js \
646 $(SRCDIR)/fossil.confirmer.js \
647 $(SRCDIR)/fossil.dom.js \
648 $(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
794 $(OBJDIR)/statrep_.c \
795 $(OBJDIR)/style_.c \
796 $(OBJDIR)/sync_.c \
797 $(OBJDIR)/tag_.c \
798 $(OBJDIR)/tar_.c \
 
799 $(OBJDIR)/th_main_.c \
800 $(OBJDIR)/timeline_.c \
801 $(OBJDIR)/tkt_.c \
802 $(OBJDIR)/tktsetup_.c \
803 $(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
937 $(OBJDIR)/statrep.o \
938 $(OBJDIR)/style.o \
939 $(OBJDIR)/sync.o \
940 $(OBJDIR)/tag.o \
941 $(OBJDIR)/tar.o \
 
942 $(OBJDIR)/th_main.o \
943 $(OBJDIR)/timeline.o \
944 $(OBJDIR)/tkt.o \
945 $(OBJDIR)/tktsetup.o \
946 $(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
1300 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1301 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1302 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1303 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1304 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
 
1305 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1306 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1307 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1308 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1309 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
2275
2276 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2277 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2278
2279 $(OBJDIR)/tar.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
2280
2281 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2282 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2283
2284 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2285
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554 $(SRCDIR)/statrep.c \
555 $(SRCDIR)/style.c \
556 $(SRCDIR)/sync.c \
557 $(SRCDIR)/tag.c \
558 $(SRCDIR)/tar.c \
559 $(SRCDIR)/terminal.c \
560 $(SRCDIR)/th_main.c \
561 $(SRCDIR)/timeline.c \
562 $(SRCDIR)/tkt.c \
563 $(SRCDIR)/tktsetup.c \
564 $(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
640 $(SRCDIR)/../skins/xekri/header.txt \
641 $(SRCDIR)/accordion.js \
642 $(SRCDIR)/ci_edit.js \
643 $(SRCDIR)/copybtn.js \
644 $(SRCDIR)/diff.tcl \
645 $(SRCDIR)/foo.js \
646 $(SRCDIR)/forum.js \
647 $(SRCDIR)/fossil.bootstrap.js \
648 $(SRCDIR)/fossil.confirmer.js \
649 $(SRCDIR)/fossil.dom.js \
650 $(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
796 $(OBJDIR)/statrep_.c \
797 $(OBJDIR)/style_.c \
798 $(OBJDIR)/sync_.c \
799 $(OBJDIR)/tag_.c \
800 $(OBJDIR)/tar_.c \
801 $(OBJDIR)/terminal_.c \
802 $(OBJDIR)/th_main_.c \
803 $(OBJDIR)/timeline_.c \
804 $(OBJDIR)/tkt_.c \
805 $(OBJDIR)/tktsetup_.c \
806 $(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
940 $(OBJDIR)/statrep.o \
941 $(OBJDIR)/style.o \
942 $(OBJDIR)/sync.o \
943 $(OBJDIR)/tag.o \
944 $(OBJDIR)/tar.o \
945 $(OBJDIR)/terminal.o \
946 $(OBJDIR)/th_main.o \
947 $(OBJDIR)/timeline.o \
948 $(OBJDIR)/tkt.o \
949 $(OBJDIR)/tktsetup.o \
950 $(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
1304 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1305 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1306 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1307 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1308 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1309 $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
1310 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1311 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1312 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1313 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1314 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
2280
2281 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2282 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2283
2284 $(OBJDIR)/tar.h: $(OBJDIR)/headers
2285
2286 $(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2287 $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2288
2289 $(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2290 $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2291
2292 $(OBJDIR)/terminal.h: $(OBJDIR)/headers
2293
2294 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2295 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2296
2297 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2298
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554554
$(SRCDIR)/statrep.c \
555555
$(SRCDIR)/style.c \
556556
$(SRCDIR)/sync.c \
557557
$(SRCDIR)/tag.c \
558558
$(SRCDIR)/tar.c \
559
+ $(SRCDIR)/terminal.c \
559560
$(SRCDIR)/th_main.c \
560561
$(SRCDIR)/timeline.c \
561562
$(SRCDIR)/tkt.c \
562563
$(SRCDIR)/tktsetup.c \
563564
$(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
639640
$(SRCDIR)/../skins/xekri/header.txt \
640641
$(SRCDIR)/accordion.js \
641642
$(SRCDIR)/ci_edit.js \
642643
$(SRCDIR)/copybtn.js \
643644
$(SRCDIR)/diff.tcl \
645
+ $(SRCDIR)/foo.js \
644646
$(SRCDIR)/forum.js \
645647
$(SRCDIR)/fossil.bootstrap.js \
646648
$(SRCDIR)/fossil.confirmer.js \
647649
$(SRCDIR)/fossil.dom.js \
648650
$(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
794796
$(OBJDIR)/statrep_.c \
795797
$(OBJDIR)/style_.c \
796798
$(OBJDIR)/sync_.c \
797799
$(OBJDIR)/tag_.c \
798800
$(OBJDIR)/tar_.c \
801
+ $(OBJDIR)/terminal_.c \
799802
$(OBJDIR)/th_main_.c \
800803
$(OBJDIR)/timeline_.c \
801804
$(OBJDIR)/tkt_.c \
802805
$(OBJDIR)/tktsetup_.c \
803806
$(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
937940
$(OBJDIR)/statrep.o \
938941
$(OBJDIR)/style.o \
939942
$(OBJDIR)/sync.o \
940943
$(OBJDIR)/tag.o \
941944
$(OBJDIR)/tar.o \
945
+ $(OBJDIR)/terminal.o \
942946
$(OBJDIR)/th_main.o \
943947
$(OBJDIR)/timeline.o \
944948
$(OBJDIR)/tkt.o \
945949
$(OBJDIR)/tktsetup.o \
946950
$(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
13001304
$(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
13011305
$(OBJDIR)/style_.c:$(OBJDIR)/style.h \
13021306
$(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
13031307
$(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
13041308
$(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1309
+ $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
13051310
$(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
13061311
$(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
13071312
$(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
13081313
$(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
13091314
$(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
22752280
22762281
$(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
22772282
$(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
22782283
22792284
$(OBJDIR)/tar.h: $(OBJDIR)/headers
2285
+
2286
+$(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2287
+ $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2288
+
2289
+$(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2290
+ $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2291
+
2292
+$(OBJDIR)/terminal.h: $(OBJDIR)/headers
22802293
22812294
$(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
22822295
$(TRANSLATE) $(SRCDIR)/th_main.c >$@
22832296
22842297
$(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
22852298
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554 $(SRCDIR)/statrep.c \
555 $(SRCDIR)/style.c \
556 $(SRCDIR)/sync.c \
557 $(SRCDIR)/tag.c \
558 $(SRCDIR)/tar.c \
 
559 $(SRCDIR)/th_main.c \
560 $(SRCDIR)/timeline.c \
561 $(SRCDIR)/tkt.c \
562 $(SRCDIR)/tktsetup.c \
563 $(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
639 $(SRCDIR)/../skins/xekri/header.txt \
640 $(SRCDIR)/accordion.js \
641 $(SRCDIR)/ci_edit.js \
642 $(SRCDIR)/copybtn.js \
643 $(SRCDIR)/diff.tcl \
 
644 $(SRCDIR)/forum.js \
645 $(SRCDIR)/fossil.bootstrap.js \
646 $(SRCDIR)/fossil.confirmer.js \
647 $(SRCDIR)/fossil.dom.js \
648 $(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
794 $(OBJDIR)/statrep_.c \
795 $(OBJDIR)/style_.c \
796 $(OBJDIR)/sync_.c \
797 $(OBJDIR)/tag_.c \
798 $(OBJDIR)/tar_.c \
 
799 $(OBJDIR)/th_main_.c \
800 $(OBJDIR)/timeline_.c \
801 $(OBJDIR)/tkt_.c \
802 $(OBJDIR)/tktsetup_.c \
803 $(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
937 $(OBJDIR)/statrep.o \
938 $(OBJDIR)/style.o \
939 $(OBJDIR)/sync.o \
940 $(OBJDIR)/tag.o \
941 $(OBJDIR)/tar.o \
 
942 $(OBJDIR)/th_main.o \
943 $(OBJDIR)/timeline.o \
944 $(OBJDIR)/tkt.o \
945 $(OBJDIR)/tktsetup.o \
946 $(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
1300 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1301 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1302 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1303 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1304 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
 
1305 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1306 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1307 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1308 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1309 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
2275
2276 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2277 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2278
2279 $(OBJDIR)/tar.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
2280
2281 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2282 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2283
2284 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2285
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -554,10 +554,11 @@
554 $(SRCDIR)/statrep.c \
555 $(SRCDIR)/style.c \
556 $(SRCDIR)/sync.c \
557 $(SRCDIR)/tag.c \
558 $(SRCDIR)/tar.c \
559 $(SRCDIR)/terminal.c \
560 $(SRCDIR)/th_main.c \
561 $(SRCDIR)/timeline.c \
562 $(SRCDIR)/tkt.c \
563 $(SRCDIR)/tktsetup.c \
564 $(SRCDIR)/undo.c \
@@ -639,10 +640,11 @@
640 $(SRCDIR)/../skins/xekri/header.txt \
641 $(SRCDIR)/accordion.js \
642 $(SRCDIR)/ci_edit.js \
643 $(SRCDIR)/copybtn.js \
644 $(SRCDIR)/diff.tcl \
645 $(SRCDIR)/foo.js \
646 $(SRCDIR)/forum.js \
647 $(SRCDIR)/fossil.bootstrap.js \
648 $(SRCDIR)/fossil.confirmer.js \
649 $(SRCDIR)/fossil.dom.js \
650 $(SRCDIR)/fossil.fetch.js \
@@ -794,10 +796,11 @@
796 $(OBJDIR)/statrep_.c \
797 $(OBJDIR)/style_.c \
798 $(OBJDIR)/sync_.c \
799 $(OBJDIR)/tag_.c \
800 $(OBJDIR)/tar_.c \
801 $(OBJDIR)/terminal_.c \
802 $(OBJDIR)/th_main_.c \
803 $(OBJDIR)/timeline_.c \
804 $(OBJDIR)/tkt_.c \
805 $(OBJDIR)/tktsetup_.c \
806 $(OBJDIR)/undo_.c \
@@ -937,10 +940,11 @@
940 $(OBJDIR)/statrep.o \
941 $(OBJDIR)/style.o \
942 $(OBJDIR)/sync.o \
943 $(OBJDIR)/tag.o \
944 $(OBJDIR)/tar.o \
945 $(OBJDIR)/terminal.o \
946 $(OBJDIR)/th_main.o \
947 $(OBJDIR)/timeline.o \
948 $(OBJDIR)/tkt.o \
949 $(OBJDIR)/tktsetup.o \
950 $(OBJDIR)/undo.o \
@@ -1300,10 +1304,11 @@
1304 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1305 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1306 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1307 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1308 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1309 $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
1310 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1311 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1312 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1313 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1314 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2275,10 +2280,18 @@
2280
2281 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2282 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2283
2284 $(OBJDIR)/tar.h: $(OBJDIR)/headers
2285
2286 $(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2287 $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2288
2289 $(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2290 $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2291
2292 $(OBJDIR)/terminal.h: $(OBJDIR)/headers
2293
2294 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2295 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2296
2297 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2298
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -553,10 +553,11 @@
553553
$(SRCDIR)/statrep.c \
554554
$(SRCDIR)/style.c \
555555
$(SRCDIR)/sync.c \
556556
$(SRCDIR)/tag.c \
557557
$(SRCDIR)/tar.c \
558
+ $(SRCDIR)/terminal.c \
558559
$(SRCDIR)/th_main.c \
559560
$(SRCDIR)/timeline.c \
560561
$(SRCDIR)/tkt.c \
561562
$(SRCDIR)/tktsetup.c \
562563
$(SRCDIR)/undo.c \
@@ -786,10 +787,11 @@
786787
$(OBJDIR)/statrep_.c \
787788
$(OBJDIR)/style_.c \
788789
$(OBJDIR)/sync_.c \
789790
$(OBJDIR)/tag_.c \
790791
$(OBJDIR)/tar_.c \
792
+ $(OBJDIR)/terminal_.c \
791793
$(OBJDIR)/th_main_.c \
792794
$(OBJDIR)/timeline_.c \
793795
$(OBJDIR)/tkt_.c \
794796
$(OBJDIR)/tktsetup_.c \
795797
$(OBJDIR)/undo_.c \
@@ -928,10 +930,11 @@
928930
$(OBJDIR)/statrep.o \
929931
$(OBJDIR)/style.o \
930932
$(OBJDIR)/sync.o \
931933
$(OBJDIR)/tag.o \
932934
$(OBJDIR)/tar.o \
935
+ $(OBJDIR)/terminal.o \
933936
$(OBJDIR)/th_main.o \
934937
$(OBJDIR)/timeline.o \
935938
$(OBJDIR)/tkt.o \
936939
$(OBJDIR)/tktsetup.o \
937940
$(OBJDIR)/undo.o \
@@ -1290,10 +1293,11 @@
12901293
$(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
12911294
$(OBJDIR)/style_.c:$(OBJDIR)/style.h \
12921295
$(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
12931296
$(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
12941297
$(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1298
+ $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
12951299
$(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
12961300
$(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
12971301
$(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
12981302
$(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
12991303
$(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2257,10 +2261,18 @@
22572261
22582262
$(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
22592263
$(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
22602264
22612265
$(OBJDIR)/tar.h: $(OBJDIR)/headers
2266
+
2267
+$(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2268
+ $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2269
+
2270
+$(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2271
+ $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2272
+
2273
+$(OBJDIR)/terminal.h: $(OBJDIR)/headers
22622274
22632275
$(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
22642276
$(TRANSLATE) $(SRCDIR)/th_main.c >$@
22652277
22662278
$(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
22672279
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -553,10 +553,11 @@
553 $(SRCDIR)/statrep.c \
554 $(SRCDIR)/style.c \
555 $(SRCDIR)/sync.c \
556 $(SRCDIR)/tag.c \
557 $(SRCDIR)/tar.c \
 
558 $(SRCDIR)/th_main.c \
559 $(SRCDIR)/timeline.c \
560 $(SRCDIR)/tkt.c \
561 $(SRCDIR)/tktsetup.c \
562 $(SRCDIR)/undo.c \
@@ -786,10 +787,11 @@
786 $(OBJDIR)/statrep_.c \
787 $(OBJDIR)/style_.c \
788 $(OBJDIR)/sync_.c \
789 $(OBJDIR)/tag_.c \
790 $(OBJDIR)/tar_.c \
 
791 $(OBJDIR)/th_main_.c \
792 $(OBJDIR)/timeline_.c \
793 $(OBJDIR)/tkt_.c \
794 $(OBJDIR)/tktsetup_.c \
795 $(OBJDIR)/undo_.c \
@@ -928,10 +930,11 @@
928 $(OBJDIR)/statrep.o \
929 $(OBJDIR)/style.o \
930 $(OBJDIR)/sync.o \
931 $(OBJDIR)/tag.o \
932 $(OBJDIR)/tar.o \
 
933 $(OBJDIR)/th_main.o \
934 $(OBJDIR)/timeline.o \
935 $(OBJDIR)/tkt.o \
936 $(OBJDIR)/tktsetup.o \
937 $(OBJDIR)/undo.o \
@@ -1290,10 +1293,11 @@
1290 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1291 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1292 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1293 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1294 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
 
1295 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1296 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1297 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1298 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1299 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2257,10 +2261,18 @@
2257
2258 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2259 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2260
2261 $(OBJDIR)/tar.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
2262
2263 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2264 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2265
2266 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2267
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -553,10 +553,11 @@
553 $(SRCDIR)/statrep.c \
554 $(SRCDIR)/style.c \
555 $(SRCDIR)/sync.c \
556 $(SRCDIR)/tag.c \
557 $(SRCDIR)/tar.c \
558 $(SRCDIR)/terminal.c \
559 $(SRCDIR)/th_main.c \
560 $(SRCDIR)/timeline.c \
561 $(SRCDIR)/tkt.c \
562 $(SRCDIR)/tktsetup.c \
563 $(SRCDIR)/undo.c \
@@ -786,10 +787,11 @@
787 $(OBJDIR)/statrep_.c \
788 $(OBJDIR)/style_.c \
789 $(OBJDIR)/sync_.c \
790 $(OBJDIR)/tag_.c \
791 $(OBJDIR)/tar_.c \
792 $(OBJDIR)/terminal_.c \
793 $(OBJDIR)/th_main_.c \
794 $(OBJDIR)/timeline_.c \
795 $(OBJDIR)/tkt_.c \
796 $(OBJDIR)/tktsetup_.c \
797 $(OBJDIR)/undo_.c \
@@ -928,10 +930,11 @@
930 $(OBJDIR)/statrep.o \
931 $(OBJDIR)/style.o \
932 $(OBJDIR)/sync.o \
933 $(OBJDIR)/tag.o \
934 $(OBJDIR)/tar.o \
935 $(OBJDIR)/terminal.o \
936 $(OBJDIR)/th_main.o \
937 $(OBJDIR)/timeline.o \
938 $(OBJDIR)/tkt.o \
939 $(OBJDIR)/tktsetup.o \
940 $(OBJDIR)/undo.o \
@@ -1290,10 +1293,11 @@
1293 $(OBJDIR)/statrep_.c:$(OBJDIR)/statrep.h \
1294 $(OBJDIR)/style_.c:$(OBJDIR)/style.h \
1295 $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h \
1296 $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h \
1297 $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h \
1298 $(OBJDIR)/terminal_.c:$(OBJDIR)/terminal.h \
1299 $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h \
1300 $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h \
1301 $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h \
1302 $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h \
1303 $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h \
@@ -2257,10 +2261,18 @@
2261
2262 $(OBJDIR)/tar.o: $(OBJDIR)/tar_.c $(OBJDIR)/tar.h $(SRCDIR)/config.h
2263 $(XTCC) -o $(OBJDIR)/tar.o -c $(OBJDIR)/tar_.c
2264
2265 $(OBJDIR)/tar.h: $(OBJDIR)/headers
2266
2267 $(OBJDIR)/terminal_.c: $(SRCDIR)/terminal.c $(TRANSLATE)
2268 $(TRANSLATE) $(SRCDIR)/terminal.c >$@
2269
2270 $(OBJDIR)/terminal.o: $(OBJDIR)/terminal_.c $(OBJDIR)/terminal.h $(SRCDIR)/config.h
2271 $(XTCC) -o $(OBJDIR)/terminal.o -c $(OBJDIR)/terminal_.c
2272
2273 $(OBJDIR)/terminal.h: $(OBJDIR)/headers
2274
2275 $(OBJDIR)/th_main_.c: $(SRCDIR)/th_main.c $(TRANSLATE)
2276 $(TRANSLATE) $(SRCDIR)/th_main.c >$@
2277
2278 $(OBJDIR)/th_main.o: $(OBJDIR)/th_main_.c $(OBJDIR)/th_main.h $(SRCDIR)/config.h
2279
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462462
statrep_.c \
463463
style_.c \
464464
sync_.c \
465465
tag_.c \
466466
tar_.c \
467
+ terminal_.c \
467468
th_main_.c \
468469
timeline_.c \
469470
tkt_.c \
470471
tktsetup_.c \
471472
undo_.c \
@@ -546,10 +547,11 @@
546547
$(SRCDIR)\..\skins\xekri\header.txt \
547548
$(SRCDIR)\accordion.js \
548549
$(SRCDIR)\ci_edit.js \
549550
$(SRCDIR)\copybtn.js \
550551
$(SRCDIR)\diff.tcl \
552
+ $(SRCDIR)\foo.js \
551553
$(SRCDIR)\forum.js \
552554
$(SRCDIR)\fossil.bootstrap.js \
553555
$(SRCDIR)\fossil.confirmer.js \
554556
$(SRCDIR)\fossil.dom.js \
555557
$(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
703705
$(OX)\statrep$O \
704706
$(OX)\style$O \
705707
$(OX)\sync$O \
706708
$(OX)\tag$O \
707709
$(OX)\tar$O \
710
+ $(OX)\terminal$O \
708711
$(OX)\th$O \
709712
$(OX)\th_lang$O \
710713
$(OX)\th_main$O \
711714
$(OX)\th_tcl$O \
712715
$(OX)\timeline$O \
@@ -908,10 +911,11 @@
908911
echo $(OX)\statrep.obj >> $@
909912
echo $(OX)\style.obj >> $@
910913
echo $(OX)\sync.obj >> $@
911914
echo $(OX)\tag.obj >> $@
912915
echo $(OX)\tar.obj >> $@
916
+ echo $(OX)\terminal.obj >> $@
913917
echo $(OX)\th.obj >> $@
914918
echo $(OX)\th_lang.obj >> $@
915919
echo $(OX)\th_main.obj >> $@
916920
echo $(OX)\th_tcl.obj >> $@
917921
echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
17591763
$(OX)\tar$O : tar_.c tar.h
17601764
$(TCC) /Fo$@ -c tar_.c
17611765
17621766
tar_.c : $(SRCDIR)\tar.c
17631767
translate$E $** > $@
1768
+
1769
+$(OX)\terminal$O : terminal_.c terminal.h
1770
+ $(TCC) /Fo$@ -c terminal_.c
1771
+
1772
+terminal_.c : $(SRCDIR)\terminal.c
1773
+ translate$E $** > $@
17641774
17651775
$(OX)\th_main$O : th_main_.c th_main.h
17661776
$(TCC) /Fo$@ -c th_main_.c
17671777
17681778
th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
20202030
statrep_.c:statrep.h \
20212031
style_.c:style.h \
20222032
sync_.c:sync.h \
20232033
tag_.c:tag.h \
20242034
tar_.c:tar.h \
2035
+ terminal_.c:terminal.h \
20252036
th_main_.c:th_main.h \
20262037
timeline_.c:timeline.h \
20272038
tkt_.c:tkt.h \
20282039
tktsetup_.c:tktsetup.h \
20292040
undo_.c:undo.h \
20302041
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462 statrep_.c \
463 style_.c \
464 sync_.c \
465 tag_.c \
466 tar_.c \
 
467 th_main_.c \
468 timeline_.c \
469 tkt_.c \
470 tktsetup_.c \
471 undo_.c \
@@ -546,10 +547,11 @@
546 $(SRCDIR)\..\skins\xekri\header.txt \
547 $(SRCDIR)\accordion.js \
548 $(SRCDIR)\ci_edit.js \
549 $(SRCDIR)\copybtn.js \
550 $(SRCDIR)\diff.tcl \
 
551 $(SRCDIR)\forum.js \
552 $(SRCDIR)\fossil.bootstrap.js \
553 $(SRCDIR)\fossil.confirmer.js \
554 $(SRCDIR)\fossil.dom.js \
555 $(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
703 $(OX)\statrep$O \
704 $(OX)\style$O \
705 $(OX)\sync$O \
706 $(OX)\tag$O \
707 $(OX)\tar$O \
 
708 $(OX)\th$O \
709 $(OX)\th_lang$O \
710 $(OX)\th_main$O \
711 $(OX)\th_tcl$O \
712 $(OX)\timeline$O \
@@ -908,10 +911,11 @@
908 echo $(OX)\statrep.obj >> $@
909 echo $(OX)\style.obj >> $@
910 echo $(OX)\sync.obj >> $@
911 echo $(OX)\tag.obj >> $@
912 echo $(OX)\tar.obj >> $@
 
913 echo $(OX)\th.obj >> $@
914 echo $(OX)\th_lang.obj >> $@
915 echo $(OX)\th_main.obj >> $@
916 echo $(OX)\th_tcl.obj >> $@
917 echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
1759 $(OX)\tar$O : tar_.c tar.h
1760 $(TCC) /Fo$@ -c tar_.c
1761
1762 tar_.c : $(SRCDIR)\tar.c
1763 translate$E $** > $@
 
 
 
 
 
 
1764
1765 $(OX)\th_main$O : th_main_.c th_main.h
1766 $(TCC) /Fo$@ -c th_main_.c
1767
1768 th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
2020 statrep_.c:statrep.h \
2021 style_.c:style.h \
2022 sync_.c:sync.h \
2023 tag_.c:tag.h \
2024 tar_.c:tar.h \
 
2025 th_main_.c:th_main.h \
2026 timeline_.c:timeline.h \
2027 tkt_.c:tkt.h \
2028 tktsetup_.c:tktsetup.h \
2029 undo_.c:undo.h \
2030
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462 statrep_.c \
463 style_.c \
464 sync_.c \
465 tag_.c \
466 tar_.c \
467 terminal_.c \
468 th_main_.c \
469 timeline_.c \
470 tkt_.c \
471 tktsetup_.c \
472 undo_.c \
@@ -546,10 +547,11 @@
547 $(SRCDIR)\..\skins\xekri\header.txt \
548 $(SRCDIR)\accordion.js \
549 $(SRCDIR)\ci_edit.js \
550 $(SRCDIR)\copybtn.js \
551 $(SRCDIR)\diff.tcl \
552 $(SRCDIR)\foo.js \
553 $(SRCDIR)\forum.js \
554 $(SRCDIR)\fossil.bootstrap.js \
555 $(SRCDIR)\fossil.confirmer.js \
556 $(SRCDIR)\fossil.dom.js \
557 $(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
705 $(OX)\statrep$O \
706 $(OX)\style$O \
707 $(OX)\sync$O \
708 $(OX)\tag$O \
709 $(OX)\tar$O \
710 $(OX)\terminal$O \
711 $(OX)\th$O \
712 $(OX)\th_lang$O \
713 $(OX)\th_main$O \
714 $(OX)\th_tcl$O \
715 $(OX)\timeline$O \
@@ -908,10 +911,11 @@
911 echo $(OX)\statrep.obj >> $@
912 echo $(OX)\style.obj >> $@
913 echo $(OX)\sync.obj >> $@
914 echo $(OX)\tag.obj >> $@
915 echo $(OX)\tar.obj >> $@
916 echo $(OX)\terminal.obj >> $@
917 echo $(OX)\th.obj >> $@
918 echo $(OX)\th_lang.obj >> $@
919 echo $(OX)\th_main.obj >> $@
920 echo $(OX)\th_tcl.obj >> $@
921 echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
1763 $(OX)\tar$O : tar_.c tar.h
1764 $(TCC) /Fo$@ -c tar_.c
1765
1766 tar_.c : $(SRCDIR)\tar.c
1767 translate$E $** > $@
1768
1769 $(OX)\terminal$O : terminal_.c terminal.h
1770 $(TCC) /Fo$@ -c terminal_.c
1771
1772 terminal_.c : $(SRCDIR)\terminal.c
1773 translate$E $** > $@
1774
1775 $(OX)\th_main$O : th_main_.c th_main.h
1776 $(TCC) /Fo$@ -c th_main_.c
1777
1778 th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
2030 statrep_.c:statrep.h \
2031 style_.c:style.h \
2032 sync_.c:sync.h \
2033 tag_.c:tag.h \
2034 tar_.c:tar.h \
2035 terminal_.c:terminal.h \
2036 th_main_.c:th_main.h \
2037 timeline_.c:timeline.h \
2038 tkt_.c:tkt.h \
2039 tktsetup_.c:tktsetup.h \
2040 undo_.c:undo.h \
2041
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462462
statrep_.c \
463463
style_.c \
464464
sync_.c \
465465
tag_.c \
466466
tar_.c \
467
+ terminal_.c \
467468
th_main_.c \
468469
timeline_.c \
469470
tkt_.c \
470471
tktsetup_.c \
471472
undo_.c \
@@ -546,10 +547,11 @@
546547
$(SRCDIR)\..\skins\xekri\header.txt \
547548
$(SRCDIR)\accordion.js \
548549
$(SRCDIR)\ci_edit.js \
549550
$(SRCDIR)\copybtn.js \
550551
$(SRCDIR)\diff.tcl \
552
+ $(SRCDIR)\foo.js \
551553
$(SRCDIR)\forum.js \
552554
$(SRCDIR)\fossil.bootstrap.js \
553555
$(SRCDIR)\fossil.confirmer.js \
554556
$(SRCDIR)\fossil.dom.js \
555557
$(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
703705
$(OX)\statrep$O \
704706
$(OX)\style$O \
705707
$(OX)\sync$O \
706708
$(OX)\tag$O \
707709
$(OX)\tar$O \
710
+ $(OX)\terminal$O \
708711
$(OX)\th$O \
709712
$(OX)\th_lang$O \
710713
$(OX)\th_main$O \
711714
$(OX)\th_tcl$O \
712715
$(OX)\timeline$O \
@@ -908,10 +911,11 @@
908911
echo $(OX)\statrep.obj >> $@
909912
echo $(OX)\style.obj >> $@
910913
echo $(OX)\sync.obj >> $@
911914
echo $(OX)\tag.obj >> $@
912915
echo $(OX)\tar.obj >> $@
916
+ echo $(OX)\terminal.obj >> $@
913917
echo $(OX)\th.obj >> $@
914918
echo $(OX)\th_lang.obj >> $@
915919
echo $(OX)\th_main.obj >> $@
916920
echo $(OX)\th_tcl.obj >> $@
917921
echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
17591763
$(OX)\tar$O : tar_.c tar.h
17601764
$(TCC) /Fo$@ -c tar_.c
17611765
17621766
tar_.c : $(SRCDIR)\tar.c
17631767
translate$E $** > $@
1768
+
1769
+$(OX)\terminal$O : terminal_.c terminal.h
1770
+ $(TCC) /Fo$@ -c terminal_.c
1771
+
1772
+terminal_.c : $(SRCDIR)\terminal.c
1773
+ translate$E $** > $@
17641774
17651775
$(OX)\th_main$O : th_main_.c th_main.h
17661776
$(TCC) /Fo$@ -c th_main_.c
17671777
17681778
th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
20202030
statrep_.c:statrep.h \
20212031
style_.c:style.h \
20222032
sync_.c:sync.h \
20232033
tag_.c:tag.h \
20242034
tar_.c:tar.h \
2035
+ terminal_.c:terminal.h \
20252036
th_main_.c:th_main.h \
20262037
timeline_.c:timeline.h \
20272038
tkt_.c:tkt.h \
20282039
tktsetup_.c:tktsetup.h \
20292040
undo_.c:undo.h \
20302041
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462 statrep_.c \
463 style_.c \
464 sync_.c \
465 tag_.c \
466 tar_.c \
 
467 th_main_.c \
468 timeline_.c \
469 tkt_.c \
470 tktsetup_.c \
471 undo_.c \
@@ -546,10 +547,11 @@
546 $(SRCDIR)\..\skins\xekri\header.txt \
547 $(SRCDIR)\accordion.js \
548 $(SRCDIR)\ci_edit.js \
549 $(SRCDIR)\copybtn.js \
550 $(SRCDIR)\diff.tcl \
 
551 $(SRCDIR)\forum.js \
552 $(SRCDIR)\fossil.bootstrap.js \
553 $(SRCDIR)\fossil.confirmer.js \
554 $(SRCDIR)\fossil.dom.js \
555 $(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
703 $(OX)\statrep$O \
704 $(OX)\style$O \
705 $(OX)\sync$O \
706 $(OX)\tag$O \
707 $(OX)\tar$O \
 
708 $(OX)\th$O \
709 $(OX)\th_lang$O \
710 $(OX)\th_main$O \
711 $(OX)\th_tcl$O \
712 $(OX)\timeline$O \
@@ -908,10 +911,11 @@
908 echo $(OX)\statrep.obj >> $@
909 echo $(OX)\style.obj >> $@
910 echo $(OX)\sync.obj >> $@
911 echo $(OX)\tag.obj >> $@
912 echo $(OX)\tar.obj >> $@
 
913 echo $(OX)\th.obj >> $@
914 echo $(OX)\th_lang.obj >> $@
915 echo $(OX)\th_main.obj >> $@
916 echo $(OX)\th_tcl.obj >> $@
917 echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
1759 $(OX)\tar$O : tar_.c tar.h
1760 $(TCC) /Fo$@ -c tar_.c
1761
1762 tar_.c : $(SRCDIR)\tar.c
1763 translate$E $** > $@
 
 
 
 
 
 
1764
1765 $(OX)\th_main$O : th_main_.c th_main.h
1766 $(TCC) /Fo$@ -c th_main_.c
1767
1768 th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
2020 statrep_.c:statrep.h \
2021 style_.c:style.h \
2022 sync_.c:sync.h \
2023 tag_.c:tag.h \
2024 tar_.c:tar.h \
 
2025 th_main_.c:th_main.h \
2026 timeline_.c:timeline.h \
2027 tkt_.c:tkt.h \
2028 tktsetup_.c:tktsetup.h \
2029 undo_.c:undo.h \
2030
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -462,10 +462,11 @@
462 statrep_.c \
463 style_.c \
464 sync_.c \
465 tag_.c \
466 tar_.c \
467 terminal_.c \
468 th_main_.c \
469 timeline_.c \
470 tkt_.c \
471 tktsetup_.c \
472 undo_.c \
@@ -546,10 +547,11 @@
547 $(SRCDIR)\..\skins\xekri\header.txt \
548 $(SRCDIR)\accordion.js \
549 $(SRCDIR)\ci_edit.js \
550 $(SRCDIR)\copybtn.js \
551 $(SRCDIR)\diff.tcl \
552 $(SRCDIR)\foo.js \
553 $(SRCDIR)\forum.js \
554 $(SRCDIR)\fossil.bootstrap.js \
555 $(SRCDIR)\fossil.confirmer.js \
556 $(SRCDIR)\fossil.dom.js \
557 $(SRCDIR)\fossil.fetch.js \
@@ -703,10 +705,11 @@
705 $(OX)\statrep$O \
706 $(OX)\style$O \
707 $(OX)\sync$O \
708 $(OX)\tag$O \
709 $(OX)\tar$O \
710 $(OX)\terminal$O \
711 $(OX)\th$O \
712 $(OX)\th_lang$O \
713 $(OX)\th_main$O \
714 $(OX)\th_tcl$O \
715 $(OX)\timeline$O \
@@ -908,10 +911,11 @@
911 echo $(OX)\statrep.obj >> $@
912 echo $(OX)\style.obj >> $@
913 echo $(OX)\sync.obj >> $@
914 echo $(OX)\tag.obj >> $@
915 echo $(OX)\tar.obj >> $@
916 echo $(OX)\terminal.obj >> $@
917 echo $(OX)\th.obj >> $@
918 echo $(OX)\th_lang.obj >> $@
919 echo $(OX)\th_main.obj >> $@
920 echo $(OX)\th_tcl.obj >> $@
921 echo $(OX)\timeline.obj >> $@
@@ -1759,10 +1763,16 @@
1763 $(OX)\tar$O : tar_.c tar.h
1764 $(TCC) /Fo$@ -c tar_.c
1765
1766 tar_.c : $(SRCDIR)\tar.c
1767 translate$E $** > $@
1768
1769 $(OX)\terminal$O : terminal_.c terminal.h
1770 $(TCC) /Fo$@ -c terminal_.c
1771
1772 terminal_.c : $(SRCDIR)\terminal.c
1773 translate$E $** > $@
1774
1775 $(OX)\th_main$O : th_main_.c th_main.h
1776 $(TCC) /Fo$@ -c th_main_.c
1777
1778 th_main_.c : $(SRCDIR)\th_main.c
@@ -2020,10 +2030,11 @@
2030 statrep_.c:statrep.h \
2031 style_.c:style.h \
2032 sync_.c:sync.h \
2033 tag_.c:tag.h \
2034 tar_.c:tar.h \
2035 terminal_.c:terminal.h \
2036 th_main_.c:th_main.h \
2037 timeline_.c:timeline.h \
2038 tkt_.c:tkt.h \
2039 tktsetup_.c:tktsetup.h \
2040 undo_.c:undo.h \
2041

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button