Fossil SCM

merging with trunk [d4a341b49dd1b701] before applying --args FILENAME patch, to simplify downstream merge.

stephan 2011-10-04 21:28 UTC stephan-hack merge
Commit 312d522fe4cf3f043b88586611ccda7f997a5695
D ci_cvs.txt
-190
--- a/ci_cvs.txt
+++ b/ci_cvs.txt
@@ -1,192 +0,0 @@
1
-===============================================================================
2
-
3
-First experimental codes ...
4
-
5
-tools/import-cvs.tcl
6
-tools/lib/rcsparser.tcl
7
-
8
-No actual import, right now only working on getting csets right. The
9
-code uses CVSROOT/history as foundation, and augments that with data
10
-from the individual RCS files (commit messages).
11
-
12
-Statistics of a run ...
13
- 3516 csets.
14
-
15
- 1545 breaks on user change
16
- 558 breaks on file duplicate
17
- 13 breaks on branch/trunk change
18
- 1402 breaks on commit message change
19
-
20
-Time statistics ...
21
- 3297 were processed in <= 1 seconds (93.77%)
22
- 217 were processed in between 2 seconds and 14 minutes.
23
- 1 was processed in ~41 minutes
24
- 1 was processed in ~22 hours
25
-
26
-Time fuzz - Differences between csets range from 0 seconds to 66
27
-days. Needs stats analysis to see if there is an obvious break. Even
28
-so the times within csets and between csets overlap a great deal,
29
-making time a bad criterium for cset separation, IMHO.
30
-
31
-Leaving that topic, back to the current cset separator ...
32
-
33
-It has a problem:
34
- The history file is not starting at the root!
35
-
36
-Examples:
37
- The first three changesets are
38
-
39
- =============================/user
40
- M {Wed Nov 22 09:28:49 AM PST 2000} ericm 1.4 tcllib/modules/ftpd/ChangeLog
41
- M {Wed Nov 22 09:28:49 AM PST 2000} ericm 1.7 tcllib/modules/ftpd/ftpd.tcl
42
- files: 2
43
- delta: 0
44
- range: 0 seconds
45
- =============================/cmsg
46
- M {Wed Nov 29 02:14:33 PM PST 2000} ericm 1.3 tcllib/aclocal.m4
47
- files: 1
48
- delta:
49
- range: 0 seconds
50
- =============================/cmsg
51
- M {Sun Feb 04 12:28:35 AM PST 2001} ericm 1.9 tcllib/modules/mime/ChangeLog
52
- M {Sun Feb 04 12:28:35 AM PST 2001} ericm 1.12 tcllib/modules/mime/mime.tcl
53
- files: 2
54
- delta: 0
55
- range: 0 seconds
56
-
57
-All csets modify files which already have several revisions. We have
58
-no csets from before that in the history, but these csets are in the
59
-RCS files.
60
-
61
-I wonder, is SF maybe removing old entries from the history when it
62
-grows too large ?
63
-
64
-This also affects incremental import ... I cannot assume that the
65
-history always grows. It may shrink ... I cannot keep an offset, will
66
-have to record the time of the last entry, or even the full entry
67
-processed last, to allow me to skip ahead to anything not known yet.
68
-
69
-I might have to try to implement the algorithm outlined below,
70
-matching the revision trees of the individual RCS files to each other
71
-to form the global tree of revisions. Maybe we can use the history to
72
-help in the matchup, for the parts where we do have it.
73
-
74
-Wait. This might be easier ... Take the delta information from the RCS
75
-files and generate a fake history ... Actually, this might even allow
76
-us to create a total history ... No, not quite, the merge entries the
77
-actual history may contain will be missing. These we can mix in from
78
-the actual history, as much as we have.
79
-
80
-Still, lets try that, a fake history, and then run this script on it
81
-to see if/where are differences.
82
-
83
-===============================================================================
84
-
85
-
86
-Notes about CVS import, regarding CVS.
87
-
88
-- Problem: CVS does not really track changesets, but only individual
89
- revisions of files. To recover changesets it is necessary to look at
90
- author, branch, timestamp information, and the commit messages. Even
91
- so this is only heuristic, not foolproof.
92
-
93
- Existing tool: cvsps.
94
-
95
- Processes the output of 'cvs log' to recover changesets. Problem:
96
- Sees only a linear list of revisions, does not see branchpoints,
97
- etc. Cannot use the tree structure to help in making the decisions.
98
-
99
-- Problem: CVS does not track merge-points at all. Recovery through
100
- heuristics is brittle at best, looking for keywords in commit
101
- messages which might indicate that a branch was merged with some
102
- other.
103
-
104
-
105
-Ideas regarding an algorithm to recover changesets.
106
-
107
-Key feature: Uses the per-file revision trees to help in uncovering
108
-the underlying changesets and global revision tree G.
109
-
110
-The per-file revision tree for a file X is in essence the global
111
-revision tree with all nodes not pertaining to X removed from it. In
112
-the reverse this allows us to built up the global revision tree from
113
-the per-file trees by matching nodes to each other and extending.
114
-
115
-Start with the per file revision tree of a single file as initial
116
-approximation of the global tree. All nodes of this tree refer to the
117
-revision of the file belonging to it, and through that the file
118
-itself. At each step the global tree contains the nodes for a finite
119
-set of files, and all nodes in the tree refer to revisions of all
120
-files in the set, making the mapping total.
121
-
122
-To add a file X to the tree take the per-file revision tree R and
123
-performs the following actions:
124
-
125
-- For each node N in R use the tuple <author, branch, commit message>
126
- to identify a set of nodes in G which may match N. Use the timestamp
127
- to locate the node nearest in time.
128
-
129
-- This process will leave nodes in N unmapped. If there are unmapped
130
- nodes which have no neighbouring mapped nodes we have to
131
- abort.
132
-
133
- Otherwise take the nodes which have mapped neighbours. Trace the
134
- edges and see which of these nodes are connected in the local
135
- tree. Then look at the identified neighbours and trace their
136
- connections.
137
-
138
- If two global nodes have a direct connection, but a multi-edge
139
- connection in the local tree insert global nodes mapping to the
140
- local nodes and map them together. This expands the global tree to
141
- hold the revisions added by the new file.
142
-
143
- Otherwise, both sides have multi-edge connections then abort. This
144
- looks like a merge of two different branches, but there are no such
145
- in CVS ... Wait ... sort the nodes over time and fit the new nodes
146
- in between the other nodes, per the timestamps. We have overlapping
147
- / alternating changes to one file and others.
148
-
149
- A last possibility is that a node is only connected to a mapped
150
- parent. This may be a new branch, or again an alternating change on
151
- the given line. Symbols on the revisions will help to map this.
152
-
153
-- We now have an extended global tree which incorporates the revisions
154
- of the new file. However new nodes will refer only to the new file,
155
- and old nodes may not refer to the new file. This has to be fixed,
156
- as all nodes have to refer to all files.
157
-
158
- Run over the tree and look at each parent/child pair. If a file is
159
- not referenced in the child, but the parent, then copy a reference
160
- to the file revision on the parent forward to the child. This
161
- signals that the file did not change in the given revision.
162
-
163
-- After all files have been integrated in this manner we have global
164
- revision tree capturing all changesets, including the unchanged
165
- files per changeset.
166
-
167
-
168
-This algorithm has to be refined to also take Attic/ files into
169
-account.
170
-
--------------------------------------------------------------------------
171
-
172
-Two archive files mapping to the same user file. How are they
173
-interleaved ?
174
-
175
-(a) sqlite/src/os_unix.h,v
176
-(b) sqlite/src/Attic/os_unix.h,v
177
-
178
-Problem: Max version of (a) is 1.9
179
- Max version of (b) is 1.11
180
- cvs co 1.10 -> no longer in the repository.
181
-
182
-This seems to indicate that the non-Attic file is relevant.
183
-
---------------------------------------------------------------------------
184
-
185
-tcllib - more problems - tklib/pie.tcl,v -
186
-
187
-invalid change text in
188
-/home/aku/Projects/Tcl/Fossil/Devel/Examples/cvs-tcllib/tklib/modules/tkpiechart/pie.tcl,v
189
-
190
-Possibly braces ?
--- a/ci_cvs.txt
+++ b/ci_cvs.txt
@@ -1,192 +0,0 @@
1 ===============================================================================
2
3 First experimental codes ...
4
5 tools/import-cvs.tcl
6 tools/lib/rcsparser.tcl
7
8 No actual import, right now only working on getting csets right. The
9 code uses CVSROOT/history as foundation, and augments that with data
10 from the individual RCS files (commit messages).
11
12 Statistics of a run ...
13 3516 csets.
14
15 1545 breaks on user change
16 558 breaks on file duplicate
17 13 breaks on branch/trunk change
18 1402 breaks on commit message change
19
20 Time statistics ...
21 3297 were processed in <= 1 seconds (93.77%)
22 217 were processed in between 2 seconds and 14 minutes.
23 1 was processed in ~41 minutes
24 1 was processed in ~22 hours
25
26 Time fuzz - Differences between csets range from 0 seconds to 66
27 days. Needs stats analysis to see if there is an obvious break. Even
28 so the times within csets and between csets overlap a great deal,
29 making time a bad criterium for cset separation, IMHO.
30
31 Leaving that topic, back to the current cset separator ...
32
33 It has a problem:
34 The history file is not starting at the root!
35
36 Examples:
37 The first three changesets are
38
39 =============================/user
40 M {Wed Nov 22 09:28:49 AM PST 2000} ericm 1.4 tcllib/modules/ftpd/ChangeLog
41 M {Wed Nov 22 09:28:49 AM PST 2000} ericm 1.7 tcllib/modules/ftpd/ftpd.tcl
42 files: 2
43 delta: 0
44 range: 0 seconds
45 =============================/cmsg
46 M {Wed Nov 29 02:14:33 PM PST 2000} ericm 1.3 tcllib/aclocal.m4
47 files: 1
48 delta:
49 range: 0 seconds
50 =============================/cmsg
51 M {Sun Feb 04 12:28:35 AM PST 2001} ericm 1.9 tcllib/modules/mime/ChangeLog
52 M {Sun Feb 04 12:28:35 AM PST 2001} ericm 1.12 tcllib/modules/mime/mime.tcl
53 files: 2
54 delta: 0
55 range: 0 seconds
56
57 All csets modify files which already have several revisions. We have
58 no csets from before that in the history, but these csets are in the
59 RCS files.
60
61 I wonder, is SF maybe removing old entries from the history when it
62 grows too large ?
63
64 This also affects incremental import ... I cannot assume that the
65 history always grows. It may shrink ... I cannot keep an offset, will
66 have to record the time of the last entry, or even the full entry
67 processed last, to allow me to skip ahead to anything not known yet.
68
69 I might have to try to implement the algorithm outlined below,
70 matching the revision trees of the individual RCS files to each other
71 to form the global tree of revisions. Maybe we can use the history to
72 help in the matchup, for the parts where we do have it.
73
74 Wait. This might be easier ... Take the delta information from the RCS
75 files and generate a fake history ... Actually, this might even allow
76 us to create a total history ... No, not quite, the merge entries the
77 actual history may contain will be missing. These we can mix in from
78 the actual history, as much as we have.
79
80 Still, lets try that, a fake history, and then run this script on it
81 to see if/where are differences.
82
83 ===============================================================================
84
85
86 Notes about CVS import, regarding CVS.
87
88 - Problem: CVS does not really track changesets, but only individual
89 revisions of files. To recover changesets it is necessary to look at
90 author, branch, timestamp information, and the commit messages. Even
91 so this is only heuristic, not foolproof.
92
93 Existing tool: cvsps.
94
95 Processes the output of 'cvs log' to recover changesets. Problem:
96 Sees only a linear list of revisions, does not see branchpoints,
97 etc. Cannot use the tree structure to help in making the decisions.
98
99 - Problem: CVS does not track merge-points at all. Recovery through
100 heuristics is brittle at best, looking for keywords in commit
101 messages which might indicate that a branch was merged with some
102 other.
103
104
105 Ideas regarding an algorithm to recover changesets.
106
107 Key feature: Uses the per-file revision trees to help in uncovering
108 the underlying changesets and global revision tree G.
109
110 The per-file revision tree for a file X is in essence the global
111 revision tree with all nodes not pertaining to X removed from it. In
112 the reverse this allows us to built up the global revision tree from
113 the per-file trees by matching nodes to each other and extending.
114
115 Start with the per file revision tree of a single file as initial
116 approximation of the global tree. All nodes of this tree refer to the
117 revision of the file belonging to it, and through that the file
118 itself. At each step the global tree contains the nodes for a finite
119 set of files, and all nodes in the tree refer to revisions of all
120 files in the set, making the mapping total.
121
122 To add a file X to the tree take the per-file revision tree R and
123 performs the following actions:
124
125 - For each node N in R use the tuple <author, branch, commit message>
126 to identify a set of nodes in G which may match N. Use the timestamp
127 to locate the node nearest in time.
128
129 - This process will leave nodes in N unmapped. If there are unmapped
130 nodes which have no neighbouring mapped nodes we have to
131 abort.
132
133 Otherwise take the nodes which have mapped neighbours. Trace the
134 edges and see which of these nodes are connected in the local
135 tree. Then look at the identified neighbours and trace their
136 connections.
137
138 If two global nodes have a direct connection, but a multi-edge
139 connection in the local tree insert global nodes mapping to the
140 local nodes and map them together. This expands the global tree to
141 hold the revisions added by the new file.
142
143 Otherwise, both sides have multi-edge connections then abort. This
144 looks like a merge of two different branches, but there are no such
145 in CVS ... Wait ... sort the nodes over time and fit the new nodes
146 in between the other nodes, per the timestamps. We have overlapping
147 / alternating changes to one file and others.
148
149 A last possibility is that a node is only connected to a mapped
150 parent. This may be a new branch, or again an alternating change on
151 the given line. Symbols on the revisions will help to map this.
152
153 - We now have an extended global tree which incorporates the revisions
154 of the new file. However new nodes will refer only to the new file,
155 and old nodes may not refer to the new file. This has to be fixed,
156 as all nodes have to refer to all files.
157
158 Run over the tree and look at each parent/child pair. If a file is
159 not referenced in the child, but the parent, then copy a reference
160 to the file revision on the parent forward to the child. This
161 signals that the file did not change in the given revision.
162
163 - After all files have been integrated in this manner we have global
164 revision tree capturing all changesets, including the unchanged
165 files per changeset.
166
167
168 This algorithm has to be refined to also take Attic/ files into
169 account.
170
--------------------------------------------------------------------------
171
172 Two archive files mapping to the same user file. How are they
173 interleaved ?
174
175 (a) sqlite/src/os_unix.h,v
176 (b) sqlite/src/Attic/os_unix.h,v
177
178 Problem: Max version of (a) is 1.9
179 Max version of (b) is 1.11
180 cvs co 1.10 -> no longer in the repository.
181
182 This seems to indicate that the non-Attic file is relevant.
183
---------------------------------------------------------------------------
184
185 tcllib - more problems - tklib/pie.tcl,v -
186
187 invalid change text in
188 /home/aku/Projects/Tcl/Fossil/Devel/Examples/cvs-tcllib/tklib/modules/tkpiechart/pie.tcl,v
189
190 Possibly braces ?
--- a/ci_cvs.txt
+++ b/ci_cvs.txt
@@ -1,192 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--------------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
---------------------------------------------------------------------------
 
 
 
 
 
 
 
D ci_fossil.txt
-126
--- a/ci_fossil.txt
+++ b/ci_fossil.txt
@@ -1,127 +0,0 @@
1
-
2
-To perform CVS imports for fossil we need at least the ability to
3
-parse CVS files, i.e. RCS files, with slight differences.
4
-
5
-For the general architecture of the import facility we have two major
6
-paths to choose between.
7
-
8
-One is to use an external tool which processes a cvs repository and
9
-drives fossil through its CLI to insert the found changesets.
10
-
11
-The other is to integrate the whole facility into the fossil binary
12
-itself.
13
-
14
-I dislike the second choice. It may be faster, as the implementation
15
-can use all internal functionality of fossil to perform the import,
16
-however it will also bloat the binary with functionality not needed
17
-most of the time. Which becomes especially obvious if more importers
18
-are to be written, like for monotone, bazaar, mercurial, bitkeeper,
19
-git, SVN, Arc, etc. Keeping all this out of the core fossil binary is
20
-IMHO more beneficial in the long term, also from a maintenance point
21
-of view. The tools can evolve separately. Especially important for CVS
22
-as it will have to deal with lots of broken repositories, all
23
-different.
24
-
25
-However, nothing speaks against looking for common parts in all
26
-possible import tools, and having these in the fossil core, as a
27
-general backend all importer may use. Something like that has already
28
-been proposed: The deconstruct|reconstruct methods. For us, actually
29
-only reconstruct is important. Taking an unordered collection of files
30
-(data, and manifests) it generates a proper fossil repository. With
31
-that method implemented all import tools only have to generate the
32
-necessary collection and then leave the main work of filling the
33
-database to fossil itself.
34
-
35
-The disadvantage of this method is however that it will gobble up a
36
-lot of temporary space in the filesystem to hold all unique revisions
37
-of all files in their expanded form.
38
-
39
-It might be worthwhile to consider an extension of 'reconstruct' which
40
-is able to incrementally add a set of files to an existing fossil
41
-repository already containing revisions. In that case the import tool
42
-can be changed to incrementally generate the collection for a
43
-particular revision, import it, and iterate over all revisions in the
44
-origin repository. This is of course also dependent on the origin
45
-repository itself, how well it supports such incremental export.
46
-
47
-This also leads to a possible method for performing the import using
48
-only existing functionality ('reconstruct' has not been implemented
49
-yet). Instead generating an unordered collection for each revision
50
-generate a properly setup workspace, simply commit it. This will
51
-require use of rm, add and update methods as well, to remove old and
52
-enter new files, and point the fossil repository to the correct parent
53
-revision from the new revision is derived.
54
-
55
-The relative efficiency (in time) of these incremental methods versus
56
-importing a complete collection of files encoding the entire origin
57
-repository however is not clear.
58
-
-----------------------------------
59
-
60
-reconstruct
61
-
62
-The core logic for handling content is in the file "content.c", in
63
-particular the functions 'content_put' and 'content_deltify'. One of
64
-the main users of these functions is in the file "checkin.c", see the
65
-function 'commit_cmd'.
66
-
67
-The logic is clear. The new modified files are simply stored without
68
-delta-compression, using 'content_put'. And should fosssil have an id
69
-for the _previous_ revision of the committed file it uses
70
-'content_deltify' to convert the already stored data for that revision
71
-into a delta with the just stored new revision as origin.
72
-
73
-In other words, fossil produces reverse deltas, with leaf revisions
74
-stored just zip-compressed (plain) and older revisions using both zip-
75
-and delta-compression.
76
-
77
-Of note is that the underlying logic in 'content_deltify' gives up on
78
-delta compression if the involved files are either not large enough,
79
-or if the achieved compression factor was not high enough. In that
80
-case the old revision of the file is left plain.
81
-
82
-The scheme can thus be called a 'truncated reverse delta'.
83
-
84
-The manifest is created and committed after the modified files. It
85
-uses the same logic as for the regular files. The new leaf is stored
86
-plain, and storage of the parent manifest is modified to be a delta
87
-with the current as origin.
88
-
89
-Further note that for a checkin of a merge result oonly the primary
90
-parent is modified in that way. The secondary parent, the one merged
91
-into the current revision is not touched. I.e. from the storage layer
92
-point of view this revision is still a leaf and the data is kept
93
-stored plain, not delta-compressed.
94
-
95
-
96
-
97
-Now the "reconstruct" can be done like so:
98
-
99
-- Scan the files in the indicated directory, and look for a manifest.
100
-
101
-- When the manifest has been found parse its contents and follow the
102
- chain of parent links to locate the root manifest (no parent).
103
-
104
-- Import the files referenced by the root manifest, then the manifest
105
- itself. This can be done using a modified form of the 'commit_cmd'
106
- which does not have to construct a manifest on its own from vfile,
107
- vmerge, etc.
108
-
109
-- After that recursively apply the import of the previous step to the
110
- children of the root, and so on.
111
-
112
-For an incremental "reconstruct" the collection of files would not be
113
-a single tree with a root, but a forest, and the roots to look for are
114
-not manifests without parent, but with a parent which is already
115
-present in the repository. After one such root has been found and
116
-processed the unprocessed files have to be searched further for more
117
-roots, and only if no such are found anymore will the remaining files
118
-be considered as superfluous.
119
-
120
-We can use the functions in "manifest.c" for the parsing and following
121
-the parental chain.
122
-
123
-Hm. But we have no direct child information. So the above algorithm
124
-has to be modified, we have to scan all manifests before we start
125
-importing, and we have to create a reverse index, from manifest to
126
-children so that we can perform the import from root to leaves.
--- a/ci_fossil.txt
+++ b/ci_fossil.txt
@@ -1,127 +0,0 @@
1
2 To perform CVS imports for fossil we need at least the ability to
3 parse CVS files, i.e. RCS files, with slight differences.
4
5 For the general architecture of the import facility we have two major
6 paths to choose between.
7
8 One is to use an external tool which processes a cvs repository and
9 drives fossil through its CLI to insert the found changesets.
10
11 The other is to integrate the whole facility into the fossil binary
12 itself.
13
14 I dislike the second choice. It may be faster, as the implementation
15 can use all internal functionality of fossil to perform the import,
16 however it will also bloat the binary with functionality not needed
17 most of the time. Which becomes especially obvious if more importers
18 are to be written, like for monotone, bazaar, mercurial, bitkeeper,
19 git, SVN, Arc, etc. Keeping all this out of the core fossil binary is
20 IMHO more beneficial in the long term, also from a maintenance point
21 of view. The tools can evolve separately. Especially important for CVS
22 as it will have to deal with lots of broken repositories, all
23 different.
24
25 However, nothing speaks against looking for common parts in all
26 possible import tools, and having these in the fossil core, as a
27 general backend all importer may use. Something like that has already
28 been proposed: The deconstruct|reconstruct methods. For us, actually
29 only reconstruct is important. Taking an unordered collection of files
30 (data, and manifests) it generates a proper fossil repository. With
31 that method implemented all import tools only have to generate the
32 necessary collection and then leave the main work of filling the
33 database to fossil itself.
34
35 The disadvantage of this method is however that it will gobble up a
36 lot of temporary space in the filesystem to hold all unique revisions
37 of all files in their expanded form.
38
39 It might be worthwhile to consider an extension of 'reconstruct' which
40 is able to incrementally add a set of files to an existing fossil
41 repository already containing revisions. In that case the import tool
42 can be changed to incrementally generate the collection for a
43 particular revision, import it, and iterate over all revisions in the
44 origin repository. This is of course also dependent on the origin
45 repository itself, how well it supports such incremental export.
46
47 This also leads to a possible method for performing the import using
48 only existing functionality ('reconstruct' has not been implemented
49 yet). Instead generating an unordered collection for each revision
50 generate a properly setup workspace, simply commit it. This will
51 require use of rm, add and update methods as well, to remove old and
52 enter new files, and point the fossil repository to the correct parent
53 revision from the new revision is derived.
54
55 The relative efficiency (in time) of these incremental methods versus
56 importing a complete collection of files encoding the entire origin
57 repository however is not clear.
58
-----------------------------------
59
60 reconstruct
61
62 The core logic for handling content is in the file "content.c", in
63 particular the functions 'content_put' and 'content_deltify'. One of
64 the main users of these functions is in the file "checkin.c", see the
65 function 'commit_cmd'.
66
67 The logic is clear. The new modified files are simply stored without
68 delta-compression, using 'content_put'. And should fosssil have an id
69 for the _previous_ revision of the committed file it uses
70 'content_deltify' to convert the already stored data for that revision
71 into a delta with the just stored new revision as origin.
72
73 In other words, fossil produces reverse deltas, with leaf revisions
74 stored just zip-compressed (plain) and older revisions using both zip-
75 and delta-compression.
76
77 Of note is that the underlying logic in 'content_deltify' gives up on
78 delta compression if the involved files are either not large enough,
79 or if the achieved compression factor was not high enough. In that
80 case the old revision of the file is left plain.
81
82 The scheme can thus be called a 'truncated reverse delta'.
83
84 The manifest is created and committed after the modified files. It
85 uses the same logic as for the regular files. The new leaf is stored
86 plain, and storage of the parent manifest is modified to be a delta
87 with the current as origin.
88
89 Further note that for a checkin of a merge result oonly the primary
90 parent is modified in that way. The secondary parent, the one merged
91 into the current revision is not touched. I.e. from the storage layer
92 point of view this revision is still a leaf and the data is kept
93 stored plain, not delta-compressed.
94
95
96
97 Now the "reconstruct" can be done like so:
98
99 - Scan the files in the indicated directory, and look for a manifest.
100
101 - When the manifest has been found parse its contents and follow the
102 chain of parent links to locate the root manifest (no parent).
103
104 - Import the files referenced by the root manifest, then the manifest
105 itself. This can be done using a modified form of the 'commit_cmd'
106 which does not have to construct a manifest on its own from vfile,
107 vmerge, etc.
108
109 - After that recursively apply the import of the previous step to the
110 children of the root, and so on.
111
112 For an incremental "reconstruct" the collection of files would not be
113 a single tree with a root, but a forest, and the roots to look for are
114 not manifests without parent, but with a parent which is already
115 present in the repository. After one such root has been found and
116 processed the unprocessed files have to be searched further for more
117 roots, and only if no such are found anymore will the remaining files
118 be considered as superfluous.
119
120 We can use the functions in "manifest.c" for the parsing and following
121 the parental chain.
122
123 Hm. But we have no direct child information. So the above algorithm
124 has to be modified, we have to scan all manifests before we start
125 importing, and we have to create a reverse index, from manifest to
126 children so that we can perform the import from root to leaves.
--- a/ci_fossil.txt
+++ b/ci_fossil.txt
@@ -1,127 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
-----------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D cvs2fossil.txt
-66
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -1,66 +0,0 @@
1
-
2
-Known problems and areas to work on
3
-===================================
4
-
5
-* Not yet able to handle the specification of multiple projects
6
- for one CVS repository. I.e. I can, for example, import all of
7
- tcllib, or a single subproject of tcllib, like tklib, but not
8
- multiple sub-projects in one go.
9
-
10
-* Consider to rework the breaker- and sort-passes so that they
11
- do not need all changesets as objects in memory.
12
-
13
- Current memory consumption after all changesets are loaded:
14
-
15
- bwidget 6971627 6.6
16
- cvs-memchan 4634049 4.4
17
- cvs-sqlite 45674501 43.6
18
- cvs-trf 8781289 8.4
19
- faqs 2835116 2.7
20
- libtommath 4405066 4.2
21
- mclistbox 3350190 3.2
22
- newclock 5020460 4.8
23
- oocore 4064574 3.9
24
- sampleextension 4729932 4.5
25
- tclapps 8482135 8.1
26
- tclbench 4116887 3.9
27
- tcl_bignum 2545192 2.4
28
- tclconfig 4105042 3.9
29
- tcllib 31707688 30.2
30
- tcltutorial 3512048 3.3
31
- tcl 109926382 104.8
32
- thread 8953139 8.5
33
- tklib 13935220 13.3
34
- tk 66149870 63.1
35
- widget 2625609 2.5
36
-
37
-* Look at the dependencies on external packages and consider
38
- which of them can be moved into the importer, either as a
39
- simple utility command, or wholesale.
40
-
41
- struct::list
42
- assign, map, reverse, filter
43
-
44
- Very few and self-contained commands.
45
-
46
- struct::set
47
- size, empty, contains, add, include, exclude,
48
- intersect, subsetof
49
-
50
- Most of the core commands.
51
-
52
- fileutil
53
- cat, appendToFile, writeFile,
54
- tempfile, stripPath, test
55
-
56
- fileutil::traverse
57
- In toto
58
-
59
- struct::graph
60
- In toto
61
-
62
- snit
63
- In toto
64
-
65
- sqlite3
66
- In toto
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -1,66 +0,0 @@
1
2 Known problems and areas to work on
3 ===================================
4
5 * Not yet able to handle the specification of multiple projects
6 for one CVS repository. I.e. I can, for example, import all of
7 tcllib, or a single subproject of tcllib, like tklib, but not
8 multiple sub-projects in one go.
9
10 * Consider to rework the breaker- and sort-passes so that they
11 do not need all changesets as objects in memory.
12
13 Current memory consumption after all changesets are loaded:
14
15 bwidget 6971627 6.6
16 cvs-memchan 4634049 4.4
17 cvs-sqlite 45674501 43.6
18 cvs-trf 8781289 8.4
19 faqs 2835116 2.7
20 libtommath 4405066 4.2
21 mclistbox 3350190 3.2
22 newclock 5020460 4.8
23 oocore 4064574 3.9
24 sampleextension 4729932 4.5
25 tclapps 8482135 8.1
26 tclbench 4116887 3.9
27 tcl_bignum 2545192 2.4
28 tclconfig 4105042 3.9
29 tcllib 31707688 30.2
30 tcltutorial 3512048 3.3
31 tcl 109926382 104.8
32 thread 8953139 8.5
33 tklib 13935220 13.3
34 tk 66149870 63.1
35 widget 2625609 2.5
36
37 * Look at the dependencies on external packages and consider
38 which of them can be moved into the importer, either as a
39 simple utility command, or wholesale.
40
41 struct::list
42 assign, map, reverse, filter
43
44 Very few and self-contained commands.
45
46 struct::set
47 size, empty, contains, add, include, exclude,
48 intersect, subsetof
49
50 Most of the core commands.
51
52 fileutil
53 cat, appendToFile, writeFile,
54 tempfile, stripPath, test
55
56 fileutil::traverse
57 In toto
58
59 struct::graph
60 In toto
61
62 snit
63 In toto
64
65 sqlite3
66 In toto
--- a/cvs2fossil.txt
+++ b/cvs2fossil.txt
@@ -1,66 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D kktodo.wiki
-69
--- a/kktodo.wiki
+++ b/kktodo.wiki
@@ -1,69 +0,0 @@
1
-<h3>kkinnell</h3>
2
-
3
-.plan -- <i>Fossil, the DG</i> Bwahahahaha! The cover art could be an <i>homo erectus</i> skull lying on some COBOL code...
4
-
5
- 1. Command line interface reference docs
6
- <ul>
7
- <li> <font color="#bb4466">Finish initial pages.</font></li>
8
- <li> Start on tech-spec (serious, not "chatty") reference pages.</li>
9
- <li> Edit, edit, edit.</li>
10
- </ul>
11
-
12
- 2. Support docs
13
- <ul>
14
- <li>Basic explanation of Distributed SCM.</i>
15
- <li>Tutorial
16
- <ul>
17
- <li>Silly source. Start with existing dir struct.</li>
18
- <li>Repository. Creatiing and populating.</li>
19
- <li>Where? Local, Intranet, Internet.</li>
20
- <li>Who? Project size defined by size of code base versus
21
- number of developers. Size matters.</li>
22
- <li>How?
23
- <ul>
24
- <li>Open, close, commit, checkout, update, merge.</li>
25
- </ul>
26
- </li>
27
- <li>Hmmm. Experimenting.</li>
28
- <ul>
29
- <li>The road less travelled, or where'd that
30
- fork come from?</li>
31
- </ul>
32
- <li>Oops! Going back in time.</li>
33
- <ul>
34
- <li>Versions</li>
35
- <ul>
36
- <li>What <i>is</i> a version?</li>
37
- <li>Is it a "version" or a "tag"?</li>
38
- <li>DSCM redux: Revisionist versioning.</li>
39
- </ul>
40
- </ul>
41
- </ul>
42
- </li>
43
- <li>Basic explanation of <i>merge</i>.
44
- <ol>
45
- <li>Leaves, branches and baselines: We want a shrubbery!</li>
46
- <li><i>update</i> merges vs. <i>merge</i> merges.
47
- All merges are equal, but some are more equal than others.</li>
48
- </ol>
49
- </li>
50
- </ul>
51
-
52
- 3. Configuration
53
-
54
- 42. General
55
- <ul>
56
- <li>Co-ordinate style and tone with drh, other devs. (documentation
57
- standard? yuck.)</li>
58
- </ul>
59
-
60
- * Tips & tricks.
61
-
62
- * <b>Fossil</b> and <b>Sqlite</b>
63
- <ul>
64
- <li>Get a word in for Mrinal Kant's
65
- <a href="http://code.google.com/p/sqlite-manager/">SQLite Manager</a>
66
- XUL app. Great tool.</li>
67
- </ul>
68
-
69
- * Th (code groveling &#91;and code groveling {and code groveling ... } ... &#93; ... )
--- a/kktodo.wiki
+++ b/kktodo.wiki
@@ -1,69 +0,0 @@
1 <h3>kkinnell</h3>
2
3 .plan -- <i>Fossil, the DG</i> Bwahahahaha! The cover art could be an <i>homo erectus</i> skull lying on some COBOL code...
4
5 1. Command line interface reference docs
6 <ul>
7 <li> <font color="#bb4466">Finish initial pages.</font></li>
8 <li> Start on tech-spec (serious, not "chatty") reference pages.</li>
9 <li> Edit, edit, edit.</li>
10 </ul>
11
12 2. Support docs
13 <ul>
14 <li>Basic explanation of Distributed SCM.</i>
15 <li>Tutorial
16 <ul>
17 <li>Silly source. Start with existing dir struct.</li>
18 <li>Repository. Creatiing and populating.</li>
19 <li>Where? Local, Intranet, Internet.</li>
20 <li>Who? Project size defined by size of code base versus
21 number of developers. Size matters.</li>
22 <li>How?
23 <ul>
24 <li>Open, close, commit, checkout, update, merge.</li>
25 </ul>
26 </li>
27 <li>Hmmm. Experimenting.</li>
28 <ul>
29 <li>The road less travelled, or where'd that
30 fork come from?</li>
31 </ul>
32 <li>Oops! Going back in time.</li>
33 <ul>
34 <li>Versions</li>
35 <ul>
36 <li>What <i>is</i> a version?</li>
37 <li>Is it a "version" or a "tag"?</li>
38 <li>DSCM redux: Revisionist versioning.</li>
39 </ul>
40 </ul>
41 </ul>
42 </li>
43 <li>Basic explanation of <i>merge</i>.
44 <ol>
45 <li>Leaves, branches and baselines: We want a shrubbery!</li>
46 <li><i>update</i> merges vs. <i>merge</i> merges.
47 All merges are equal, but some are more equal than others.</li>
48 </ol>
49 </li>
50 </ul>
51
52 3. Configuration
53
54 42. General
55 <ul>
56 <li>Co-ordinate style and tone with drh, other devs. (documentation
57 standard? yuck.)</li>
58 </ul>
59
60 * Tips & tricks.
61
62 * <b>Fossil</b> and <b>Sqlite</b>
63 <ul>
64 <li>Get a word in for Mrinal Kant's
65 <a href="http://code.google.com/p/sqlite-manager/">SQLite Manager</a>
66 XUL app. Great tool.</li>
67 </ul>
68
69 * Th (code groveling &#91;and code groveling {and code groveling ... } ... &#93; ... )
--- a/kktodo.wiki
+++ b/kktodo.wiki
@@ -1,69 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D rse-notes.txt
-198
--- a/rse-notes.txt
+++ b/rse-notes.txt
@@ -1,198 +0,0 @@
1
-From: "Ralf S. Engelschall"
2
-Date: October 18, 2008 1:40:53 PM EDT
3
-To: [email protected]
4
-Subject: Some Fossil Feedback
5
-
6
-I've today looked at your Fossil project (latest version from your
7
-repository). That's a _really_ interesting and very promising DVCS.
8
-While I looked around and tested it, I stumbled over some issues I want
9
-to share with you:
10
-
11
-o No tarball
12
-
13
- You currently still do not provide any tarballs of the Fossil sources.
14
- Sure, you are still hacking wild on the code and one can on-the-fly
15
- fetch a ZIP archive, but that's a manual process. For packagers (like
16
- me in the OpenPKG project) this is very nasty and just means that
17
- Fossil will usually still not be packaged. As a result it will be not
18
- spreaded as much as possible and this way you still do not get as much
19
- as possible feedback. Hence, I recommend that you let daily snapshot
20
- tarballs (or ZIP files) be rolled. This would be great.
21
-
22
-o UUID
23
-
24
- Under http://www.fossil-scm.org/index.html/doc/tip/www/concepts.wiki
25
- you describe the concepts and you clearly name the artifact ID a
26
- "UUID" and even say that this is a "Universally Unique Identifier".
27
- Unfortunately, a UUID is a 128-bit entity standardized by the ISO
28
- (under ISO/IEC 11578:1996) and IETF (under RFC-4122) and hence it is
29
- *VERY MUCH* confusing and unclean that your 160-bit SHA1-based ID is
30
- called "UUID" in Fossil.
31
-
32
- I *STRONGLY* recommend you to either use real UUIDs (128-bit
33
- entities, where a UUID of version 5 even is SHA1-based!) or you name
34
- your 160-bit SHA1 entities differently (perhaps AID for "Artifact
35
- Identifier"?).
36
-
37
-o "fossil cgi <script>"
38
-
39
- Currently we have only "fossil cgi <script>" where <script> contains
40
- "repository: <file>". This is a neat idea and should be kept. But
41
- this way one cannot easily host multiple repositories over this
42
- CGI interface without creating such a script for every individual
43
- repository.
44
-
45
- Perhaps a "fossil cgi --repository <file>" would help here, as this
46
- way one can use a generic CGI script which first figures out the
47
- name <name> of the individual project and then runs "fossil cgi
48
- --repository /path/to/repositories/<name>.db". But perhaps I'm just
49
- overlooking something and this is already possible...
50
-
51
-o "fossil db <operation>"
52
-
53
- In Monotone DVCS we have a "mtn db" command for the low-level SQLite
54
- database manipulations. For instance a "mtn --db=<monotone-repository>
55
- db dump" is more or less equal to a "sqlite3 <monotone-repository>
56
- .dump". A "mtn --db=<monotone-repository> db exec '<SQL>'" is equal
57
- "echo '<SQL>' | sqlite3 <monotone-repository>", etc. The point is
58
- that the DVCS user usually has no SQLite CLI at hand but as the DVCS
59
- already contains more or less the complete SQLite it is very useful to
60
- also include the SQLite CLI functionality and wire it into the DVCS
61
- CLI via a "db" command.
62
-
63
-o "fossil version"
64
-
65
- Mostly all VCS I know if either support a command "version" or a
66
- command-line option "--version" or most of the time even both. Please
67
- output the "This is fossil version [9e80dc66cf] 2008-10-18 13:03:36"
68
- there (at least additionally) instead of at the end of "fossil help".
69
-
70
-o "--port" vs. "-port"
71
-
72
- In the "fossil help server" there is "--port" while under
73
- http://www.fossil-scm.org/index.html/doc/tip/www/quickstart.wiki there
74
- is "-port". I personally like GNU-long-style options "--xxxx" more
75
- than the CC-style options "-xxx". But anyway, independent which one is
76
- correct (well, perhaps both even work) only one should be documented
77
- to avoid confusion.
78
-
79
-o User creation on the CLI
80
-
81
- There is "fossil user new ?USERNAME?" which interactively prompts
82
- for the capabilities and the password -- even from the TTY and not
83
- from STDIN. One needs "fossil user new ?USERNAME? ?CAPABILITIES?
84
- ?PASSWORD?" to be able to create a repository in batch without having
85
- to hack the user into the "user" table via the SQLite CLI. Similar:
86
- the "fossil user password USERNAME" should be actually "fossil user
87
- password USERNAME ?PASSWORD?", please.
88
-
89
-o "-R <repository"
90
-
91
- There is the "-R" option for specifiying the repository. But it is
92
- a sub-command option and not a global option. And on "fossil ui" or
93
- "fossil server" it even is an argument and not an option. This is
94
- confusing. Every time one has to figure out how to set the repository
95
- on the CLI. Monotone simply uses a *global* option "--db" and that's
96
- it. So, I recommend that Fossil also uses a single global option
97
- "--repository"/"-R" instead of a command-specific option. Sure, not
98
- all commands might require a repository, but IMHO it is better to
99
- ignore the global option there than having to figure out every time
100
- how the repository has to be specified.
101
-
102
-o Setup pages
103
-
104
- When hitting "Apply changes" on any setup page, one keeps staying on
105
- this page. Sure, that's what an "apply" button usually is about. But
106
- I at least would have liked to see a button (either instead of the
107
- "apply changes" or at least in addition) which applies the changes and
108
- goes back to the setup main page (from where one usually come).
109
-
110
-o _FOSSIL_
111
-
112
- Very nice idea to use another SQLite database for the _FOSSIL_
113
- control file. BUT: Why "_FOSSIL_"? CVS's "CVS" directory was ugly for
114
- decades. Today we have ".svn", ".git", ".hg" and "_MTN"/".mtn" to get
115
- rid of those ugly control files or directories of the DVCS! Sure,
116
- dot-files are disliked by Windows people. But that's no problem, one
117
- can accept "_XXX" in addition to ".XXX" easily, of course.
118
-
119
- So, I really would like to see the file "_FOSSIL_" to be renamed
120
- to ".fossil" under Unix and "_fossil" under Windows or (if the
121
- upper-case is important to you) ".FOSSIL" and "_FOSSIL". But to see
122
- an ugly "_FOSSIL_" at the top of every source tree is really rather
123
- boring for Unix people!
124
-
125
-o "fossil open", "fossil checkout", "fossil update".
126
-
127
- I'm personally confused that "fossil open" is what "checkout" does in
128
- other DVCS and that "checkout" is just a variant of "update". Hmmm...
129
- for me it looks at least one should be eleminated to reduce confusion.
130
- The difference between checkout and update could become an option of
131
- a single option. And the remaining to perhaps better should be either
132
- "open" + "update" or "checkout" + "update". Well, perhaps I'm still
133
- not understanding Fossil enough. But I can only tell that I got rather
134
- confused.
135
-
136
-o "fossil commit"
137
-
138
- There is "fossil commit" but no short-hand "fossil ci". But there
139
- is "fossil status" and even just "fossil st" which clearly shows
140
- that Fossil allows abbreviations or at least prefix-matching on the
141
- commands. Sure, "ci" is not a prefix of "commit" but mostly all VCS
142
- support the good old RCS/CVS "ci" and similar aliases. So I recommend
143
- that Fossil does not only alias matching, but also provides aliases:
144
- "ci" for "commit", "co" for "checkout", "log" for "timeline", etc.
145
- Sorry, having to type the long "fossil commit" every time is too long
146
- for us Unix hackers ;-)
147
-
148
- Additionally, Fossil seems to use GnuPG when installed and --nosign is
149
- not specified. Hmm... two questions arise here for me: 1. should the
150
- use of a cryptographically strong signature really be just _optional_
151
- (Monotone for instance RSA signs every commit) and 2. is GnuPG here
152
- really the right tool (Monotone does a plain RSA signing and is even
153
- able to leverage a running SSH agent for the operation -- something
154
- which is very cool both under Unix with "ssh-agent" and under Windows
155
- with "pagent"). OTOH, GnuPG 2.x supports a gpg-agent, so this might be
156
- no longer a big issue. But Fossil should document this a little bit
157
- futher: how to create the necessary GnuPG key, how to setup gpg-agent,
158
- etc.
159
-
160
-o "fossil diff"
161
-
162
- There is "Usage: fossil diff|gdiff ?-i? ?-r REVISION? FILE...". Two
163
- questions arise: Why do I have to specify a "FILE"? I would expect
164
- that a simple "fossil diff" recursively shows a "diff" of all changed
165
- files in the source tree. Additionally, how does one do a diff between
166
- two particular revisions (one seems to be not able to specifiy "-r"
167
- twice).
168
-
169
-o "manifest" / "manifest.uuid"
170
-
171
- Above I was already bothered by the _FOSSIL_ file, but now that I
172
- played with Fossil I see that "manifest" and "manifest.uuid" files
173
- showed up in my source tree. Why is this not implicitly in the
174
- database and instead externally represented in the source tree.
175
- Hmmm... then I recommend that you use a .fossil *DIRECTORY*, place
176
- the control file into .fossil/control (or whatever) and the manifest
177
- stuff into .fossil/manifest and .fossil/manifest.uuid. But please do
178
- not clutter the top-level of the source three with control data of the
179
- DVCS.
180
-
181
-o "fossil mv"
182
-
183
- There is "fossil add" and "fossil rm", but no "fossil mv". Hopefully
184
- this doesn't mean a file move is an "add" and a "remove" bundle, as
185
- this way Fossil would have trouble to know that the file was renamed
186
- and hence the full history tracking of a file seems to be broken.
187
-
188
-o "fossil changes" vs. "fossil status"
189
-
190
- Finally, I got confused by the "fossil changes" and "fossil status"
191
- commands. "fossil status" seems to be a super-set of "fossil changes".
192
- Looks a little bit less orthogonal than necessary. I would remove
193
- "fossil changes" or at least do not show the file details on "fossil
194
- status".
195
-
196
-Yours,
197
- Ralf S. Engelschall
198
-
--- a/rse-notes.txt
+++ b/rse-notes.txt
@@ -1,198 +0,0 @@
1 From: "Ralf S. Engelschall"
2 Date: October 18, 2008 1:40:53 PM EDT
3 To: [email protected]
4 Subject: Some Fossil Feedback
5
6 I've today looked at your Fossil project (latest version from your
7 repository). That's a _really_ interesting and very promising DVCS.
8 While I looked around and tested it, I stumbled over some issues I want
9 to share with you:
10
11 o No tarball
12
13 You currently still do not provide any tarballs of the Fossil sources.
14 Sure, you are still hacking wild on the code and one can on-the-fly
15 fetch a ZIP archive, but that's a manual process. For packagers (like
16 me in the OpenPKG project) this is very nasty and just means that
17 Fossil will usually still not be packaged. As a result it will be not
18 spreaded as much as possible and this way you still do not get as much
19 as possible feedback. Hence, I recommend that you let daily snapshot
20 tarballs (or ZIP files) be rolled. This would be great.
21
22 o UUID
23
24 Under http://www.fossil-scm.org/index.html/doc/tip/www/concepts.wiki
25 you describe the concepts and you clearly name the artifact ID a
26 "UUID" and even say that this is a "Universally Unique Identifier".
27 Unfortunately, a UUID is a 128-bit entity standardized by the ISO
28 (under ISO/IEC 11578:1996) and IETF (under RFC-4122) and hence it is
29 *VERY MUCH* confusing and unclean that your 160-bit SHA1-based ID is
30 called "UUID" in Fossil.
31
32 I *STRONGLY* recommend you to either use real UUIDs (128-bit
33 entities, where a UUID of version 5 even is SHA1-based!) or you name
34 your 160-bit SHA1 entities differently (perhaps AID for "Artifact
35 Identifier"?).
36
37 o "fossil cgi <script>"
38
39 Currently we have only "fossil cgi <script>" where <script> contains
40 "repository: <file>". This is a neat idea and should be kept. But
41 this way one cannot easily host multiple repositories over this
42 CGI interface without creating such a script for every individual
43 repository.
44
45 Perhaps a "fossil cgi --repository <file>" would help here, as this
46 way one can use a generic CGI script which first figures out the
47 name <name> of the individual project and then runs "fossil cgi
48 --repository /path/to/repositories/<name>.db". But perhaps I'm just
49 overlooking something and this is already possible...
50
51 o "fossil db <operation>"
52
53 In Monotone DVCS we have a "mtn db" command for the low-level SQLite
54 database manipulations. For instance a "mtn --db=<monotone-repository>
55 db dump" is more or less equal to a "sqlite3 <monotone-repository>
56 .dump". A "mtn --db=<monotone-repository> db exec '<SQL>'" is equal
57 "echo '<SQL>' | sqlite3 <monotone-repository>", etc. The point is
58 that the DVCS user usually has no SQLite CLI at hand but as the DVCS
59 already contains more or less the complete SQLite it is very useful to
60 also include the SQLite CLI functionality and wire it into the DVCS
61 CLI via a "db" command.
62
63 o "fossil version"
64
65 Mostly all VCS I know if either support a command "version" or a
66 command-line option "--version" or most of the time even both. Please
67 output the "This is fossil version [9e80dc66cf] 2008-10-18 13:03:36"
68 there (at least additionally) instead of at the end of "fossil help".
69
70 o "--port" vs. "-port"
71
72 In the "fossil help server" there is "--port" while under
73 http://www.fossil-scm.org/index.html/doc/tip/www/quickstart.wiki there
74 is "-port". I personally like GNU-long-style options "--xxxx" more
75 than the CC-style options "-xxx". But anyway, independent which one is
76 correct (well, perhaps both even work) only one should be documented
77 to avoid confusion.
78
79 o User creation on the CLI
80
81 There is "fossil user new ?USERNAME?" which interactively prompts
82 for the capabilities and the password -- even from the TTY and not
83 from STDIN. One needs "fossil user new ?USERNAME? ?CAPABILITIES?
84 ?PASSWORD?" to be able to create a repository in batch without having
85 to hack the user into the "user" table via the SQLite CLI. Similar:
86 the "fossil user password USERNAME" should be actually "fossil user
87 password USERNAME ?PASSWORD?", please.
88
89 o "-R <repository"
90
91 There is the "-R" option for specifiying the repository. But it is
92 a sub-command option and not a global option. And on "fossil ui" or
93 "fossil server" it even is an argument and not an option. This is
94 confusing. Every time one has to figure out how to set the repository
95 on the CLI. Monotone simply uses a *global* option "--db" and that's
96 it. So, I recommend that Fossil also uses a single global option
97 "--repository"/"-R" instead of a command-specific option. Sure, not
98 all commands might require a repository, but IMHO it is better to
99 ignore the global option there than having to figure out every time
100 how the repository has to be specified.
101
102 o Setup pages
103
104 When hitting "Apply changes" on any setup page, one keeps staying on
105 this page. Sure, that's what an "apply" button usually is about. But
106 I at least would have liked to see a button (either instead of the
107 "apply changes" or at least in addition) which applies the changes and
108 goes back to the setup main page (from where one usually come).
109
110 o _FOSSIL_
111
112 Very nice idea to use another SQLite database for the _FOSSIL_
113 control file. BUT: Why "_FOSSIL_"? CVS's "CVS" directory was ugly for
114 decades. Today we have ".svn", ".git", ".hg" and "_MTN"/".mtn" to get
115 rid of those ugly control files or directories of the DVCS! Sure,
116 dot-files are disliked by Windows people. But that's no problem, one
117 can accept "_XXX" in addition to ".XXX" easily, of course.
118
119 So, I really would like to see the file "_FOSSIL_" to be renamed
120 to ".fossil" under Unix and "_fossil" under Windows or (if the
121 upper-case is important to you) ".FOSSIL" and "_FOSSIL". But to see
122 an ugly "_FOSSIL_" at the top of every source tree is really rather
123 boring for Unix people!
124
125 o "fossil open", "fossil checkout", "fossil update".
126
127 I'm personally confused that "fossil open" is what "checkout" does in
128 other DVCS and that "checkout" is just a variant of "update". Hmmm...
129 for me it looks at least one should be eleminated to reduce confusion.
130 The difference between checkout and update could become an option of
131 a single option. And the remaining to perhaps better should be either
132 "open" + "update" or "checkout" + "update". Well, perhaps I'm still
133 not understanding Fossil enough. But I can only tell that I got rather
134 confused.
135
136 o "fossil commit"
137
138 There is "fossil commit" but no short-hand "fossil ci". But there
139 is "fossil status" and even just "fossil st" which clearly shows
140 that Fossil allows abbreviations or at least prefix-matching on the
141 commands. Sure, "ci" is not a prefix of "commit" but mostly all VCS
142 support the good old RCS/CVS "ci" and similar aliases. So I recommend
143 that Fossil does not only alias matching, but also provides aliases:
144 "ci" for "commit", "co" for "checkout", "log" for "timeline", etc.
145 Sorry, having to type the long "fossil commit" every time is too long
146 for us Unix hackers ;-)
147
148 Additionally, Fossil seems to use GnuPG when installed and --nosign is
149 not specified. Hmm... two questions arise here for me: 1. should the
150 use of a cryptographically strong signature really be just _optional_
151 (Monotone for instance RSA signs every commit) and 2. is GnuPG here
152 really the right tool (Monotone does a plain RSA signing and is even
153 able to leverage a running SSH agent for the operation -- something
154 which is very cool both under Unix with "ssh-agent" and under Windows
155 with "pagent"). OTOH, GnuPG 2.x supports a gpg-agent, so this might be
156 no longer a big issue. But Fossil should document this a little bit
157 futher: how to create the necessary GnuPG key, how to setup gpg-agent,
158 etc.
159
160 o "fossil diff"
161
162 There is "Usage: fossil diff|gdiff ?-i? ?-r REVISION? FILE...". Two
163 questions arise: Why do I have to specify a "FILE"? I would expect
164 that a simple "fossil diff" recursively shows a "diff" of all changed
165 files in the source tree. Additionally, how does one do a diff between
166 two particular revisions (one seems to be not able to specifiy "-r"
167 twice).
168
169 o "manifest" / "manifest.uuid"
170
171 Above I was already bothered by the _FOSSIL_ file, but now that I
172 played with Fossil I see that "manifest" and "manifest.uuid" files
173 showed up in my source tree. Why is this not implicitly in the
174 database and instead externally represented in the source tree.
175 Hmmm... then I recommend that you use a .fossil *DIRECTORY*, place
176 the control file into .fossil/control (or whatever) and the manifest
177 stuff into .fossil/manifest and .fossil/manifest.uuid. But please do
178 not clutter the top-level of the source three with control data of the
179 DVCS.
180
181 o "fossil mv"
182
183 There is "fossil add" and "fossil rm", but no "fossil mv". Hopefully
184 this doesn't mean a file move is an "add" and a "remove" bundle, as
185 this way Fossil would have trouble to know that the file was renamed
186 and hence the full history tracking of a file seems to be broken.
187
188 o "fossil changes" vs. "fossil status"
189
190 Finally, I got confused by the "fossil changes" and "fossil status"
191 commands. "fossil status" seems to be a super-set of "fossil changes".
192 Looks a little bit less orthogonal than necessary. I would remove
193 "fossil changes" or at least do not show the file details on "fossil
194 status".
195
196 Yours,
197 Ralf S. Engelschall
198
--- a/rse-notes.txt
+++ b/rse-notes.txt
@@ -1,198 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+10 -3
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
5757
*/
5858
static const char *azManifest[] = {
5959
"manifest",
6060
"manifest.uuid",
6161
};
62
+
63
+ /* Cached setting "manifest" */
64
+ static int cachedManifest = -1;
65
+
66
+ if( cachedManifest == -1 ){
67
+ cachedManifest = db_get_boolean("manifest",0);
68
+ }
6269
6370
if( N>=0 && N<count(azName) ) return azName[N];
6471
if( N>=count(azName) && N<count(azName)+count(azManifest)
65
- && db_get_boolean("manifest",0) ){
72
+ && cachedManifest ){
6673
return azManifest[N-count(azName)];
6774
}
6875
return 0;
6976
}
7077
@@ -228,11 +235,11 @@
228235
int isDir;
229236
Blob fullName;
230237
231238
file_canonical_name(g.argv[i], &fullName);
232239
zName = blob_str(&fullName);
233
- isDir = file_isdir(zName);
240
+ isDir = file_wd_isdir(zName);
234241
if( isDir==1 ){
235242
vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
236243
}else if( isDir==0 ){
237244
fossil_fatal("not found: %s", zName);
238245
}else if( file_access(zName, R_OK) ){
@@ -506,11 +513,11 @@
506513
"UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
507514
);
508515
db_multi_exec(
509516
"CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
510517
);
511
- if( file_isdir(zDest)!=1 ){
518
+ if( file_wd_isdir(zDest)!=1 ){
512519
Blob orig;
513520
if( g.argc!=4 ){
514521
usage("OLDNAME NEWNAME");
515522
}
516523
file_tree_name(g.argv[2], &orig, 1);
517524
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
57 */
58 static const char *azManifest[] = {
59 "manifest",
60 "manifest.uuid",
61 };
 
 
 
 
 
 
 
62
63 if( N>=0 && N<count(azName) ) return azName[N];
64 if( N>=count(azName) && N<count(azName)+count(azManifest)
65 && db_get_boolean("manifest",0) ){
66 return azManifest[N-count(azName)];
67 }
68 return 0;
69 }
70
@@ -228,11 +235,11 @@
228 int isDir;
229 Blob fullName;
230
231 file_canonical_name(g.argv[i], &fullName);
232 zName = blob_str(&fullName);
233 isDir = file_isdir(zName);
234 if( isDir==1 ){
235 vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
236 }else if( isDir==0 ){
237 fossil_fatal("not found: %s", zName);
238 }else if( file_access(zName, R_OK) ){
@@ -506,11 +513,11 @@
506 "UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
507 );
508 db_multi_exec(
509 "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
510 );
511 if( file_isdir(zDest)!=1 ){
512 Blob orig;
513 if( g.argc!=4 ){
514 usage("OLDNAME NEWNAME");
515 }
516 file_tree_name(g.argv[2], &orig, 1);
517
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
57 */
58 static const char *azManifest[] = {
59 "manifest",
60 "manifest.uuid",
61 };
62
63 /* Cached setting "manifest" */
64 static int cachedManifest = -1;
65
66 if( cachedManifest == -1 ){
67 cachedManifest = db_get_boolean("manifest",0);
68 }
69
70 if( N>=0 && N<count(azName) ) return azName[N];
71 if( N>=count(azName) && N<count(azName)+count(azManifest)
72 && cachedManifest ){
73 return azManifest[N-count(azName)];
74 }
75 return 0;
76 }
77
@@ -228,11 +235,11 @@
235 int isDir;
236 Blob fullName;
237
238 file_canonical_name(g.argv[i], &fullName);
239 zName = blob_str(&fullName);
240 isDir = file_wd_isdir(zName);
241 if( isDir==1 ){
242 vfile_scan(&fullName, nRoot-1, includeDotFiles, pIgnore);
243 }else if( isDir==0 ){
244 fossil_fatal("not found: %s", zName);
245 }else if( file_access(zName, R_OK) ){
@@ -506,11 +513,11 @@
513 "UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
514 );
515 db_multi_exec(
516 "CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
517 );
518 if( file_wd_isdir(zDest)!=1 ){
519 Blob orig;
520 if( g.argc!=4 ){
521 usage("OLDNAME NEWNAME");
522 }
523 file_tree_name(g.argv[2], &orig, 1);
524
+26
--- src/blob.c
+++ src/blob.c
@@ -311,10 +311,36 @@
311311
sz = szA<szB ? szA : szB;
312312
rc = memcmp(blob_buffer(pA), blob_buffer(pB), sz);
313313
if( rc==0 ){
314314
rc = szA - szB;
315315
}
316
+ return rc;
317
+}
318
+
319
+/*
320
+** Compare two blobs in constant time and return zero if they are equal.
321
+** Constant time comparison only applies for blobs of the same length.
322
+** If lengths are different, immediately returns 1.
323
+*/
324
+int blob_constant_time_cmp(Blob *pA, Blob *pB){
325
+ int szA, szB, i;
326
+ unsigned char *buf1, *buf2;
327
+ unsigned char rc = 0;
328
+
329
+ blob_is_init(pA);
330
+ blob_is_init(pB);
331
+ szA = blob_size(pA);
332
+ szB = blob_size(pB);
333
+ if( szA!=szB || szA==0 ) return 1;
334
+
335
+ buf1 = blob_buffer(pA);
336
+ buf2 = blob_buffer(pB);
337
+
338
+ for( i=0; i<szA; i++ ){
339
+ rc = rc | (buf1[i] ^ buf2[i]);
340
+ }
341
+
316342
return rc;
317343
}
318344
319345
/*
320346
** Compare a blob to a string. Return TRUE if they are equal.
321347
--- src/blob.c
+++ src/blob.c
@@ -311,10 +311,36 @@
311 sz = szA<szB ? szA : szB;
312 rc = memcmp(blob_buffer(pA), blob_buffer(pB), sz);
313 if( rc==0 ){
314 rc = szA - szB;
315 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316 return rc;
317 }
318
319 /*
320 ** Compare a blob to a string. Return TRUE if they are equal.
321
--- src/blob.c
+++ src/blob.c
@@ -311,10 +311,36 @@
311 sz = szA<szB ? szA : szB;
312 rc = memcmp(blob_buffer(pA), blob_buffer(pB), sz);
313 if( rc==0 ){
314 rc = szA - szB;
315 }
316 return rc;
317 }
318
319 /*
320 ** Compare two blobs in constant time and return zero if they are equal.
321 ** Constant time comparison only applies for blobs of the same length.
322 ** If lengths are different, immediately returns 1.
323 */
324 int blob_constant_time_cmp(Blob *pA, Blob *pB){
325 int szA, szB, i;
326 unsigned char *buf1, *buf2;
327 unsigned char rc = 0;
328
329 blob_is_init(pA);
330 blob_is_init(pB);
331 szA = blob_size(pA);
332 szB = blob_size(pB);
333 if( szA!=szB || szA==0 ) return 1;
334
335 buf1 = blob_buffer(pA);
336 buf2 = blob_buffer(pB);
337
338 for( i=0; i<szA; i++ ){
339 rc = rc | (buf1[i] ^ buf2[i]);
340 }
341
342 return rc;
343 }
344
345 /*
346 ** Compare a blob to a string. Return TRUE if they are equal.
347
+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -325,11 +325,11 @@
325325
*/
326326
/*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
327327
time_t expires = time(0) + 604800;
328328
fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires));
329329
}else{
330
- fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
330
+ fprintf(g.httpOut, "Cache-control: no-cache\r\n");
331331
}
332332
333333
/* Content intended for logged in users should only be cached in
334334
** the browser, not some shared location.
335335
*/
336336
--- src/cgi.c
+++ src/cgi.c
@@ -325,11 +325,11 @@
325 */
326 /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
327 time_t expires = time(0) + 604800;
328 fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires));
329 }else{
330 fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
331 }
332
333 /* Content intended for logged in users should only be cached in
334 ** the browser, not some shared location.
335 */
336
--- src/cgi.c
+++ src/cgi.c
@@ -325,11 +325,11 @@
325 */
326 /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
327 time_t expires = time(0) + 604800;
328 fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires));
329 }else{
330 fprintf(g.httpOut, "Cache-control: no-cache\r\n");
331 }
332
333 /* Content intended for logged in users should only be cached in
334 ** the browser, not some shared location.
335 */
336
+11 -10
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658658
while( db_step(&q)==SQLITE_ROW ){
659659
const char *zName = db_column_text(&q, 0);
660660
const char *zUuid = db_column_text(&q, 1);
661661
const char *zOrig = db_column_text(&q, 2);
662662
int frid = db_column_int(&q, 3);
663
- int isexe = db_column_int(&q, 4);
663
+ int isExe = db_column_int(&q, 4);
664664
int isLink = db_column_int(&q, 5);
665665
int isSelected = db_column_int(&q, 6);
666666
const char *zPerm;
667667
int cmp;
668668
#if !defined(_WIN32)
669
- /* For unix, extract the "executable" permission bit directly from
670
- ** the filesystem. On windows, the "executable" bit is retained
669
+ int mPerm;
670
+
671
+ /* For unix, extract the "executable" and "symlink" permissions
672
+ ** directly from the filesystem. On windows, permissions are
671673
** unchanged from the original.
672674
*/
675
+
673676
blob_resize(&filename, nBasename);
674677
blob_append(&filename, zName, -1);
675
- isexe = file_wd_isexe(blob_str(&filename));
676
-
677
- /* For unix, check if the file on the filesystem is symlink.
678
- ** On windows, the bit is retained unchanged from original.
679
- */
680
- isLink = file_wd_islink(blob_str(&filename));
678
+
679
+ mPerm = file_wd_perm(blob_str(&filename));
680
+ isExe = ( mPerm==PERM_EXE );
681
+ isLink = ( mPerm==PERM_LNK );
681682
#endif
682
- if( isexe ){
683
+ if( isExe ){
683684
zPerm = " x";
684685
}else if( isLink ){
685686
zPerm = " l"; /* note: symlinks don't have executable bit on unix */
686687
}else{
687688
zPerm = "";
688689
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658 while( db_step(&q)==SQLITE_ROW ){
659 const char *zName = db_column_text(&q, 0);
660 const char *zUuid = db_column_text(&q, 1);
661 const char *zOrig = db_column_text(&q, 2);
662 int frid = db_column_int(&q, 3);
663 int isexe = db_column_int(&q, 4);
664 int isLink = db_column_int(&q, 5);
665 int isSelected = db_column_int(&q, 6);
666 const char *zPerm;
667 int cmp;
668 #if !defined(_WIN32)
669 /* For unix, extract the "executable" permission bit directly from
670 ** the filesystem. On windows, the "executable" bit is retained
 
 
671 ** unchanged from the original.
672 */
 
673 blob_resize(&filename, nBasename);
674 blob_append(&filename, zName, -1);
675 isexe = file_wd_isexe(blob_str(&filename));
676
677 /* For unix, check if the file on the filesystem is symlink.
678 ** On windows, the bit is retained unchanged from original.
679 */
680 isLink = file_wd_islink(blob_str(&filename));
681 #endif
682 if( isexe ){
683 zPerm = " x";
684 }else if( isLink ){
685 zPerm = " l"; /* note: symlinks don't have executable bit on unix */
686 }else{
687 zPerm = "";
688
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658 while( db_step(&q)==SQLITE_ROW ){
659 const char *zName = db_column_text(&q, 0);
660 const char *zUuid = db_column_text(&q, 1);
661 const char *zOrig = db_column_text(&q, 2);
662 int frid = db_column_int(&q, 3);
663 int isExe = db_column_int(&q, 4);
664 int isLink = db_column_int(&q, 5);
665 int isSelected = db_column_int(&q, 6);
666 const char *zPerm;
667 int cmp;
668 #if !defined(_WIN32)
669 int mPerm;
670
671 /* For unix, extract the "executable" and "symlink" permissions
672 ** directly from the filesystem. On windows, permissions are
673 ** unchanged from the original.
674 */
675
676 blob_resize(&filename, nBasename);
677 blob_append(&filename, zName, -1);
678
679 mPerm = file_wd_perm(blob_str(&filename));
680 isExe = ( mPerm==PERM_EXE );
681 isLink = ( mPerm==PERM_LNK );
 
 
682 #endif
683 if( isExe ){
684 zPerm = " x";
685 }else if( isLink ){
686 zPerm = " l"; /* note: symlinks don't have executable bit on unix */
687 }else{
688 zPerm = "";
689
+2 -2
--- src/file.c
+++ src/file.c
@@ -394,11 +394,11 @@
394394
** with the same name.
395395
**
396396
** Return the number of errors.
397397
*/
398398
int file_mkdir(const char *zName, int forceFlag){
399
- int rc = file_isdir(zName);
399
+ int rc = file_wd_isdir(zName);
400400
if( rc==2 ){
401401
if( !forceFlag ) return 1;
402402
file_delete(zName);
403403
}
404404
if( rc!=1 ){
@@ -899,11 +899,11 @@
899899
int file_is_the_same(Blob *pContent, const char *zName){
900900
i64 iSize;
901901
int rc;
902902
Blob onDisk;
903903
904
- iSize = file_size(zName);
904
+ iSize = file_wd_size(zName);
905905
if( iSize<0 ) return 0;
906906
if( iSize!=blob_size(pContent) ) return 0;
907907
if( file_wd_islink(zName) ){
908908
blob_read_link(&onDisk, zName);
909909
}else{
910910
--- src/file.c
+++ src/file.c
@@ -394,11 +394,11 @@
394 ** with the same name.
395 **
396 ** Return the number of errors.
397 */
398 int file_mkdir(const char *zName, int forceFlag){
399 int rc = file_isdir(zName);
400 if( rc==2 ){
401 if( !forceFlag ) return 1;
402 file_delete(zName);
403 }
404 if( rc!=1 ){
@@ -899,11 +899,11 @@
899 int file_is_the_same(Blob *pContent, const char *zName){
900 i64 iSize;
901 int rc;
902 Blob onDisk;
903
904 iSize = file_size(zName);
905 if( iSize<0 ) return 0;
906 if( iSize!=blob_size(pContent) ) return 0;
907 if( file_wd_islink(zName) ){
908 blob_read_link(&onDisk, zName);
909 }else{
910
--- src/file.c
+++ src/file.c
@@ -394,11 +394,11 @@
394 ** with the same name.
395 **
396 ** Return the number of errors.
397 */
398 int file_mkdir(const char *zName, int forceFlag){
399 int rc = file_wd_isdir(zName);
400 if( rc==2 ){
401 if( !forceFlag ) return 1;
402 file_delete(zName);
403 }
404 if( rc!=1 ){
@@ -899,11 +899,11 @@
899 int file_is_the_same(Blob *pContent, const char *zName){
900 i64 iSize;
901 int rc;
902 Blob onDisk;
903
904 iSize = file_wd_size(zName);
905 if( iSize<0 ) return 0;
906 if( iSize!=blob_size(pContent) ) return 0;
907 if( file_wd_islink(zName) ){
908 blob_read_link(&onDisk, zName);
909 }else{
910
+5 -4
--- src/gzip.c
+++ src/gzip.c
@@ -47,20 +47,21 @@
4747
}
4848
4949
/*
5050
** Begin constructing a gzip file.
5151
*/
52
-void gzip_begin(void){
52
+void gzip_begin(sqlite3_int64 now){
5353
char aHdr[10];
54
- sqlite3_int64 now;
5554
assert( gzip.eState==0 );
5655
blob_zero(&gzip.out);
5756
aHdr[0] = 0x1f;
5857
aHdr[1] = 0x8b;
5958
aHdr[2] = 8;
6059
aHdr[3] = 0;
61
- now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
60
+ if( now==0 ){
61
+ now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
62
+ }
6263
put32(&aHdr[4], now&0xffffffff);
6364
aHdr[8] = 2;
6465
aHdr[9] = 255;
6566
blob_append(&gzip.out, aHdr, 10);
6667
gzip.iCRC = 0;
@@ -125,15 +126,15 @@
125126
void test_gzip_cmd(void){
126127
Blob b;
127128
char *zOut;
128129
if( g.argc!=3 ) usage("FILENAME");
129130
sqlite3_open(":memory:", &g.db);
130
- gzip_begin();
131
+ gzip_begin(0);
131132
blob_read_from_file(&b, g.argv[2]);
132133
zOut = mprintf("%s.gz", g.argv[2]);
133134
gzip_step(blob_buffer(&b), blob_size(&b));
134135
blob_reset(&b);
135136
gzip_finish(&b);
136137
blob_write_to_file(&b, zOut);
137138
blob_reset(&b);
138139
fossil_free(zOut);
139140
}
140141
--- src/gzip.c
+++ src/gzip.c
@@ -47,20 +47,21 @@
47 }
48
49 /*
50 ** Begin constructing a gzip file.
51 */
52 void gzip_begin(void){
53 char aHdr[10];
54 sqlite3_int64 now;
55 assert( gzip.eState==0 );
56 blob_zero(&gzip.out);
57 aHdr[0] = 0x1f;
58 aHdr[1] = 0x8b;
59 aHdr[2] = 8;
60 aHdr[3] = 0;
61 now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
 
 
62 put32(&aHdr[4], now&0xffffffff);
63 aHdr[8] = 2;
64 aHdr[9] = 255;
65 blob_append(&gzip.out, aHdr, 10);
66 gzip.iCRC = 0;
@@ -125,15 +126,15 @@
125 void test_gzip_cmd(void){
126 Blob b;
127 char *zOut;
128 if( g.argc!=3 ) usage("FILENAME");
129 sqlite3_open(":memory:", &g.db);
130 gzip_begin();
131 blob_read_from_file(&b, g.argv[2]);
132 zOut = mprintf("%s.gz", g.argv[2]);
133 gzip_step(blob_buffer(&b), blob_size(&b));
134 blob_reset(&b);
135 gzip_finish(&b);
136 blob_write_to_file(&b, zOut);
137 blob_reset(&b);
138 fossil_free(zOut);
139 }
140
--- src/gzip.c
+++ src/gzip.c
@@ -47,20 +47,21 @@
47 }
48
49 /*
50 ** Begin constructing a gzip file.
51 */
52 void gzip_begin(sqlite3_int64 now){
53 char aHdr[10];
 
54 assert( gzip.eState==0 );
55 blob_zero(&gzip.out);
56 aHdr[0] = 0x1f;
57 aHdr[1] = 0x8b;
58 aHdr[2] = 8;
59 aHdr[3] = 0;
60 if( now==0 ){
61 now = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0");
62 }
63 put32(&aHdr[4], now&0xffffffff);
64 aHdr[8] = 2;
65 aHdr[9] = 255;
66 blob_append(&gzip.out, aHdr, 10);
67 gzip.iCRC = 0;
@@ -125,15 +126,15 @@
126 void test_gzip_cmd(void){
127 Blob b;
128 char *zOut;
129 if( g.argc!=3 ) usage("FILENAME");
130 sqlite3_open(":memory:", &g.db);
131 gzip_begin(0);
132 blob_read_from_file(&b, g.argv[2]);
133 zOut = mprintf("%s.gz", g.argv[2]);
134 gzip_step(blob_buffer(&b), blob_size(&b));
135 blob_reset(&b);
136 gzip_finish(&b);
137 blob_write_to_file(&b, zOut);
138 blob_reset(&b);
139 fossil_free(zOut);
140 }
141
--- src/http_socket.c
+++ src/http_socket.c
@@ -200,16 +200,16 @@
200200
201201
/*
202202
** Receive content back from the open socket connection.
203203
*/
204204
size_t socket_receive(void *NotUsed, void *pContent, size_t N){
205
- size_t got;
205
+ ssize_t got;
206206
size_t total = 0;
207207
while( N>0 ){
208208
got = recv(iSocket, pContent, N, 0);
209209
if( got<=0 ) break;
210
- total += got;
211
- N -= got;
210
+ total += (size_t)got;
211
+ N -= (size_t)got;
212212
pContent = (void*)&((char*)pContent)[got];
213213
}
214214
return total;
215215
}
216216
--- src/http_socket.c
+++ src/http_socket.c
@@ -200,16 +200,16 @@
200
201 /*
202 ** Receive content back from the open socket connection.
203 */
204 size_t socket_receive(void *NotUsed, void *pContent, size_t N){
205 size_t got;
206 size_t total = 0;
207 while( N>0 ){
208 got = recv(iSocket, pContent, N, 0);
209 if( got<=0 ) break;
210 total += got;
211 N -= got;
212 pContent = (void*)&((char*)pContent)[got];
213 }
214 return total;
215 }
216
--- src/http_socket.c
+++ src/http_socket.c
@@ -200,16 +200,16 @@
200
201 /*
202 ** Receive content back from the open socket connection.
203 */
204 size_t socket_receive(void *NotUsed, void *pContent, size_t N){
205 ssize_t got;
206 size_t total = 0;
207 while( N>0 ){
208 got = recv(iSocket, pContent, N, 0);
209 if( got<=0 ) break;
210 total += (size_t)got;
211 N -= (size_t)got;
212 pContent = (void*)&((char*)pContent)[got];
213 }
214 return total;
215 }
216
+4 -2
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -104,10 +104,12 @@
104104
SSL_library_init();
105105
SSL_load_error_strings();
106106
ERR_load_BIO_strings();
107107
OpenSSL_add_all_algorithms();
108108
sslCtx = SSL_CTX_new(SSLv23_client_method());
109
+ /* Disable SSLv2 */
110
+ SSL_CTX_set_options(sslCtx, SSL_OP_NO_SSLv2);
109111
110112
/* Set up acceptable CA root certificates */
111113
zCaSetting = db_get("ssl-ca-location", 0);
112114
if( zCaSetting==0 || zCaSetting[0]=='\0' ){
113115
/* CA location not specified, use platform's default certificate store */
@@ -249,11 +251,11 @@
249251
int j;
250252
for( j = 0; j < mdLength; ++j ) {
251253
BIO_printf(mem, " %02x", md[j]);
252254
}
253255
}
254
- BIO_write(mem, "", 1); // null-terminate mem buffer
256
+ BIO_write(mem, "", 1); /* nul-terminate mem buffer */
255257
BIO_get_mem_data(mem, &desc);
256258
257259
if( hasSavedCertificate ){
258260
warning = "WARNING: Certificate doesn't match the "
259261
"saved certificate for this host!";
@@ -304,11 +306,11 @@
304306
BIO *mem;
305307
char *zCert, *zHost;
306308
307309
mem = BIO_new(BIO_s_mem());
308310
PEM_write_bio_X509(mem, cert);
309
- BIO_write(mem, "", 1); // null-terminate mem buffer
311
+ BIO_write(mem, "", 1); /* nul-terminate mem buffer */
310312
BIO_get_mem_data(mem, &zCert);
311313
zHost = mprintf("cert:%s", g.urlName);
312314
db_set(zHost, zCert, 1);
313315
free(zHost);
314316
BIO_free(mem);
315317
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -104,10 +104,12 @@
104 SSL_library_init();
105 SSL_load_error_strings();
106 ERR_load_BIO_strings();
107 OpenSSL_add_all_algorithms();
108 sslCtx = SSL_CTX_new(SSLv23_client_method());
 
 
109
110 /* Set up acceptable CA root certificates */
111 zCaSetting = db_get("ssl-ca-location", 0);
112 if( zCaSetting==0 || zCaSetting[0]=='\0' ){
113 /* CA location not specified, use platform's default certificate store */
@@ -249,11 +251,11 @@
249 int j;
250 for( j = 0; j < mdLength; ++j ) {
251 BIO_printf(mem, " %02x", md[j]);
252 }
253 }
254 BIO_write(mem, "", 1); // null-terminate mem buffer
255 BIO_get_mem_data(mem, &desc);
256
257 if( hasSavedCertificate ){
258 warning = "WARNING: Certificate doesn't match the "
259 "saved certificate for this host!";
@@ -304,11 +306,11 @@
304 BIO *mem;
305 char *zCert, *zHost;
306
307 mem = BIO_new(BIO_s_mem());
308 PEM_write_bio_X509(mem, cert);
309 BIO_write(mem, "", 1); // null-terminate mem buffer
310 BIO_get_mem_data(mem, &zCert);
311 zHost = mprintf("cert:%s", g.urlName);
312 db_set(zHost, zCert, 1);
313 free(zHost);
314 BIO_free(mem);
315
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -104,10 +104,12 @@
104 SSL_library_init();
105 SSL_load_error_strings();
106 ERR_load_BIO_strings();
107 OpenSSL_add_all_algorithms();
108 sslCtx = SSL_CTX_new(SSLv23_client_method());
109 /* Disable SSLv2 */
110 SSL_CTX_set_options(sslCtx, SSL_OP_NO_SSLv2);
111
112 /* Set up acceptable CA root certificates */
113 zCaSetting = db_get("ssl-ca-location", 0);
114 if( zCaSetting==0 || zCaSetting[0]=='\0' ){
115 /* CA location not specified, use platform's default certificate store */
@@ -249,11 +251,11 @@
251 int j;
252 for( j = 0; j < mdLength; ++j ) {
253 BIO_printf(mem, " %02x", md[j]);
254 }
255 }
256 BIO_write(mem, "", 1); /* nul-terminate mem buffer */
257 BIO_get_mem_data(mem, &desc);
258
259 if( hasSavedCertificate ){
260 warning = "WARNING: Certificate doesn't match the "
261 "saved certificate for this host!";
@@ -304,11 +306,11 @@
306 BIO *mem;
307 char *zCert, *zHost;
308
309 mem = BIO_new(BIO_s_mem());
310 PEM_write_bio_X509(mem, cert);
311 BIO_write(mem, "", 1); /* nul-terminate mem buffer */
312 BIO_get_mem_data(mem, &zCert);
313 zHost = mprintf("cert:%s", g.urlName);
314 db_set(zHost, zCert, 1);
315 free(zHost);
316 BIO_free(mem);
317
+45 -11
--- src/login.c
+++ src/login.c
@@ -230,12 +230,14 @@
230230
}
231231
if( g.perm.Password && zPasswd && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0 ){
232232
/* The user requests a password change */
233233
zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
234234
if( db_int(1, "SELECT 0 FROM user"
235
- " WHERE uid=%d AND (pw=%Q OR pw=%Q)",
236
- g.userUid, zPasswd, zSha1Pw) ){
235
+ " WHERE uid=%d"
236
+ " AND (constant_time_cmp(pw,%Q)=0"
237
+ " OR constant_time_cmp(pw,%Q)=0)",
238
+ g.userUid, zSha1Pw, zPasswd) ){
237239
sleep(1);
238240
zErrMsg =
239241
@ <p><span class="loginError">
240242
@ You entered an incorrect old password while attempting to change
241243
@ your password. Your password is unchanged.
@@ -308,12 +310,12 @@
308310
uid = db_int(0,
309311
"SELECT uid FROM user"
310312
" WHERE login=%Q"
311313
" AND length(cap)>0 AND length(pw)>0"
312314
" AND login NOT IN ('anonymous','nobody','developer','reader')"
313
- " AND (pw=%Q OR pw=%Q)",
314
- zUsername, zPasswd, zSha1Pw
315
+ " AND (constant_time_cmp(pw,%Q)=0 OR constant_time_cmp(pw,%Q)=0)",
316
+ zUsername, zSha1Pw, zPasswd
315317
);
316318
if( uid<=0 ){
317319
sleep(1);
318320
zErrMsg =
319321
@ <p><span class="loginError">
@@ -451,10 +453,37 @@
451453
@ </table>
452454
@ </form>
453455
}
454456
style_footer();
455457
}
458
+
459
+/*
460
+** SQL function for constant time comparison of two values.
461
+** Sets result to 0 if two values are equal.
462
+*/
463
+static void constant_time_cmp_function(
464
+ sqlite3_context *context,
465
+ int argc,
466
+ sqlite3_value **argv
467
+){
468
+ const unsigned char *buf1, *buf2;
469
+ int len, i;
470
+ unsigned char rc = 0;
471
+
472
+ assert( argc==2 );
473
+ len = sqlite3_value_bytes(argv[0]);
474
+ if( len==0 || len!=sqlite3_value_bytes(argv[1]) ){
475
+ rc = 1;
476
+ }else{
477
+ buf1 = sqlite3_value_text(argv[0]);
478
+ buf2 = sqlite3_value_text(argv[1]);
479
+ for( i=0; i<len; i++ ){
480
+ rc = rc | (buf1[i] ^ buf2[i]);
481
+ }
482
+ }
483
+ sqlite3_result_int(context, rc);
484
+}
456485
457486
/*
458487
** Attempt to find login credentials for user zLogin on a peer repository
459488
** with project code zCode. Transfer those credentials to the local
460489
** repository.
@@ -481,20 +510,22 @@
481510
if( zOtherRepo==0 ) return 0; /* No such peer repository */
482511
483512
rc = sqlite3_open(zOtherRepo, &pOther);
484513
if( rc==SQLITE_OK ){
485514
sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
515
+ sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
516
+ constant_time_cmp_function, 0, 0);
486517
sqlite3_busy_timeout(pOther, 5000);
487518
zSQL = mprintf(
488519
"SELECT cexpire FROM user"
489
- " WHERE cookie=%Q"
520
+ " WHERE login=%Q"
490521
" AND ipaddr=%Q"
491
- " AND login=%Q"
492522
" AND length(cap)>0"
493523
" AND length(pw)>0"
494
- " AND cexpire>julianday('now')",
495
- zHash, zRemoteAddr, zLogin
524
+ " AND cexpire>julianday('now')"
525
+ " AND constant_time_cmp(cookie,%Q)=0",
526
+ zLogin, zRemoteAddr, zHash
496527
);
497528
pStmt = 0;
498529
rc = sqlite3_prepare_v2(pOther, zSQL, -1, &pStmt, 0);
499530
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
500531
db_multi_exec(
@@ -527,16 +558,16 @@
527558
if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
528559
if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
529560
uid = db_int(0,
530561
"SELECT uid FROM user"
531562
" WHERE login=%Q"
532
- " AND cookie=%Q"
533563
" AND ipaddr=%Q"
534564
" AND cexpire>julianday('now')"
535565
" AND length(cap)>0"
536
- " AND length(pw)>0",
537
- zLogin, zCookie, zRemoteAddr
566
+ " AND length(pw)>0"
567
+ " AND constant_time_cmp(cookie,%Q)=0",
568
+ zLogin, zRemoteAddr, zCookie
538569
);
539570
return uid;
540571
}
541572
542573
/*
@@ -554,10 +585,13 @@
554585
char *zRemoteAddr; /* Abbreviated IP address of the requestor */
555586
const char *zCap = 0; /* Capability string */
556587
557588
/* Only run this check once. */
558589
if( g.userUid!=0 ) return;
590
+
591
+ sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
592
+ constant_time_cmp_function, 0, 0);
559593
560594
/* If the HTTP connection is coming over 127.0.0.1 and if
561595
** local login is disabled and if we are using HTTP and not HTTPS,
562596
** then there is no need to check user credentials.
563597
**
564598
--- src/login.c
+++ src/login.c
@@ -230,12 +230,14 @@
230 }
231 if( g.perm.Password && zPasswd && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0 ){
232 /* The user requests a password change */
233 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
234 if( db_int(1, "SELECT 0 FROM user"
235 " WHERE uid=%d AND (pw=%Q OR pw=%Q)",
236 g.userUid, zPasswd, zSha1Pw) ){
 
 
237 sleep(1);
238 zErrMsg =
239 @ <p><span class="loginError">
240 @ You entered an incorrect old password while attempting to change
241 @ your password. Your password is unchanged.
@@ -308,12 +310,12 @@
308 uid = db_int(0,
309 "SELECT uid FROM user"
310 " WHERE login=%Q"
311 " AND length(cap)>0 AND length(pw)>0"
312 " AND login NOT IN ('anonymous','nobody','developer','reader')"
313 " AND (pw=%Q OR pw=%Q)",
314 zUsername, zPasswd, zSha1Pw
315 );
316 if( uid<=0 ){
317 sleep(1);
318 zErrMsg =
319 @ <p><span class="loginError">
@@ -451,10 +453,37 @@
451 @ </table>
452 @ </form>
453 }
454 style_footer();
455 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
457 /*
458 ** Attempt to find login credentials for user zLogin on a peer repository
459 ** with project code zCode. Transfer those credentials to the local
460 ** repository.
@@ -481,20 +510,22 @@
481 if( zOtherRepo==0 ) return 0; /* No such peer repository */
482
483 rc = sqlite3_open(zOtherRepo, &pOther);
484 if( rc==SQLITE_OK ){
485 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
 
 
486 sqlite3_busy_timeout(pOther, 5000);
487 zSQL = mprintf(
488 "SELECT cexpire FROM user"
489 " WHERE cookie=%Q"
490 " AND ipaddr=%Q"
491 " AND login=%Q"
492 " AND length(cap)>0"
493 " AND length(pw)>0"
494 " AND cexpire>julianday('now')",
495 zHash, zRemoteAddr, zLogin
 
496 );
497 pStmt = 0;
498 rc = sqlite3_prepare_v2(pOther, zSQL, -1, &pStmt, 0);
499 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
500 db_multi_exec(
@@ -527,16 +558,16 @@
527 if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
528 if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
529 uid = db_int(0,
530 "SELECT uid FROM user"
531 " WHERE login=%Q"
532 " AND cookie=%Q"
533 " AND ipaddr=%Q"
534 " AND cexpire>julianday('now')"
535 " AND length(cap)>0"
536 " AND length(pw)>0",
537 zLogin, zCookie, zRemoteAddr
 
538 );
539 return uid;
540 }
541
542 /*
@@ -554,10 +585,13 @@
554 char *zRemoteAddr; /* Abbreviated IP address of the requestor */
555 const char *zCap = 0; /* Capability string */
556
557 /* Only run this check once. */
558 if( g.userUid!=0 ) return;
 
 
 
559
560 /* If the HTTP connection is coming over 127.0.0.1 and if
561 ** local login is disabled and if we are using HTTP and not HTTPS,
562 ** then there is no need to check user credentials.
563 **
564
--- src/login.c
+++ src/login.c
@@ -230,12 +230,14 @@
230 }
231 if( g.perm.Password && zPasswd && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0 ){
232 /* The user requests a password change */
233 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
234 if( db_int(1, "SELECT 0 FROM user"
235 " WHERE uid=%d"
236 " AND (constant_time_cmp(pw,%Q)=0"
237 " OR constant_time_cmp(pw,%Q)=0)",
238 g.userUid, zSha1Pw, zPasswd) ){
239 sleep(1);
240 zErrMsg =
241 @ <p><span class="loginError">
242 @ You entered an incorrect old password while attempting to change
243 @ your password. Your password is unchanged.
@@ -308,12 +310,12 @@
310 uid = db_int(0,
311 "SELECT uid FROM user"
312 " WHERE login=%Q"
313 " AND length(cap)>0 AND length(pw)>0"
314 " AND login NOT IN ('anonymous','nobody','developer','reader')"
315 " AND (constant_time_cmp(pw,%Q)=0 OR constant_time_cmp(pw,%Q)=0)",
316 zUsername, zSha1Pw, zPasswd
317 );
318 if( uid<=0 ){
319 sleep(1);
320 zErrMsg =
321 @ <p><span class="loginError">
@@ -451,10 +453,37 @@
453 @ </table>
454 @ </form>
455 }
456 style_footer();
457 }
458
459 /*
460 ** SQL function for constant time comparison of two values.
461 ** Sets result to 0 if two values are equal.
462 */
463 static void constant_time_cmp_function(
464 sqlite3_context *context,
465 int argc,
466 sqlite3_value **argv
467 ){
468 const unsigned char *buf1, *buf2;
469 int len, i;
470 unsigned char rc = 0;
471
472 assert( argc==2 );
473 len = sqlite3_value_bytes(argv[0]);
474 if( len==0 || len!=sqlite3_value_bytes(argv[1]) ){
475 rc = 1;
476 }else{
477 buf1 = sqlite3_value_text(argv[0]);
478 buf2 = sqlite3_value_text(argv[1]);
479 for( i=0; i<len; i++ ){
480 rc = rc | (buf1[i] ^ buf2[i]);
481 }
482 }
483 sqlite3_result_int(context, rc);
484 }
485
486 /*
487 ** Attempt to find login credentials for user zLogin on a peer repository
488 ** with project code zCode. Transfer those credentials to the local
489 ** repository.
@@ -481,20 +510,22 @@
510 if( zOtherRepo==0 ) return 0; /* No such peer repository */
511
512 rc = sqlite3_open(zOtherRepo, &pOther);
513 if( rc==SQLITE_OK ){
514 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
515 sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
516 constant_time_cmp_function, 0, 0);
517 sqlite3_busy_timeout(pOther, 5000);
518 zSQL = mprintf(
519 "SELECT cexpire FROM user"
520 " WHERE login=%Q"
521 " AND ipaddr=%Q"
 
522 " AND length(cap)>0"
523 " AND length(pw)>0"
524 " AND cexpire>julianday('now')"
525 " AND constant_time_cmp(cookie,%Q)=0",
526 zLogin, zRemoteAddr, zHash
527 );
528 pStmt = 0;
529 rc = sqlite3_prepare_v2(pOther, zSQL, -1, &pStmt, 0);
530 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
531 db_multi_exec(
@@ -527,16 +558,16 @@
558 if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
559 if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
560 uid = db_int(0,
561 "SELECT uid FROM user"
562 " WHERE login=%Q"
 
563 " AND ipaddr=%Q"
564 " AND cexpire>julianday('now')"
565 " AND length(cap)>0"
566 " AND length(pw)>0"
567 " AND constant_time_cmp(cookie,%Q)=0",
568 zLogin, zRemoteAddr, zCookie
569 );
570 return uid;
571 }
572
573 /*
@@ -554,10 +585,13 @@
585 char *zRemoteAddr; /* Abbreviated IP address of the requestor */
586 const char *zCap = 0; /* Capability string */
587
588 /* Only run this check once. */
589 if( g.userUid!=0 ) return;
590
591 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
592 constant_time_cmp_function, 0, 0);
593
594 /* If the HTTP connection is coming over 127.0.0.1 and if
595 ** local login is disabled and if we are using HTTP and not HTTPS,
596 ** then there is no need to check user credentials.
597 **
598
+17 -1
--- src/main.c
+++ src/main.c
@@ -150,10 +150,11 @@
150150
151151
/* For defense against Cross-site Request Forgery attacks */
152152
char zCsrfToken[12]; /* Value of the anti-CSRF token */
153153
int okCsrf; /* Anti-CSRF token is present and valid */
154154
155
+ int parseCnt[10]; /* Counts of artifacts parsed */
155156
FILE *fDebug; /* Write debug information here, if the file exists */
156157
int thTrace; /* True to enable TH1 debugging output */
157158
Blob thLog; /* Text of the TH1 debugging output */
158159
159160
int isHome; /* True if rendering the "home" page */
@@ -216,11 +217,11 @@
216217
upr = mid - 1;
217218
}else{
218219
lwr = mid + 1;
219220
}
220221
}
221
- for(m=cnt=0, i=upr-2; i<=upr+3 && i<nMap; i++){
222
+ for(m=cnt=0, i=upr-2; cnt<2 && i<=upr+3 && i<nMap; i++){
222223
if( i<0 ) continue;
223224
if( strncmp(zName, aMap[i].zName, n)==0 ){
224225
m = i;
225226
cnt++;
226227
}
@@ -646,10 +647,25 @@
646647
aCmd[nCmd++] = aCommand[i].zName;
647648
}
648649
multi_column_list(aCmd, nCmd);
649650
}
650651
652
+
653
+/*
654
+** COMMAND: test-list-webpage
655
+**
656
+** List all web pages
657
+*/
658
+void cmd_test_webpage_list(void){
659
+ int i, nCmd;
660
+ const char *aCmd[count(aWebpage)];
661
+ for(i=nCmd=0; i<count(aWebpage); i++){
662
+ aCmd[nCmd++] = aWebpage[i].zName;
663
+ }
664
+ multi_column_list(aCmd, nCmd);
665
+}
666
+
651667
652668
/*
653669
** COMMAND: version
654670
**
655671
** Usage: %fossil version
656672
--- src/main.c
+++ src/main.c
@@ -150,10 +150,11 @@
150
151 /* For defense against Cross-site Request Forgery attacks */
152 char zCsrfToken[12]; /* Value of the anti-CSRF token */
153 int okCsrf; /* Anti-CSRF token is present and valid */
154
 
155 FILE *fDebug; /* Write debug information here, if the file exists */
156 int thTrace; /* True to enable TH1 debugging output */
157 Blob thLog; /* Text of the TH1 debugging output */
158
159 int isHome; /* True if rendering the "home" page */
@@ -216,11 +217,11 @@
216 upr = mid - 1;
217 }else{
218 lwr = mid + 1;
219 }
220 }
221 for(m=cnt=0, i=upr-2; i<=upr+3 && i<nMap; i++){
222 if( i<0 ) continue;
223 if( strncmp(zName, aMap[i].zName, n)==0 ){
224 m = i;
225 cnt++;
226 }
@@ -646,10 +647,25 @@
646 aCmd[nCmd++] = aCommand[i].zName;
647 }
648 multi_column_list(aCmd, nCmd);
649 }
650
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
652 /*
653 ** COMMAND: version
654 **
655 ** Usage: %fossil version
656
--- src/main.c
+++ src/main.c
@@ -150,10 +150,11 @@
150
151 /* For defense against Cross-site Request Forgery attacks */
152 char zCsrfToken[12]; /* Value of the anti-CSRF token */
153 int okCsrf; /* Anti-CSRF token is present and valid */
154
155 int parseCnt[10]; /* Counts of artifacts parsed */
156 FILE *fDebug; /* Write debug information here, if the file exists */
157 int thTrace; /* True to enable TH1 debugging output */
158 Blob thLog; /* Text of the TH1 debugging output */
159
160 int isHome; /* True if rendering the "home" page */
@@ -216,11 +217,11 @@
217 upr = mid - 1;
218 }else{
219 lwr = mid + 1;
220 }
221 }
222 for(m=cnt=0, i=upr-2; cnt<2 && i<=upr+3 && i<nMap; i++){
223 if( i<0 ) continue;
224 if( strncmp(zName, aMap[i].zName, n)==0 ){
225 m = i;
226 cnt++;
227 }
@@ -646,10 +647,25 @@
647 aCmd[nCmd++] = aCommand[i].zName;
648 }
649 multi_column_list(aCmd, nCmd);
650 }
651
652
653 /*
654 ** COMMAND: test-list-webpage
655 **
656 ** List all web pages
657 */
658 void cmd_test_webpage_list(void){
659 int i, nCmd;
660 const char *aCmd[count(aWebpage)];
661 for(i=nCmd=0; i<count(aWebpage); i++){
662 aCmd[nCmd++] = aWebpage[i].zName;
663 }
664 multi_column_list(aCmd, nCmd);
665 }
666
667
668 /*
669 ** COMMAND: version
670 **
671 ** Usage: %fossil version
672
--- src/manifest.c
+++ src/manifest.c
@@ -345,14 +345,24 @@
345345
char cType;
346346
char *z;
347347
int n;
348348
char *zUuid;
349349
int sz = 0;
350
+ int isRepeat;
351
+ static Bag seen;
352
+
353
+ if( bag_find(&seen, rid) ){
354
+ isRepeat = 1;
355
+ }else{
356
+ isRepeat = 0;
357
+ bag_insert(&seen, rid);
358
+ }
350359
351360
/* Every control artifact ends with a '\n' character. Exit early
352361
** if that is not the case for this artifact.
353362
*/
363
+ if( !isRepeat ) g.parseCnt[0]++;
354364
z = blob_materialize(pContent);
355365
n = blob_size(pContent);
356366
if( n<=0 || z[n-1]!='\n' ){
357367
blob_reset(pContent);
358368
return 0;
@@ -885,10 +895,11 @@
885895
if( p->zWikiTitle ) goto manifest_syntax_error;
886896
if( p->zTicketUuid ) goto manifest_syntax_error;
887897
p->type = CFTYPE_MANIFEST;
888898
}
889899
md5sum_init();
900
+ if( !isRepeat ) g.parseCnt[p->type]++;
890901
return p;
891902
892903
manifest_syntax_error:
893904
/*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/
894905
md5sum_init();
895906
--- src/manifest.c
+++ src/manifest.c
@@ -345,14 +345,24 @@
345 char cType;
346 char *z;
347 int n;
348 char *zUuid;
349 int sz = 0;
 
 
 
 
 
 
 
 
 
350
351 /* Every control artifact ends with a '\n' character. Exit early
352 ** if that is not the case for this artifact.
353 */
 
354 z = blob_materialize(pContent);
355 n = blob_size(pContent);
356 if( n<=0 || z[n-1]!='\n' ){
357 blob_reset(pContent);
358 return 0;
@@ -885,10 +895,11 @@
885 if( p->zWikiTitle ) goto manifest_syntax_error;
886 if( p->zTicketUuid ) goto manifest_syntax_error;
887 p->type = CFTYPE_MANIFEST;
888 }
889 md5sum_init();
 
890 return p;
891
892 manifest_syntax_error:
893 /*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/
894 md5sum_init();
895
--- src/manifest.c
+++ src/manifest.c
@@ -345,14 +345,24 @@
345 char cType;
346 char *z;
347 int n;
348 char *zUuid;
349 int sz = 0;
350 int isRepeat;
351 static Bag seen;
352
353 if( bag_find(&seen, rid) ){
354 isRepeat = 1;
355 }else{
356 isRepeat = 0;
357 bag_insert(&seen, rid);
358 }
359
360 /* Every control artifact ends with a '\n' character. Exit early
361 ** if that is not the case for this artifact.
362 */
363 if( !isRepeat ) g.parseCnt[0]++;
364 z = blob_materialize(pContent);
365 n = blob_size(pContent);
366 if( n<=0 || z[n-1]!='\n' ){
367 blob_reset(pContent);
368 return 0;
@@ -885,10 +895,11 @@
895 if( p->zWikiTitle ) goto manifest_syntax_error;
896 if( p->zTicketUuid ) goto manifest_syntax_error;
897 p->type = CFTYPE_MANIFEST;
898 }
899 md5sum_init();
900 if( !isRepeat ) g.parseCnt[p->type]++;
901 return p;
902
903 manifest_syntax_error:
904 /*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/
905 md5sum_init();
906
--- src/rebuild.c
+++ src/rebuild.c
@@ -500,10 +500,11 @@
500500
** --noverify Skip the verification of changes to the BLOB table
501501
** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
502502
** --randomize Scan artifacts in a random order
503503
** --vacuum Run VACUUM on the database after rebuilding
504504
** --wal Set Write-Ahead-Log journalling mode on the database
505
+** --stats Show artifact statistics after rebuilding
505506
**
506507
** See also: deconstruct, reconstruct
507508
*/
508509
void rebuild_database(void){
509510
int forceFlag;
@@ -514,18 +515,20 @@
514515
const char *zPagesize;
515516
int newPagesize = 0;
516517
int activateWal;
517518
int runVacuum;
518519
int runCompress;
520
+ int showStats;
519521
520522
omitVerify = find_option("noverify",0,0)!=0;
521523
forceFlag = find_option("force","f",0)!=0;
522524
randomizeFlag = find_option("randomize", 0, 0)!=0;
523525
doClustering = find_option("cluster", 0, 0)!=0;
524526
runVacuum = find_option("vacuum",0,0)!=0;
525527
runCompress = find_option("compress",0,0)!=0;
526528
zPagesize = find_option("pagesize",0,1);
529
+ showStats = find_option("stats",0,0)!=0;
527530
if( zPagesize ){
528531
newPagesize = atoi(zPagesize);
529532
if( newPagesize<512 || newPagesize>65536
530533
|| (newPagesize&(newPagesize-1))!=0
531534
){
@@ -579,10 +582,30 @@
579582
}
580583
if( activateWal ){
581584
db_multi_exec("PRAGMA journal_mode=WAL;");
582585
}
583586
}
587
+ if( showStats ){
588
+ static struct { int idx; const char *zLabel; } aStat[] = {
589
+ { CFTYPE_ANY, "Artifacts:" },
590
+ { CFTYPE_MANIFEST, "Manifests:" },
591
+ { CFTYPE_CLUSTER, "Clusters:" },
592
+ { CFTYPE_CONTROL, "Tags:" },
593
+ { CFTYPE_WIKI, "Wikis:" },
594
+ { CFTYPE_TICKET, "Tickets:" },
595
+ { CFTYPE_ATTACHMENT,"Attachments:" },
596
+ { CFTYPE_EVENT, "Events:" },
597
+ };
598
+ int i;
599
+ int subtotal = 0;
600
+ for(i=0; i<count(aStat); i++){
601
+ int k = aStat[i].idx;
602
+ fossil_print("%-15s %6d\n", aStat[i].zLabel, g.parseCnt[k]);
603
+ if( k>0 ) subtotal += g.parseCnt[k];
604
+ }
605
+ fossil_print("%-15s %6d\n", "Other:", g.parseCnt[CFTYPE_ANY] - subtotal);
606
+ }
584607
}
585608
586609
/*
587610
** COMMAND: test-detach ?REPOSITORY?
588611
**
589612
--- src/rebuild.c
+++ src/rebuild.c
@@ -500,10 +500,11 @@
500 ** --noverify Skip the verification of changes to the BLOB table
501 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
502 ** --randomize Scan artifacts in a random order
503 ** --vacuum Run VACUUM on the database after rebuilding
504 ** --wal Set Write-Ahead-Log journalling mode on the database
 
505 **
506 ** See also: deconstruct, reconstruct
507 */
508 void rebuild_database(void){
509 int forceFlag;
@@ -514,18 +515,20 @@
514 const char *zPagesize;
515 int newPagesize = 0;
516 int activateWal;
517 int runVacuum;
518 int runCompress;
 
519
520 omitVerify = find_option("noverify",0,0)!=0;
521 forceFlag = find_option("force","f",0)!=0;
522 randomizeFlag = find_option("randomize", 0, 0)!=0;
523 doClustering = find_option("cluster", 0, 0)!=0;
524 runVacuum = find_option("vacuum",0,0)!=0;
525 runCompress = find_option("compress",0,0)!=0;
526 zPagesize = find_option("pagesize",0,1);
 
527 if( zPagesize ){
528 newPagesize = atoi(zPagesize);
529 if( newPagesize<512 || newPagesize>65536
530 || (newPagesize&(newPagesize-1))!=0
531 ){
@@ -579,10 +582,30 @@
579 }
580 if( activateWal ){
581 db_multi_exec("PRAGMA journal_mode=WAL;");
582 }
583 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584 }
585
586 /*
587 ** COMMAND: test-detach ?REPOSITORY?
588 **
589
--- src/rebuild.c
+++ src/rebuild.c
@@ -500,10 +500,11 @@
500 ** --noverify Skip the verification of changes to the BLOB table
501 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
502 ** --randomize Scan artifacts in a random order
503 ** --vacuum Run VACUUM on the database after rebuilding
504 ** --wal Set Write-Ahead-Log journalling mode on the database
505 ** --stats Show artifact statistics after rebuilding
506 **
507 ** See also: deconstruct, reconstruct
508 */
509 void rebuild_database(void){
510 int forceFlag;
@@ -514,18 +515,20 @@
515 const char *zPagesize;
516 int newPagesize = 0;
517 int activateWal;
518 int runVacuum;
519 int runCompress;
520 int showStats;
521
522 omitVerify = find_option("noverify",0,0)!=0;
523 forceFlag = find_option("force","f",0)!=0;
524 randomizeFlag = find_option("randomize", 0, 0)!=0;
525 doClustering = find_option("cluster", 0, 0)!=0;
526 runVacuum = find_option("vacuum",0,0)!=0;
527 runCompress = find_option("compress",0,0)!=0;
528 zPagesize = find_option("pagesize",0,1);
529 showStats = find_option("stats",0,0)!=0;
530 if( zPagesize ){
531 newPagesize = atoi(zPagesize);
532 if( newPagesize<512 || newPagesize>65536
533 || (newPagesize&(newPagesize-1))!=0
534 ){
@@ -579,10 +582,30 @@
582 }
583 if( activateWal ){
584 db_multi_exec("PRAGMA journal_mode=WAL;");
585 }
586 }
587 if( showStats ){
588 static struct { int idx; const char *zLabel; } aStat[] = {
589 { CFTYPE_ANY, "Artifacts:" },
590 { CFTYPE_MANIFEST, "Manifests:" },
591 { CFTYPE_CLUSTER, "Clusters:" },
592 { CFTYPE_CONTROL, "Tags:" },
593 { CFTYPE_WIKI, "Wikis:" },
594 { CFTYPE_TICKET, "Tickets:" },
595 { CFTYPE_ATTACHMENT,"Attachments:" },
596 { CFTYPE_EVENT, "Events:" },
597 };
598 int i;
599 int subtotal = 0;
600 for(i=0; i<count(aStat); i++){
601 int k = aStat[i].idx;
602 fossil_print("%-15s %6d\n", aStat[i].zLabel, g.parseCnt[k]);
603 if( k>0 ) subtotal += g.parseCnt[k];
604 }
605 fossil_print("%-15s %6d\n", "Other:", g.parseCnt[CFTYPE_ANY] - subtotal);
606 }
607 }
608
609 /*
610 ** COMMAND: test-detach ?REPOSITORY?
611 **
612
+314 -818
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
2424
#endif
2525
#ifndef SQLITE_API
2626
# define SQLITE_API
2727
#endif
2828
/************** Begin file sqliteInt.h ***************************************/
29
-#line 1 "tsrc/sqliteInt.h"
3029
/*
3130
** 2001 September 15
3231
**
3332
** The author disclaims copyright to this source code. In place of
3433
** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
7978
#include "config.h"
8079
#endif
8180
8281
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
8382
/************** Begin file sqliteLimit.h *************************************/
84
-#line 1 "tsrc/sqliteLimit.h"
8583
/*
8684
** 2007 May 7
8785
**
8886
** The author disclaims copyright to this source code. In place of
8987
** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291289
# define SQLITE_MAX_TRIGGER_DEPTH 1000
292290
#endif
293291
294292
/************** End of sqliteLimit.h *****************************************/
295293
/************** Continuing where we left off in sqliteInt.h ******************/
296
-#line 54 "tsrc/sqliteInt.h"
297294
298295
/* Disable nuisance warnings on Borland compilers */
299296
#if defined(__BORLANDC__)
300297
#pragma warn -rch /* unreachable code */
301298
#pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548545
# define unlikely(X) !!(X)
549546
#endif
550547
551548
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552549
/************** Begin file sqlite3.h *****************************************/
553
-#line 1 "tsrc/sqlite3.h"
554550
/*
555551
** 2001 September 15
556552
**
557553
** The author disclaims copyright to this source code. In place of
558554
** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660656
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661657
** [sqlite_version()] and [sqlite_source_id()].
662658
*/
663659
#define SQLITE_VERSION "3.7.8"
664660
#define SQLITE_VERSION_NUMBER 3007008
665
-#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
661
+#define SQLITE_SOURCE_ID "2011-09-19 14:49:19 3e0da808d2f5b4d12046e05980ca04578f581177"
666662
667663
/*
668664
** CAPI3REF: Run-Time Library Version Numbers
669665
** KEYWORDS: sqlite3_version, sqlite3_sourceid
670666
**
@@ -7309,14 +7305,12 @@
73097305
#endif /* ifndef _SQLITE3RTREE_H_ */
73107306
73117307
73127308
/************** End of sqlite3.h *********************************************/
73137309
/************** Continuing where we left off in sqliteInt.h ******************/
7314
-#line 309 "tsrc/sqliteInt.h"
73157310
/************** Include hash.h in the middle of sqliteInt.h ******************/
73167311
/************** Begin file hash.h ********************************************/
7317
-#line 1 "tsrc/hash.h"
73187312
/*
73197313
** 2001 September 22
73207314
**
73217315
** The author disclaims copyright to this source code. In place of
73227316
** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
74127406
74137407
#endif /* _SQLITE_HASH_H_ */
74147408
74157409
/************** End of hash.h ************************************************/
74167410
/************** Continuing where we left off in sqliteInt.h ******************/
7417
-#line 310 "tsrc/sqliteInt.h"
74187411
/************** Include parse.h in the middle of sqliteInt.h *****************/
74197412
/************** Begin file parse.h *******************************************/
7420
-#line 1 "tsrc/parse.h"
74217413
#define TK_SEMI 1
74227414
#define TK_EXPLAIN 2
74237415
#define TK_QUERY 3
74247416
#define TK_PLAN 4
74257417
#define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
75767568
#define TK_UMINUS 156
75777569
#define TK_UPLUS 157
75787570
75797571
/************** End of parse.h ***********************************************/
75807572
/************** Continuing where we left off in sqliteInt.h ******************/
7581
-#line 311 "tsrc/sqliteInt.h"
75827573
#include <stdio.h>
75837574
#include <stdlib.h>
75847575
#include <string.h>
75857576
#include <assert.h>
75867577
#include <stddef.h>
@@ -7920,11 +7911,10 @@
79207911
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
79217912
** pointer types (i.e. FuncDef) defined above.
79227913
*/
79237914
/************** Include btree.h in the middle of sqliteInt.h *****************/
79247915
/************** Begin file btree.h *******************************************/
7925
-#line 1 "tsrc/btree.h"
79267916
/*
79277917
** 2001 September 15
79287918
**
79297919
** The author disclaims copyright to this source code. In place of
79307920
** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
81658155
81668156
#endif /* _BTREE_H_ */
81678157
81688158
/************** End of btree.h ***********************************************/
81698159
/************** Continuing where we left off in sqliteInt.h ******************/
8170
-#line 653 "tsrc/sqliteInt.h"
81718160
/************** Include vdbe.h in the middle of sqliteInt.h ******************/
81728161
/************** Begin file vdbe.h ********************************************/
8173
-#line 1 "tsrc/vdbe.h"
81748162
/*
81758163
** 2001 September 15
81768164
**
81778165
** The author disclaims copyright to this source code. In place of
81788166
** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
83338321
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
83348322
** header file that defines a number for each opcode used by the VDBE.
83358323
*/
83368324
/************** Include opcodes.h in the middle of vdbe.h ********************/
83378325
/************** Begin file opcodes.h *****************************************/
8338
-#line 1 "tsrc/opcodes.h"
83398326
/* Automatically generated. Do not edit */
83408327
/* See the mkopcodeh.awk script for details */
83418328
#define OP_Goto 1
83428329
#define OP_Gosub 2
83438330
#define OP_Return 3
@@ -8387,108 +8374,109 @@
83878374
#define OP_Jump 25
83888375
#define OP_And 69 /* same as TK_AND */
83898376
#define OP_Or 68 /* same as TK_OR */
83908377
#define OP_Not 19 /* same as TK_NOT */
83918378
#define OP_BitNot 93 /* same as TK_BITNOT */
8392
-#define OP_If 26
8393
-#define OP_IfNot 27
8379
+#define OP_Once 26
8380
+#define OP_If 27
8381
+#define OP_IfNot 28
83948382
#define OP_IsNull 73 /* same as TK_ISNULL */
83958383
#define OP_NotNull 74 /* same as TK_NOTNULL */
8396
-#define OP_Column 28
8397
-#define OP_Affinity 29
8398
-#define OP_MakeRecord 30
8399
-#define OP_Count 31
8400
-#define OP_Savepoint 32
8401
-#define OP_AutoCommit 33
8402
-#define OP_Transaction 34
8403
-#define OP_ReadCookie 35
8404
-#define OP_SetCookie 36
8405
-#define OP_VerifyCookie 37
8406
-#define OP_OpenRead 38
8407
-#define OP_OpenWrite 39
8408
-#define OP_OpenAutoindex 40
8409
-#define OP_OpenEphemeral 41
8410
-#define OP_SorterOpen 42
8411
-#define OP_OpenPseudo 43
8412
-#define OP_Close 44
8413
-#define OP_SeekLt 45
8414
-#define OP_SeekLe 46
8415
-#define OP_SeekGe 47
8416
-#define OP_SeekGt 48
8417
-#define OP_Seek 49
8418
-#define OP_NotFound 50
8419
-#define OP_Found 51
8420
-#define OP_IsUnique 52
8421
-#define OP_NotExists 53
8422
-#define OP_Sequence 54
8423
-#define OP_NewRowid 55
8424
-#define OP_Insert 56
8425
-#define OP_InsertInt 57
8426
-#define OP_Delete 58
8427
-#define OP_ResetCount 59
8428
-#define OP_SorterCompare 60
8429
-#define OP_SorterData 61
8430
-#define OP_RowKey 62
8431
-#define OP_RowData 63
8432
-#define OP_Rowid 64
8433
-#define OP_NullRow 65
8434
-#define OP_Last 66
8435
-#define OP_SorterSort 67
8436
-#define OP_Sort 70
8437
-#define OP_Rewind 71
8438
-#define OP_SorterNext 72
8439
-#define OP_Prev 81
8440
-#define OP_Next 92
8441
-#define OP_SorterInsert 95
8442
-#define OP_IdxInsert 96
8443
-#define OP_IdxDelete 97
8444
-#define OP_IdxRowid 98
8445
-#define OP_IdxLT 99
8446
-#define OP_IdxGE 100
8447
-#define OP_Destroy 101
8448
-#define OP_Clear 102
8449
-#define OP_CreateIndex 103
8450
-#define OP_CreateTable 104
8451
-#define OP_ParseSchema 105
8452
-#define OP_LoadAnalysis 106
8453
-#define OP_DropTable 107
8454
-#define OP_DropIndex 108
8455
-#define OP_DropTrigger 109
8456
-#define OP_IntegrityCk 110
8457
-#define OP_RowSetAdd 111
8458
-#define OP_RowSetRead 112
8459
-#define OP_RowSetTest 113
8460
-#define OP_Program 114
8461
-#define OP_Param 115
8462
-#define OP_FkCounter 116
8463
-#define OP_FkIfZero 117
8464
-#define OP_MemMax 118
8465
-#define OP_IfPos 119
8466
-#define OP_IfNeg 120
8467
-#define OP_IfZero 121
8468
-#define OP_AggStep 122
8469
-#define OP_AggFinal 123
8470
-#define OP_Checkpoint 124
8471
-#define OP_JournalMode 125
8472
-#define OP_Vacuum 126
8473
-#define OP_IncrVacuum 127
8474
-#define OP_Expire 128
8475
-#define OP_TableLock 129
8476
-#define OP_VBegin 131
8477
-#define OP_VCreate 132
8478
-#define OP_VDestroy 133
8479
-#define OP_VOpen 134
8480
-#define OP_VFilter 135
8481
-#define OP_VColumn 136
8482
-#define OP_VNext 137
8483
-#define OP_VRename 138
8484
-#define OP_VUpdate 139
8485
-#define OP_Pagecount 140
8486
-#define OP_MaxPgcnt 146
8487
-#define OP_Trace 147
8488
-#define OP_Noop 148
8489
-#define OP_Explain 149
8384
+#define OP_Column 29
8385
+#define OP_Affinity 30
8386
+#define OP_MakeRecord 31
8387
+#define OP_Count 32
8388
+#define OP_Savepoint 33
8389
+#define OP_AutoCommit 34
8390
+#define OP_Transaction 35
8391
+#define OP_ReadCookie 36
8392
+#define OP_SetCookie 37
8393
+#define OP_VerifyCookie 38
8394
+#define OP_OpenRead 39
8395
+#define OP_OpenWrite 40
8396
+#define OP_OpenAutoindex 41
8397
+#define OP_OpenEphemeral 42
8398
+#define OP_SorterOpen 43
8399
+#define OP_OpenPseudo 44
8400
+#define OP_Close 45
8401
+#define OP_SeekLt 46
8402
+#define OP_SeekLe 47
8403
+#define OP_SeekGe 48
8404
+#define OP_SeekGt 49
8405
+#define OP_Seek 50
8406
+#define OP_NotFound 51
8407
+#define OP_Found 52
8408
+#define OP_IsUnique 53
8409
+#define OP_NotExists 54
8410
+#define OP_Sequence 55
8411
+#define OP_NewRowid 56
8412
+#define OP_Insert 57
8413
+#define OP_InsertInt 58
8414
+#define OP_Delete 59
8415
+#define OP_ResetCount 60
8416
+#define OP_SorterCompare 61
8417
+#define OP_SorterData 62
8418
+#define OP_RowKey 63
8419
+#define OP_RowData 64
8420
+#define OP_Rowid 65
8421
+#define OP_NullRow 66
8422
+#define OP_Last 67
8423
+#define OP_SorterSort 70
8424
+#define OP_Sort 71
8425
+#define OP_Rewind 72
8426
+#define OP_SorterNext 81
8427
+#define OP_Prev 92
8428
+#define OP_Next 95
8429
+#define OP_SorterInsert 96
8430
+#define OP_IdxInsert 97
8431
+#define OP_IdxDelete 98
8432
+#define OP_IdxRowid 99
8433
+#define OP_IdxLT 100
8434
+#define OP_IdxGE 101
8435
+#define OP_Destroy 102
8436
+#define OP_Clear 103
8437
+#define OP_CreateIndex 104
8438
+#define OP_CreateTable 105
8439
+#define OP_ParseSchema 106
8440
+#define OP_LoadAnalysis 107
8441
+#define OP_DropTable 108
8442
+#define OP_DropIndex 109
8443
+#define OP_DropTrigger 110
8444
+#define OP_IntegrityCk 111
8445
+#define OP_RowSetAdd 112
8446
+#define OP_RowSetRead 113
8447
+#define OP_RowSetTest 114
8448
+#define OP_Program 115
8449
+#define OP_Param 116
8450
+#define OP_FkCounter 117
8451
+#define OP_FkIfZero 118
8452
+#define OP_MemMax 119
8453
+#define OP_IfPos 120
8454
+#define OP_IfNeg 121
8455
+#define OP_IfZero 122
8456
+#define OP_AggStep 123
8457
+#define OP_AggFinal 124
8458
+#define OP_Checkpoint 125
8459
+#define OP_JournalMode 126
8460
+#define OP_Vacuum 127
8461
+#define OP_IncrVacuum 128
8462
+#define OP_Expire 129
8463
+#define OP_TableLock 131
8464
+#define OP_VBegin 132
8465
+#define OP_VCreate 133
8466
+#define OP_VDestroy 134
8467
+#define OP_VOpen 135
8468
+#define OP_VFilter 136
8469
+#define OP_VColumn 137
8470
+#define OP_VNext 138
8471
+#define OP_VRename 139
8472
+#define OP_VUpdate 140
8473
+#define OP_Pagecount 146
8474
+#define OP_MaxPgcnt 147
8475
+#define OP_Trace 148
8476
+#define OP_Noop 149
8477
+#define OP_Explain 150
84908478
84918479
84928480
/* Properties such as "out2" or "jump" that are specified in
84938481
** comments following the "case" for each opcode in the vdbe.c
84948482
** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
85028490
#define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
85038491
#define OPFLG_INITIALIZER {\
85048492
/* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
85058493
/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
85068494
/* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8507
-/* 24 */ 0x00, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\
8508
-/* 32 */ 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00,\
8509
-/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,\
8510
-/* 48 */ 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02, 0x02,\
8511
-/* 56 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8512
-/* 64 */ 0x02, 0x00, 0x01, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8495
+/* 24 */ 0x00, 0x01, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00,\
8496
+/* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\
8497
+/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,\
8498
+/* 48 */ 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02,\
8499
+/* 56 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8500
+/* 64 */ 0x00, 0x02, 0x00, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
85138501
/* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
85148502
/* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8515
-/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x08,\
8516
-/* 96 */ 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00, 0x02,\
8517
-/* 104 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,\
8518
-/* 112 */ 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08, 0x05,\
8519
-/* 120 */ 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01,\
8520
-/* 128 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01,\
8521
-/* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
8522
-/* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
8503
+/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x01,\
8504
+/* 96 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8505
+/* 104 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8506
+/* 112 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
8507
+/* 120 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00,\
8508
+/* 128 */ 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
8509
+/* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8510
+/* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
85238511
85248512
/************** End of opcodes.h *********************************************/
85258513
/************** Continuing where we left off in vdbe.h ***********************/
8526
-#line 164 "tsrc/vdbe.h"
85278514
85288515
/*
85298516
** Prototypes for the VDBE interface. See comments on the implementation
85308517
** for a description of what each of these routines does.
85318518
*/
@@ -8541,11 +8528,11 @@
85418528
SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
85428529
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
85438530
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
85448531
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
85458532
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8546
-SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
8533
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
85478534
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
85488535
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
85498536
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
85508537
SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
85518538
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
85968583
85978584
#endif
85988585
85998586
/************** End of vdbe.h ************************************************/
86008587
/************** Continuing where we left off in sqliteInt.h ******************/
8601
-#line 654 "tsrc/sqliteInt.h"
86028588
/************** Include pager.h in the middle of sqliteInt.h *****************/
86038589
/************** Begin file pager.h *******************************************/
8604
-#line 1 "tsrc/pager.h"
86058590
/*
86068591
** 2001 September 15
86078592
**
86088593
** The author disclaims copyright to this source code. In place of
86098594
** a legal notice, here is a blessing:
@@ -8662,11 +8647,10 @@
86628647
** NOTE: These values must match the corresponding BTREE_ values in btree.h.
86638648
*/
86648649
#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
86658650
#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
86668651
#define PAGER_MEMORY 0x0004 /* In-memory database */
8667
-#define PAGER_SORTER 0x0020 /* Accumulator in external merge sort */
86688652
86698653
/*
86708654
** Valid values for the second argument to sqlite3PagerLockingMode().
86718655
*/
86728656
#define PAGER_LOCKINGMODE_QUERY -1
@@ -8785,14 +8769,12 @@
87858769
87868770
#endif /* _PAGER_H_ */
87878771
87888772
/************** End of pager.h ***********************************************/
87898773
/************** Continuing where we left off in sqliteInt.h ******************/
8790
-#line 655 "tsrc/sqliteInt.h"
87918774
/************** Include pcache.h in the middle of sqliteInt.h ****************/
87928775
/************** Begin file pcache.h ******************************************/
8793
-#line 1 "tsrc/pcache.h"
87948776
/*
87958777
** 2008 August 05
87968778
**
87978779
** The author disclaims copyright to this source code. In place of
87988780
** a legal notice, here is a blessing:
@@ -8947,15 +8929,13 @@
89478929
89488930
#endif /* _PCACHE_H_ */
89498931
89508932
/************** End of pcache.h **********************************************/
89518933
/************** Continuing where we left off in sqliteInt.h ******************/
8952
-#line 656 "tsrc/sqliteInt.h"
89538934
89548935
/************** Include os.h in the middle of sqliteInt.h ********************/
89558936
/************** Begin file os.h **********************************************/
8956
-#line 1 "tsrc/os.h"
89578937
/*
89588938
** 2001 September 16
89598939
**
89608940
** The author disclaims copyright to this source code. In place of
89618941
** a legal notice, here is a blessing:
@@ -9234,14 +9214,12 @@
92349214
92359215
#endif /* _SQLITE_OS_H_ */
92369216
92379217
/************** End of os.h **************************************************/
92389218
/************** Continuing where we left off in sqliteInt.h ******************/
9239
-#line 658 "tsrc/sqliteInt.h"
92409219
/************** Include mutex.h in the middle of sqliteInt.h *****************/
92419220
/************** Begin file mutex.h *******************************************/
9242
-#line 1 "tsrc/mutex.h"
92439221
/*
92449222
** 2007 August 28
92459223
**
92469224
** The author disclaims copyright to this source code. In place of
92479225
** a legal notice, here is a blessing:
@@ -9312,11 +9290,10 @@
93129290
#define sqlite3MutexEnd()
93139291
#endif /* defined(SQLITE_MUTEX_OMIT) */
93149292
93159293
/************** End of mutex.h ***********************************************/
93169294
/************** Continuing where we left off in sqliteInt.h ******************/
9317
-#line 659 "tsrc/sqliteInt.h"
93189295
93199296
93209297
/*
93219298
** Each database file to be accessed by the system is an instance
93229299
** of the following structure. There are normally two of these structures
@@ -10509,11 +10486,12 @@
1050910486
char *zDatabase; /* Name of database holding this table */
1051010487
char *zName; /* Name of the table */
1051110488
char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
1051210489
Table *pTab; /* An SQL table corresponding to zName */
1051310490
Select *pSelect; /* A SELECT statement used in place of a table name */
10514
- u8 isPopulated; /* Temporary table associated with SELECT is populated */
10491
+ int addrFillSub; /* Address of subroutine to manifest a subquery */
10492
+ int regReturn; /* Register holding return address of addrFillSub */
1051510493
u8 jointype; /* Type of join between this able and the previous */
1051610494
u8 notIndexed; /* True if there is a NOT INDEXED clause */
1051710495
u8 isCorrelated; /* True if sub-query is correlated */
1051810496
#ifndef SQLITE_OMIT_EXPLAIN
1051910497
u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11893,10 @@
1191511893
1191611894
#endif /* _SQLITEINT_H_ */
1191711895
1191811896
/************** End of sqliteInt.h *******************************************/
1191911897
/************** Begin file global.c ******************************************/
11920
-#line 1 "tsrc/global.c"
1192111898
/*
1192211899
** 2008 June 13
1192311900
**
1192411901
** The author disclaims copyright to this source code. In place of
1192511902
** a legal notice, here is a blessing:
@@ -12060,11 +12037,11 @@
1206012037
SQLITE_DEFAULT_MEMSTATUS, /* bMemstat */
1206112038
1, /* bCoreMutex */
1206212039
SQLITE_THREADSAFE==1, /* bFullMutex */
1206312040
SQLITE_USE_URI, /* bOpenUri */
1206412041
0x7ffffffe, /* mxStrlen */
12065
- 100, /* szLookaside */
12042
+ 128, /* szLookaside */
1206612043
500, /* nLookaside */
1206712044
{0,0,0,0,0,0,0,0}, /* m */
1206812045
{0,0,0,0,0,0,0,0,0}, /* mutex */
1206912046
{0,0,0,0,0,0,0,0,0,0,0}, /* pcache */
1207012047
(void*)0, /* pHeap */
@@ -12138,11 +12115,10 @@
1213812115
*/
1213912116
SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
1214012117
1214112118
/************** End of global.c **********************************************/
1214212119
/************** Begin file ctime.c *******************************************/
12143
-#line 1 "tsrc/ctime.c"
1214412120
/*
1214512121
** 2010 February 23
1214612122
**
1214712123
** The author disclaims copyright to this source code. In place of
1214812124
** a legal notice, here is a blessing:
@@ -12543,11 +12519,10 @@
1254312519
1254412520
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
1254512521
1254612522
/************** End of ctime.c ***********************************************/
1254712523
/************** Begin file status.c ******************************************/
12548
-#line 1 "tsrc/status.c"
1254912524
/*
1255012525
** 2008 June 18
1255112526
**
1255212527
** The author disclaims copyright to this source code. In place of
1255312528
** a legal notice, here is a blessing:
@@ -12561,11 +12536,10 @@
1256112536
** This module implements the sqlite3_status() interface and related
1256212537
** functionality.
1256312538
*/
1256412539
/************** Include vdbeInt.h in the middle of status.c ******************/
1256512540
/************** Begin file vdbeInt.h *****************************************/
12566
-#line 1 "tsrc/vdbeInt.h"
1256712541
/*
1256812542
** 2003 September 6
1256912543
**
1257012544
** The author disclaims copyright to this source code. In place of
1257112545
** a legal notice, here is a blessing:
@@ -13013,11 +12987,10 @@
1301312987
1301412988
#endif /* !defined(_VDBEINT_H_) */
1301512989
1301612990
/************** End of vdbeInt.h *********************************************/
1301712991
/************** Continuing where we left off in status.c *********************/
13018
-#line 18 "tsrc/status.c"
1301912992
1302012993
/*
1302112994
** Variables in which to record status information.
1302212995
*/
1302312996
typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13200,10 @@
1322713200
return rc;
1322813201
}
1322913202
1323013203
/************** End of status.c **********************************************/
1323113204
/************** Begin file date.c ********************************************/
13232
-#line 1 "tsrc/date.c"
1323313205
/*
1323413206
** 2003 October 31
1323513207
**
1323613208
** The author disclaims copyright to this source code. In place of
1323713209
** a legal notice, here is a blessing:
@@ -14355,11 +14327,10 @@
1435514327
}
1435614328
}
1435714329
1435814330
/************** End of date.c ************************************************/
1435914331
/************** Begin file os.c **********************************************/
14360
-#line 1 "tsrc/os.c"
1436114332
/*
1436214333
** 2005 November 29
1436314334
**
1436414335
** The author disclaims copyright to this source code. In place of
1436514336
** a legal notice, here is a blessing:
@@ -14565,11 +14536,11 @@
1456514536
int flags,
1456614537
int *pOutFlags
1456714538
){
1456814539
int rc = SQLITE_NOMEM;
1456914540
sqlite3_file *pFile;
14570
- pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile);
14541
+ pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
1457114542
if( pFile ){
1457214543
rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
1457314544
if( rc!=SQLITE_OK ){
1457414545
sqlite3_free(pFile);
1457514546
}else{
@@ -14689,11 +14660,10 @@
1468914660
return SQLITE_OK;
1469014661
}
1469114662
1469214663
/************** End of os.c **************************************************/
1469314664
/************** Begin file fault.c *******************************************/
14694
-#line 1 "tsrc/fault.c"
1469514665
/*
1469614666
** 2008 Jan 22
1469714667
**
1469814668
** The author disclaims copyright to this source code. In place of
1469914669
** a legal notice, here is a blessing:
@@ -14779,11 +14749,10 @@
1477914749
1478014750
#endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
1478114751
1478214752
/************** End of fault.c ***********************************************/
1478314753
/************** Begin file mem0.c ********************************************/
14784
-#line 1 "tsrc/mem0.c"
1478514754
/*
1478614755
** 2008 October 28
1478714756
**
1478814757
** The author disclaims copyright to this source code. In place of
1478914758
** a legal notice, here is a blessing:
@@ -14841,11 +14810,10 @@
1484114810
1484214811
#endif /* SQLITE_ZERO_MALLOC */
1484314812
1484414813
/************** End of mem0.c ************************************************/
1484514814
/************** Begin file mem1.c ********************************************/
14846
-#line 1 "tsrc/mem1.c"
1484714815
/*
1484814816
** 2007 August 14
1484914817
**
1485014818
** The author disclaims copyright to this source code. In place of
1485114819
** a legal notice, here is a blessing:
@@ -14994,11 +14962,10 @@
1499414962
1499514963
#endif /* SQLITE_SYSTEM_MALLOC */
1499614964
1499714965
/************** End of mem1.c ************************************************/
1499814966
/************** Begin file mem2.c ********************************************/
14999
-#line 1 "tsrc/mem2.c"
1500014967
/*
1500114968
** 2007 August 15
1500214969
**
1500314970
** The author disclaims copyright to this source code. In place of
1500414971
** a legal notice, here is a blessing:
@@ -15525,11 +15492,10 @@
1552515492
1552615493
#endif /* SQLITE_MEMDEBUG */
1552715494
1552815495
/************** End of mem2.c ************************************************/
1552915496
/************** Begin file mem3.c ********************************************/
15530
-#line 1 "tsrc/mem3.c"
1553115497
/*
1553215498
** 2007 October 14
1553315499
**
1553415500
** The author disclaims copyright to this source code. In place of
1553515501
** a legal notice, here is a blessing:
@@ -16215,11 +16181,10 @@
1621516181
1621616182
#endif /* SQLITE_ENABLE_MEMSYS3 */
1621716183
1621816184
/************** End of mem3.c ************************************************/
1621916185
/************** Begin file mem5.c ********************************************/
16220
-#line 1 "tsrc/mem5.c"
1622116186
/*
1622216187
** 2007 October 14
1622316188
**
1622416189
** The author disclaims copyright to this source code. In place of
1622516190
** a legal notice, here is a blessing:
@@ -16799,11 +16764,10 @@
1679916764
1680016765
#endif /* SQLITE_ENABLE_MEMSYS5 */
1680116766
1680216767
/************** End of mem5.c ************************************************/
1680316768
/************** Begin file mutex.c *******************************************/
16804
-#line 1 "tsrc/mutex.c"
1680516769
/*
1680616770
** 2007 August 14
1680716771
**
1680816772
** The author disclaims copyright to this source code. In place of
1680916773
** a legal notice, here is a blessing:
@@ -16955,11 +16919,10 @@
1695516919
1695616920
#endif /* SQLITE_MUTEX_OMIT */
1695716921
1695816922
/************** End of mutex.c ***********************************************/
1695916923
/************** Begin file mutex_noop.c **************************************/
16960
-#line 1 "tsrc/mutex_noop.c"
1696116924
/*
1696216925
** 2008 October 07
1696316926
**
1696416927
** The author disclaims copyright to this source code. In place of
1696516928
** a legal notice, here is a blessing:
@@ -17164,11 +17127,10 @@
1716417127
#endif /* SQLITE_MUTEX_NOOP */
1716517128
#endif /* SQLITE_MUTEX_OMIT */
1716617129
1716717130
/************** End of mutex_noop.c ******************************************/
1716817131
/************** Begin file mutex_os2.c ***************************************/
17169
-#line 1 "tsrc/mutex_os2.c"
1717017132
/*
1717117133
** 2007 August 28
1717217134
**
1717317135
** The author disclaims copyright to this source code. In place of
1717417136
** a legal notice, here is a blessing:
@@ -17441,11 +17403,10 @@
1744117403
}
1744217404
#endif /* SQLITE_MUTEX_OS2 */
1744317405
1744417406
/************** End of mutex_os2.c *******************************************/
1744517407
/************** Begin file mutex_unix.c **************************************/
17446
-#line 1 "tsrc/mutex_unix.c"
1744717408
/*
1744817409
** 2007 August 28
1744917410
**
1745017411
** The author disclaims copyright to this source code. In place of
1745117412
** a legal notice, here is a blessing:
@@ -17795,11 +17756,10 @@
1779517756
1779617757
#endif /* SQLITE_MUTEX_PTHREAD */
1779717758
1779817759
/************** End of mutex_unix.c ******************************************/
1779917760
/************** Begin file mutex_w32.c ***************************************/
17800
-#line 1 "tsrc/mutex_w32.c"
1780117761
/*
1780217762
** 2007 August 14
1780317763
**
1780417764
** The author disclaims copyright to this source code. In place of
1780517765
** a legal notice, here is a blessing:
@@ -18130,11 +18090,10 @@
1813018090
}
1813118091
#endif /* SQLITE_MUTEX_W32 */
1813218092
1813318093
/************** End of mutex_w32.c *******************************************/
1813418094
/************** Begin file malloc.c ******************************************/
18135
-#line 1 "tsrc/malloc.c"
1813618095
/*
1813718096
** 2001 September 15
1813818097
**
1813918098
** The author disclaims copyright to this source code. In place of
1814018099
** a legal notice, here is a blessing:
@@ -18910,11 +18869,10 @@
1891018869
return rc & (db ? db->errMask : 0xff);
1891118870
}
1891218871
1891318872
/************** End of malloc.c **********************************************/
1891418873
/************** Begin file printf.c ******************************************/
18915
-#line 1 "tsrc/printf.c"
1891618874
/*
1891718875
** The "printf" code that follows dates from the 1980's. It is in
1891818876
** the public domain. The original comments are included here for
1891918877
** completeness. They are very out-of-date but might be useful as
1892018878
** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19900,10 @@
1994219900
}
1994319901
#endif
1994419902
1994519903
/************** End of printf.c **********************************************/
1994619904
/************** Begin file random.c ******************************************/
19947
-#line 1 "tsrc/random.c"
1994819905
/*
1994919906
** 2001 September 15
1995019907
**
1995119908
** The author disclaims copyright to this source code. In place of
1995219909
** a legal notice, here is a blessing:
@@ -20090,11 +20047,10 @@
2009020047
}
2009120048
#endif /* SQLITE_OMIT_BUILTIN_TEST */
2009220049
2009320050
/************** End of random.c **********************************************/
2009420051
/************** Begin file utf.c *********************************************/
20095
-#line 1 "tsrc/utf.c"
2009620052
/*
2009720053
** 2004 April 13
2009820054
**
2009920055
** The author disclaims copyright to this source code. In place of
2010020056
** a legal notice, here is a blessing:
@@ -20652,11 +20608,10 @@
2065220608
#endif /* SQLITE_TEST */
2065320609
#endif /* SQLITE_OMIT_UTF16 */
2065420610
2065520611
/************** End of utf.c *************************************************/
2065620612
/************** Begin file util.c ********************************************/
20657
-#line 1 "tsrc/util.c"
2065820613
/*
2065920614
** 2001 September 15
2066020615
**
2066120616
** The author disclaims copyright to this source code. In place of
2066220617
** a legal notice, here is a blessing:
@@ -21835,11 +21790,10 @@
2183521790
}
2183621791
#endif
2183721792
2183821793
/************** End of util.c ************************************************/
2183921794
/************** Begin file hash.c ********************************************/
21840
-#line 1 "tsrc/hash.c"
2184121795
/*
2184221796
** 2001 September 22
2184321797
**
2184421798
** The author disclaims copyright to this source code. In place of
2184521799
** a legal notice, here is a blessing:
@@ -22115,11 +22069,10 @@
2211522069
return 0;
2211622070
}
2211722071
2211822072
/************** End of hash.c ************************************************/
2211922073
/************** Begin file opcodes.c *****************************************/
22120
-#line 1 "tsrc/opcodes.c"
2212122074
/* Automatically generated. Do not edit */
2212222075
/* See the mkopcodec.awk script for details. */
2212322076
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
2212422077
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
2212522078
static const char *const azName[] = { "?",
@@ -22146,66 +22099,66 @@
2214622099
/* 21 */ "MustBeInt",
2214722100
/* 22 */ "RealAffinity",
2214822101
/* 23 */ "Permutation",
2214922102
/* 24 */ "Compare",
2215022103
/* 25 */ "Jump",
22151
- /* 26 */ "If",
22152
- /* 27 */ "IfNot",
22153
- /* 28 */ "Column",
22154
- /* 29 */ "Affinity",
22155
- /* 30 */ "MakeRecord",
22156
- /* 31 */ "Count",
22157
- /* 32 */ "Savepoint",
22158
- /* 33 */ "AutoCommit",
22159
- /* 34 */ "Transaction",
22160
- /* 35 */ "ReadCookie",
22161
- /* 36 */ "SetCookie",
22162
- /* 37 */ "VerifyCookie",
22163
- /* 38 */ "OpenRead",
22164
- /* 39 */ "OpenWrite",
22165
- /* 40 */ "OpenAutoindex",
22166
- /* 41 */ "OpenEphemeral",
22167
- /* 42 */ "SorterOpen",
22168
- /* 43 */ "OpenPseudo",
22169
- /* 44 */ "Close",
22170
- /* 45 */ "SeekLt",
22171
- /* 46 */ "SeekLe",
22172
- /* 47 */ "SeekGe",
22173
- /* 48 */ "SeekGt",
22174
- /* 49 */ "Seek",
22175
- /* 50 */ "NotFound",
22176
- /* 51 */ "Found",
22177
- /* 52 */ "IsUnique",
22178
- /* 53 */ "NotExists",
22179
- /* 54 */ "Sequence",
22180
- /* 55 */ "NewRowid",
22181
- /* 56 */ "Insert",
22182
- /* 57 */ "InsertInt",
22183
- /* 58 */ "Delete",
22184
- /* 59 */ "ResetCount",
22185
- /* 60 */ "SorterCompare",
22186
- /* 61 */ "SorterData",
22187
- /* 62 */ "RowKey",
22188
- /* 63 */ "RowData",
22189
- /* 64 */ "Rowid",
22190
- /* 65 */ "NullRow",
22191
- /* 66 */ "Last",
22192
- /* 67 */ "SorterSort",
22104
+ /* 26 */ "Once",
22105
+ /* 27 */ "If",
22106
+ /* 28 */ "IfNot",
22107
+ /* 29 */ "Column",
22108
+ /* 30 */ "Affinity",
22109
+ /* 31 */ "MakeRecord",
22110
+ /* 32 */ "Count",
22111
+ /* 33 */ "Savepoint",
22112
+ /* 34 */ "AutoCommit",
22113
+ /* 35 */ "Transaction",
22114
+ /* 36 */ "ReadCookie",
22115
+ /* 37 */ "SetCookie",
22116
+ /* 38 */ "VerifyCookie",
22117
+ /* 39 */ "OpenRead",
22118
+ /* 40 */ "OpenWrite",
22119
+ /* 41 */ "OpenAutoindex",
22120
+ /* 42 */ "OpenEphemeral",
22121
+ /* 43 */ "SorterOpen",
22122
+ /* 44 */ "OpenPseudo",
22123
+ /* 45 */ "Close",
22124
+ /* 46 */ "SeekLt",
22125
+ /* 47 */ "SeekLe",
22126
+ /* 48 */ "SeekGe",
22127
+ /* 49 */ "SeekGt",
22128
+ /* 50 */ "Seek",
22129
+ /* 51 */ "NotFound",
22130
+ /* 52 */ "Found",
22131
+ /* 53 */ "IsUnique",
22132
+ /* 54 */ "NotExists",
22133
+ /* 55 */ "Sequence",
22134
+ /* 56 */ "NewRowid",
22135
+ /* 57 */ "Insert",
22136
+ /* 58 */ "InsertInt",
22137
+ /* 59 */ "Delete",
22138
+ /* 60 */ "ResetCount",
22139
+ /* 61 */ "SorterCompare",
22140
+ /* 62 */ "SorterData",
22141
+ /* 63 */ "RowKey",
22142
+ /* 64 */ "RowData",
22143
+ /* 65 */ "Rowid",
22144
+ /* 66 */ "NullRow",
22145
+ /* 67 */ "Last",
2219322146
/* 68 */ "Or",
2219422147
/* 69 */ "And",
22195
- /* 70 */ "Sort",
22196
- /* 71 */ "Rewind",
22197
- /* 72 */ "SorterNext",
22148
+ /* 70 */ "SorterSort",
22149
+ /* 71 */ "Sort",
22150
+ /* 72 */ "Rewind",
2219822151
/* 73 */ "IsNull",
2219922152
/* 74 */ "NotNull",
2220022153
/* 75 */ "Ne",
2220122154
/* 76 */ "Eq",
2220222155
/* 77 */ "Gt",
2220322156
/* 78 */ "Le",
2220422157
/* 79 */ "Lt",
2220522158
/* 80 */ "Ge",
22206
- /* 81 */ "Prev",
22159
+ /* 81 */ "SorterNext",
2220722160
/* 82 */ "BitAnd",
2220822161
/* 83 */ "BitOr",
2220922162
/* 84 */ "ShiftLeft",
2221022163
/* 85 */ "ShiftRight",
2221122164
/* 86 */ "Add",
@@ -22212,76 +22165,76 @@
2221222165
/* 87 */ "Subtract",
2221322166
/* 88 */ "Multiply",
2221422167
/* 89 */ "Divide",
2221522168
/* 90 */ "Remainder",
2221622169
/* 91 */ "Concat",
22217
- /* 92 */ "Next",
22170
+ /* 92 */ "Prev",
2221822171
/* 93 */ "BitNot",
2221922172
/* 94 */ "String8",
22220
- /* 95 */ "SorterInsert",
22221
- /* 96 */ "IdxInsert",
22222
- /* 97 */ "IdxDelete",
22223
- /* 98 */ "IdxRowid",
22224
- /* 99 */ "IdxLT",
22225
- /* 100 */ "IdxGE",
22226
- /* 101 */ "Destroy",
22227
- /* 102 */ "Clear",
22228
- /* 103 */ "CreateIndex",
22229
- /* 104 */ "CreateTable",
22230
- /* 105 */ "ParseSchema",
22231
- /* 106 */ "LoadAnalysis",
22232
- /* 107 */ "DropTable",
22233
- /* 108 */ "DropIndex",
22234
- /* 109 */ "DropTrigger",
22235
- /* 110 */ "IntegrityCk",
22236
- /* 111 */ "RowSetAdd",
22237
- /* 112 */ "RowSetRead",
22238
- /* 113 */ "RowSetTest",
22239
- /* 114 */ "Program",
22240
- /* 115 */ "Param",
22241
- /* 116 */ "FkCounter",
22242
- /* 117 */ "FkIfZero",
22243
- /* 118 */ "MemMax",
22244
- /* 119 */ "IfPos",
22245
- /* 120 */ "IfNeg",
22246
- /* 121 */ "IfZero",
22247
- /* 122 */ "AggStep",
22248
- /* 123 */ "AggFinal",
22249
- /* 124 */ "Checkpoint",
22250
- /* 125 */ "JournalMode",
22251
- /* 126 */ "Vacuum",
22252
- /* 127 */ "IncrVacuum",
22253
- /* 128 */ "Expire",
22254
- /* 129 */ "TableLock",
22173
+ /* 95 */ "Next",
22174
+ /* 96 */ "SorterInsert",
22175
+ /* 97 */ "IdxInsert",
22176
+ /* 98 */ "IdxDelete",
22177
+ /* 99 */ "IdxRowid",
22178
+ /* 100 */ "IdxLT",
22179
+ /* 101 */ "IdxGE",
22180
+ /* 102 */ "Destroy",
22181
+ /* 103 */ "Clear",
22182
+ /* 104 */ "CreateIndex",
22183
+ /* 105 */ "CreateTable",
22184
+ /* 106 */ "ParseSchema",
22185
+ /* 107 */ "LoadAnalysis",
22186
+ /* 108 */ "DropTable",
22187
+ /* 109 */ "DropIndex",
22188
+ /* 110 */ "DropTrigger",
22189
+ /* 111 */ "IntegrityCk",
22190
+ /* 112 */ "RowSetAdd",
22191
+ /* 113 */ "RowSetRead",
22192
+ /* 114 */ "RowSetTest",
22193
+ /* 115 */ "Program",
22194
+ /* 116 */ "Param",
22195
+ /* 117 */ "FkCounter",
22196
+ /* 118 */ "FkIfZero",
22197
+ /* 119 */ "MemMax",
22198
+ /* 120 */ "IfPos",
22199
+ /* 121 */ "IfNeg",
22200
+ /* 122 */ "IfZero",
22201
+ /* 123 */ "AggStep",
22202
+ /* 124 */ "AggFinal",
22203
+ /* 125 */ "Checkpoint",
22204
+ /* 126 */ "JournalMode",
22205
+ /* 127 */ "Vacuum",
22206
+ /* 128 */ "IncrVacuum",
22207
+ /* 129 */ "Expire",
2225522208
/* 130 */ "Real",
22256
- /* 131 */ "VBegin",
22257
- /* 132 */ "VCreate",
22258
- /* 133 */ "VDestroy",
22259
- /* 134 */ "VOpen",
22260
- /* 135 */ "VFilter",
22261
- /* 136 */ "VColumn",
22262
- /* 137 */ "VNext",
22263
- /* 138 */ "VRename",
22264
- /* 139 */ "VUpdate",
22265
- /* 140 */ "Pagecount",
22209
+ /* 131 */ "TableLock",
22210
+ /* 132 */ "VBegin",
22211
+ /* 133 */ "VCreate",
22212
+ /* 134 */ "VDestroy",
22213
+ /* 135 */ "VOpen",
22214
+ /* 136 */ "VFilter",
22215
+ /* 137 */ "VColumn",
22216
+ /* 138 */ "VNext",
22217
+ /* 139 */ "VRename",
22218
+ /* 140 */ "VUpdate",
2226622219
/* 141 */ "ToText",
2226722220
/* 142 */ "ToBlob",
2226822221
/* 143 */ "ToNumeric",
2226922222
/* 144 */ "ToInt",
2227022223
/* 145 */ "ToReal",
22271
- /* 146 */ "MaxPgcnt",
22272
- /* 147 */ "Trace",
22273
- /* 148 */ "Noop",
22274
- /* 149 */ "Explain",
22224
+ /* 146 */ "Pagecount",
22225
+ /* 147 */ "MaxPgcnt",
22226
+ /* 148 */ "Trace",
22227
+ /* 149 */ "Noop",
22228
+ /* 150 */ "Explain",
2227522229
};
2227622230
return azName[i];
2227722231
}
2227822232
#endif
2227922233
2228022234
/************** End of opcodes.c *********************************************/
2228122235
/************** Begin file os_os2.c ******************************************/
22282
-#line 1 "tsrc/os_os2.c"
2228322236
/*
2228422237
** 2006 Feb 14
2228522238
**
2228622239
** The author disclaims copyright to this source code. In place of
2228722240
** a legal notice, here is a blessing:
@@ -22334,11 +22287,10 @@
2233422287
/*
2233522288
** Include code that is common to all os_*.c files
2233622289
*/
2233722290
/************** Include os_common.h in the middle of os_os2.c ****************/
2233822291
/************** Begin file os_common.h ***************************************/
22339
-#line 1 "tsrc/os_common.h"
2234022292
/*
2234122293
** 2004 May 22
2234222294
**
2234322295
** The author disclaims copyright to this source code. In place of
2234422296
** a legal notice, here is a blessing:
@@ -22388,11 +22340,10 @@
2238822340
** hwtime.h contains inline assembler code for implementing
2238922341
** high-performance timing routines.
2239022342
*/
2239122343
/************** Include hwtime.h in the middle of os_common.h ****************/
2239222344
/************** Begin file hwtime.h ******************************************/
22393
-#line 1 "tsrc/hwtime.h"
2239422345
/*
2239522346
** 2008 May 27
2239622347
**
2239722348
** The author disclaims copyright to this source code. In place of
2239822349
** a legal notice, here is a blessing:
@@ -22477,11 +22428,10 @@
2247722428
2247822429
#endif /* !defined(_HWTIME_H_) */
2247922430
2248022431
/************** End of hwtime.h **********************************************/
2248122432
/************** Continuing where we left off in os_common.h ******************/
22482
-#line 53 "tsrc/os_common.h"
2248322433
2248422434
static sqlite_uint64 g_start;
2248522435
static sqlite_uint64 g_elapsed;
2248622436
#define TIMER_START g_start=sqlite3Hwtime()
2248722437
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22494,10 @@
2254422494
2254522495
#endif /* !defined(_OS_COMMON_H_) */
2254622496
2254722497
/************** End of os_common.h *******************************************/
2254822498
/************** Continuing where we left off in os_os2.c *********************/
22549
-#line 57 "tsrc/os_os2.c"
2255022499
2255122500
/* Forward references */
2255222501
typedef struct os2File os2File; /* The file structure */
2255322502
typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
2255422503
typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24365,10 @@
2441624365
2441724366
#endif /* SQLITE_OS_OS2 */
2441824367
2441924368
/************** End of os_os2.c **********************************************/
2442024369
/************** Begin file os_unix.c *****************************************/
24421
-#line 1 "tsrc/os_unix.c"
2442224370
/*
2442324371
** 2004 May 22
2442424372
**
2442524373
** The author disclaims copyright to this source code. In place of
2442624374
** a legal notice, here is a blessing:
@@ -24681,11 +24629,10 @@
2468124629
/*
2468224630
** Include code that is common to all os_*.c files
2468324631
*/
2468424632
/************** Include os_common.h in the middle of os_unix.c ***************/
2468524633
/************** Begin file os_common.h ***************************************/
24686
-#line 1 "tsrc/os_common.h"
2468724634
/*
2468824635
** 2004 May 22
2468924636
**
2469024637
** The author disclaims copyright to this source code. In place of
2469124638
** a legal notice, here is a blessing:
@@ -24735,11 +24682,10 @@
2473524682
** hwtime.h contains inline assembler code for implementing
2473624683
** high-performance timing routines.
2473724684
*/
2473824685
/************** Include hwtime.h in the middle of os_common.h ****************/
2473924686
/************** Begin file hwtime.h ******************************************/
24740
-#line 1 "tsrc/hwtime.h"
2474124687
/*
2474224688
** 2008 May 27
2474324689
**
2474424690
** The author disclaims copyright to this source code. In place of
2474524691
** a legal notice, here is a blessing:
@@ -24824,11 +24770,10 @@
2482424770
2482524771
#endif /* !defined(_HWTIME_H_) */
2482624772
2482724773
/************** End of hwtime.h **********************************************/
2482824774
/************** Continuing where we left off in os_common.h ******************/
24829
-#line 53 "tsrc/os_common.h"
2483024775
2483124776
static sqlite_uint64 g_start;
2483224777
static sqlite_uint64 g_elapsed;
2483324778
#define TIMER_START g_start=sqlite3Hwtime()
2483424779
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24836,10 @@
2489124836
2489224837
#endif /* !defined(_OS_COMMON_H_) */
2489324838
2489424839
/************** End of os_common.h *******************************************/
2489524840
/************** Continuing where we left off in os_unix.c ********************/
24896
-#line 265 "tsrc/os_unix.c"
2489724841
2489824842
/*
2489924843
** Define various macros that are missing from some systems.
2490024844
*/
2490124845
#ifndef O_LARGEFILE
@@ -31401,11 +31345,10 @@
3140131345
3140231346
#endif /* SQLITE_OS_UNIX */
3140331347
3140431348
/************** End of os_unix.c *********************************************/
3140531349
/************** Begin file os_win.c ******************************************/
31406
-#line 1 "tsrc/os_win.c"
3140731350
/*
3140831351
** 2004 May 22
3140931352
**
3141031353
** The author disclaims copyright to this source code. In place of
3141131354
** a legal notice, here is a blessing:
@@ -31463,11 +31406,10 @@
3146331406
/*
3146431407
** Include code that is common to all os_*.c files
3146531408
*/
3146631409
/************** Include os_common.h in the middle of os_win.c ****************/
3146731410
/************** Begin file os_common.h ***************************************/
31468
-#line 1 "tsrc/os_common.h"
3146931411
/*
3147031412
** 2004 May 22
3147131413
**
3147231414
** The author disclaims copyright to this source code. In place of
3147331415
** a legal notice, here is a blessing:
@@ -31517,11 +31459,10 @@
3151731459
** hwtime.h contains inline assembler code for implementing
3151831460
** high-performance timing routines.
3151931461
*/
3152031462
/************** Include hwtime.h in the middle of os_common.h ****************/
3152131463
/************** Begin file hwtime.h ******************************************/
31522
-#line 1 "tsrc/hwtime.h"
3152331464
/*
3152431465
** 2008 May 27
3152531466
**
3152631467
** The author disclaims copyright to this source code. In place of
3152731468
** a legal notice, here is a blessing:
@@ -31606,11 +31547,10 @@
3160631547
3160731548
#endif /* !defined(_HWTIME_H_) */
3160831549
3160931550
/************** End of hwtime.h **********************************************/
3161031551
/************** Continuing where we left off in os_common.h ******************/
31611
-#line 53 "tsrc/os_common.h"
3161231552
3161331553
static sqlite_uint64 g_start;
3161431554
static sqlite_uint64 g_elapsed;
3161531555
#define TIMER_START g_start=sqlite3Hwtime()
3161631556
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31613,10 @@
3167331613
3167431614
#endif /* !defined(_OS_COMMON_H_) */
3167531615
3167631616
/************** End of os_common.h *******************************************/
3167731617
/************** Continuing where we left off in os_win.c *********************/
31678
-#line 62 "tsrc/os_win.c"
3167931618
3168031619
/*
3168131620
** Some microsoft compilers lack this definition.
3168231621
*/
3168331622
#ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32799,23 @@
3286032799
3286132800
/*
3286232801
** Make sure all writes to a particular file are committed to disk.
3286332802
*/
3286432803
static int winSync(sqlite3_file *id, int flags){
32865
-#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG)
32866
- winFile *pFile = (winFile*)id;
32804
+#ifndef SQLITE_NO_SYNC
32805
+ /*
32806
+ ** Used only when SQLITE_NO_SYNC is not defined.
32807
+ */
3286732808
BOOL rc;
32809
+#endif
32810
+#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \
32811
+ (defined(SQLITE_TEST) && defined(SQLITE_DEBUG))
32812
+ /*
32813
+ ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or
32814
+ ** OSTRACE() macros.
32815
+ */
32816
+ winFile *pFile = (winFile*)id;
3286832817
#else
3286932818
UNUSED_PARAMETER(id);
3287032819
#endif
3287132820
3287232821
assert( pFile );
@@ -34809,11 +34758,10 @@
3480934758
3481034759
#endif /* SQLITE_OS_WIN */
3481134760
3481234761
/************** End of os_win.c **********************************************/
3481334762
/************** Begin file bitvec.c ******************************************/
34814
-#line 1 "tsrc/bitvec.c"
3481534763
/*
3481634764
** 2008 February 16
3481734765
**
3481834766
** The author disclaims copyright to this source code. In place of
3481934767
** a legal notice, here is a blessing:
@@ -35220,11 +35168,10 @@
3522035168
}
3522135169
#endif /* SQLITE_OMIT_BUILTIN_TEST */
3522235170
3522335171
/************** End of bitvec.c **********************************************/
3522435172
/************** Begin file pcache.c ******************************************/
35225
-#line 1 "tsrc/pcache.c"
3522635173
/*
3522735174
** 2008 August 05
3522835175
**
3522935176
** The author disclaims copyright to this source code. In place of
3523035177
** a legal notice, here is a blessing:
@@ -35817,11 +35764,10 @@
3581735764
}
3581835765
#endif
3581935766
3582035767
/************** End of pcache.c **********************************************/
3582135768
/************** Begin file pcache1.c *****************************************/
35822
-#line 1 "tsrc/pcache1.c"
3582335769
/*
3582435770
** 2008 November 05
3582535771
**
3582635772
** The author disclaims copyright to this source code. In place of
3582735773
** a legal notice, here is a blessing:
@@ -37034,11 +36980,10 @@
3703436980
}
3703536981
#endif
3703636982
3703736983
/************** End of pcache1.c *********************************************/
3703836984
/************** Begin file rowset.c ******************************************/
37039
-#line 1 "tsrc/rowset.c"
3704036985
/*
3704136986
** 2008 December 3
3704236987
**
3704336988
** The author disclaims copyright to this source code. In place of
3704436989
** a legal notice, here is a blessing:
@@ -37459,11 +37404,10 @@
3745937404
return 0;
3746037405
}
3746137406
3746237407
/************** End of rowset.c **********************************************/
3746337408
/************** Begin file pager.c *******************************************/
37464
-#line 1 "tsrc/pager.c"
3746537409
/*
3746637410
** 2001 September 15
3746737411
**
3746837412
** The author disclaims copyright to this source code. In place of
3746937413
** a legal notice, here is a blessing:
@@ -37483,11 +37427,10 @@
3748337427
** another is writing.
3748437428
*/
3748537429
#ifndef SQLITE_OMIT_DISKIO
3748637430
/************** Include wal.h in the middle of pager.c ***********************/
3748737431
/************** Begin file wal.h *********************************************/
37488
-#line 1 "tsrc/wal.h"
3748937432
/*
3749037433
** 2010 February 1
3749137434
**
3749237435
** The author disclaims copyright to this source code. In place of
3749337436
** a legal notice, here is a blessing:
@@ -37608,11 +37551,10 @@
3760837551
#endif /* ifndef SQLITE_OMIT_WAL */
3760937552
#endif /* _WAL_H_ */
3761037553
3761137554
/************** End of wal.h *************************************************/
3761237555
/************** Continuing where we left off in pager.c **********************/
37613
-#line 24 "tsrc/pager.c"
3761437556
3761537557
3761637558
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
3761737559
**
3761837560
** This comment block describes invariants that hold when using a rollback
@@ -38208,11 +38150,10 @@
3820838150
u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */
3820938151
u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */
3821038152
u8 tempFile; /* zFilename is a temporary file */
3821138153
u8 readOnly; /* True for a read-only database */
3821238154
u8 memDb; /* True to inhibit all file I/O */
38213
- u8 hasSeenStress; /* pagerStress() called one or more times */
3821438155
3821538156
/**************************************************************************
3821638157
** The following block contains those class members that change during
3821738158
** routine opertion. Class members not in this block are either fixed
3821838159
** when the pager is first created or else only change when there is a
@@ -41763,11 +41704,10 @@
4176341704
** is impossible for sqlite3PCacheFetch() to be called with createFlag==1
4176441705
** while in the error state, hence it is impossible for this routine to
4176541706
** be called in the error state. Nevertheless, we include a NEVER()
4176641707
** test for the error state as a safeguard against future changes.
4176741708
*/
41768
- pPager->hasSeenStress = 1;
4176941709
if( NEVER(pPager->errCode) ) return SQLITE_OK;
4177041710
if( pPager->doNotSpill ) return SQLITE_OK;
4177141711
if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
4177241712
return SQLITE_OK;
4177341713
}
@@ -44422,11 +44362,10 @@
4442244362
4442344363
#endif /* SQLITE_OMIT_DISKIO */
4442444364
4442544365
/************** End of pager.c ***********************************************/
4442644366
/************** Begin file wal.c *********************************************/
44427
-#line 1 "tsrc/wal.c"
4442844367
/*
4442944368
** 2010 February 1
4443044369
**
4443144370
** The author disclaims copyright to this source code. In place of
4443244371
** a legal notice, here is a blessing:
@@ -47377,11 +47316,10 @@
4737747316
4737847317
#endif /* #ifndef SQLITE_OMIT_WAL */
4737947318
4738047319
/************** End of wal.c *************************************************/
4738147320
/************** Begin file btmutex.c *****************************************/
47382
-#line 1 "tsrc/btmutex.c"
4738347321
/*
4738447322
** 2007 August 27
4738547323
**
4738647324
** The author disclaims copyright to this source code. In place of
4738747325
** a legal notice, here is a blessing:
@@ -47397,11 +47335,10 @@
4739747335
** big and we want to break it down some. This packaged seemed like
4739847336
** a good breakout.
4739947337
*/
4740047338
/************** Include btreeInt.h in the middle of btmutex.c ****************/
4740147339
/************** Begin file btreeInt.h ****************************************/
47402
-#line 1 "tsrc/btreeInt.h"
4740347340
/*
4740447341
** 2004 April 6
4740547342
**
4740647343
** The author disclaims copyright to this source code. In place of
4740747344
** a legal notice, here is a blessing:
@@ -48043,11 +47980,10 @@
4804347980
#define get4byte sqlite3Get4byte
4804447981
#define put4byte sqlite3Put4byte
4804547982
4804647983
/************** End of btreeInt.h ********************************************/
4804747984
/************** Continuing where we left off in btmutex.c ********************/
48048
-#line 19 "tsrc/btmutex.c"
4804947985
#ifndef SQLITE_OMIT_SHARED_CACHE
4805047986
#if SQLITE_THREADSAFE
4805147987
4805247988
/*
4805347989
** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48252,10 @@
4831648252
#endif /* if SQLITE_THREADSAFE */
4831748253
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
4831848254
4831948255
/************** End of btmutex.c *********************************************/
4832048256
/************** Begin file btree.c *******************************************/
48321
-#line 1 "tsrc/btree.c"
4832248257
/*
4832348258
** 2004 April 6
4832448259
**
4832548260
** The author disclaims copyright to this source code. In place of
4832648261
** a legal notice, here is a blessing:
@@ -48982,11 +48917,11 @@
4898248917
assert( nKey==(i64)(int)nKey );
4898348918
pIdxKey = sqlite3VdbeAllocUnpackedRecord(
4898448919
pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
4898548920
);
4898648921
if( pIdxKey==0 ) return SQLITE_NOMEM;
48987
- sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey);
48922
+ sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
4898848923
}else{
4898948924
pIdxKey = 0;
4899048925
}
4899148926
rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
4899248927
if( pFree ){
@@ -56504,11 +56439,10 @@
5650456439
return rc;
5650556440
}
5650656441
5650756442
/************** End of btree.c ***********************************************/
5650856443
/************** Begin file backup.c ******************************************/
56509
-#line 1 "tsrc/backup.c"
5651056444
/*
5651156445
** 2009 January 28
5651256446
**
5651356447
** The author disclaims copyright to this source code. In place of
5651456448
** a legal notice, here is a blessing:
@@ -57211,11 +57145,10 @@
5721157145
}
5721257146
#endif /* SQLITE_OMIT_VACUUM */
5721357147
5721457148
/************** End of backup.c **********************************************/
5721557149
/************** Begin file vdbemem.c *****************************************/
57216
-#line 1 "tsrc/vdbemem.c"
5721757150
/*
5721857151
** 2004 May 26
5721957152
**
5722057153
** The author disclaims copyright to this source code. In place of
5722157154
** a legal notice, here is a blessing:
@@ -58366,11 +58299,10 @@
5836658299
return 0;
5836758300
}
5836858301
5836958302
/************** End of vdbemem.c *********************************************/
5837058303
/************** Begin file vdbeaux.c *****************************************/
58371
-#line 1 "tsrc/vdbeaux.c"
5837258304
/*
5837358305
** 2003 September 6
5837458306
**
5837558307
** The author disclaims copyright to this source code. In place of
5837658308
** a legal notice, here is a blessing:
@@ -59037,22 +58969,19 @@
5903758969
p->pNext = pVdbe->pProgram;
5903858970
pVdbe->pProgram = p;
5903958971
}
5904058972
5904158973
/*
59042
-** Change N opcodes starting at addr to No-ops.
58974
+** Change the opcode at addr into OP_Noop
5904358975
*/
59044
-SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
58976
+SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
5904558977
if( p->aOp ){
5904658978
VdbeOp *pOp = &p->aOp[addr];
5904758979
sqlite3 *db = p->db;
59048
- while( N-- ){
59049
- freeP4(db, pOp->p4type, pOp->p4.p);
59050
- memset(pOp, 0, sizeof(pOp[0]));
59051
- pOp->opcode = OP_Noop;
59052
- pOp++;
59053
- }
58980
+ freeP4(db, pOp->p4type, pOp->p4.p);
58981
+ memset(pOp, 0, sizeof(pOp[0]));
58982
+ pOp->opcode = OP_Noop;
5905458983
}
5905558984
}
5905658985
5905758986
/*
5905858987
** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59133,11 @@
5920459133
** check the value of p->nOp-1 before continuing.
5920559134
*/
5920659135
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
5920759136
/* C89 specifies that the constant "dummy" will be initialized to all
5920859137
** zeros, which is correct. MSVC generates a warning, nevertheless. */
59209
- static const VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59138
+ static VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
5921059139
assert( p->magic==VDBE_MAGIC_INIT );
5921159140
if( addr<0 ){
5921259141
#ifdef SQLITE_OMIT_TRACE
5921359142
if( p->nOp==0 ) return (VdbeOp*)&dummy;
5921459143
#endif
@@ -61609,11 +61538,10 @@
6160961538
}
6161061539
}
6161161540
6161261541
/************** End of vdbeaux.c *********************************************/
6161361542
/************** Begin file vdbeapi.c *****************************************/
61614
-#line 1 "tsrc/vdbeapi.c"
6161561543
/*
6161661544
** 2004 May 26
6161761545
**
6161861546
** The author disclaims copyright to this source code. In place of
6161961547
** a legal notice, here is a blessing:
@@ -62917,11 +62845,10 @@
6291762845
return v;
6291862846
}
6291962847
6292062848
/************** End of vdbeapi.c *********************************************/
6292162849
/************** Begin file vdbetrace.c ***************************************/
62922
-#line 1 "tsrc/vdbetrace.c"
6292362850
/*
6292462851
** 2009 November 25
6292562852
**
6292662853
** The author disclaims copyright to this source code. In place of
6292762854
** a legal notice, here is a blessing:
@@ -63073,11 +63000,10 @@
6307363000
6307463001
#endif /* #ifndef SQLITE_OMIT_TRACE */
6307563002
6307663003
/************** End of vdbetrace.c *******************************************/
6307763004
/************** Begin file vdbe.c ********************************************/
63078
-#line 1 "tsrc/vdbe.c"
6307963005
/*
6308063006
** 2001 September 15
6308163007
**
6308263008
** The author disclaims copyright to this source code. In place of
6308363009
** a legal notice, here is a blessing:
@@ -63543,11 +63469,10 @@
6354363469
** hwtime.h contains inline assembler code for implementing
6354463470
** high-performance timing routines.
6354563471
*/
6354663472
/************** Include hwtime.h in the middle of vdbe.c *********************/
6354763473
/************** Begin file hwtime.h ******************************************/
63548
-#line 1 "tsrc/hwtime.h"
6354963474
/*
6355063475
** 2008 May 27
6355163476
**
6355263477
** The author disclaims copyright to this source code. In place of
6355363478
** a legal notice, here is a blessing:
@@ -63632,11 +63557,10 @@
6363263557
6363363558
#endif /* !defined(_HWTIME_H_) */
6363463559
6363563560
/************** End of hwtime.h **********************************************/
6363663561
/************** Continuing where we left off in vdbe.c ***********************/
63637
-#line 471 "tsrc/vdbe.c"
6363863562
6363963563
#endif
6364063564
6364163565
/*
6364263566
** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65551,20 @@
6562765551
sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
6562865552
}
6562965553
break;
6563065554
}
6563165555
65556
+/* Opcode: Once P1 P2 * * *
65557
+**
65558
+** Jump to P2 if the value in register P1 is a not null or zero. If
65559
+** the value is NULL or zero, fall through and change the P1 register
65560
+** to an integer 1.
65561
+**
65562
+** When P1 is not used otherwise in a program, this opcode falls through
65563
+** once and jumps on all subsequent invocations. It is the equivalent
65564
+** of "OP_If P1 P2", followed by "OP_Integer 1 P1".
65565
+*/
6563265566
/* Opcode: If P1 P2 P3 * *
6563365567
**
6563465568
** Jump to P2 if the value in register P1 is true. The value
6563565569
** is considered true if it is numeric and non-zero. If the value
6563665570
** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65573,11 @@
6563965573
**
6564065574
** Jump to P2 if the value in register P1 is False. The value
6564165575
** is considered true if it has a numeric value of zero. If the value
6564265576
** in P1 is NULL then take the jump if P3 is true.
6564365577
*/
65578
+case OP_Once: /* jump, in1 */
6564465579
case OP_If: /* jump, in1 */
6564565580
case OP_IfNot: { /* jump, in1 */
6564665581
#if 0 /* local variables moved into u.al */
6564765582
int c;
6564865583
#endif /* local variables moved into u.al */
@@ -65657,10 +65592,16 @@
6565765592
#endif
6565865593
if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
6565965594
}
6566065595
if( u.al.c ){
6566165596
pc = pOp->p2-1;
65597
+ }else if( pOp->opcode==OP_Once ){
65598
+ assert( (pIn1->flags & (MEM_Agg|MEM_Dyn|MEM_RowSet|MEM_Frame))==0 );
65599
+ memAboutToChange(p, pIn1);
65600
+ pIn1->flags = MEM_Int;
65601
+ pIn1->u.i = 1;
65602
+ REGISTER_TRACE(pOp->p1, pIn1);
6566265603
}
6566365604
break;
6566465605
}
6566565606
6566665607
/* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69801,10 @@
6986069801
goto vdbe_error_halt;
6986169802
}
6986269803
6986369804
/************** End of vdbe.c ************************************************/
6986469805
/************** Begin file vdbeblob.c ****************************************/
69865
-#line 1 "tsrc/vdbeblob.c"
6986669806
/*
6986769807
** 2007 May 1
6986869808
**
6986969809
** The author disclaims copyright to this source code. In place of
6987069810
** a legal notice, here is a blessing:
@@ -70134,21 +70074,21 @@
7013470074
/* Make sure a mutex is held on the table to be accessed */
7013570075
sqlite3VdbeUsesBtree(v, iDb);
7013670076
7013770077
/* Configure the OP_TableLock instruction */
7013870078
#ifdef SQLITE_OMIT_SHARED_CACHE
70139
- sqlite3VdbeChangeToNoop(v, 2, 1);
70079
+ sqlite3VdbeChangeToNoop(v, 2);
7014070080
#else
7014170081
sqlite3VdbeChangeP1(v, 2, iDb);
7014270082
sqlite3VdbeChangeP2(v, 2, pTab->tnum);
7014370083
sqlite3VdbeChangeP3(v, 2, flags);
7014470084
sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
7014570085
#endif
7014670086
7014770087
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
7014870088
** parameter of the other to pTab->tnum. */
70149
- sqlite3VdbeChangeToNoop(v, 4 - flags, 1);
70089
+ sqlite3VdbeChangeToNoop(v, 4 - flags);
7015070090
sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
7015170091
sqlite3VdbeChangeP3(v, 3 + flags, iDb);
7015270092
7015370093
/* Configure the number of columns. Configure the cursor to
7015470094
** think that the table has one more column than it really
@@ -70331,11 +70271,10 @@
7033170271
7033270272
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
7033370273
7033470274
/************** End of vdbeblob.c ********************************************/
7033570275
/************** Begin file vdbesort.c ****************************************/
70336
-#line 1 "tsrc/vdbesort.c"
7033770276
/*
7033870277
** 2011 July 9
7033970278
**
7034070279
** The author disclaims copyright to this source code. In place of
7034170280
** a legal notice, here is a blessing:
@@ -70492,12 +70431,16 @@
7049270431
int rc; /* Return Code */
7049370432
int nRead; /* Number of bytes read */
7049470433
int nRec = 0; /* Size of record in bytes */
7049570434
int iOff = 0; /* Size of serialized size varint in bytes */
7049670435
70497
- nRead = pIter->iEof - pIter->iReadOff;
70498
- if( nRead>5 ) nRead = 5;
70436
+ assert( pIter->iEof>=pIter->iReadOff );
70437
+ if( pIter->iEof-pIter->iReadOff>5 ){
70438
+ nRead = 5;
70439
+ }else{
70440
+ nRead = (int)(pIter->iEof - pIter->iReadOff);
70441
+ }
7049970442
if( nRead<=0 ){
7050070443
/* This is an EOF condition */
7050170444
vdbeSorterIterZero(db, pIter);
7050270445
return SQLITE_OK;
7050370446
}
@@ -71211,11 +71154,10 @@
7121171154
7121271155
#endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
7121371156
7121471157
/************** End of vdbesort.c ********************************************/
7121571158
/************** Begin file journal.c *****************************************/
71216
-#line 1 "tsrc/journal.c"
7121771159
/*
7121871160
** 2007 August 22
7121971161
**
7122071162
** The author disclaims copyright to this source code. In place of
7122171163
** a legal notice, here is a blessing:
@@ -71452,11 +71394,10 @@
7145271394
}
7145371395
#endif
7145471396
7145571397
/************** End of journal.c *********************************************/
7145671398
/************** Begin file memjournal.c **************************************/
71457
-#line 1 "tsrc/memjournal.c"
7145871399
/*
7145971400
** 2008 October 7
7146071401
**
7146171402
** The author disclaims copyright to this source code. In place of
7146271403
** a legal notice, here is a blessing:
@@ -71714,11 +71655,10 @@
7171471655
return sizeof(MemJournal);
7171571656
}
7171671657
7171771658
/************** End of memjournal.c ******************************************/
7171871659
/************** Begin file walker.c ******************************************/
71719
-#line 1 "tsrc/walker.c"
7172071660
/*
7172171661
** 2008 August 16
7172271662
**
7172371663
** The author disclaims copyright to this source code. In place of
7172471664
** a legal notice, here is a blessing:
@@ -71853,11 +71793,10 @@
7185371793
return rc & WRC_Abort;
7185471794
}
7185571795
7185671796
/************** End of walker.c **********************************************/
7185771797
/************** Begin file resolve.c *****************************************/
71858
-#line 1 "tsrc/resolve.c"
7185971798
/*
7186071799
** 2008 August 18
7186171800
**
7186271801
** The author disclaims copyright to this source code. In place of
7186371802
** a legal notice, here is a blessing:
@@ -73074,11 +73013,10 @@
7307473013
sqlite3WalkSelect(&w, p);
7307573014
}
7307673015
7307773016
/************** End of resolve.c *********************************************/
7307873017
/************** Begin file expr.c ********************************************/
73079
-#line 1 "tsrc/expr.c"
7308073018
/*
7308173019
** 2001 September 15
7308273020
**
7308373021
** The author disclaims copyright to this source code. In place of
7308473022
** a legal notice, here is a blessing:
@@ -73977,11 +73915,12 @@
7397773915
pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
7397873916
pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
7397973917
pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
7398073918
pNewItem->jointype = pOldItem->jointype;
7398173919
pNewItem->iCursor = pOldItem->iCursor;
73982
- pNewItem->isPopulated = pOldItem->isPopulated;
73920
+ pNewItem->addrFillSub = pOldItem->addrFillSub;
73921
+ pNewItem->regReturn = pOldItem->regReturn;
7398373922
pNewItem->isCorrelated = pOldItem->isCorrelated;
7398473923
pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
7398573924
pNewItem->notIndexed = pOldItem->notIndexed;
7398673925
pNewItem->pIndex = pOldItem->pIndex;
7398773926
pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74476,11 @@
7453774476
assert(v);
7453874477
if( iCol<0 ){
7453974478
int iMem = ++pParse->nMem;
7454074479
int iAddr;
7454174480
74542
- iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74543
- sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74481
+ iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
7454474482
7454574483
sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
7454674484
eType = IN_INDEX_ROWID;
7454774485
7454874486
sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74507,11 @@
7456974507
int iMem = ++pParse->nMem;
7457074508
int iAddr;
7457174509
char *pKey;
7457274510
7457374511
pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74574
- iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74575
- sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74512
+ iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
7457674513
7457774514
sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
7457874515
pKey,P4_KEYINFO_HANDOFF);
7457974516
VdbeComment((v, "%s", pIdx->zName));
7458074517
eType = IN_INDEX_INDEX;
@@ -74651,11 +74588,11 @@
7465174588
Parse *pParse, /* Parsing context */
7465274589
Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
7465374590
int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
7465474591
int isRowid /* If true, LHS of IN operator is a rowid */
7465574592
){
74656
- int testAddr = 0; /* One-time test address */
74593
+ int testAddr = -1; /* One-time test address */
7465774594
int rReg = 0; /* Register storing resulting */
7465874595
Vdbe *v = sqlite3GetVdbe(pParse);
7465974596
if( NEVER(v==0) ) return 0;
7466074597
sqlite3ExprCachePush(pParse);
7466174598
@@ -74669,19 +74606,17 @@
7466974606
** If all of the above are false, then we can run this code just once
7467074607
** save the results, and reuse the same result on subsequent invocations.
7467174608
*/
7467274609
if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
7467374610
int mem = ++pParse->nMem;
74674
- sqlite3VdbeAddOp1(v, OP_If, mem);
74675
- testAddr = sqlite3VdbeAddOp2(v, OP_Integer, 1, mem);
74676
- assert( testAddr>0 || pParse->db->mallocFailed );
74611
+ testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem);
7467774612
}
7467874613
7467974614
#ifndef SQLITE_OMIT_EXPLAIN
7468074615
if( pParse->explain==2 ){
7468174616
char *zMsg = sqlite3MPrintf(
74682
- pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ",
74617
+ pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ",
7468374618
pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
7468474619
);
7468574620
sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
7468674621
}
7468774622
#endif
@@ -74769,13 +74704,13 @@
7476974704
/* If the expression is not constant then we will need to
7477074705
** disable the test that was generated above that makes sure
7477174706
** this code only executes once. Because for a non-constant
7477274707
** expression we need to rerun this code each time.
7477374708
*/
74774
- if( testAddr && !sqlite3ExprIsConstant(pE2) ){
74775
- sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
74776
- testAddr = 0;
74709
+ if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){
74710
+ sqlite3VdbeChangeToNoop(v, testAddr);
74711
+ testAddr = -1;
7477774712
}
7477874713
7477974714
/* Evaluate the expression and insert it into the temp table */
7478074715
if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
7478174716
sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74775,12 @@
7484074775
ExprSetIrreducible(pExpr);
7484174776
break;
7484274777
}
7484374778
}
7484474779
74845
- if( testAddr ){
74846
- sqlite3VdbeJumpHere(v, testAddr-1);
74780
+ if( testAddr>=0 ){
74781
+ sqlite3VdbeJumpHere(v, testAddr);
7484774782
}
7484874783
sqlite3ExprCachePop(pParse, 1);
7484974784
7485074785
return rReg;
7485174786
}
@@ -76835,11 +76770,10 @@
7683576770
}
7683676771
}
7683776772
7683876773
/************** End of expr.c ************************************************/
7683976774
/************** Begin file alter.c *******************************************/
76840
-#line 1 "tsrc/alter.c"
7684176775
/*
7684276776
** 2005 February 15
7684376777
**
7684476778
** The author disclaims copyright to this source code. In place of
7684576779
** a legal notice, here is a blessing:
@@ -77664,11 +77598,10 @@
7766477598
}
7766577599
#endif /* SQLITE_ALTER_TABLE */
7766677600
7766777601
/************** End of alter.c ***********************************************/
7766877602
/************** Begin file analyze.c *****************************************/
77669
-#line 1 "tsrc/analyze.c"
7767077603
/*
7767177604
** 2005 July 8
7767277605
**
7767377606
** The author disclaims copyright to this source code. In place of
7767477607
** a legal notice, here is a blessing:
@@ -78386,11 +78319,10 @@
7838678319
7838778320
#endif /* SQLITE_OMIT_ANALYZE */
7838878321
7838978322
/************** End of analyze.c *********************************************/
7839078323
/************** Begin file attach.c ******************************************/
78391
-#line 1 "tsrc/attach.c"
7839278324
/*
7839378325
** 2003 April 6
7839478326
**
7839578327
** The author disclaims copyright to this source code. In place of
7839678328
** a legal notice, here is a blessing:
@@ -78946,11 +78878,10 @@
7894678878
}
7894778879
#endif
7894878880
7894978881
/************** End of attach.c **********************************************/
7895078882
/************** Begin file auth.c ********************************************/
78951
-#line 1 "tsrc/auth.c"
7895278883
/*
7895378884
** 2003 January 11
7895478885
**
7895578886
** The author disclaims copyright to this source code. In place of
7895678887
** a legal notice, here is a blessing:
@@ -79198,11 +79129,10 @@
7919879129
7919979130
#endif /* SQLITE_OMIT_AUTHORIZATION */
7920079131
7920179132
/************** End of auth.c ************************************************/
7920279133
/************** Begin file build.c *******************************************/
79203
-#line 1 "tsrc/build.c"
7920479134
/*
7920579135
** 2001 September 15
7920679136
**
7920779137
** The author disclaims copyright to this source code. In place of
7920879138
** a legal notice, here is a blessing:
@@ -83002,11 +82932,10 @@
8300282932
return pKey;
8300382933
}
8300482934
8300582935
/************** End of build.c ***********************************************/
8300682936
/************** Begin file callback.c ****************************************/
83007
-#line 1 "tsrc/callback.c"
8300882937
/*
8300982938
** 2005 May 23
8301082939
**
8301182940
** The author disclaims copyright to this source code. In place of
8301282941
** a legal notice, here is a blessing:
@@ -83462,11 +83391,10 @@
8346283391
return p;
8346383392
}
8346483393
8346583394
/************** End of callback.c ********************************************/
8346683395
/************** Begin file delete.c ******************************************/
83467
-#line 1 "tsrc/delete.c"
8346883396
/*
8346983397
** 2001 September 15
8347083398
**
8347183399
** The author disclaims copyright to this source code. In place of
8347283400
** a legal notice, here is a blessing:
@@ -84117,11 +84045,10 @@
8411784045
return regBase;
8411884046
}
8411984047
8412084048
/************** End of delete.c **********************************************/
8412184049
/************** Begin file func.c ********************************************/
84122
-#line 1 "tsrc/func.c"
8412384050
/*
8412484051
** 2002 February 23
8412584052
**
8412684053
** The author disclaims copyright to this source code. In place of
8412784054
** a legal notice, here is a blessing:
@@ -85726,11 +85653,10 @@
8572685653
#endif
8572785654
}
8572885655
8572985656
/************** End of func.c ************************************************/
8573085657
/************** Begin file fkey.c ********************************************/
85731
-#line 1 "tsrc/fkey.c"
8573285658
/*
8573385659
**
8573485660
** The author disclaims copyright to this source code. In place of
8573585661
** a legal notice, here is a blessing:
8573685662
**
@@ -86947,11 +86873,10 @@
8694786873
}
8694886874
#endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
8694986875
8695086876
/************** End of fkey.c ************************************************/
8695186877
/************** Begin file insert.c ******************************************/
86952
-#line 1 "tsrc/insert.c"
8695386878
/*
8695486879
** 2001 September 15
8695586880
**
8695686881
** The author disclaims copyright to this source code. In place of
8695786882
** a legal notice, here is a blessing:
@@ -88793,11 +88718,10 @@
8879388718
}
8879488719
#endif /* SQLITE_OMIT_XFER_OPT */
8879588720
8879688721
/************** End of insert.c **********************************************/
8879788722
/************** Begin file legacy.c ******************************************/
88798
-#line 1 "tsrc/legacy.c"
8879988723
/*
8880088724
** 2001 September 15
8880188725
**
8880288726
** The author disclaims copyright to this source code. In place of
8880388727
** a legal notice, here is a blessing:
@@ -88941,11 +88865,10 @@
8894188865
return rc;
8894288866
}
8894388867
8894488868
/************** End of legacy.c **********************************************/
8894588869
/************** Begin file loadext.c *****************************************/
88946
-#line 1 "tsrc/loadext.c"
8894788870
/*
8894888871
** 2006 June 7
8894988872
**
8895088873
** The author disclaims copyright to this source code. In place of
8895188874
** a legal notice, here is a blessing:
@@ -88962,11 +88885,10 @@
8896288885
#ifndef SQLITE_CORE
8896388886
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
8896488887
#endif
8896588888
/************** Include sqlite3ext.h in the middle of loadext.c **************/
8896688889
/************** Begin file sqlite3ext.h **************************************/
88967
-#line 1 "tsrc/sqlite3ext.h"
8896888890
/*
8896988891
** 2006 June 7
8897088892
**
8897188893
** The author disclaims copyright to this source code. In place of
8897288894
** a legal notice, here is a blessing:
@@ -89391,11 +89313,10 @@
8939189313
8939289314
#endif /* _SQLITE3EXT_H_ */
8939389315
8939489316
/************** End of sqlite3ext.h ******************************************/
8939589317
/************** Continuing where we left off in loadext.c ********************/
89396
-#line 20 "tsrc/loadext.c"
8939789318
/* #include <string.h> */
8939889319
8939989320
#ifndef SQLITE_OMIT_LOAD_EXTENSION
8940089321
8940189322
/*
@@ -90031,11 +89952,10 @@
9003189952
}
9003289953
}
9003389954
9003489955
/************** End of loadext.c *********************************************/
9003589956
/************** Begin file pragma.c ******************************************/
90036
-#line 1 "tsrc/pragma.c"
9003789957
/*
9003889958
** 2003 April 6
9003989959
**
9004089960
** The author disclaims copyright to this source code. In place of
9004189961
** a legal notice, here is a blessing:
@@ -91560,11 +91480,10 @@
9156091480
9156191481
#endif /* SQLITE_OMIT_PRAGMA */
9156291482
9156391483
/************** End of pragma.c **********************************************/
9156491484
/************** Begin file prepare.c *****************************************/
91565
-#line 1 "tsrc/prepare.c"
9156691485
/*
9156791486
** 2005 May 25
9156891487
**
9156991488
** The author disclaims copyright to this source code. In place of
9157091489
** a legal notice, here is a blessing:
@@ -92421,11 +92340,10 @@
9242192340
9242292341
#endif /* SQLITE_OMIT_UTF16 */
9242392342
9242492343
/************** End of prepare.c *********************************************/
9242592344
/************** Begin file select.c ******************************************/
92426
-#line 1 "tsrc/select.c"
9242792345
/*
9242892346
** 2001 September 15
9242992347
**
9243092348
** The author disclaims copyright to this source code. In place of
9243192349
** a legal notice, here is a blessing:
@@ -92512,10 +92430,12 @@
9251292430
pNew->addrOpenEphm[2] = -1;
9251392431
if( db->mallocFailed ) {
9251492432
clearSelect(db, pNew);
9251592433
if( pNew!=&standin ) sqlite3DbFree(db, pNew);
9251692434
pNew = 0;
92435
+ }else{
92436
+ assert( pNew->pSrc!=0 || pParse->nErr>0 );
9251792437
}
9251892438
return pNew;
9251992439
}
9252092440
9252192441
/*
@@ -96224,11 +96144,15 @@
9622496144
struct SrcList_item *pItem = &pTabList->a[i];
9622596145
SelectDest dest;
9622696146
Select *pSub = pItem->pSelect;
9622796147
int isAggSub;
9622896148
96229
- if( pSub==0 || pItem->isPopulated ) continue;
96149
+ if( pSub==0 ) continue;
96150
+ if( pItem->addrFillSub ){
96151
+ sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
96152
+ continue;
96153
+ }
9623096154
9623196155
/* Increment Parse.nHeight by the height of the largest expression
9623296156
** tree refered to by this, the parent select. The child select
9623396157
** may contain expression trees of at most
9623496158
** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96159,48 @@
9623596159
** more conservative than necessary, but much easier than enforcing
9623696160
** an exact limit.
9623796161
*/
9623896162
pParse->nHeight += sqlite3SelectExprHeight(p);
9623996163
96240
- /* Check to see if the subquery can be absorbed into the parent. */
9624196164
isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
9624296165
if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
96166
+ /* This subquery can be absorbed into its parent. */
9624396167
if( isAggSub ){
9624496168
isAgg = 1;
9624596169
p->selFlags |= SF_Aggregate;
9624696170
}
9624796171
i = -1;
9624896172
}else{
96173
+ /* Generate a subroutine that will fill an ephemeral table with
96174
+ ** the content of this subquery. pItem->addrFillSub will point
96175
+ ** to the address of the generated subroutine. pItem->regReturn
96176
+ ** is a register allocated to hold the subroutine return address
96177
+ */
96178
+ int topAddr;
96179
+ int onceAddr = 0;
96180
+ int retAddr;
96181
+ assert( pItem->addrFillSub==0 );
96182
+ pItem->regReturn = ++pParse->nMem;
96183
+ topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
96184
+ pItem->addrFillSub = topAddr+1;
96185
+ VdbeNoopComment((v, "materialize %s", pItem->pTab->zName));
96186
+ if( pItem->isCorrelated==0 && pParse->pTriggerTab==0 ){
96187
+ /* If the subquery is no correlated and if we are not inside of
96188
+ ** a trigger, then we only need to compute the value of the subquery
96189
+ ** once. */
96190
+ int regOnce = ++pParse->nMem;
96191
+ onceAddr = sqlite3VdbeAddOp1(v, OP_Once, regOnce);
96192
+ }
9624996193
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
96250
- assert( pItem->isPopulated==0 );
9625196194
explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
9625296195
sqlite3Select(pParse, pSub, &dest);
96253
- pItem->isPopulated = 1;
9625496196
pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
96197
+ if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
96198
+ retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
96199
+ VdbeComment((v, "end %s", pItem->pTab->zName));
96200
+ sqlite3VdbeChangeP1(v, topAddr, retAddr);
96201
+
9625596202
}
9625696203
if( /*pParse->nErr ||*/ db->mallocFailed ){
9625796204
goto select_end;
9625896205
}
9625996206
pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96337,11 @@
9639096337
/* If sorting index that was created by a prior OP_OpenEphemeral
9639196338
** instruction ended up not being needed, then change the OP_OpenEphemeral
9639296339
** into an OP_Noop.
9639396340
*/
9639496341
if( addrSortIndex>=0 && pOrderBy==0 ){
96395
- sqlite3VdbeChangeToNoop(v, addrSortIndex, 1);
96342
+ sqlite3VdbeChangeToNoop(v, addrSortIndex);
9639696343
p->addrOpenEphm[2] = -1;
9639796344
}
9639896345
9639996346
if( pWInfo->eDistinct ){
9640096347
VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96620,11 @@
9667396620
*/
9667496621
if( groupBySort ){
9667596622
sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
9667696623
}else{
9667796624
sqlite3WhereEnd(pWInfo);
96678
- sqlite3VdbeChangeToNoop(v, addrSortingIdx, 1);
96625
+ sqlite3VdbeChangeToNoop(v, addrSortingIdx);
9667996626
}
9668096627
9668196628
/* Output the final row of result
9668296629
*/
9668396630
sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96928,10 @@
9698196928
*****************************************************************************/
9698296929
#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
9698396930
9698496931
/************** End of select.c **********************************************/
9698596932
/************** Begin file table.c *******************************************/
96986
-#line 1 "tsrc/table.c"
9698796933
/*
9698896934
** 2001 September 15
9698996935
**
9699096936
** The author disclaims copyright to this source code. In place of
9699196937
** a legal notice, here is a blessing:
@@ -97181,11 +97127,10 @@
9718197127
9718297128
#endif /* SQLITE_OMIT_GET_TABLE */
9718397129
9718497130
/************** End of table.c ***********************************************/
9718597131
/************** Begin file trigger.c *****************************************/
97186
-#line 1 "tsrc/trigger.c"
9718797132
/*
9718897133
**
9718997134
** The author disclaims copyright to this source code. In place of
9719097135
** a legal notice, here is a blessing:
9719197136
**
@@ -98307,11 +98252,10 @@
9830798252
9830898253
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
9830998254
9831098255
/************** End of trigger.c *********************************************/
9831198256
/************** Begin file update.c ******************************************/
98312
-#line 1 "tsrc/update.c"
9831398257
/*
9831498258
** 2001 September 15
9831598259
**
9831698260
** The author disclaims copyright to this source code. In place of
9831798261
** a legal notice, here is a blessing:
@@ -98980,11 +98924,10 @@
9898098924
}
9898198925
#endif /* SQLITE_OMIT_VIRTUALTABLE */
9898298926
9898398927
/************** End of update.c **********************************************/
9898498928
/************** Begin file vacuum.c ******************************************/
98985
-#line 1 "tsrc/vacuum.c"
9898698929
/*
9898798930
** 2003 April 6
9898898931
**
9898998932
** The author disclaims copyright to this source code. In place of
9899098933
** a legal notice, here is a blessing:
@@ -99327,11 +99270,10 @@
9932799270
9932899271
#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
9932999272
9933099273
/************** End of vacuum.c **********************************************/
9933199274
/************** Begin file vtab.c ********************************************/
99332
-#line 1 "tsrc/vtab.c"
9933399275
/*
9933499276
** 2006 June 10
9933599277
**
9933699278
** The author disclaims copyright to this source code. In place of
9933799279
** a legal notice, here is a blessing:
@@ -100396,11 +100338,10 @@
100396100338
100397100339
#endif /* SQLITE_OMIT_VIRTUALTABLE */
100398100340
100399100341
/************** End of vtab.c ************************************************/
100400100342
/************** Begin file where.c *******************************************/
100401
-#line 1 "tsrc/where.c"
100402100343
/*
100403100344
** 2001 September 15
100404100345
**
100405100346
** The author disclaims copyright to this source code. In place of
100406100347
** a legal notice, here is a blessing:
@@ -100865,15 +100806,23 @@
100865100806
return mask;
100866100807
}
100867100808
static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100868100809
Bitmask mask = 0;
100869100810
while( pS ){
100811
+ SrcList *pSrc = pS->pSrc;
100870100812
mask |= exprListTableUsage(pMaskSet, pS->pEList);
100871100813
mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100872100814
mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100873100815
mask |= exprTableUsage(pMaskSet, pS->pWhere);
100874100816
mask |= exprTableUsage(pMaskSet, pS->pHaving);
100817
+ if( ALWAYS(pSrc!=0) ){
100818
+ int i;
100819
+ for(i=0; i<pSrc->nSrc; i++){
100820
+ mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
100821
+ mask |= exprTableUsage(pMaskSet, pSrc->a[i].pOn);
100822
+ }
100823
+ }
100875100824
pS = pS->pPrior;
100876100825
}
100877100826
return mask;
100878100827
}
100879100828
@@ -102392,12 +102341,11 @@
102392102341
/* Generate code to skip over the creation and initialization of the
102393102342
** transient index on 2nd and subsequent iterations of the loop. */
102394102343
v = pParse->pVdbe;
102395102344
assert( v!=0 );
102396102345
regIsInit = ++pParse->nMem;
102397
- addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit);
102398
- sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit);
102346
+ addrInit = sqlite3VdbeAddOp1(v, OP_Once, regIsInit);
102399102347
102400102348
/* Count the number of columns that will be added to the index
102401102349
** and used to match WHERE clause constraints */
102402102350
nColumn = 0;
102403102351
pTable = pSrc->pTab;
@@ -105583,11 +105531,10 @@
105583105531
return;
105584105532
}
105585105533
105586105534
/************** End of where.c ***********************************************/
105587105535
/************** Begin file parse.c *******************************************/
105588
-#line 1 "tsrc/parse.c"
105589105536
/* Driver template for the LEMON parser generator.
105590105537
** The author disclaims copyright to this source code.
105591105538
**
105592105539
** This version of "lempar.c" is modified, slightly, for use by SQLite.
105593105540
** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105543,10 @@
105596105543
** specific grammar used by SQLite.
105597105544
*/
105598105545
/* First off, code is included that follows the "include" declaration
105599105546
** in the input grammar file. */
105600105547
/* #include <stdio.h> */
105601
-#line 51 "parse.y"
105602105548
105603105549
105604105550
/*
105605105551
** Disable all error recovery processing in the parser push-down
105606105552
** automaton.
@@ -105644,11 +105590,10 @@
105644105590
/*
105645105591
** An instance of this structure holds the ATTACH key and the key type.
105646105592
*/
105647105593
struct AttachKey { int type; Token key; };
105648105594
105649
-#line 722 "parse.y"
105650105595
105651105596
/* This is a utility routine used to set the ExprSpan.zStart and
105652105597
** ExprSpan.zEnd values of pOut so that the span covers the complete
105653105598
** range of text beginning with pStart and going to the end of pEnd.
105654105599
*/
@@ -105664,11 +105609,10 @@
105664105609
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105665105610
pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105666105611
pOut->zStart = pValue->z;
105667105612
pOut->zEnd = &pValue->z[pValue->n];
105668105613
}
105669
-#line 817 "parse.y"
105670105614
105671105615
/* This routine constructs a binary expression node out of two ExprSpan
105672105616
** objects and uses the result to populate a new ExprSpan object.
105673105617
*/
105674105618
static void spanBinaryExpr(
@@ -105680,11 +105624,10 @@
105680105624
){
105681105625
pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105682105626
pOut->zStart = pLeft->zStart;
105683105627
pOut->zEnd = pRight->zEnd;
105684105628
}
105685
-#line 873 "parse.y"
105686105629
105687105630
/* Construct an expression node for a unary postfix operator
105688105631
*/
105689105632
static void spanUnaryPostfix(
105690105633
ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105638,10 @@
105695105638
){
105696105639
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105697105640
pOut->zStart = pOperand->zStart;
105698105641
pOut->zEnd = &pPostOp->z[pPostOp->n];
105699105642
}
105700
-#line 892 "parse.y"
105701105643
105702105644
/* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105703105645
** unary TK_ISNULL or TK_NOTNULL expression. */
105704105646
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105705105647
sqlite3 *db = pParse->db;
@@ -105707,11 +105649,10 @@
105707105649
pA->op = (u8)op;
105708105650
sqlite3ExprDelete(db, pA->pRight);
105709105651
pA->pRight = 0;
105710105652
}
105711105653
}
105712
-#line 920 "parse.y"
105713105654
105714105655
/* Construct an expression node for a unary prefix operator
105715105656
*/
105716105657
static void spanUnaryPrefix(
105717105658
ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105663,10 @@
105722105663
){
105723105664
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105724105665
pOut->zStart = pPreOp->z;
105725105666
pOut->zEnd = pOperand->zEnd;
105726105667
}
105727
-#line 141 "parse.c"
105728105668
/* Next is all token values, in a form suitable for use by makeheaders.
105729105669
** This section will be null unless lemon is run with the -m switch.
105730105670
*/
105731105671
/*
105732105672
** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106918,17 @@
106978106918
** inside the C code.
106979106919
*/
106980106920
case 160: /* select */
106981106921
case 194: /* oneselect */
106982106922
{
106983
-#line 403 "parse.y"
106984106923
sqlite3SelectDelete(pParse->db, (yypminor->yy387));
106985
-#line 1399 "parse.c"
106986106924
}
106987106925
break;
106988106926
case 174: /* term */
106989106927
case 175: /* expr */
106990106928
{
106991
-#line 720 "parse.y"
106992106929
sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
106993
-#line 1407 "parse.c"
106994106930
}
106995106931
break;
106996106932
case 179: /* idxlist_opt */
106997106933
case 187: /* idxlist */
106998106934
case 197: /* selcollist */
@@ -107004,23 +106940,19 @@
107004106940
case 217: /* setlist */
107005106941
case 220: /* itemlist */
107006106942
case 221: /* exprlist */
107007106943
case 226: /* case_exprlist */
107008106944
{
107009
-#line 1103 "parse.y"
107010106945
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107011
-#line 1425 "parse.c"
107012106946
}
107013106947
break;
107014106948
case 193: /* fullname */
107015106949
case 198: /* from */
107016106950
case 206: /* seltablist */
107017106951
case 207: /* stl_prefix */
107018106952
{
107019
-#line 534 "parse.y"
107020106953
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107021
-#line 1435 "parse.c"
107022106954
}
107023106955
break;
107024106956
case 199: /* where_opt */
107025106957
case 201: /* having_opt */
107026106958
case 210: /* on_opt */
@@ -107028,37 +106960,29 @@
107028106960
case 225: /* case_operand */
107029106961
case 227: /* case_else */
107030106962
case 238: /* when_clause */
107031106963
case 243: /* key_opt */
107032106964
{
107033
-#line 644 "parse.y"
107034106965
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107035
-#line 1449 "parse.c"
107036106966
}
107037106967
break;
107038106968
case 211: /* using_opt */
107039106969
case 213: /* inscollist */
107040106970
case 219: /* inscollist_opt */
107041106971
{
107042
-#line 566 "parse.y"
107043106972
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107044
-#line 1458 "parse.c"
107045106973
}
107046106974
break;
107047106975
case 234: /* trigger_cmd_list */
107048106976
case 239: /* trigger_cmd */
107049106977
{
107050
-#line 1210 "parse.y"
107051106978
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107052
-#line 1466 "parse.c"
107053106979
}
107054106980
break;
107055106981
case 236: /* trigger_event */
107056106982
{
107057
-#line 1196 "parse.y"
107058106983
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107059
-#line 1473 "parse.c"
107060106984
}
107061106985
break;
107062106986
default: break; /* If no destructor action specified: do nothing */
107063106987
}
107064106988
}
@@ -107240,16 +107164,14 @@
107240107164
}
107241107165
#endif
107242107166
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107243107167
/* Here code is inserted which will execute if the parser
107244107168
** stack every overflows */
107245
-#line 38 "parse.y"
107246107169
107247107170
UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107248107171
sqlite3ErrorMsg(pParse, "parser stack overflow");
107249107172
pParse->parseError = 1;
107250
-#line 1664 "parse.c"
107251107173
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107252107174
}
107253107175
107254107176
/*
107255107177
** Perform a shift action.
@@ -107686,94 +107608,66 @@
107686107608
** { ... } // User supplied code
107687107609
** #line <lineno> <thisfile>
107688107610
** break;
107689107611
*/
107690107612
case 5: /* explain ::= */
107691
-#line 107 "parse.y"
107692107613
{ sqlite3BeginParse(pParse, 0); }
107693
-#line 2107 "parse.c"
107694107614
break;
107695107615
case 6: /* explain ::= EXPLAIN */
107696
-#line 109 "parse.y"
107697107616
{ sqlite3BeginParse(pParse, 1); }
107698
-#line 2112 "parse.c"
107699107617
break;
107700107618
case 7: /* explain ::= EXPLAIN QUERY PLAN */
107701
-#line 110 "parse.y"
107702107619
{ sqlite3BeginParse(pParse, 2); }
107703
-#line 2117 "parse.c"
107704107620
break;
107705107621
case 8: /* cmdx ::= cmd */
107706
-#line 112 "parse.y"
107707107622
{ sqlite3FinishCoding(pParse); }
107708
-#line 2122 "parse.c"
107709107623
break;
107710107624
case 9: /* cmd ::= BEGIN transtype trans_opt */
107711
-#line 117 "parse.y"
107712107625
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
107713
-#line 2127 "parse.c"
107714107626
break;
107715107627
case 13: /* transtype ::= */
107716
-#line 122 "parse.y"
107717107628
{yygotominor.yy4 = TK_DEFERRED;}
107718
-#line 2132 "parse.c"
107719107629
break;
107720107630
case 14: /* transtype ::= DEFERRED */
107721107631
case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107722107632
case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107723107633
case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107724107634
case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
107725
-#line 123 "parse.y"
107726107635
{yygotominor.yy4 = yymsp[0].major;}
107727
-#line 2141 "parse.c"
107728107636
break;
107729107637
case 17: /* cmd ::= COMMIT trans_opt */
107730107638
case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
107731
-#line 126 "parse.y"
107732107639
{sqlite3CommitTransaction(pParse);}
107733
-#line 2147 "parse.c"
107734107640
break;
107735107641
case 19: /* cmd ::= ROLLBACK trans_opt */
107736
-#line 128 "parse.y"
107737107642
{sqlite3RollbackTransaction(pParse);}
107738
-#line 2152 "parse.c"
107739107643
break;
107740107644
case 22: /* cmd ::= SAVEPOINT nm */
107741
-#line 132 "parse.y"
107742107645
{
107743107646
sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107744107647
}
107745
-#line 2159 "parse.c"
107746107648
break;
107747107649
case 23: /* cmd ::= RELEASE savepoint_opt nm */
107748
-#line 135 "parse.y"
107749107650
{
107750107651
sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107751107652
}
107752
-#line 2166 "parse.c"
107753107653
break;
107754107654
case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
107755
-#line 138 "parse.y"
107756107655
{
107757107656
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107758107657
}
107759
-#line 2173 "parse.c"
107760107658
break;
107761107659
case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
107762
-#line 145 "parse.y"
107763107660
{
107764107661
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107765107662
}
107766
-#line 2180 "parse.c"
107767107663
break;
107768107664
case 27: /* createkw ::= CREATE */
107769
-#line 148 "parse.y"
107770107665
{
107771107666
pParse->db->lookaside.bEnabled = 0;
107772107667
yygotominor.yy0 = yymsp[0].minor.yy0;
107773107668
}
107774
-#line 2188 "parse.c"
107775107669
break;
107776107670
case 28: /* ifnotexists ::= */
107777107671
case 31: /* temp ::= */ yytestcase(yyruleno==31);
107778107672
case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107779107673
case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107677,44 @@
107783107677
case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107784107678
case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107785107679
case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107786107680
case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107787107681
case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
107788
-#line 153 "parse.y"
107789107682
{yygotominor.yy4 = 0;}
107790
-#line 2204 "parse.c"
107791107683
break;
107792107684
case 29: /* ifnotexists ::= IF NOT EXISTS */
107793107685
case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107794107686
case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107795107687
case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107796107688
case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107797107689
case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107798107690
case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107799107691
case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
107800
-#line 154 "parse.y"
107801107692
{yygotominor.yy4 = 1;}
107802
-#line 2216 "parse.c"
107803107693
break;
107804107694
case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
107805
-#line 160 "parse.y"
107806107695
{
107807107696
sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107808107697
}
107809
-#line 2223 "parse.c"
107810107698
break;
107811107699
case 33: /* create_table_args ::= AS select */
107812
-#line 163 "parse.y"
107813107700
{
107814107701
sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107815107702
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107816107703
}
107817
-#line 2231 "parse.c"
107818107704
break;
107819107705
case 36: /* column ::= columnid type carglist */
107820
-#line 175 "parse.y"
107821107706
{
107822107707
yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107823107708
yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107824107709
}
107825
-#line 2239 "parse.c"
107826107710
break;
107827107711
case 37: /* columnid ::= nm */
107828
-#line 179 "parse.y"
107829107712
{
107830107713
sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107831107714
yygotominor.yy0 = yymsp[0].minor.yy0;
107832107715
}
107833
-#line 2247 "parse.c"
107834107716
break;
107835107717
case 38: /* id ::= ID */
107836107718
case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107837107719
case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107838107720
case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107734,256 @@
107852107734
case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107853107735
case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107854107736
case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107855107737
case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107856107738
case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
107857
-#line 189 "parse.y"
107858107739
{yygotominor.yy0 = yymsp[0].minor.yy0;}
107859
-#line 2273 "parse.c"
107860107740
break;
107861107741
case 45: /* type ::= typetoken */
107862
-#line 251 "parse.y"
107863107742
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
107864
-#line 2278 "parse.c"
107865107743
break;
107866107744
case 47: /* typetoken ::= typename LP signed RP */
107867
-#line 253 "parse.y"
107868107745
{
107869107746
yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107870107747
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107871107748
}
107872
-#line 2286 "parse.c"
107873107749
break;
107874107750
case 48: /* typetoken ::= typename LP signed COMMA signed RP */
107875
-#line 257 "parse.y"
107876107751
{
107877107752
yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107878107753
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107879107754
}
107880
-#line 2294 "parse.c"
107881107755
break;
107882107756
case 50: /* typename ::= typename ids */
107883
-#line 263 "parse.y"
107884107757
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
107885
-#line 2299 "parse.c"
107886107758
break;
107887107759
case 57: /* ccons ::= DEFAULT term */
107888107760
case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
107889
-#line 274 "parse.y"
107890107761
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
107891
-#line 2305 "parse.c"
107892107762
break;
107893107763
case 58: /* ccons ::= DEFAULT LP expr RP */
107894
-#line 275 "parse.y"
107895107764
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
107896
-#line 2310 "parse.c"
107897107765
break;
107898107766
case 60: /* ccons ::= DEFAULT MINUS term */
107899
-#line 277 "parse.y"
107900107767
{
107901107768
ExprSpan v;
107902107769
v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107903107770
v.zStart = yymsp[-1].minor.yy0.z;
107904107771
v.zEnd = yymsp[0].minor.yy118.zEnd;
107905107772
sqlite3AddDefaultValue(pParse,&v);
107906107773
}
107907
-#line 2321 "parse.c"
107908107774
break;
107909107775
case 61: /* ccons ::= DEFAULT id */
107910
-#line 284 "parse.y"
107911107776
{
107912107777
ExprSpan v;
107913107778
spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107914107779
sqlite3AddDefaultValue(pParse,&v);
107915107780
}
107916
-#line 2330 "parse.c"
107917107781
break;
107918107782
case 63: /* ccons ::= NOT NULL onconf */
107919
-#line 294 "parse.y"
107920107783
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
107921
-#line 2335 "parse.c"
107922107784
break;
107923107785
case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
107924
-#line 296 "parse.y"
107925107786
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
107926
-#line 2340 "parse.c"
107927107787
break;
107928107788
case 65: /* ccons ::= UNIQUE onconf */
107929
-#line 297 "parse.y"
107930107789
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
107931
-#line 2345 "parse.c"
107932107790
break;
107933107791
case 66: /* ccons ::= CHECK LP expr RP */
107934
-#line 298 "parse.y"
107935107792
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
107936
-#line 2350 "parse.c"
107937107793
break;
107938107794
case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
107939
-#line 300 "parse.y"
107940107795
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
107941
-#line 2355 "parse.c"
107942107796
break;
107943107797
case 68: /* ccons ::= defer_subclause */
107944
-#line 301 "parse.y"
107945107798
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
107946
-#line 2360 "parse.c"
107947107799
break;
107948107800
case 69: /* ccons ::= COLLATE ids */
107949
-#line 302 "parse.y"
107950107801
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
107951
-#line 2365 "parse.c"
107952107802
break;
107953107803
case 72: /* refargs ::= */
107954
-#line 315 "parse.y"
107955107804
{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
107956
-#line 2370 "parse.c"
107957107805
break;
107958107806
case 73: /* refargs ::= refargs refarg */
107959
-#line 316 "parse.y"
107960107807
{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
107961
-#line 2375 "parse.c"
107962107808
break;
107963107809
case 74: /* refarg ::= MATCH nm */
107964107810
case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
107965
-#line 318 "parse.y"
107966107811
{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
107967
-#line 2381 "parse.c"
107968107812
break;
107969107813
case 76: /* refarg ::= ON DELETE refact */
107970
-#line 320 "parse.y"
107971107814
{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
107972
-#line 2386 "parse.c"
107973107815
break;
107974107816
case 77: /* refarg ::= ON UPDATE refact */
107975
-#line 321 "parse.y"
107976107817
{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
107977
-#line 2391 "parse.c"
107978107818
break;
107979107819
case 78: /* refact ::= SET NULL */
107980
-#line 323 "parse.y"
107981107820
{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
107982
-#line 2396 "parse.c"
107983107821
break;
107984107822
case 79: /* refact ::= SET DEFAULT */
107985
-#line 324 "parse.y"
107986107823
{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
107987
-#line 2401 "parse.c"
107988107824
break;
107989107825
case 80: /* refact ::= CASCADE */
107990
-#line 325 "parse.y"
107991107826
{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
107992
-#line 2406 "parse.c"
107993107827
break;
107994107828
case 81: /* refact ::= RESTRICT */
107995
-#line 326 "parse.y"
107996107829
{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
107997
-#line 2411 "parse.c"
107998107830
break;
107999107831
case 82: /* refact ::= NO ACTION */
108000
-#line 327 "parse.y"
108001107832
{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108002
-#line 2416 "parse.c"
108003107833
break;
108004107834
case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108005107835
case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108006107836
case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108007107837
case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108008
-#line 330 "parse.y"
108009107838
{yygotominor.yy4 = yymsp[0].minor.yy4;}
108010
-#line 2424 "parse.c"
108011107839
break;
108012107840
case 88: /* conslist_opt ::= */
108013
-#line 339 "parse.y"
108014107841
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108015
-#line 2429 "parse.c"
108016107842
break;
108017107843
case 89: /* conslist_opt ::= COMMA conslist */
108018
-#line 340 "parse.y"
108019107844
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
108020
-#line 2434 "parse.c"
108021107845
break;
108022107846
case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108023
-#line 346 "parse.y"
108024107847
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108025
-#line 2439 "parse.c"
108026107848
break;
108027107849
case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108028
-#line 348 "parse.y"
108029107850
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108030
-#line 2444 "parse.c"
108031107851
break;
108032107852
case 96: /* tcons ::= CHECK LP expr RP onconf */
108033
-#line 350 "parse.y"
108034107853
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108035
-#line 2449 "parse.c"
108036107854
break;
108037107855
case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108038
-#line 352 "parse.y"
108039107856
{
108040107857
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108041107858
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108042107859
}
108043
-#line 2457 "parse.c"
108044107860
break;
108045107861
case 100: /* onconf ::= */
108046
-#line 366 "parse.y"
108047107862
{yygotominor.yy4 = OE_Default;}
108048
-#line 2462 "parse.c"
108049107863
break;
108050107864
case 102: /* orconf ::= */
108051
-#line 368 "parse.y"
108052107865
{yygotominor.yy210 = OE_Default;}
108053
-#line 2467 "parse.c"
108054107866
break;
108055107867
case 103: /* orconf ::= OR resolvetype */
108056
-#line 369 "parse.y"
108057107868
{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108058
-#line 2472 "parse.c"
108059107869
break;
108060107870
case 105: /* resolvetype ::= IGNORE */
108061
-#line 371 "parse.y"
108062107871
{yygotominor.yy4 = OE_Ignore;}
108063
-#line 2477 "parse.c"
108064107872
break;
108065107873
case 106: /* resolvetype ::= REPLACE */
108066
-#line 372 "parse.y"
108067107874
{yygotominor.yy4 = OE_Replace;}
108068
-#line 2482 "parse.c"
108069107875
break;
108070107876
case 107: /* cmd ::= DROP TABLE ifexists fullname */
108071
-#line 376 "parse.y"
108072107877
{
108073107878
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108074107879
}
108075
-#line 2489 "parse.c"
108076107880
break;
108077107881
case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108078
-#line 386 "parse.y"
108079107882
{
108080107883
sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108081107884
}
108082
-#line 2496 "parse.c"
108083107885
break;
108084107886
case 111: /* cmd ::= DROP VIEW ifexists fullname */
108085
-#line 389 "parse.y"
108086107887
{
108087107888
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108088107889
}
108089
-#line 2503 "parse.c"
108090107890
break;
108091107891
case 112: /* cmd ::= select */
108092
-#line 396 "parse.y"
108093107892
{
108094107893
SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108095107894
sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108096107895
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108097107896
}
108098
-#line 2512 "parse.c"
108099107897
break;
108100107898
case 113: /* select ::= oneselect */
108101
-#line 407 "parse.y"
108102107899
{yygotominor.yy387 = yymsp[0].minor.yy387;}
108103
-#line 2517 "parse.c"
108104107900
break;
108105107901
case 114: /* select ::= select multiselect_op oneselect */
108106
-#line 409 "parse.y"
108107107902
{
108108107903
if( yymsp[0].minor.yy387 ){
108109107904
yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108110107905
yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108111107906
}else{
108112107907
sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108113107908
}
108114107909
yygotominor.yy387 = yymsp[0].minor.yy387;
108115107910
}
108116
-#line 2530 "parse.c"
108117107911
break;
108118107912
case 116: /* multiselect_op ::= UNION ALL */
108119
-#line 420 "parse.y"
108120107913
{yygotominor.yy4 = TK_ALL;}
108121
-#line 2535 "parse.c"
108122107914
break;
108123107915
case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108124
-#line 424 "parse.y"
108125107916
{
108126107917
yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108127107918
}
108128
-#line 2542 "parse.c"
108129107919
break;
108130107920
case 122: /* sclp ::= selcollist COMMA */
108131107921
case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108132
-#line 445 "parse.y"
108133107922
{yygotominor.yy322 = yymsp[-1].minor.yy322;}
108134
-#line 2548 "parse.c"
108135107923
break;
108136107924
case 123: /* sclp ::= */
108137107925
case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108138107926
case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108139107927
case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108140107928
case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108141
-#line 446 "parse.y"
108142107929
{yygotominor.yy322 = 0;}
108143
-#line 2557 "parse.c"
108144107930
break;
108145107931
case 124: /* selcollist ::= sclp expr as */
108146
-#line 447 "parse.y"
108147107932
{
108148107933
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108149107934
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108150107935
sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108151107936
}
108152
-#line 2566 "parse.c"
108153107937
break;
108154107938
case 125: /* selcollist ::= sclp STAR */
108155
-#line 452 "parse.y"
108156107939
{
108157107940
Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108158107941
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108159107942
}
108160
-#line 2574 "parse.c"
108161107943
break;
108162107944
case 126: /* selcollist ::= sclp nm DOT STAR */
108163
-#line 456 "parse.y"
108164107945
{
108165107946
Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108166107947
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108167107948
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108168107949
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108169107950
}
108170
-#line 2584 "parse.c"
108171107951
break;
108172107952
case 129: /* as ::= */
108173
-#line 469 "parse.y"
108174107953
{yygotominor.yy0.n = 0;}
108175
-#line 2589 "parse.c"
108176107954
break;
108177107955
case 130: /* from ::= */
108178
-#line 481 "parse.y"
108179107956
{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108180
-#line 2594 "parse.c"
108181107957
break;
108182107958
case 131: /* from ::= FROM seltablist */
108183
-#line 482 "parse.y"
108184107959
{
108185107960
yygotominor.yy259 = yymsp[0].minor.yy259;
108186107961
sqlite3SrcListShiftJoinType(yygotominor.yy259);
108187107962
}
108188
-#line 2602 "parse.c"
108189107963
break;
108190107964
case 132: /* stl_prefix ::= seltablist joinop */
108191
-#line 490 "parse.y"
108192107965
{
108193107966
yygotominor.yy259 = yymsp[-1].minor.yy259;
108194107967
if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108195107968
}
108196
-#line 2610 "parse.c"
108197107969
break;
108198107970
case 133: /* stl_prefix ::= */
108199
-#line 494 "parse.y"
108200107971
{yygotominor.yy259 = 0;}
108201
-#line 2615 "parse.c"
108202107972
break;
108203107973
case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108204
-#line 495 "parse.y"
108205107974
{
108206107975
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108207107976
sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108208107977
}
108209
-#line 2623 "parse.c"
108210107978
break;
108211107979
case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108212
-#line 501 "parse.y"
108213107980
{
108214107981
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108215107982
}
108216
-#line 2630 "parse.c"
108217107983
break;
108218107984
case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108219
-#line 505 "parse.y"
108220107985
{
108221107986
if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108222107987
yygotominor.yy259 = yymsp[-4].minor.yy259;
108223107988
}else{
108224107989
Select *pSubquery;
@@ -108225,260 +107990,180 @@
108225107990
sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108226107991
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108227107992
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108228107993
}
108229107994
}
108230
-#line 2644 "parse.c"
108231107995
break;
108232107996
case 137: /* dbnm ::= */
108233107997
case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108234
-#line 530 "parse.y"
108235107998
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108236
-#line 2650 "parse.c"
108237107999
break;
108238108000
case 139: /* fullname ::= nm dbnm */
108239
-#line 535 "parse.y"
108240108001
{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108241
-#line 2655 "parse.c"
108242108002
break;
108243108003
case 140: /* joinop ::= COMMA|JOIN */
108244
-#line 539 "parse.y"
108245108004
{ yygotominor.yy4 = JT_INNER; }
108246
-#line 2660 "parse.c"
108247108005
break;
108248108006
case 141: /* joinop ::= JOIN_KW JOIN */
108249
-#line 540 "parse.y"
108250108007
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108251
-#line 2665 "parse.c"
108252108008
break;
108253108009
case 142: /* joinop ::= JOIN_KW nm JOIN */
108254
-#line 541 "parse.y"
108255108010
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108256
-#line 2670 "parse.c"
108257108011
break;
108258108012
case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108259
-#line 543 "parse.y"
108260108013
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108261
-#line 2675 "parse.c"
108262108014
break;
108263108015
case 144: /* on_opt ::= ON expr */
108264108016
case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108265108017
case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108266108018
case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108267108019
case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108268108020
case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108269
-#line 547 "parse.y"
108270108021
{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108271
-#line 2685 "parse.c"
108272108022
break;
108273108023
case 145: /* on_opt ::= */
108274108024
case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108275108025
case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108276108026
case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108277108027
case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108278
-#line 548 "parse.y"
108279108028
{yygotominor.yy314 = 0;}
108280
-#line 2694 "parse.c"
108281108029
break;
108282108030
case 148: /* indexed_opt ::= NOT INDEXED */
108283
-#line 563 "parse.y"
108284108031
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108285
-#line 2699 "parse.c"
108286108032
break;
108287108033
case 149: /* using_opt ::= USING LP inscollist RP */
108288108034
case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108289
-#line 567 "parse.y"
108290108035
{yygotominor.yy384 = yymsp[-1].minor.yy384;}
108291
-#line 2705 "parse.c"
108292108036
break;
108293108037
case 150: /* using_opt ::= */
108294108038
case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108295
-#line 568 "parse.y"
108296108039
{yygotominor.yy384 = 0;}
108297
-#line 2711 "parse.c"
108298108040
break;
108299108041
case 152: /* orderby_opt ::= ORDER BY sortlist */
108300108042
case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108301108043
case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108302
-#line 579 "parse.y"
108303108044
{yygotominor.yy322 = yymsp[0].minor.yy322;}
108304
-#line 2718 "parse.c"
108305108045
break;
108306108046
case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108307
-#line 580 "parse.y"
108308108047
{
108309108048
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108310108049
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108311108050
}
108312
-#line 2726 "parse.c"
108313108051
break;
108314108052
case 154: /* sortlist ::= sortitem sortorder */
108315
-#line 584 "parse.y"
108316108053
{
108317108054
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108318108055
if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108319108056
}
108320
-#line 2734 "parse.c"
108321108057
break;
108322108058
case 156: /* sortorder ::= ASC */
108323108059
case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108324
-#line 592 "parse.y"
108325108060
{yygotominor.yy4 = SQLITE_SO_ASC;}
108326
-#line 2740 "parse.c"
108327108061
break;
108328108062
case 157: /* sortorder ::= DESC */
108329
-#line 593 "parse.y"
108330108063
{yygotominor.yy4 = SQLITE_SO_DESC;}
108331
-#line 2745 "parse.c"
108332108064
break;
108333108065
case 163: /* limit_opt ::= */
108334
-#line 619 "parse.y"
108335108066
{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108336
-#line 2750 "parse.c"
108337108067
break;
108338108068
case 164: /* limit_opt ::= LIMIT expr */
108339
-#line 620 "parse.y"
108340108069
{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108341
-#line 2755 "parse.c"
108342108070
break;
108343108071
case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108344
-#line 622 "parse.y"
108345108072
{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108346
-#line 2760 "parse.c"
108347108073
break;
108348108074
case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108349
-#line 624 "parse.y"
108350108075
{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108351
-#line 2765 "parse.c"
108352108076
break;
108353108077
case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108354
-#line 637 "parse.y"
108355108078
{
108356108079
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108357108080
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108358108081
}
108359
-#line 2773 "parse.c"
108360108082
break;
108361108083
case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108362
-#line 660 "parse.y"
108363108084
{
108364108085
sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108365108086
sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108366108087
sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108367108088
}
108368
-#line 2782 "parse.c"
108369108089
break;
108370108090
case 171: /* setlist ::= setlist COMMA nm EQ expr */
108371
-#line 670 "parse.y"
108372108091
{
108373108092
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108374108093
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108375108094
}
108376
-#line 2790 "parse.c"
108377108095
break;
108378108096
case 172: /* setlist ::= nm EQ expr */
108379
-#line 674 "parse.y"
108380108097
{
108381108098
yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108382108099
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108383108100
}
108384
-#line 2798 "parse.c"
108385108101
break;
108386108102
case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108387
-#line 683 "parse.y"
108388108103
{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108389
-#line 2803 "parse.c"
108390108104
break;
108391108105
case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108392
-#line 685 "parse.y"
108393108106
{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108394
-#line 2808 "parse.c"
108395108107
break;
108396108108
case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108397
-#line 687 "parse.y"
108398108109
{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108399
-#line 2813 "parse.c"
108400108110
break;
108401108111
case 176: /* insert_cmd ::= INSERT orconf */
108402
-#line 690 "parse.y"
108403108112
{yygotominor.yy210 = yymsp[0].minor.yy210;}
108404
-#line 2818 "parse.c"
108405108113
break;
108406108114
case 177: /* insert_cmd ::= REPLACE */
108407
-#line 691 "parse.y"
108408108115
{yygotominor.yy210 = OE_Replace;}
108409
-#line 2823 "parse.c"
108410108116
break;
108411108117
case 178: /* itemlist ::= itemlist COMMA expr */
108412108118
case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108413
-#line 698 "parse.y"
108414108119
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108415
-#line 2829 "parse.c"
108416108120
break;
108417108121
case 179: /* itemlist ::= expr */
108418108122
case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108419
-#line 700 "parse.y"
108420108123
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108421
-#line 2835 "parse.c"
108422108124
break;
108423108125
case 182: /* inscollist ::= inscollist COMMA nm */
108424
-#line 710 "parse.y"
108425108126
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108426
-#line 2840 "parse.c"
108427108127
break;
108428108128
case 183: /* inscollist ::= nm */
108429
-#line 712 "parse.y"
108430108129
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108431
-#line 2845 "parse.c"
108432108130
break;
108433108131
case 184: /* expr ::= term */
108434
-#line 743 "parse.y"
108435108132
{yygotominor.yy118 = yymsp[0].minor.yy118;}
108436
-#line 2850 "parse.c"
108437108133
break;
108438108134
case 185: /* expr ::= LP expr RP */
108439
-#line 744 "parse.y"
108440108135
{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108441
-#line 2855 "parse.c"
108442108136
break;
108443108137
case 186: /* term ::= NULL */
108444108138
case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108445108139
case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108446
-#line 745 "parse.y"
108447108140
{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108448
-#line 2862 "parse.c"
108449108141
break;
108450108142
case 187: /* expr ::= id */
108451108143
case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108452
-#line 746 "parse.y"
108453108144
{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108454
-#line 2868 "parse.c"
108455108145
break;
108456108146
case 189: /* expr ::= nm DOT nm */
108457
-#line 748 "parse.y"
108458108147
{
108459108148
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108460108149
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108461108150
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108462108151
spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108463108152
}
108464
-#line 2878 "parse.c"
108465108153
break;
108466108154
case 190: /* expr ::= nm DOT nm DOT nm */
108467
-#line 754 "parse.y"
108468108155
{
108469108156
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108470108157
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108471108158
Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108472108159
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108473108160
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108474108161
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108475108162
}
108476
-#line 2890 "parse.c"
108477108163
break;
108478108164
case 193: /* expr ::= REGISTER */
108479
-#line 764 "parse.y"
108480108165
{
108481108166
/* When doing a nested parse, one can include terms in an expression
108482108167
** that look like this: #1 #2 ... These terms refer to registers
108483108168
** in the virtual machine. #N is the N-th register. */
108484108169
if( pParse->nested==0 ){
@@ -108488,40 +108173,32 @@
108488108173
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108489108174
if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108490108175
}
108491108176
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108492108177
}
108493
-#line 2907 "parse.c"
108494108178
break;
108495108179
case 194: /* expr ::= VARIABLE */
108496
-#line 777 "parse.y"
108497108180
{
108498108181
spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108499108182
sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108500108183
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108501108184
}
108502
-#line 2916 "parse.c"
108503108185
break;
108504108186
case 195: /* expr ::= expr COLLATE ids */
108505
-#line 782 "parse.y"
108506108187
{
108507108188
yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108508108189
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108509108190
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108510108191
}
108511
-#line 2925 "parse.c"
108512108192
break;
108513108193
case 196: /* expr ::= CAST LP expr AS typetoken RP */
108514
-#line 788 "parse.y"
108515108194
{
108516108195
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108517108196
spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108518108197
}
108519
-#line 2933 "parse.c"
108520108198
break;
108521108199
case 197: /* expr ::= ID LP distinct exprlist RP */
108522
-#line 793 "parse.y"
108523108200
{
108524108201
if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108525108202
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108526108203
}
108527108204
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108205,47 @@
108528108205
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108529108206
if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108530108207
yygotominor.yy118.pExpr->flags |= EP_Distinct;
108531108208
}
108532108209
}
108533
-#line 2947 "parse.c"
108534108210
break;
108535108211
case 198: /* expr ::= ID LP STAR RP */
108536
-#line 803 "parse.y"
108537108212
{
108538108213
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108539108214
spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108540108215
}
108541
-#line 2955 "parse.c"
108542108216
break;
108543108217
case 199: /* term ::= CTIME_KW */
108544
-#line 807 "parse.y"
108545108218
{
108546108219
/* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108547108220
** treated as functions that return constants */
108548108221
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108549108222
if( yygotominor.yy118.pExpr ){
108550108223
yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108551108224
}
108552108225
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108553108226
}
108554
-#line 2968 "parse.c"
108555108227
break;
108556108228
case 200: /* expr ::= expr AND expr */
108557108229
case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108558108230
case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108559108231
case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108560108232
case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108561108233
case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108562108234
case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108563108235
case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108564
-#line 834 "parse.y"
108565108236
{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108566
-#line 2980 "parse.c"
108567108237
break;
108568108238
case 208: /* likeop ::= LIKE_KW */
108569108239
case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108570
-#line 847 "parse.y"
108571108240
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108572
-#line 2986 "parse.c"
108573108241
break;
108574108242
case 209: /* likeop ::= NOT LIKE_KW */
108575108243
case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108576
-#line 848 "parse.y"
108577108244
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108578
-#line 2992 "parse.c"
108579108245
break;
108580108246
case 212: /* expr ::= expr likeop expr */
108581
-#line 851 "parse.y"
108582108247
{
108583108248
ExprList *pList;
108584108249
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108585108250
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108586108251
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108252,12 @@
108587108252
if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108588108253
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108589108254
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108590108255
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108591108256
}
108592
-#line 3006 "parse.c"
108593108257
break;
108594108258
case 213: /* expr ::= expr likeop expr ESCAPE expr */
108595
-#line 861 "parse.y"
108596108259
{
108597108260
ExprList *pList;
108598108261
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108599108262
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108600108263
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108265,40 @@
108602108265
if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108603108266
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108604108267
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108605108268
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108606108269
}
108607
-#line 3021 "parse.c"
108608108270
break;
108609108271
case 214: /* expr ::= expr ISNULL|NOTNULL */
108610
-#line 889 "parse.y"
108611108272
{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
108612
-#line 3026 "parse.c"
108613108273
break;
108614108274
case 215: /* expr ::= expr NOT NULL */
108615
-#line 890 "parse.y"
108616108275
{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
108617
-#line 3031 "parse.c"
108618108276
break;
108619108277
case 216: /* expr ::= expr IS expr */
108620
-#line 911 "parse.y"
108621108278
{
108622108279
spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108623108280
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108624108281
}
108625
-#line 3039 "parse.c"
108626108282
break;
108627108283
case 217: /* expr ::= expr IS NOT expr */
108628
-#line 915 "parse.y"
108629108284
{
108630108285
spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108631108286
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108632108287
}
108633
-#line 3047 "parse.c"
108634108288
break;
108635108289
case 218: /* expr ::= NOT expr */
108636108290
case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
108637
-#line 938 "parse.y"
108638108291
{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108639
-#line 3053 "parse.c"
108640108292
break;
108641108293
case 220: /* expr ::= MINUS expr */
108642
-#line 941 "parse.y"
108643108294
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108644
-#line 3058 "parse.c"
108645108295
break;
108646108296
case 221: /* expr ::= PLUS expr */
108647
-#line 943 "parse.y"
108648108297
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108649
-#line 3063 "parse.c"
108650108298
break;
108651108299
case 224: /* expr ::= expr between_op expr AND expr */
108652
-#line 948 "parse.y"
108653108300
{
108654108301
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108655108302
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108656108303
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108657108304
if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108308,12 @@
108661108308
}
108662108309
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108663108310
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108664108311
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108665108312
}
108666
-#line 3080 "parse.c"
108667108313
break;
108668108314
case 227: /* expr ::= expr in_op LP exprlist RP */
108669
-#line 965 "parse.y"
108670108315
{
108671108316
if( yymsp[-1].minor.yy322==0 ){
108672108317
/* Expressions of the form
108673108318
**
108674108319
** expr1 IN ()
@@ -108690,14 +108335,12 @@
108690108335
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108691108336
}
108692108337
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108693108338
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108694108339
}
108695
-#line 3109 "parse.c"
108696108340
break;
108697108341
case 228: /* expr ::= LP select RP */
108698
-#line 990 "parse.y"
108699108342
{
108700108343
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108701108344
if( yygotominor.yy118.pExpr ){
108702108345
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108703108346
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108349,12 @@
108706108349
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108707108350
}
108708108351
yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108709108352
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108710108353
}
108711
-#line 3125 "parse.c"
108712108354
break;
108713108355
case 229: /* expr ::= expr in_op LP select RP */
108714
-#line 1002 "parse.y"
108715108356
{
108716108357
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108717108358
if( yygotominor.yy118.pExpr ){
108718108359
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108719108360
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108364,12 @@
108723108364
}
108724108365
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108725108366
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108726108367
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108727108368
}
108728
-#line 3142 "parse.c"
108729108369
break;
108730108370
case 230: /* expr ::= expr in_op nm dbnm */
108731
-#line 1015 "parse.y"
108732108371
{
108733108372
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108734108373
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108735108374
if( yygotominor.yy118.pExpr ){
108736108375
yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108380,12 @@
108741108380
}
108742108381
if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108743108382
yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108744108383
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108745108384
}
108746
-#line 3160 "parse.c"
108747108385
break;
108748108386
case 231: /* expr ::= EXISTS LP select RP */
108749
-#line 1029 "parse.y"
108750108387
{
108751108388
Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108752108389
if( p ){
108753108390
p->x.pSelect = yymsp[-1].minor.yy387;
108754108391
ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108394,12 @@
108757108394
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108758108395
}
108759108396
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108760108397
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108761108398
}
108762
-#line 3176 "parse.c"
108763108399
break;
108764108400
case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
108765
-#line 1044 "parse.y"
108766108401
{
108767108402
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108768108403
if( yygotominor.yy118.pExpr ){
108769108404
yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108770108405
sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108407,38 @@
108772108407
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108773108408
}
108774108409
yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108775108410
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108776108411
}
108777
-#line 3191 "parse.c"
108778108412
break;
108779108413
case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
108780
-#line 1057 "parse.y"
108781108414
{
108782108415
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108783108416
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108784108417
}
108785
-#line 3199 "parse.c"
108786108418
break;
108787108419
case 234: /* case_exprlist ::= WHEN expr THEN expr */
108788
-#line 1061 "parse.y"
108789108420
{
108790108421
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108791108422
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108792108423
}
108793
-#line 3207 "parse.c"
108794108424
break;
108795108425
case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
108796
-#line 1090 "parse.y"
108797108426
{
108798108427
sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108799108428
sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108800108429
&yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108801108430
}
108802
-#line 3216 "parse.c"
108803108431
break;
108804108432
case 244: /* uniqueflag ::= UNIQUE */
108805108433
case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
108806
-#line 1097 "parse.y"
108807108434
{yygotominor.yy4 = OE_Abort;}
108808
-#line 3222 "parse.c"
108809108435
break;
108810108436
case 245: /* uniqueflag ::= */
108811
-#line 1098 "parse.y"
108812108437
{yygotominor.yy4 = OE_None;}
108813
-#line 3227 "parse.c"
108814108438
break;
108815108439
case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
108816
-#line 1107 "parse.y"
108817108440
{
108818108441
Expr *p = 0;
108819108442
if( yymsp[-1].minor.yy0.n>0 ){
108820108443
p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108821108444
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108446,12 @@
108823108446
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108824108447
sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108825108448
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108826108449
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108827108450
}
108828
-#line 3242 "parse.c"
108829108451
break;
108830108452
case 249: /* idxlist ::= nm collate sortorder */
108831
-#line 1118 "parse.y"
108832108453
{
108833108454
Expr *p = 0;
108834108455
if( yymsp[-1].minor.yy0.n>0 ){
108835108456
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108836108457
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108459,214 @@
108838108459
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108839108460
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108840108461
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108841108462
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108842108463
}
108843
-#line 3257 "parse.c"
108844108464
break;
108845108465
case 250: /* collate ::= */
108846
-#line 1131 "parse.y"
108847108466
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
108848
-#line 3262 "parse.c"
108849108467
break;
108850108468
case 252: /* cmd ::= DROP INDEX ifexists fullname */
108851
-#line 1137 "parse.y"
108852108469
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
108853
-#line 3267 "parse.c"
108854108470
break;
108855108471
case 253: /* cmd ::= VACUUM */
108856108472
case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
108857
-#line 1143 "parse.y"
108858108473
{sqlite3Vacuum(pParse);}
108859
-#line 3273 "parse.c"
108860108474
break;
108861108475
case 255: /* cmd ::= PRAGMA nm dbnm */
108862
-#line 1151 "parse.y"
108863108476
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
108864
-#line 3278 "parse.c"
108865108477
break;
108866108478
case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
108867
-#line 1152 "parse.y"
108868108479
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
108869
-#line 3283 "parse.c"
108870108480
break;
108871108481
case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
108872
-#line 1153 "parse.y"
108873108482
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
108874
-#line 3288 "parse.c"
108875108483
break;
108876108484
case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
108877
-#line 1155 "parse.y"
108878108485
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
108879
-#line 3293 "parse.c"
108880108486
break;
108881108487
case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
108882
-#line 1157 "parse.y"
108883108488
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
108884
-#line 3298 "parse.c"
108885108489
break;
108886108490
case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
108887
-#line 1175 "parse.y"
108888108491
{
108889108492
Token all;
108890108493
all.z = yymsp[-3].minor.yy0.z;
108891108494
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108892108495
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108893108496
}
108894
-#line 3308 "parse.c"
108895108497
break;
108896108498
case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
108897
-#line 1184 "parse.y"
108898108499
{
108899108500
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108900108501
yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108901108502
}
108902
-#line 3316 "parse.c"
108903108503
break;
108904108504
case 272: /* trigger_time ::= BEFORE */
108905108505
case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
108906
-#line 1190 "parse.y"
108907108506
{ yygotominor.yy4 = TK_BEFORE; }
108908
-#line 3322 "parse.c"
108909108507
break;
108910108508
case 273: /* trigger_time ::= AFTER */
108911
-#line 1191 "parse.y"
108912108509
{ yygotominor.yy4 = TK_AFTER; }
108913
-#line 3327 "parse.c"
108914108510
break;
108915108511
case 274: /* trigger_time ::= INSTEAD OF */
108916
-#line 1192 "parse.y"
108917108512
{ yygotominor.yy4 = TK_INSTEAD;}
108918
-#line 3332 "parse.c"
108919108513
break;
108920108514
case 276: /* trigger_event ::= DELETE|INSERT */
108921108515
case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
108922
-#line 1197 "parse.y"
108923108516
{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
108924
-#line 3338 "parse.c"
108925108517
break;
108926108518
case 278: /* trigger_event ::= UPDATE OF inscollist */
108927
-#line 1199 "parse.y"
108928108519
{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
108929
-#line 3343 "parse.c"
108930108520
break;
108931108521
case 281: /* when_clause ::= */
108932108522
case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
108933
-#line 1206 "parse.y"
108934108523
{ yygotominor.yy314 = 0; }
108935
-#line 3349 "parse.c"
108936108524
break;
108937108525
case 282: /* when_clause ::= WHEN expr */
108938108526
case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
108939
-#line 1207 "parse.y"
108940108527
{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
108941
-#line 3355 "parse.c"
108942108528
break;
108943108529
case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
108944
-#line 1211 "parse.y"
108945108530
{
108946108531
assert( yymsp[-2].minor.yy203!=0 );
108947108532
yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108948108533
yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108949108534
yygotominor.yy203 = yymsp[-2].minor.yy203;
108950108535
}
108951
-#line 3365 "parse.c"
108952108536
break;
108953108537
case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
108954
-#line 1217 "parse.y"
108955108538
{
108956108539
assert( yymsp[-1].minor.yy203!=0 );
108957108540
yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108958108541
yygotominor.yy203 = yymsp[-1].minor.yy203;
108959108542
}
108960
-#line 3374 "parse.c"
108961108543
break;
108962108544
case 286: /* trnm ::= nm DOT nm */
108963
-#line 1229 "parse.y"
108964108545
{
108965108546
yygotominor.yy0 = yymsp[0].minor.yy0;
108966108547
sqlite3ErrorMsg(pParse,
108967108548
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108968108549
"statements within triggers");
108969108550
}
108970
-#line 3384 "parse.c"
108971108551
break;
108972108552
case 288: /* tridxby ::= INDEXED BY nm */
108973
-#line 1241 "parse.y"
108974108553
{
108975108554
sqlite3ErrorMsg(pParse,
108976108555
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108977108556
"within triggers");
108978108557
}
108979
-#line 3393 "parse.c"
108980108558
break;
108981108559
case 289: /* tridxby ::= NOT INDEXED */
108982
-#line 1246 "parse.y"
108983108560
{
108984108561
sqlite3ErrorMsg(pParse,
108985108562
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108986108563
"within triggers");
108987108564
}
108988
-#line 3402 "parse.c"
108989108565
break;
108990108566
case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
108991
-#line 1259 "parse.y"
108992108567
{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
108993
-#line 3407 "parse.c"
108994108568
break;
108995108569
case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
108996
-#line 1264 "parse.y"
108997108570
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
108998
-#line 3412 "parse.c"
108999108571
break;
109000108572
case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109001
-#line 1267 "parse.y"
109002108573
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109003
-#line 3417 "parse.c"
109004108574
break;
109005108575
case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109006
-#line 1271 "parse.y"
109007108576
{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109008
-#line 3422 "parse.c"
109009108577
break;
109010108578
case 294: /* trigger_cmd ::= select */
109011
-#line 1274 "parse.y"
109012108579
{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109013
-#line 3427 "parse.c"
109014108580
break;
109015108581
case 295: /* expr ::= RAISE LP IGNORE RP */
109016
-#line 1277 "parse.y"
109017108582
{
109018108583
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109019108584
if( yygotominor.yy118.pExpr ){
109020108585
yygotominor.yy118.pExpr->affinity = OE_Ignore;
109021108586
}
109022108587
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109023108588
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109024108589
}
109025
-#line 3439 "parse.c"
109026108590
break;
109027108591
case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109028
-#line 1285 "parse.y"
109029108592
{
109030108593
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109031108594
if( yygotominor.yy118.pExpr ) {
109032108595
yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109033108596
}
109034108597
yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109035108598
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109036108599
}
109037
-#line 3451 "parse.c"
109038108600
break;
109039108601
case 297: /* raisetype ::= ROLLBACK */
109040
-#line 1296 "parse.y"
109041108602
{yygotominor.yy4 = OE_Rollback;}
109042
-#line 3456 "parse.c"
109043108603
break;
109044108604
case 299: /* raisetype ::= FAIL */
109045
-#line 1298 "parse.y"
109046108605
{yygotominor.yy4 = OE_Fail;}
109047
-#line 3461 "parse.c"
109048108606
break;
109049108607
case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109050
-#line 1303 "parse.y"
109051108608
{
109052108609
sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109053108610
}
109054
-#line 3468 "parse.c"
109055108611
break;
109056108612
case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109057
-#line 1310 "parse.y"
109058108613
{
109059108614
sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109060108615
}
109061
-#line 3475 "parse.c"
109062108616
break;
109063108617
case 302: /* cmd ::= DETACH database_kw_opt expr */
109064
-#line 1313 "parse.y"
109065108618
{
109066108619
sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109067108620
}
109068
-#line 3482 "parse.c"
109069108621
break;
109070108622
case 307: /* cmd ::= REINDEX */
109071
-#line 1328 "parse.y"
109072108623
{sqlite3Reindex(pParse, 0, 0);}
109073
-#line 3487 "parse.c"
109074108624
break;
109075108625
case 308: /* cmd ::= REINDEX nm dbnm */
109076
-#line 1329 "parse.y"
109077108626
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109078
-#line 3492 "parse.c"
109079108627
break;
109080108628
case 309: /* cmd ::= ANALYZE */
109081
-#line 1334 "parse.y"
109082108629
{sqlite3Analyze(pParse, 0, 0);}
109083
-#line 3497 "parse.c"
109084108630
break;
109085108631
case 310: /* cmd ::= ANALYZE nm dbnm */
109086
-#line 1335 "parse.y"
109087108632
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109088
-#line 3502 "parse.c"
109089108633
break;
109090108634
case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109091
-#line 1340 "parse.y"
109092108635
{
109093108636
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109094108637
}
109095
-#line 3509 "parse.c"
109096108638
break;
109097108639
case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109098
-#line 1343 "parse.y"
109099108640
{
109100108641
sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109101108642
}
109102
-#line 3516 "parse.c"
109103108643
break;
109104108644
case 313: /* add_column_fullname ::= fullname */
109105
-#line 1346 "parse.y"
109106108645
{
109107108646
pParse->db->lookaside.bEnabled = 0;
109108108647
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109109108648
}
109110
-#line 3524 "parse.c"
109111108649
break;
109112108650
case 316: /* cmd ::= create_vtab */
109113
-#line 1356 "parse.y"
109114108651
{sqlite3VtabFinishParse(pParse,0);}
109115
-#line 3529 "parse.c"
109116108652
break;
109117108653
case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109118
-#line 1357 "parse.y"
109119108654
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109120
-#line 3534 "parse.c"
109121108655
break;
109122108656
case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109123
-#line 1358 "parse.y"
109124108657
{
109125108658
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109126108659
}
109127
-#line 3541 "parse.c"
109128108660
break;
109129108661
case 321: /* vtabarg ::= */
109130
-#line 1363 "parse.y"
109131108662
{sqlite3VtabArgInit(pParse);}
109132
-#line 3546 "parse.c"
109133108663
break;
109134108664
case 323: /* vtabargtoken ::= ANY */
109135108665
case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109136108666
case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109137
-#line 1365 "parse.y"
109138108667
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109139
-#line 3553 "parse.c"
109140108668
break;
109141108669
default:
109142108670
/* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109143108671
/* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109144108672
/* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108764,15 @@
109236108764
int yymajor, /* The major type of the error token */
109237108765
YYMINORTYPE yyminor /* The minor type of the error token */
109238108766
){
109239108767
sqlite3ParserARG_FETCH;
109240108768
#define TOKEN (yyminor.yy0)
109241
-#line 32 "parse.y"
109242108769
109243108770
UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109244108771
assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109245108772
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109246108773
pParse->parseError = 1;
109247
-#line 3661 "parse.c"
109248108774
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109249108775
}
109250108776
109251108777
/*
109252108778
** The following is executed when the parser accepts
@@ -109436,11 +108962,10 @@
109436108962
return;
109437108963
}
109438108964
109439108965
/************** End of parse.c ***********************************************/
109440108966
/************** Begin file tokenize.c ****************************************/
109441
-#line 1 "tsrc/tokenize.c"
109442108967
/*
109443108968
** 2001 September 15
109444108969
**
109445108970
** The author disclaims copyright to this source code. In place of
109446108971
** a legal notice, here is a blessing:
@@ -109502,11 +109027,10 @@
109502109027
** named keywordhash.h and then included into this source file by
109503109028
** the #include below.
109504109029
*/
109505109030
/************** Include keywordhash.h in the middle of tokenize.c ************/
109506109031
/************** Begin file keywordhash.h *************************************/
109507
-#line 1 "tsrc/keywordhash.h"
109508109032
/***** This file contains automatically generated code ******
109509109033
**
109510109034
** The code in this file has been automatically generated by
109511109035
**
109512109036
** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109300,10 @@
109776109300
}
109777109301
#define SQLITE_N_KEYWORD 121
109778109302
109779109303
/************** End of keywordhash.h *****************************************/
109780109304
/************** Continuing where we left off in tokenize.c *******************/
109781
-#line 66 "tsrc/tokenize.c"
109782109305
109783109306
109784109307
/*
109785109308
** If X is a character that can be used in an identifier then
109786109309
** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109764,10 @@
110241109764
return nErr;
110242109765
}
110243109766
110244109767
/************** End of tokenize.c ********************************************/
110245109768
/************** Begin file complete.c ****************************************/
110246
-#line 1 "tsrc/complete.c"
110247109769
/*
110248109770
** 2001 September 15
110249109771
**
110250109772
** The author disclaims copyright to this source code. In place of
110251109773
** a legal notice, here is a blessing:
@@ -110527,11 +110049,10 @@
110527110049
#endif /* SQLITE_OMIT_UTF16 */
110528110050
#endif /* SQLITE_OMIT_COMPLETE */
110529110051
110530110052
/************** End of complete.c ********************************************/
110531110053
/************** Begin file main.c ********************************************/
110532
-#line 1 "tsrc/main.c"
110533110054
/*
110534110055
** 2001 September 15
110535110056
**
110536110057
** The author disclaims copyright to this source code. In place of
110537110058
** a legal notice, here is a blessing:
@@ -110548,11 +110069,10 @@
110548110069
*/
110549110070
110550110071
#ifdef SQLITE_ENABLE_FTS3
110551110072
/************** Include fts3.h in the middle of main.c ***********************/
110552110073
/************** Begin file fts3.h ********************************************/
110553
-#line 1 "tsrc/fts3.h"
110554110074
/*
110555110075
** 2006 Oct 10
110556110076
**
110557110077
** The author disclaims copyright to this source code. In place of
110558110078
** a legal notice, here is a blessing:
@@ -110577,16 +110097,14 @@
110577110097
} /* extern "C" */
110578110098
#endif /* __cplusplus */
110579110099
110580110100
/************** End of fts3.h ************************************************/
110581110101
/************** Continuing where we left off in main.c ***********************/
110582
-#line 21 "tsrc/main.c"
110583110102
#endif
110584110103
#ifdef SQLITE_ENABLE_RTREE
110585110104
/************** Include rtree.h in the middle of main.c **********************/
110586110105
/************** Begin file rtree.h *******************************************/
110587
-#line 1 "tsrc/rtree.h"
110588110106
/*
110589110107
** 2008 May 26
110590110108
**
110591110109
** The author disclaims copyright to this source code. In place of
110592110110
** a legal notice, here is a blessing:
@@ -110611,16 +110129,14 @@
110611110129
} /* extern "C" */
110612110130
#endif /* __cplusplus */
110613110131
110614110132
/************** End of rtree.h ***********************************************/
110615110133
/************** Continuing where we left off in main.c ***********************/
110616
-#line 24 "tsrc/main.c"
110617110134
#endif
110618110135
#ifdef SQLITE_ENABLE_ICU
110619110136
/************** Include sqliteicu.h in the middle of main.c ******************/
110620110137
/************** Begin file sqliteicu.h ***************************************/
110621
-#line 1 "tsrc/sqliteicu.h"
110622110138
/*
110623110139
** 2008 May 26
110624110140
**
110625110141
** The author disclaims copyright to this source code. In place of
110626110142
** a legal notice, here is a blessing:
@@ -110646,11 +110162,10 @@
110646110162
#endif /* __cplusplus */
110647110163
110648110164
110649110165
/************** End of sqliteicu.h *******************************************/
110650110166
/************** Continuing where we left off in main.c ***********************/
110651
-#line 27 "tsrc/main.c"
110652110167
#endif
110653110168
110654110169
#ifndef SQLITE_AMALGAMATION
110655110170
/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110656110171
** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113092,10 @@
113577113092
return 0;
113578113093
}
113579113094
113580113095
/************** End of main.c ************************************************/
113581113096
/************** Begin file notify.c ******************************************/
113582
-#line 1 "tsrc/notify.c"
113583113097
/*
113584113098
** 2009 March 3
113585113099
**
113586113100
** The author disclaims copyright to this source code. In place of
113587113101
** a legal notice, here is a blessing:
@@ -113911,11 +113425,10 @@
113911113425
}
113912113426
#endif
113913113427
113914113428
/************** End of notify.c **********************************************/
113915113429
/************** Begin file fts3.c ********************************************/
113916
-#line 1 "tsrc/fts3.c"
113917113430
/*
113918113431
** 2006 Oct 10
113919113432
**
113920113433
** The author disclaims copyright to this source code. In place of
113921113434
** a legal notice, here is a blessing:
@@ -114208,11 +113721,10 @@
114208113721
** into a single segment.
114209113722
*/
114210113723
114211113724
/************** Include fts3Int.h in the middle of fts3.c ********************/
114212113725
/************** Begin file fts3Int.h *****************************************/
114213
-#line 1 "tsrc/fts3Int.h"
114214113726
/*
114215113727
** 2009 Nov 12
114216113728
**
114217113729
** The author disclaims copyright to this source code. In place of
114218113730
** a legal notice, here is a blessing:
@@ -114247,11 +113759,10 @@
114247113759
SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114248113760
#endif
114249113761
114250113762
/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114251113763
/************** Begin file fts3_tokenizer.h **********************************/
114252
-#line 1 "tsrc/fts3_tokenizer.h"
114253113764
/*
114254113765
** 2006 July 10
114255113766
**
114256113767
** The author disclaims copyright to this source code.
114257113768
**
@@ -114402,14 +113913,12 @@
114402113913
114403113914
#endif /* _FTS3_TOKENIZER_H_ */
114404113915
114405113916
/************** End of fts3_tokenizer.h **************************************/
114406113917
/************** Continuing where we left off in fts3Int.h ********************/
114407
-#line 40 "tsrc/fts3Int.h"
114408113918
/************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114409113919
/************** Begin file fts3_hash.h ***************************************/
114410
-#line 1 "tsrc/fts3_hash.h"
114411113920
/*
114412113921
** 2001 September 22
114413113922
**
114414113923
** The author disclaims copyright to this source code. In place of
114415113924
** a legal notice, here is a blessing:
@@ -114521,11 +114030,10 @@
114521114030
114522114031
#endif /* _FTS3_HASH_H_ */
114523114032
114524114033
/************** End of fts3_hash.h *******************************************/
114525114034
/************** Continuing where we left off in fts3Int.h ********************/
114526
-#line 41 "tsrc/fts3Int.h"
114527114035
114528114036
/*
114529114037
** This constant controls how often segments are merged. Once there are
114530114038
** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114531114039
** segment of level N+1.
@@ -114998,11 +114506,10 @@
114998114506
#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114999114507
#endif /* _FTSINT_H */
115000114508
115001114509
/************** End of fts3Int.h *********************************************/
115002114510
/************** Continuing where we left off in fts3.c ***********************/
115003
-#line 296 "tsrc/fts3.c"
115004114511
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115005114512
115006114513
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115007114514
# define SQLITE_CORE 1
115008114515
#endif
@@ -119548,11 +119055,10 @@
119548119055
119549119056
#endif
119550119057
119551119058
/************** End of fts3.c ************************************************/
119552119059
/************** Begin file fts3_aux.c ****************************************/
119553
-#line 1 "tsrc/fts3_aux.c"
119554119060
/*
119555119061
** 2011 Jan 27
119556119062
**
119557119063
** The author disclaims copyright to this source code. In place of
119558119064
** a legal notice, here is a blessing:
@@ -120025,11 +119531,10 @@
120025119531
120026119532
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120027119533
120028119534
/************** End of fts3_aux.c ********************************************/
120029119535
/************** Begin file fts3_expr.c ***************************************/
120030
-#line 1 "tsrc/fts3_expr.c"
120031119536
/*
120032119537
** 2008 Nov 28
120033119538
**
120034119539
** The author disclaims copyright to this source code. In place of
120035119540
** a legal notice, here is a blessing:
@@ -120992,11 +120497,10 @@
120992120497
#endif
120993120498
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120994120499
120995120500
/************** End of fts3_expr.c *******************************************/
120996120501
/************** Begin file fts3_hash.c ***************************************/
120997
-#line 1 "tsrc/fts3_hash.c"
120998120502
/*
120999120503
** 2001 September 22
121000120504
**
121001120505
** The author disclaims copyright to this source code. In place of
121002120506
** a legal notice, here is a blessing:
@@ -121377,11 +120881,10 @@
121377120881
121378120882
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121379120883
121380120884
/************** End of fts3_hash.c *******************************************/
121381120885
/************** Begin file fts3_porter.c *************************************/
121382
-#line 1 "tsrc/fts3_porter.c"
121383120886
/*
121384120887
** 2006 September 30
121385120888
**
121386120889
** The author disclaims copyright to this source code. In place of
121387120890
** a legal notice, here is a blessing:
@@ -122024,11 +121527,10 @@
122024121527
122025121528
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122026121529
122027121530
/************** End of fts3_porter.c *****************************************/
122028121531
/************** Begin file fts3_tokenizer.c **********************************/
122029
-#line 1 "tsrc/fts3_tokenizer.c"
122030121532
/*
122031121533
** 2007 June 22
122032121534
**
122033121535
** The author disclaims copyright to this source code. In place of
122034121536
** a legal notice, here is a blessing:
@@ -122516,11 +122018,10 @@
122516122018
122517122019
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122518122020
122519122021
/************** End of fts3_tokenizer.c **************************************/
122520122022
/************** Begin file fts3_tokenizer1.c *********************************/
122521
-#line 1 "tsrc/fts3_tokenizer1.c"
122522122023
/*
122523122024
** 2006 Oct 10
122524122025
**
122525122026
** The author disclaims copyright to this source code. In place of
122526122027
** a legal notice, here is a blessing:
@@ -122751,11 +122252,10 @@
122751122252
122752122253
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122753122254
122754122255
/************** End of fts3_tokenizer1.c *************************************/
122755122256
/************** Begin file fts3_write.c **************************************/
122756
-#line 1 "tsrc/fts3_write.c"
122757122257
/*
122758122258
** 2009 Oct 23
122759122259
**
122760122260
** The author disclaims copyright to this source code. In place of
122761122261
** a legal notice, here is a blessing:
@@ -126022,11 +125522,10 @@
126022125522
126023125523
#endif
126024125524
126025125525
/************** End of fts3_write.c ******************************************/
126026125526
/************** Begin file fts3_snippet.c ************************************/
126027
-#line 1 "tsrc/fts3_snippet.c"
126028125527
/*
126029125528
** 2009 Oct 23
126030125529
**
126031125530
** The author disclaims copyright to this source code. In place of
126032125531
** a legal notice, here is a blessing:
@@ -127524,11 +127023,10 @@
127524127023
127525127024
#endif
127526127025
127527127026
/************** End of fts3_snippet.c ****************************************/
127528127027
/************** Begin file rtree.c *******************************************/
127529
-#line 1 "tsrc/rtree.c"
127530127028
/*
127531127029
** 2001 September 15
127532127030
**
127533127031
** The author disclaims copyright to this source code. In place of
127534127032
** a legal notice, here is a blessing:
@@ -130806,11 +130304,10 @@
130806130304
130807130305
#endif
130808130306
130809130307
/************** End of rtree.c ***********************************************/
130810130308
/************** Begin file icu.c *********************************************/
130811
-#line 1 "tsrc/icu.c"
130812130309
/*
130813130310
** 2007 May 6
130814130311
**
130815130312
** The author disclaims copyright to this source code. In place of
130816130313
** a legal notice, here is a blessing:
@@ -131309,11 +130806,10 @@
131309130806
131310130807
#endif
131311130808
131312130809
/************** End of icu.c *************************************************/
131313130810
/************** Begin file fts3_icu.c ****************************************/
131314
-#line 1 "tsrc/fts3_icu.c"
131315130811
/*
131316130812
** 2007 June 22
131317130813
**
131318130814
** The author disclaims copyright to this source code. In place of
131319130815
** a legal notice, here is a blessing:
131320130816
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
29 #line 1 "tsrc/sqliteInt.h"
30 /*
31 ** 2001 September 15
32 **
33 ** The author disclaims copyright to this source code. In place of
34 ** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
79 #include "config.h"
80 #endif
81
82 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
83 /************** Begin file sqliteLimit.h *************************************/
84 #line 1 "tsrc/sqliteLimit.h"
85 /*
86 ** 2007 May 7
87 **
88 ** The author disclaims copyright to this source code. In place of
89 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291 # define SQLITE_MAX_TRIGGER_DEPTH 1000
292 #endif
293
294 /************** End of sqliteLimit.h *****************************************/
295 /************** Continuing where we left off in sqliteInt.h ******************/
296 #line 54 "tsrc/sqliteInt.h"
297
298 /* Disable nuisance warnings on Borland compilers */
299 #if defined(__BORLANDC__)
300 #pragma warn -rch /* unreachable code */
301 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548 # define unlikely(X) !!(X)
549 #endif
550
551 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552 /************** Begin file sqlite3.h *****************************************/
553 #line 1 "tsrc/sqlite3.h"
554 /*
555 ** 2001 September 15
556 **
557 ** The author disclaims copyright to this source code. In place of
558 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661 ** [sqlite_version()] and [sqlite_source_id()].
662 */
663 #define SQLITE_VERSION "3.7.8"
664 #define SQLITE_VERSION_NUMBER 3007008
665 #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
666
667 /*
668 ** CAPI3REF: Run-Time Library Version Numbers
669 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
670 **
@@ -7309,14 +7305,12 @@
7309 #endif /* ifndef _SQLITE3RTREE_H_ */
7310
7311
7312 /************** End of sqlite3.h *********************************************/
7313 /************** Continuing where we left off in sqliteInt.h ******************/
7314 #line 309 "tsrc/sqliteInt.h"
7315 /************** Include hash.h in the middle of sqliteInt.h ******************/
7316 /************** Begin file hash.h ********************************************/
7317 #line 1 "tsrc/hash.h"
7318 /*
7319 ** 2001 September 22
7320 **
7321 ** The author disclaims copyright to this source code. In place of
7322 ** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
7412
7413 #endif /* _SQLITE_HASH_H_ */
7414
7415 /************** End of hash.h ************************************************/
7416 /************** Continuing where we left off in sqliteInt.h ******************/
7417 #line 310 "tsrc/sqliteInt.h"
7418 /************** Include parse.h in the middle of sqliteInt.h *****************/
7419 /************** Begin file parse.h *******************************************/
7420 #line 1 "tsrc/parse.h"
7421 #define TK_SEMI 1
7422 #define TK_EXPLAIN 2
7423 #define TK_QUERY 3
7424 #define TK_PLAN 4
7425 #define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
7576 #define TK_UMINUS 156
7577 #define TK_UPLUS 157
7578
7579 /************** End of parse.h ***********************************************/
7580 /************** Continuing where we left off in sqliteInt.h ******************/
7581 #line 311 "tsrc/sqliteInt.h"
7582 #include <stdio.h>
7583 #include <stdlib.h>
7584 #include <string.h>
7585 #include <assert.h>
7586 #include <stddef.h>
@@ -7920,11 +7911,10 @@
7920 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7921 ** pointer types (i.e. FuncDef) defined above.
7922 */
7923 /************** Include btree.h in the middle of sqliteInt.h *****************/
7924 /************** Begin file btree.h *******************************************/
7925 #line 1 "tsrc/btree.h"
7926 /*
7927 ** 2001 September 15
7928 **
7929 ** The author disclaims copyright to this source code. In place of
7930 ** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
8165
8166 #endif /* _BTREE_H_ */
8167
8168 /************** End of btree.h ***********************************************/
8169 /************** Continuing where we left off in sqliteInt.h ******************/
8170 #line 653 "tsrc/sqliteInt.h"
8171 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8172 /************** Begin file vdbe.h ********************************************/
8173 #line 1 "tsrc/vdbe.h"
8174 /*
8175 ** 2001 September 15
8176 **
8177 ** The author disclaims copyright to this source code. In place of
8178 ** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
8333 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8334 ** header file that defines a number for each opcode used by the VDBE.
8335 */
8336 /************** Include opcodes.h in the middle of vdbe.h ********************/
8337 /************** Begin file opcodes.h *****************************************/
8338 #line 1 "tsrc/opcodes.h"
8339 /* Automatically generated. Do not edit */
8340 /* See the mkopcodeh.awk script for details */
8341 #define OP_Goto 1
8342 #define OP_Gosub 2
8343 #define OP_Return 3
@@ -8387,108 +8374,109 @@
8387 #define OP_Jump 25
8388 #define OP_And 69 /* same as TK_AND */
8389 #define OP_Or 68 /* same as TK_OR */
8390 #define OP_Not 19 /* same as TK_NOT */
8391 #define OP_BitNot 93 /* same as TK_BITNOT */
8392 #define OP_If 26
8393 #define OP_IfNot 27
 
8394 #define OP_IsNull 73 /* same as TK_ISNULL */
8395 #define OP_NotNull 74 /* same as TK_NOTNULL */
8396 #define OP_Column 28
8397 #define OP_Affinity 29
8398 #define OP_MakeRecord 30
8399 #define OP_Count 31
8400 #define OP_Savepoint 32
8401 #define OP_AutoCommit 33
8402 #define OP_Transaction 34
8403 #define OP_ReadCookie 35
8404 #define OP_SetCookie 36
8405 #define OP_VerifyCookie 37
8406 #define OP_OpenRead 38
8407 #define OP_OpenWrite 39
8408 #define OP_OpenAutoindex 40
8409 #define OP_OpenEphemeral 41
8410 #define OP_SorterOpen 42
8411 #define OP_OpenPseudo 43
8412 #define OP_Close 44
8413 #define OP_SeekLt 45
8414 #define OP_SeekLe 46
8415 #define OP_SeekGe 47
8416 #define OP_SeekGt 48
8417 #define OP_Seek 49
8418 #define OP_NotFound 50
8419 #define OP_Found 51
8420 #define OP_IsUnique 52
8421 #define OP_NotExists 53
8422 #define OP_Sequence 54
8423 #define OP_NewRowid 55
8424 #define OP_Insert 56
8425 #define OP_InsertInt 57
8426 #define OP_Delete 58
8427 #define OP_ResetCount 59
8428 #define OP_SorterCompare 60
8429 #define OP_SorterData 61
8430 #define OP_RowKey 62
8431 #define OP_RowData 63
8432 #define OP_Rowid 64
8433 #define OP_NullRow 65
8434 #define OP_Last 66
8435 #define OP_SorterSort 67
8436 #define OP_Sort 70
8437 #define OP_Rewind 71
8438 #define OP_SorterNext 72
8439 #define OP_Prev 81
8440 #define OP_Next 92
8441 #define OP_SorterInsert 95
8442 #define OP_IdxInsert 96
8443 #define OP_IdxDelete 97
8444 #define OP_IdxRowid 98
8445 #define OP_IdxLT 99
8446 #define OP_IdxGE 100
8447 #define OP_Destroy 101
8448 #define OP_Clear 102
8449 #define OP_CreateIndex 103
8450 #define OP_CreateTable 104
8451 #define OP_ParseSchema 105
8452 #define OP_LoadAnalysis 106
8453 #define OP_DropTable 107
8454 #define OP_DropIndex 108
8455 #define OP_DropTrigger 109
8456 #define OP_IntegrityCk 110
8457 #define OP_RowSetAdd 111
8458 #define OP_RowSetRead 112
8459 #define OP_RowSetTest 113
8460 #define OP_Program 114
8461 #define OP_Param 115
8462 #define OP_FkCounter 116
8463 #define OP_FkIfZero 117
8464 #define OP_MemMax 118
8465 #define OP_IfPos 119
8466 #define OP_IfNeg 120
8467 #define OP_IfZero 121
8468 #define OP_AggStep 122
8469 #define OP_AggFinal 123
8470 #define OP_Checkpoint 124
8471 #define OP_JournalMode 125
8472 #define OP_Vacuum 126
8473 #define OP_IncrVacuum 127
8474 #define OP_Expire 128
8475 #define OP_TableLock 129
8476 #define OP_VBegin 131
8477 #define OP_VCreate 132
8478 #define OP_VDestroy 133
8479 #define OP_VOpen 134
8480 #define OP_VFilter 135
8481 #define OP_VColumn 136
8482 #define OP_VNext 137
8483 #define OP_VRename 138
8484 #define OP_VUpdate 139
8485 #define OP_Pagecount 140
8486 #define OP_MaxPgcnt 146
8487 #define OP_Trace 147
8488 #define OP_Noop 148
8489 #define OP_Explain 149
8490
8491
8492 /* Properties such as "out2" or "jump" that are specified in
8493 ** comments following the "case" for each opcode in the vdbe.c
8494 ** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
8502 #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
8503 #define OPFLG_INITIALIZER {\
8504 /* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
8505 /* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
8506 /* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8507 /* 24 */ 0x00, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\
8508 /* 32 */ 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00,\
8509 /* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,\
8510 /* 48 */ 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02, 0x02,\
8511 /* 56 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8512 /* 64 */ 0x02, 0x00, 0x01, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8513 /* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8514 /* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8515 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x08,\
8516 /* 96 */ 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00, 0x02,\
8517 /* 104 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,\
8518 /* 112 */ 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08, 0x05,\
8519 /* 120 */ 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01,\
8520 /* 128 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01,\
8521 /* 136 */ 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04,\
8522 /* 144 */ 0x04, 0x04, 0x02, 0x00, 0x00, 0x00,}
8523
8524 /************** End of opcodes.h *********************************************/
8525 /************** Continuing where we left off in vdbe.h ***********************/
8526 #line 164 "tsrc/vdbe.h"
8527
8528 /*
8529 ** Prototypes for the VDBE interface. See comments on the implementation
8530 ** for a description of what each of these routines does.
8531 */
@@ -8541,11 +8528,11 @@
8541 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
8542 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
8543 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
8544 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
8545 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8546 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
8547 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
8548 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
8549 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
8550 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
8551 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
8596
8597 #endif
8598
8599 /************** End of vdbe.h ************************************************/
8600 /************** Continuing where we left off in sqliteInt.h ******************/
8601 #line 654 "tsrc/sqliteInt.h"
8602 /************** Include pager.h in the middle of sqliteInt.h *****************/
8603 /************** Begin file pager.h *******************************************/
8604 #line 1 "tsrc/pager.h"
8605 /*
8606 ** 2001 September 15
8607 **
8608 ** The author disclaims copyright to this source code. In place of
8609 ** a legal notice, here is a blessing:
@@ -8662,11 +8647,10 @@
8662 ** NOTE: These values must match the corresponding BTREE_ values in btree.h.
8663 */
8664 #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
8665 #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
8666 #define PAGER_MEMORY 0x0004 /* In-memory database */
8667 #define PAGER_SORTER 0x0020 /* Accumulator in external merge sort */
8668
8669 /*
8670 ** Valid values for the second argument to sqlite3PagerLockingMode().
8671 */
8672 #define PAGER_LOCKINGMODE_QUERY -1
@@ -8785,14 +8769,12 @@
8785
8786 #endif /* _PAGER_H_ */
8787
8788 /************** End of pager.h ***********************************************/
8789 /************** Continuing where we left off in sqliteInt.h ******************/
8790 #line 655 "tsrc/sqliteInt.h"
8791 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8792 /************** Begin file pcache.h ******************************************/
8793 #line 1 "tsrc/pcache.h"
8794 /*
8795 ** 2008 August 05
8796 **
8797 ** The author disclaims copyright to this source code. In place of
8798 ** a legal notice, here is a blessing:
@@ -8947,15 +8929,13 @@
8947
8948 #endif /* _PCACHE_H_ */
8949
8950 /************** End of pcache.h **********************************************/
8951 /************** Continuing where we left off in sqliteInt.h ******************/
8952 #line 656 "tsrc/sqliteInt.h"
8953
8954 /************** Include os.h in the middle of sqliteInt.h ********************/
8955 /************** Begin file os.h **********************************************/
8956 #line 1 "tsrc/os.h"
8957 /*
8958 ** 2001 September 16
8959 **
8960 ** The author disclaims copyright to this source code. In place of
8961 ** a legal notice, here is a blessing:
@@ -9234,14 +9214,12 @@
9234
9235 #endif /* _SQLITE_OS_H_ */
9236
9237 /************** End of os.h **************************************************/
9238 /************** Continuing where we left off in sqliteInt.h ******************/
9239 #line 658 "tsrc/sqliteInt.h"
9240 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9241 /************** Begin file mutex.h *******************************************/
9242 #line 1 "tsrc/mutex.h"
9243 /*
9244 ** 2007 August 28
9245 **
9246 ** The author disclaims copyright to this source code. In place of
9247 ** a legal notice, here is a blessing:
@@ -9312,11 +9290,10 @@
9312 #define sqlite3MutexEnd()
9313 #endif /* defined(SQLITE_MUTEX_OMIT) */
9314
9315 /************** End of mutex.h ***********************************************/
9316 /************** Continuing where we left off in sqliteInt.h ******************/
9317 #line 659 "tsrc/sqliteInt.h"
9318
9319
9320 /*
9321 ** Each database file to be accessed by the system is an instance
9322 ** of the following structure. There are normally two of these structures
@@ -10509,11 +10486,12 @@
10509 char *zDatabase; /* Name of database holding this table */
10510 char *zName; /* Name of the table */
10511 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
10512 Table *pTab; /* An SQL table corresponding to zName */
10513 Select *pSelect; /* A SELECT statement used in place of a table name */
10514 u8 isPopulated; /* Temporary table associated with SELECT is populated */
 
10515 u8 jointype; /* Type of join between this able and the previous */
10516 u8 notIndexed; /* True if there is a NOT INDEXED clause */
10517 u8 isCorrelated; /* True if sub-query is correlated */
10518 #ifndef SQLITE_OMIT_EXPLAIN
10519 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11893,10 @@
11915
11916 #endif /* _SQLITEINT_H_ */
11917
11918 /************** End of sqliteInt.h *******************************************/
11919 /************** Begin file global.c ******************************************/
11920 #line 1 "tsrc/global.c"
11921 /*
11922 ** 2008 June 13
11923 **
11924 ** The author disclaims copyright to this source code. In place of
11925 ** a legal notice, here is a blessing:
@@ -12060,11 +12037,11 @@
12060 SQLITE_DEFAULT_MEMSTATUS, /* bMemstat */
12061 1, /* bCoreMutex */
12062 SQLITE_THREADSAFE==1, /* bFullMutex */
12063 SQLITE_USE_URI, /* bOpenUri */
12064 0x7ffffffe, /* mxStrlen */
12065 100, /* szLookaside */
12066 500, /* nLookaside */
12067 {0,0,0,0,0,0,0,0}, /* m */
12068 {0,0,0,0,0,0,0,0,0}, /* mutex */
12069 {0,0,0,0,0,0,0,0,0,0,0}, /* pcache */
12070 (void*)0, /* pHeap */
@@ -12138,11 +12115,10 @@
12138 */
12139 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12140
12141 /************** End of global.c **********************************************/
12142 /************** Begin file ctime.c *******************************************/
12143 #line 1 "tsrc/ctime.c"
12144 /*
12145 ** 2010 February 23
12146 **
12147 ** The author disclaims copyright to this source code. In place of
12148 ** a legal notice, here is a blessing:
@@ -12543,11 +12519,10 @@
12543
12544 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12545
12546 /************** End of ctime.c ***********************************************/
12547 /************** Begin file status.c ******************************************/
12548 #line 1 "tsrc/status.c"
12549 /*
12550 ** 2008 June 18
12551 **
12552 ** The author disclaims copyright to this source code. In place of
12553 ** a legal notice, here is a blessing:
@@ -12561,11 +12536,10 @@
12561 ** This module implements the sqlite3_status() interface and related
12562 ** functionality.
12563 */
12564 /************** Include vdbeInt.h in the middle of status.c ******************/
12565 /************** Begin file vdbeInt.h *****************************************/
12566 #line 1 "tsrc/vdbeInt.h"
12567 /*
12568 ** 2003 September 6
12569 **
12570 ** The author disclaims copyright to this source code. In place of
12571 ** a legal notice, here is a blessing:
@@ -13013,11 +12987,10 @@
13013
13014 #endif /* !defined(_VDBEINT_H_) */
13015
13016 /************** End of vdbeInt.h *********************************************/
13017 /************** Continuing where we left off in status.c *********************/
13018 #line 18 "tsrc/status.c"
13019
13020 /*
13021 ** Variables in which to record status information.
13022 */
13023 typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13200,10 @@
13227 return rc;
13228 }
13229
13230 /************** End of status.c **********************************************/
13231 /************** Begin file date.c ********************************************/
13232 #line 1 "tsrc/date.c"
13233 /*
13234 ** 2003 October 31
13235 **
13236 ** The author disclaims copyright to this source code. In place of
13237 ** a legal notice, here is a blessing:
@@ -14355,11 +14327,10 @@
14355 }
14356 }
14357
14358 /************** End of date.c ************************************************/
14359 /************** Begin file os.c **********************************************/
14360 #line 1 "tsrc/os.c"
14361 /*
14362 ** 2005 November 29
14363 **
14364 ** The author disclaims copyright to this source code. In place of
14365 ** a legal notice, here is a blessing:
@@ -14565,11 +14536,11 @@
14565 int flags,
14566 int *pOutFlags
14567 ){
14568 int rc = SQLITE_NOMEM;
14569 sqlite3_file *pFile;
14570 pFile = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile);
14571 if( pFile ){
14572 rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
14573 if( rc!=SQLITE_OK ){
14574 sqlite3_free(pFile);
14575 }else{
@@ -14689,11 +14660,10 @@
14689 return SQLITE_OK;
14690 }
14691
14692 /************** End of os.c **************************************************/
14693 /************** Begin file fault.c *******************************************/
14694 #line 1 "tsrc/fault.c"
14695 /*
14696 ** 2008 Jan 22
14697 **
14698 ** The author disclaims copyright to this source code. In place of
14699 ** a legal notice, here is a blessing:
@@ -14779,11 +14749,10 @@
14779
14780 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14781
14782 /************** End of fault.c ***********************************************/
14783 /************** Begin file mem0.c ********************************************/
14784 #line 1 "tsrc/mem0.c"
14785 /*
14786 ** 2008 October 28
14787 **
14788 ** The author disclaims copyright to this source code. In place of
14789 ** a legal notice, here is a blessing:
@@ -14841,11 +14810,10 @@
14841
14842 #endif /* SQLITE_ZERO_MALLOC */
14843
14844 /************** End of mem0.c ************************************************/
14845 /************** Begin file mem1.c ********************************************/
14846 #line 1 "tsrc/mem1.c"
14847 /*
14848 ** 2007 August 14
14849 **
14850 ** The author disclaims copyright to this source code. In place of
14851 ** a legal notice, here is a blessing:
@@ -14994,11 +14962,10 @@
14994
14995 #endif /* SQLITE_SYSTEM_MALLOC */
14996
14997 /************** End of mem1.c ************************************************/
14998 /************** Begin file mem2.c ********************************************/
14999 #line 1 "tsrc/mem2.c"
15000 /*
15001 ** 2007 August 15
15002 **
15003 ** The author disclaims copyright to this source code. In place of
15004 ** a legal notice, here is a blessing:
@@ -15525,11 +15492,10 @@
15525
15526 #endif /* SQLITE_MEMDEBUG */
15527
15528 /************** End of mem2.c ************************************************/
15529 /************** Begin file mem3.c ********************************************/
15530 #line 1 "tsrc/mem3.c"
15531 /*
15532 ** 2007 October 14
15533 **
15534 ** The author disclaims copyright to this source code. In place of
15535 ** a legal notice, here is a blessing:
@@ -16215,11 +16181,10 @@
16215
16216 #endif /* SQLITE_ENABLE_MEMSYS3 */
16217
16218 /************** End of mem3.c ************************************************/
16219 /************** Begin file mem5.c ********************************************/
16220 #line 1 "tsrc/mem5.c"
16221 /*
16222 ** 2007 October 14
16223 **
16224 ** The author disclaims copyright to this source code. In place of
16225 ** a legal notice, here is a blessing:
@@ -16799,11 +16764,10 @@
16799
16800 #endif /* SQLITE_ENABLE_MEMSYS5 */
16801
16802 /************** End of mem5.c ************************************************/
16803 /************** Begin file mutex.c *******************************************/
16804 #line 1 "tsrc/mutex.c"
16805 /*
16806 ** 2007 August 14
16807 **
16808 ** The author disclaims copyright to this source code. In place of
16809 ** a legal notice, here is a blessing:
@@ -16955,11 +16919,10 @@
16955
16956 #endif /* SQLITE_MUTEX_OMIT */
16957
16958 /************** End of mutex.c ***********************************************/
16959 /************** Begin file mutex_noop.c **************************************/
16960 #line 1 "tsrc/mutex_noop.c"
16961 /*
16962 ** 2008 October 07
16963 **
16964 ** The author disclaims copyright to this source code. In place of
16965 ** a legal notice, here is a blessing:
@@ -17164,11 +17127,10 @@
17164 #endif /* SQLITE_MUTEX_NOOP */
17165 #endif /* SQLITE_MUTEX_OMIT */
17166
17167 /************** End of mutex_noop.c ******************************************/
17168 /************** Begin file mutex_os2.c ***************************************/
17169 #line 1 "tsrc/mutex_os2.c"
17170 /*
17171 ** 2007 August 28
17172 **
17173 ** The author disclaims copyright to this source code. In place of
17174 ** a legal notice, here is a blessing:
@@ -17441,11 +17403,10 @@
17441 }
17442 #endif /* SQLITE_MUTEX_OS2 */
17443
17444 /************** End of mutex_os2.c *******************************************/
17445 /************** Begin file mutex_unix.c **************************************/
17446 #line 1 "tsrc/mutex_unix.c"
17447 /*
17448 ** 2007 August 28
17449 **
17450 ** The author disclaims copyright to this source code. In place of
17451 ** a legal notice, here is a blessing:
@@ -17795,11 +17756,10 @@
17795
17796 #endif /* SQLITE_MUTEX_PTHREAD */
17797
17798 /************** End of mutex_unix.c ******************************************/
17799 /************** Begin file mutex_w32.c ***************************************/
17800 #line 1 "tsrc/mutex_w32.c"
17801 /*
17802 ** 2007 August 14
17803 **
17804 ** The author disclaims copyright to this source code. In place of
17805 ** a legal notice, here is a blessing:
@@ -18130,11 +18090,10 @@
18130 }
18131 #endif /* SQLITE_MUTEX_W32 */
18132
18133 /************** End of mutex_w32.c *******************************************/
18134 /************** Begin file malloc.c ******************************************/
18135 #line 1 "tsrc/malloc.c"
18136 /*
18137 ** 2001 September 15
18138 **
18139 ** The author disclaims copyright to this source code. In place of
18140 ** a legal notice, here is a blessing:
@@ -18910,11 +18869,10 @@
18910 return rc & (db ? db->errMask : 0xff);
18911 }
18912
18913 /************** End of malloc.c **********************************************/
18914 /************** Begin file printf.c ******************************************/
18915 #line 1 "tsrc/printf.c"
18916 /*
18917 ** The "printf" code that follows dates from the 1980's. It is in
18918 ** the public domain. The original comments are included here for
18919 ** completeness. They are very out-of-date but might be useful as
18920 ** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19900,10 @@
19942 }
19943 #endif
19944
19945 /************** End of printf.c **********************************************/
19946 /************** Begin file random.c ******************************************/
19947 #line 1 "tsrc/random.c"
19948 /*
19949 ** 2001 September 15
19950 **
19951 ** The author disclaims copyright to this source code. In place of
19952 ** a legal notice, here is a blessing:
@@ -20090,11 +20047,10 @@
20090 }
20091 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20092
20093 /************** End of random.c **********************************************/
20094 /************** Begin file utf.c *********************************************/
20095 #line 1 "tsrc/utf.c"
20096 /*
20097 ** 2004 April 13
20098 **
20099 ** The author disclaims copyright to this source code. In place of
20100 ** a legal notice, here is a blessing:
@@ -20652,11 +20608,10 @@
20652 #endif /* SQLITE_TEST */
20653 #endif /* SQLITE_OMIT_UTF16 */
20654
20655 /************** End of utf.c *************************************************/
20656 /************** Begin file util.c ********************************************/
20657 #line 1 "tsrc/util.c"
20658 /*
20659 ** 2001 September 15
20660 **
20661 ** The author disclaims copyright to this source code. In place of
20662 ** a legal notice, here is a blessing:
@@ -21835,11 +21790,10 @@
21835 }
21836 #endif
21837
21838 /************** End of util.c ************************************************/
21839 /************** Begin file hash.c ********************************************/
21840 #line 1 "tsrc/hash.c"
21841 /*
21842 ** 2001 September 22
21843 **
21844 ** The author disclaims copyright to this source code. In place of
21845 ** a legal notice, here is a blessing:
@@ -22115,11 +22069,10 @@
22115 return 0;
22116 }
22117
22118 /************** End of hash.c ************************************************/
22119 /************** Begin file opcodes.c *****************************************/
22120 #line 1 "tsrc/opcodes.c"
22121 /* Automatically generated. Do not edit */
22122 /* See the mkopcodec.awk script for details. */
22123 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22124 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22125 static const char *const azName[] = { "?",
@@ -22146,66 +22099,66 @@
22146 /* 21 */ "MustBeInt",
22147 /* 22 */ "RealAffinity",
22148 /* 23 */ "Permutation",
22149 /* 24 */ "Compare",
22150 /* 25 */ "Jump",
22151 /* 26 */ "If",
22152 /* 27 */ "IfNot",
22153 /* 28 */ "Column",
22154 /* 29 */ "Affinity",
22155 /* 30 */ "MakeRecord",
22156 /* 31 */ "Count",
22157 /* 32 */ "Savepoint",
22158 /* 33 */ "AutoCommit",
22159 /* 34 */ "Transaction",
22160 /* 35 */ "ReadCookie",
22161 /* 36 */ "SetCookie",
22162 /* 37 */ "VerifyCookie",
22163 /* 38 */ "OpenRead",
22164 /* 39 */ "OpenWrite",
22165 /* 40 */ "OpenAutoindex",
22166 /* 41 */ "OpenEphemeral",
22167 /* 42 */ "SorterOpen",
22168 /* 43 */ "OpenPseudo",
22169 /* 44 */ "Close",
22170 /* 45 */ "SeekLt",
22171 /* 46 */ "SeekLe",
22172 /* 47 */ "SeekGe",
22173 /* 48 */ "SeekGt",
22174 /* 49 */ "Seek",
22175 /* 50 */ "NotFound",
22176 /* 51 */ "Found",
22177 /* 52 */ "IsUnique",
22178 /* 53 */ "NotExists",
22179 /* 54 */ "Sequence",
22180 /* 55 */ "NewRowid",
22181 /* 56 */ "Insert",
22182 /* 57 */ "InsertInt",
22183 /* 58 */ "Delete",
22184 /* 59 */ "ResetCount",
22185 /* 60 */ "SorterCompare",
22186 /* 61 */ "SorterData",
22187 /* 62 */ "RowKey",
22188 /* 63 */ "RowData",
22189 /* 64 */ "Rowid",
22190 /* 65 */ "NullRow",
22191 /* 66 */ "Last",
22192 /* 67 */ "SorterSort",
22193 /* 68 */ "Or",
22194 /* 69 */ "And",
22195 /* 70 */ "Sort",
22196 /* 71 */ "Rewind",
22197 /* 72 */ "SorterNext",
22198 /* 73 */ "IsNull",
22199 /* 74 */ "NotNull",
22200 /* 75 */ "Ne",
22201 /* 76 */ "Eq",
22202 /* 77 */ "Gt",
22203 /* 78 */ "Le",
22204 /* 79 */ "Lt",
22205 /* 80 */ "Ge",
22206 /* 81 */ "Prev",
22207 /* 82 */ "BitAnd",
22208 /* 83 */ "BitOr",
22209 /* 84 */ "ShiftLeft",
22210 /* 85 */ "ShiftRight",
22211 /* 86 */ "Add",
@@ -22212,76 +22165,76 @@
22212 /* 87 */ "Subtract",
22213 /* 88 */ "Multiply",
22214 /* 89 */ "Divide",
22215 /* 90 */ "Remainder",
22216 /* 91 */ "Concat",
22217 /* 92 */ "Next",
22218 /* 93 */ "BitNot",
22219 /* 94 */ "String8",
22220 /* 95 */ "SorterInsert",
22221 /* 96 */ "IdxInsert",
22222 /* 97 */ "IdxDelete",
22223 /* 98 */ "IdxRowid",
22224 /* 99 */ "IdxLT",
22225 /* 100 */ "IdxGE",
22226 /* 101 */ "Destroy",
22227 /* 102 */ "Clear",
22228 /* 103 */ "CreateIndex",
22229 /* 104 */ "CreateTable",
22230 /* 105 */ "ParseSchema",
22231 /* 106 */ "LoadAnalysis",
22232 /* 107 */ "DropTable",
22233 /* 108 */ "DropIndex",
22234 /* 109 */ "DropTrigger",
22235 /* 110 */ "IntegrityCk",
22236 /* 111 */ "RowSetAdd",
22237 /* 112 */ "RowSetRead",
22238 /* 113 */ "RowSetTest",
22239 /* 114 */ "Program",
22240 /* 115 */ "Param",
22241 /* 116 */ "FkCounter",
22242 /* 117 */ "FkIfZero",
22243 /* 118 */ "MemMax",
22244 /* 119 */ "IfPos",
22245 /* 120 */ "IfNeg",
22246 /* 121 */ "IfZero",
22247 /* 122 */ "AggStep",
22248 /* 123 */ "AggFinal",
22249 /* 124 */ "Checkpoint",
22250 /* 125 */ "JournalMode",
22251 /* 126 */ "Vacuum",
22252 /* 127 */ "IncrVacuum",
22253 /* 128 */ "Expire",
22254 /* 129 */ "TableLock",
22255 /* 130 */ "Real",
22256 /* 131 */ "VBegin",
22257 /* 132 */ "VCreate",
22258 /* 133 */ "VDestroy",
22259 /* 134 */ "VOpen",
22260 /* 135 */ "VFilter",
22261 /* 136 */ "VColumn",
22262 /* 137 */ "VNext",
22263 /* 138 */ "VRename",
22264 /* 139 */ "VUpdate",
22265 /* 140 */ "Pagecount",
22266 /* 141 */ "ToText",
22267 /* 142 */ "ToBlob",
22268 /* 143 */ "ToNumeric",
22269 /* 144 */ "ToInt",
22270 /* 145 */ "ToReal",
22271 /* 146 */ "MaxPgcnt",
22272 /* 147 */ "Trace",
22273 /* 148 */ "Noop",
22274 /* 149 */ "Explain",
 
22275 };
22276 return azName[i];
22277 }
22278 #endif
22279
22280 /************** End of opcodes.c *********************************************/
22281 /************** Begin file os_os2.c ******************************************/
22282 #line 1 "tsrc/os_os2.c"
22283 /*
22284 ** 2006 Feb 14
22285 **
22286 ** The author disclaims copyright to this source code. In place of
22287 ** a legal notice, here is a blessing:
@@ -22334,11 +22287,10 @@
22334 /*
22335 ** Include code that is common to all os_*.c files
22336 */
22337 /************** Include os_common.h in the middle of os_os2.c ****************/
22338 /************** Begin file os_common.h ***************************************/
22339 #line 1 "tsrc/os_common.h"
22340 /*
22341 ** 2004 May 22
22342 **
22343 ** The author disclaims copyright to this source code. In place of
22344 ** a legal notice, here is a blessing:
@@ -22388,11 +22340,10 @@
22388 ** hwtime.h contains inline assembler code for implementing
22389 ** high-performance timing routines.
22390 */
22391 /************** Include hwtime.h in the middle of os_common.h ****************/
22392 /************** Begin file hwtime.h ******************************************/
22393 #line 1 "tsrc/hwtime.h"
22394 /*
22395 ** 2008 May 27
22396 **
22397 ** The author disclaims copyright to this source code. In place of
22398 ** a legal notice, here is a blessing:
@@ -22477,11 +22428,10 @@
22477
22478 #endif /* !defined(_HWTIME_H_) */
22479
22480 /************** End of hwtime.h **********************************************/
22481 /************** Continuing where we left off in os_common.h ******************/
22482 #line 53 "tsrc/os_common.h"
22483
22484 static sqlite_uint64 g_start;
22485 static sqlite_uint64 g_elapsed;
22486 #define TIMER_START g_start=sqlite3Hwtime()
22487 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22494,10 @@
22544
22545 #endif /* !defined(_OS_COMMON_H_) */
22546
22547 /************** End of os_common.h *******************************************/
22548 /************** Continuing where we left off in os_os2.c *********************/
22549 #line 57 "tsrc/os_os2.c"
22550
22551 /* Forward references */
22552 typedef struct os2File os2File; /* The file structure */
22553 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22554 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24365,10 @@
24416
24417 #endif /* SQLITE_OS_OS2 */
24418
24419 /************** End of os_os2.c **********************************************/
24420 /************** Begin file os_unix.c *****************************************/
24421 #line 1 "tsrc/os_unix.c"
24422 /*
24423 ** 2004 May 22
24424 **
24425 ** The author disclaims copyright to this source code. In place of
24426 ** a legal notice, here is a blessing:
@@ -24681,11 +24629,10 @@
24681 /*
24682 ** Include code that is common to all os_*.c files
24683 */
24684 /************** Include os_common.h in the middle of os_unix.c ***************/
24685 /************** Begin file os_common.h ***************************************/
24686 #line 1 "tsrc/os_common.h"
24687 /*
24688 ** 2004 May 22
24689 **
24690 ** The author disclaims copyright to this source code. In place of
24691 ** a legal notice, here is a blessing:
@@ -24735,11 +24682,10 @@
24735 ** hwtime.h contains inline assembler code for implementing
24736 ** high-performance timing routines.
24737 */
24738 /************** Include hwtime.h in the middle of os_common.h ****************/
24739 /************** Begin file hwtime.h ******************************************/
24740 #line 1 "tsrc/hwtime.h"
24741 /*
24742 ** 2008 May 27
24743 **
24744 ** The author disclaims copyright to this source code. In place of
24745 ** a legal notice, here is a blessing:
@@ -24824,11 +24770,10 @@
24824
24825 #endif /* !defined(_HWTIME_H_) */
24826
24827 /************** End of hwtime.h **********************************************/
24828 /************** Continuing where we left off in os_common.h ******************/
24829 #line 53 "tsrc/os_common.h"
24830
24831 static sqlite_uint64 g_start;
24832 static sqlite_uint64 g_elapsed;
24833 #define TIMER_START g_start=sqlite3Hwtime()
24834 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24836,10 @@
24891
24892 #endif /* !defined(_OS_COMMON_H_) */
24893
24894 /************** End of os_common.h *******************************************/
24895 /************** Continuing where we left off in os_unix.c ********************/
24896 #line 265 "tsrc/os_unix.c"
24897
24898 /*
24899 ** Define various macros that are missing from some systems.
24900 */
24901 #ifndef O_LARGEFILE
@@ -31401,11 +31345,10 @@
31401
31402 #endif /* SQLITE_OS_UNIX */
31403
31404 /************** End of os_unix.c *********************************************/
31405 /************** Begin file os_win.c ******************************************/
31406 #line 1 "tsrc/os_win.c"
31407 /*
31408 ** 2004 May 22
31409 **
31410 ** The author disclaims copyright to this source code. In place of
31411 ** a legal notice, here is a blessing:
@@ -31463,11 +31406,10 @@
31463 /*
31464 ** Include code that is common to all os_*.c files
31465 */
31466 /************** Include os_common.h in the middle of os_win.c ****************/
31467 /************** Begin file os_common.h ***************************************/
31468 #line 1 "tsrc/os_common.h"
31469 /*
31470 ** 2004 May 22
31471 **
31472 ** The author disclaims copyright to this source code. In place of
31473 ** a legal notice, here is a blessing:
@@ -31517,11 +31459,10 @@
31517 ** hwtime.h contains inline assembler code for implementing
31518 ** high-performance timing routines.
31519 */
31520 /************** Include hwtime.h in the middle of os_common.h ****************/
31521 /************** Begin file hwtime.h ******************************************/
31522 #line 1 "tsrc/hwtime.h"
31523 /*
31524 ** 2008 May 27
31525 **
31526 ** The author disclaims copyright to this source code. In place of
31527 ** a legal notice, here is a blessing:
@@ -31606,11 +31547,10 @@
31606
31607 #endif /* !defined(_HWTIME_H_) */
31608
31609 /************** End of hwtime.h **********************************************/
31610 /************** Continuing where we left off in os_common.h ******************/
31611 #line 53 "tsrc/os_common.h"
31612
31613 static sqlite_uint64 g_start;
31614 static sqlite_uint64 g_elapsed;
31615 #define TIMER_START g_start=sqlite3Hwtime()
31616 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31613,10 @@
31673
31674 #endif /* !defined(_OS_COMMON_H_) */
31675
31676 /************** End of os_common.h *******************************************/
31677 /************** Continuing where we left off in os_win.c *********************/
31678 #line 62 "tsrc/os_win.c"
31679
31680 /*
31681 ** Some microsoft compilers lack this definition.
31682 */
31683 #ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32799,23 @@
32860
32861 /*
32862 ** Make sure all writes to a particular file are committed to disk.
32863 */
32864 static int winSync(sqlite3_file *id, int flags){
32865 #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG)
32866 winFile *pFile = (winFile*)id;
 
 
32867 BOOL rc;
 
 
 
 
 
 
 
 
32868 #else
32869 UNUSED_PARAMETER(id);
32870 #endif
32871
32872 assert( pFile );
@@ -34809,11 +34758,10 @@
34809
34810 #endif /* SQLITE_OS_WIN */
34811
34812 /************** End of os_win.c **********************************************/
34813 /************** Begin file bitvec.c ******************************************/
34814 #line 1 "tsrc/bitvec.c"
34815 /*
34816 ** 2008 February 16
34817 **
34818 ** The author disclaims copyright to this source code. In place of
34819 ** a legal notice, here is a blessing:
@@ -35220,11 +35168,10 @@
35220 }
35221 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35222
35223 /************** End of bitvec.c **********************************************/
35224 /************** Begin file pcache.c ******************************************/
35225 #line 1 "tsrc/pcache.c"
35226 /*
35227 ** 2008 August 05
35228 **
35229 ** The author disclaims copyright to this source code. In place of
35230 ** a legal notice, here is a blessing:
@@ -35817,11 +35764,10 @@
35817 }
35818 #endif
35819
35820 /************** End of pcache.c **********************************************/
35821 /************** Begin file pcache1.c *****************************************/
35822 #line 1 "tsrc/pcache1.c"
35823 /*
35824 ** 2008 November 05
35825 **
35826 ** The author disclaims copyright to this source code. In place of
35827 ** a legal notice, here is a blessing:
@@ -37034,11 +36980,10 @@
37034 }
37035 #endif
37036
37037 /************** End of pcache1.c *********************************************/
37038 /************** Begin file rowset.c ******************************************/
37039 #line 1 "tsrc/rowset.c"
37040 /*
37041 ** 2008 December 3
37042 **
37043 ** The author disclaims copyright to this source code. In place of
37044 ** a legal notice, here is a blessing:
@@ -37459,11 +37404,10 @@
37459 return 0;
37460 }
37461
37462 /************** End of rowset.c **********************************************/
37463 /************** Begin file pager.c *******************************************/
37464 #line 1 "tsrc/pager.c"
37465 /*
37466 ** 2001 September 15
37467 **
37468 ** The author disclaims copyright to this source code. In place of
37469 ** a legal notice, here is a blessing:
@@ -37483,11 +37427,10 @@
37483 ** another is writing.
37484 */
37485 #ifndef SQLITE_OMIT_DISKIO
37486 /************** Include wal.h in the middle of pager.c ***********************/
37487 /************** Begin file wal.h *********************************************/
37488 #line 1 "tsrc/wal.h"
37489 /*
37490 ** 2010 February 1
37491 **
37492 ** The author disclaims copyright to this source code. In place of
37493 ** a legal notice, here is a blessing:
@@ -37608,11 +37551,10 @@
37608 #endif /* ifndef SQLITE_OMIT_WAL */
37609 #endif /* _WAL_H_ */
37610
37611 /************** End of wal.h *************************************************/
37612 /************** Continuing where we left off in pager.c **********************/
37613 #line 24 "tsrc/pager.c"
37614
37615
37616 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37617 **
37618 ** This comment block describes invariants that hold when using a rollback
@@ -38208,11 +38150,10 @@
38208 u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */
38209 u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */
38210 u8 tempFile; /* zFilename is a temporary file */
38211 u8 readOnly; /* True for a read-only database */
38212 u8 memDb; /* True to inhibit all file I/O */
38213 u8 hasSeenStress; /* pagerStress() called one or more times */
38214
38215 /**************************************************************************
38216 ** The following block contains those class members that change during
38217 ** routine opertion. Class members not in this block are either fixed
38218 ** when the pager is first created or else only change when there is a
@@ -41763,11 +41704,10 @@
41763 ** is impossible for sqlite3PCacheFetch() to be called with createFlag==1
41764 ** while in the error state, hence it is impossible for this routine to
41765 ** be called in the error state. Nevertheless, we include a NEVER()
41766 ** test for the error state as a safeguard against future changes.
41767 */
41768 pPager->hasSeenStress = 1;
41769 if( NEVER(pPager->errCode) ) return SQLITE_OK;
41770 if( pPager->doNotSpill ) return SQLITE_OK;
41771 if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
41772 return SQLITE_OK;
41773 }
@@ -44422,11 +44362,10 @@
44422
44423 #endif /* SQLITE_OMIT_DISKIO */
44424
44425 /************** End of pager.c ***********************************************/
44426 /************** Begin file wal.c *********************************************/
44427 #line 1 "tsrc/wal.c"
44428 /*
44429 ** 2010 February 1
44430 **
44431 ** The author disclaims copyright to this source code. In place of
44432 ** a legal notice, here is a blessing:
@@ -47377,11 +47316,10 @@
47377
47378 #endif /* #ifndef SQLITE_OMIT_WAL */
47379
47380 /************** End of wal.c *************************************************/
47381 /************** Begin file btmutex.c *****************************************/
47382 #line 1 "tsrc/btmutex.c"
47383 /*
47384 ** 2007 August 27
47385 **
47386 ** The author disclaims copyright to this source code. In place of
47387 ** a legal notice, here is a blessing:
@@ -47397,11 +47335,10 @@
47397 ** big and we want to break it down some. This packaged seemed like
47398 ** a good breakout.
47399 */
47400 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47401 /************** Begin file btreeInt.h ****************************************/
47402 #line 1 "tsrc/btreeInt.h"
47403 /*
47404 ** 2004 April 6
47405 **
47406 ** The author disclaims copyright to this source code. In place of
47407 ** a legal notice, here is a blessing:
@@ -48043,11 +47980,10 @@
48043 #define get4byte sqlite3Get4byte
48044 #define put4byte sqlite3Put4byte
48045
48046 /************** End of btreeInt.h ********************************************/
48047 /************** Continuing where we left off in btmutex.c ********************/
48048 #line 19 "tsrc/btmutex.c"
48049 #ifndef SQLITE_OMIT_SHARED_CACHE
48050 #if SQLITE_THREADSAFE
48051
48052 /*
48053 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48252,10 @@
48316 #endif /* if SQLITE_THREADSAFE */
48317 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48318
48319 /************** End of btmutex.c *********************************************/
48320 /************** Begin file btree.c *******************************************/
48321 #line 1 "tsrc/btree.c"
48322 /*
48323 ** 2004 April 6
48324 **
48325 ** The author disclaims copyright to this source code. In place of
48326 ** a legal notice, here is a blessing:
@@ -48982,11 +48917,11 @@
48982 assert( nKey==(i64)(int)nKey );
48983 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
48984 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
48985 );
48986 if( pIdxKey==0 ) return SQLITE_NOMEM;
48987 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, pIdxKey);
48988 }else{
48989 pIdxKey = 0;
48990 }
48991 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48992 if( pFree ){
@@ -56504,11 +56439,10 @@
56504 return rc;
56505 }
56506
56507 /************** End of btree.c ***********************************************/
56508 /************** Begin file backup.c ******************************************/
56509 #line 1 "tsrc/backup.c"
56510 /*
56511 ** 2009 January 28
56512 **
56513 ** The author disclaims copyright to this source code. In place of
56514 ** a legal notice, here is a blessing:
@@ -57211,11 +57145,10 @@
57211 }
57212 #endif /* SQLITE_OMIT_VACUUM */
57213
57214 /************** End of backup.c **********************************************/
57215 /************** Begin file vdbemem.c *****************************************/
57216 #line 1 "tsrc/vdbemem.c"
57217 /*
57218 ** 2004 May 26
57219 **
57220 ** The author disclaims copyright to this source code. In place of
57221 ** a legal notice, here is a blessing:
@@ -58366,11 +58299,10 @@
58366 return 0;
58367 }
58368
58369 /************** End of vdbemem.c *********************************************/
58370 /************** Begin file vdbeaux.c *****************************************/
58371 #line 1 "tsrc/vdbeaux.c"
58372 /*
58373 ** 2003 September 6
58374 **
58375 ** The author disclaims copyright to this source code. In place of
58376 ** a legal notice, here is a blessing:
@@ -59037,22 +58969,19 @@
59037 p->pNext = pVdbe->pProgram;
59038 pVdbe->pProgram = p;
59039 }
59040
59041 /*
59042 ** Change N opcodes starting at addr to No-ops.
59043 */
59044 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
59045 if( p->aOp ){
59046 VdbeOp *pOp = &p->aOp[addr];
59047 sqlite3 *db = p->db;
59048 while( N-- ){
59049 freeP4(db, pOp->p4type, pOp->p4.p);
59050 memset(pOp, 0, sizeof(pOp[0]));
59051 pOp->opcode = OP_Noop;
59052 pOp++;
59053 }
59054 }
59055 }
59056
59057 /*
59058 ** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59133,11 @@
59204 ** check the value of p->nOp-1 before continuing.
59205 */
59206 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
59207 /* C89 specifies that the constant "dummy" will be initialized to all
59208 ** zeros, which is correct. MSVC generates a warning, nevertheless. */
59209 static const VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59210 assert( p->magic==VDBE_MAGIC_INIT );
59211 if( addr<0 ){
59212 #ifdef SQLITE_OMIT_TRACE
59213 if( p->nOp==0 ) return (VdbeOp*)&dummy;
59214 #endif
@@ -61609,11 +61538,10 @@
61609 }
61610 }
61611
61612 /************** End of vdbeaux.c *********************************************/
61613 /************** Begin file vdbeapi.c *****************************************/
61614 #line 1 "tsrc/vdbeapi.c"
61615 /*
61616 ** 2004 May 26
61617 **
61618 ** The author disclaims copyright to this source code. In place of
61619 ** a legal notice, here is a blessing:
@@ -62917,11 +62845,10 @@
62917 return v;
62918 }
62919
62920 /************** End of vdbeapi.c *********************************************/
62921 /************** Begin file vdbetrace.c ***************************************/
62922 #line 1 "tsrc/vdbetrace.c"
62923 /*
62924 ** 2009 November 25
62925 **
62926 ** The author disclaims copyright to this source code. In place of
62927 ** a legal notice, here is a blessing:
@@ -63073,11 +63000,10 @@
63073
63074 #endif /* #ifndef SQLITE_OMIT_TRACE */
63075
63076 /************** End of vdbetrace.c *******************************************/
63077 /************** Begin file vdbe.c ********************************************/
63078 #line 1 "tsrc/vdbe.c"
63079 /*
63080 ** 2001 September 15
63081 **
63082 ** The author disclaims copyright to this source code. In place of
63083 ** a legal notice, here is a blessing:
@@ -63543,11 +63469,10 @@
63543 ** hwtime.h contains inline assembler code for implementing
63544 ** high-performance timing routines.
63545 */
63546 /************** Include hwtime.h in the middle of vdbe.c *********************/
63547 /************** Begin file hwtime.h ******************************************/
63548 #line 1 "tsrc/hwtime.h"
63549 /*
63550 ** 2008 May 27
63551 **
63552 ** The author disclaims copyright to this source code. In place of
63553 ** a legal notice, here is a blessing:
@@ -63632,11 +63557,10 @@
63632
63633 #endif /* !defined(_HWTIME_H_) */
63634
63635 /************** End of hwtime.h **********************************************/
63636 /************** Continuing where we left off in vdbe.c ***********************/
63637 #line 471 "tsrc/vdbe.c"
63638
63639 #endif
63640
63641 /*
63642 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65551,20 @@
65627 sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
65628 }
65629 break;
65630 }
65631
 
 
 
 
 
 
 
 
 
 
65632 /* Opcode: If P1 P2 P3 * *
65633 **
65634 ** Jump to P2 if the value in register P1 is true. The value
65635 ** is considered true if it is numeric and non-zero. If the value
65636 ** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65573,11 @@
65639 **
65640 ** Jump to P2 if the value in register P1 is False. The value
65641 ** is considered true if it has a numeric value of zero. If the value
65642 ** in P1 is NULL then take the jump if P3 is true.
65643 */
 
65644 case OP_If: /* jump, in1 */
65645 case OP_IfNot: { /* jump, in1 */
65646 #if 0 /* local variables moved into u.al */
65647 int c;
65648 #endif /* local variables moved into u.al */
@@ -65657,10 +65592,16 @@
65657 #endif
65658 if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
65659 }
65660 if( u.al.c ){
65661 pc = pOp->p2-1;
 
 
 
 
 
 
65662 }
65663 break;
65664 }
65665
65666 /* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69801,10 @@
69860 goto vdbe_error_halt;
69861 }
69862
69863 /************** End of vdbe.c ************************************************/
69864 /************** Begin file vdbeblob.c ****************************************/
69865 #line 1 "tsrc/vdbeblob.c"
69866 /*
69867 ** 2007 May 1
69868 **
69869 ** The author disclaims copyright to this source code. In place of
69870 ** a legal notice, here is a blessing:
@@ -70134,21 +70074,21 @@
70134 /* Make sure a mutex is held on the table to be accessed */
70135 sqlite3VdbeUsesBtree(v, iDb);
70136
70137 /* Configure the OP_TableLock instruction */
70138 #ifdef SQLITE_OMIT_SHARED_CACHE
70139 sqlite3VdbeChangeToNoop(v, 2, 1);
70140 #else
70141 sqlite3VdbeChangeP1(v, 2, iDb);
70142 sqlite3VdbeChangeP2(v, 2, pTab->tnum);
70143 sqlite3VdbeChangeP3(v, 2, flags);
70144 sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
70145 #endif
70146
70147 /* Remove either the OP_OpenWrite or OpenRead. Set the P2
70148 ** parameter of the other to pTab->tnum. */
70149 sqlite3VdbeChangeToNoop(v, 4 - flags, 1);
70150 sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
70151 sqlite3VdbeChangeP3(v, 3 + flags, iDb);
70152
70153 /* Configure the number of columns. Configure the cursor to
70154 ** think that the table has one more column than it really
@@ -70331,11 +70271,10 @@
70331
70332 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70333
70334 /************** End of vdbeblob.c ********************************************/
70335 /************** Begin file vdbesort.c ****************************************/
70336 #line 1 "tsrc/vdbesort.c"
70337 /*
70338 ** 2011 July 9
70339 **
70340 ** The author disclaims copyright to this source code. In place of
70341 ** a legal notice, here is a blessing:
@@ -70492,12 +70431,16 @@
70492 int rc; /* Return Code */
70493 int nRead; /* Number of bytes read */
70494 int nRec = 0; /* Size of record in bytes */
70495 int iOff = 0; /* Size of serialized size varint in bytes */
70496
70497 nRead = pIter->iEof - pIter->iReadOff;
70498 if( nRead>5 ) nRead = 5;
 
 
 
 
70499 if( nRead<=0 ){
70500 /* This is an EOF condition */
70501 vdbeSorterIterZero(db, pIter);
70502 return SQLITE_OK;
70503 }
@@ -71211,11 +71154,10 @@
71211
71212 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71213
71214 /************** End of vdbesort.c ********************************************/
71215 /************** Begin file journal.c *****************************************/
71216 #line 1 "tsrc/journal.c"
71217 /*
71218 ** 2007 August 22
71219 **
71220 ** The author disclaims copyright to this source code. In place of
71221 ** a legal notice, here is a blessing:
@@ -71452,11 +71394,10 @@
71452 }
71453 #endif
71454
71455 /************** End of journal.c *********************************************/
71456 /************** Begin file memjournal.c **************************************/
71457 #line 1 "tsrc/memjournal.c"
71458 /*
71459 ** 2008 October 7
71460 **
71461 ** The author disclaims copyright to this source code. In place of
71462 ** a legal notice, here is a blessing:
@@ -71714,11 +71655,10 @@
71714 return sizeof(MemJournal);
71715 }
71716
71717 /************** End of memjournal.c ******************************************/
71718 /************** Begin file walker.c ******************************************/
71719 #line 1 "tsrc/walker.c"
71720 /*
71721 ** 2008 August 16
71722 **
71723 ** The author disclaims copyright to this source code. In place of
71724 ** a legal notice, here is a blessing:
@@ -71853,11 +71793,10 @@
71853 return rc & WRC_Abort;
71854 }
71855
71856 /************** End of walker.c **********************************************/
71857 /************** Begin file resolve.c *****************************************/
71858 #line 1 "tsrc/resolve.c"
71859 /*
71860 ** 2008 August 18
71861 **
71862 ** The author disclaims copyright to this source code. In place of
71863 ** a legal notice, here is a blessing:
@@ -73074,11 +73013,10 @@
73074 sqlite3WalkSelect(&w, p);
73075 }
73076
73077 /************** End of resolve.c *********************************************/
73078 /************** Begin file expr.c ********************************************/
73079 #line 1 "tsrc/expr.c"
73080 /*
73081 ** 2001 September 15
73082 **
73083 ** The author disclaims copyright to this source code. In place of
73084 ** a legal notice, here is a blessing:
@@ -73977,11 +73915,12 @@
73977 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
73978 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
73979 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
73980 pNewItem->jointype = pOldItem->jointype;
73981 pNewItem->iCursor = pOldItem->iCursor;
73982 pNewItem->isPopulated = pOldItem->isPopulated;
 
73983 pNewItem->isCorrelated = pOldItem->isCorrelated;
73984 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
73985 pNewItem->notIndexed = pOldItem->notIndexed;
73986 pNewItem->pIndex = pOldItem->pIndex;
73987 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74476,11 @@
74537 assert(v);
74538 if( iCol<0 ){
74539 int iMem = ++pParse->nMem;
74540 int iAddr;
74541
74542 iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74543 sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74544
74545 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
74546 eType = IN_INDEX_ROWID;
74547
74548 sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74507,11 @@
74569 int iMem = ++pParse->nMem;
74570 int iAddr;
74571 char *pKey;
74572
74573 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74574 iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem);
74575 sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem);
74576
74577 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
74578 pKey,P4_KEYINFO_HANDOFF);
74579 VdbeComment((v, "%s", pIdx->zName));
74580 eType = IN_INDEX_INDEX;
@@ -74651,11 +74588,11 @@
74651 Parse *pParse, /* Parsing context */
74652 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
74653 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
74654 int isRowid /* If true, LHS of IN operator is a rowid */
74655 ){
74656 int testAddr = 0; /* One-time test address */
74657 int rReg = 0; /* Register storing resulting */
74658 Vdbe *v = sqlite3GetVdbe(pParse);
74659 if( NEVER(v==0) ) return 0;
74660 sqlite3ExprCachePush(pParse);
74661
@@ -74669,19 +74606,17 @@
74669 ** If all of the above are false, then we can run this code just once
74670 ** save the results, and reuse the same result on subsequent invocations.
74671 */
74672 if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
74673 int mem = ++pParse->nMem;
74674 sqlite3VdbeAddOp1(v, OP_If, mem);
74675 testAddr = sqlite3VdbeAddOp2(v, OP_Integer, 1, mem);
74676 assert( testAddr>0 || pParse->db->mallocFailed );
74677 }
74678
74679 #ifndef SQLITE_OMIT_EXPLAIN
74680 if( pParse->explain==2 ){
74681 char *zMsg = sqlite3MPrintf(
74682 pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ",
74683 pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
74684 );
74685 sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
74686 }
74687 #endif
@@ -74769,13 +74704,13 @@
74769 /* If the expression is not constant then we will need to
74770 ** disable the test that was generated above that makes sure
74771 ** this code only executes once. Because for a non-constant
74772 ** expression we need to rerun this code each time.
74773 */
74774 if( testAddr && !sqlite3ExprIsConstant(pE2) ){
74775 sqlite3VdbeChangeToNoop(v, testAddr-1, 2);
74776 testAddr = 0;
74777 }
74778
74779 /* Evaluate the expression and insert it into the temp table */
74780 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
74781 sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74775,12 @@
74840 ExprSetIrreducible(pExpr);
74841 break;
74842 }
74843 }
74844
74845 if( testAddr ){
74846 sqlite3VdbeJumpHere(v, testAddr-1);
74847 }
74848 sqlite3ExprCachePop(pParse, 1);
74849
74850 return rReg;
74851 }
@@ -76835,11 +76770,10 @@
76835 }
76836 }
76837
76838 /************** End of expr.c ************************************************/
76839 /************** Begin file alter.c *******************************************/
76840 #line 1 "tsrc/alter.c"
76841 /*
76842 ** 2005 February 15
76843 **
76844 ** The author disclaims copyright to this source code. In place of
76845 ** a legal notice, here is a blessing:
@@ -77664,11 +77598,10 @@
77664 }
77665 #endif /* SQLITE_ALTER_TABLE */
77666
77667 /************** End of alter.c ***********************************************/
77668 /************** Begin file analyze.c *****************************************/
77669 #line 1 "tsrc/analyze.c"
77670 /*
77671 ** 2005 July 8
77672 **
77673 ** The author disclaims copyright to this source code. In place of
77674 ** a legal notice, here is a blessing:
@@ -78386,11 +78319,10 @@
78386
78387 #endif /* SQLITE_OMIT_ANALYZE */
78388
78389 /************** End of analyze.c *********************************************/
78390 /************** Begin file attach.c ******************************************/
78391 #line 1 "tsrc/attach.c"
78392 /*
78393 ** 2003 April 6
78394 **
78395 ** The author disclaims copyright to this source code. In place of
78396 ** a legal notice, here is a blessing:
@@ -78946,11 +78878,10 @@
78946 }
78947 #endif
78948
78949 /************** End of attach.c **********************************************/
78950 /************** Begin file auth.c ********************************************/
78951 #line 1 "tsrc/auth.c"
78952 /*
78953 ** 2003 January 11
78954 **
78955 ** The author disclaims copyright to this source code. In place of
78956 ** a legal notice, here is a blessing:
@@ -79198,11 +79129,10 @@
79198
79199 #endif /* SQLITE_OMIT_AUTHORIZATION */
79200
79201 /************** End of auth.c ************************************************/
79202 /************** Begin file build.c *******************************************/
79203 #line 1 "tsrc/build.c"
79204 /*
79205 ** 2001 September 15
79206 **
79207 ** The author disclaims copyright to this source code. In place of
79208 ** a legal notice, here is a blessing:
@@ -83002,11 +82932,10 @@
83002 return pKey;
83003 }
83004
83005 /************** End of build.c ***********************************************/
83006 /************** Begin file callback.c ****************************************/
83007 #line 1 "tsrc/callback.c"
83008 /*
83009 ** 2005 May 23
83010 **
83011 ** The author disclaims copyright to this source code. In place of
83012 ** a legal notice, here is a blessing:
@@ -83462,11 +83391,10 @@
83462 return p;
83463 }
83464
83465 /************** End of callback.c ********************************************/
83466 /************** Begin file delete.c ******************************************/
83467 #line 1 "tsrc/delete.c"
83468 /*
83469 ** 2001 September 15
83470 **
83471 ** The author disclaims copyright to this source code. In place of
83472 ** a legal notice, here is a blessing:
@@ -84117,11 +84045,10 @@
84117 return regBase;
84118 }
84119
84120 /************** End of delete.c **********************************************/
84121 /************** Begin file func.c ********************************************/
84122 #line 1 "tsrc/func.c"
84123 /*
84124 ** 2002 February 23
84125 **
84126 ** The author disclaims copyright to this source code. In place of
84127 ** a legal notice, here is a blessing:
@@ -85726,11 +85653,10 @@
85726 #endif
85727 }
85728
85729 /************** End of func.c ************************************************/
85730 /************** Begin file fkey.c ********************************************/
85731 #line 1 "tsrc/fkey.c"
85732 /*
85733 **
85734 ** The author disclaims copyright to this source code. In place of
85735 ** a legal notice, here is a blessing:
85736 **
@@ -86947,11 +86873,10 @@
86947 }
86948 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
86949
86950 /************** End of fkey.c ************************************************/
86951 /************** Begin file insert.c ******************************************/
86952 #line 1 "tsrc/insert.c"
86953 /*
86954 ** 2001 September 15
86955 **
86956 ** The author disclaims copyright to this source code. In place of
86957 ** a legal notice, here is a blessing:
@@ -88793,11 +88718,10 @@
88793 }
88794 #endif /* SQLITE_OMIT_XFER_OPT */
88795
88796 /************** End of insert.c **********************************************/
88797 /************** Begin file legacy.c ******************************************/
88798 #line 1 "tsrc/legacy.c"
88799 /*
88800 ** 2001 September 15
88801 **
88802 ** The author disclaims copyright to this source code. In place of
88803 ** a legal notice, here is a blessing:
@@ -88941,11 +88865,10 @@
88941 return rc;
88942 }
88943
88944 /************** End of legacy.c **********************************************/
88945 /************** Begin file loadext.c *****************************************/
88946 #line 1 "tsrc/loadext.c"
88947 /*
88948 ** 2006 June 7
88949 **
88950 ** The author disclaims copyright to this source code. In place of
88951 ** a legal notice, here is a blessing:
@@ -88962,11 +88885,10 @@
88962 #ifndef SQLITE_CORE
88963 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
88964 #endif
88965 /************** Include sqlite3ext.h in the middle of loadext.c **************/
88966 /************** Begin file sqlite3ext.h **************************************/
88967 #line 1 "tsrc/sqlite3ext.h"
88968 /*
88969 ** 2006 June 7
88970 **
88971 ** The author disclaims copyright to this source code. In place of
88972 ** a legal notice, here is a blessing:
@@ -89391,11 +89313,10 @@
89391
89392 #endif /* _SQLITE3EXT_H_ */
89393
89394 /************** End of sqlite3ext.h ******************************************/
89395 /************** Continuing where we left off in loadext.c ********************/
89396 #line 20 "tsrc/loadext.c"
89397 /* #include <string.h> */
89398
89399 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89400
89401 /*
@@ -90031,11 +89952,10 @@
90031 }
90032 }
90033
90034 /************** End of loadext.c *********************************************/
90035 /************** Begin file pragma.c ******************************************/
90036 #line 1 "tsrc/pragma.c"
90037 /*
90038 ** 2003 April 6
90039 **
90040 ** The author disclaims copyright to this source code. In place of
90041 ** a legal notice, here is a blessing:
@@ -91560,11 +91480,10 @@
91560
91561 #endif /* SQLITE_OMIT_PRAGMA */
91562
91563 /************** End of pragma.c **********************************************/
91564 /************** Begin file prepare.c *****************************************/
91565 #line 1 "tsrc/prepare.c"
91566 /*
91567 ** 2005 May 25
91568 **
91569 ** The author disclaims copyright to this source code. In place of
91570 ** a legal notice, here is a blessing:
@@ -92421,11 +92340,10 @@
92421
92422 #endif /* SQLITE_OMIT_UTF16 */
92423
92424 /************** End of prepare.c *********************************************/
92425 /************** Begin file select.c ******************************************/
92426 #line 1 "tsrc/select.c"
92427 /*
92428 ** 2001 September 15
92429 **
92430 ** The author disclaims copyright to this source code. In place of
92431 ** a legal notice, here is a blessing:
@@ -92512,10 +92430,12 @@
92512 pNew->addrOpenEphm[2] = -1;
92513 if( db->mallocFailed ) {
92514 clearSelect(db, pNew);
92515 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92516 pNew = 0;
 
 
92517 }
92518 return pNew;
92519 }
92520
92521 /*
@@ -96224,11 +96144,15 @@
96224 struct SrcList_item *pItem = &pTabList->a[i];
96225 SelectDest dest;
96226 Select *pSub = pItem->pSelect;
96227 int isAggSub;
96228
96229 if( pSub==0 || pItem->isPopulated ) continue;
 
 
 
 
96230
96231 /* Increment Parse.nHeight by the height of the largest expression
96232 ** tree refered to by this, the parent select. The child select
96233 ** may contain expression trees of at most
96234 ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96159,48 @@
96235 ** more conservative than necessary, but much easier than enforcing
96236 ** an exact limit.
96237 */
96238 pParse->nHeight += sqlite3SelectExprHeight(p);
96239
96240 /* Check to see if the subquery can be absorbed into the parent. */
96241 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
96242 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
 
96243 if( isAggSub ){
96244 isAgg = 1;
96245 p->selFlags |= SF_Aggregate;
96246 }
96247 i = -1;
96248 }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96249 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
96250 assert( pItem->isPopulated==0 );
96251 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
96252 sqlite3Select(pParse, pSub, &dest);
96253 pItem->isPopulated = 1;
96254 pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
 
 
 
 
 
96255 }
96256 if( /*pParse->nErr ||*/ db->mallocFailed ){
96257 goto select_end;
96258 }
96259 pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96337,11 @@
96390 /* If sorting index that was created by a prior OP_OpenEphemeral
96391 ** instruction ended up not being needed, then change the OP_OpenEphemeral
96392 ** into an OP_Noop.
96393 */
96394 if( addrSortIndex>=0 && pOrderBy==0 ){
96395 sqlite3VdbeChangeToNoop(v, addrSortIndex, 1);
96396 p->addrOpenEphm[2] = -1;
96397 }
96398
96399 if( pWInfo->eDistinct ){
96400 VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96620,11 @@
96673 */
96674 if( groupBySort ){
96675 sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
96676 }else{
96677 sqlite3WhereEnd(pWInfo);
96678 sqlite3VdbeChangeToNoop(v, addrSortingIdx, 1);
96679 }
96680
96681 /* Output the final row of result
96682 */
96683 sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96928,10 @@
96981 *****************************************************************************/
96982 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
96983
96984 /************** End of select.c **********************************************/
96985 /************** Begin file table.c *******************************************/
96986 #line 1 "tsrc/table.c"
96987 /*
96988 ** 2001 September 15
96989 **
96990 ** The author disclaims copyright to this source code. In place of
96991 ** a legal notice, here is a blessing:
@@ -97181,11 +97127,10 @@
97181
97182 #endif /* SQLITE_OMIT_GET_TABLE */
97183
97184 /************** End of table.c ***********************************************/
97185 /************** Begin file trigger.c *****************************************/
97186 #line 1 "tsrc/trigger.c"
97187 /*
97188 **
97189 ** The author disclaims copyright to this source code. In place of
97190 ** a legal notice, here is a blessing:
97191 **
@@ -98307,11 +98252,10 @@
98307
98308 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98309
98310 /************** End of trigger.c *********************************************/
98311 /************** Begin file update.c ******************************************/
98312 #line 1 "tsrc/update.c"
98313 /*
98314 ** 2001 September 15
98315 **
98316 ** The author disclaims copyright to this source code. In place of
98317 ** a legal notice, here is a blessing:
@@ -98980,11 +98924,10 @@
98980 }
98981 #endif /* SQLITE_OMIT_VIRTUALTABLE */
98982
98983 /************** End of update.c **********************************************/
98984 /************** Begin file vacuum.c ******************************************/
98985 #line 1 "tsrc/vacuum.c"
98986 /*
98987 ** 2003 April 6
98988 **
98989 ** The author disclaims copyright to this source code. In place of
98990 ** a legal notice, here is a blessing:
@@ -99327,11 +99270,10 @@
99327
99328 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99329
99330 /************** End of vacuum.c **********************************************/
99331 /************** Begin file vtab.c ********************************************/
99332 #line 1 "tsrc/vtab.c"
99333 /*
99334 ** 2006 June 10
99335 **
99336 ** The author disclaims copyright to this source code. In place of
99337 ** a legal notice, here is a blessing:
@@ -100396,11 +100338,10 @@
100396
100397 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100398
100399 /************** End of vtab.c ************************************************/
100400 /************** Begin file where.c *******************************************/
100401 #line 1 "tsrc/where.c"
100402 /*
100403 ** 2001 September 15
100404 **
100405 ** The author disclaims copyright to this source code. In place of
100406 ** a legal notice, here is a blessing:
@@ -100865,15 +100806,23 @@
100865 return mask;
100866 }
100867 static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100868 Bitmask mask = 0;
100869 while( pS ){
 
100870 mask |= exprListTableUsage(pMaskSet, pS->pEList);
100871 mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100872 mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100873 mask |= exprTableUsage(pMaskSet, pS->pWhere);
100874 mask |= exprTableUsage(pMaskSet, pS->pHaving);
 
 
 
 
 
 
 
100875 pS = pS->pPrior;
100876 }
100877 return mask;
100878 }
100879
@@ -102392,12 +102341,11 @@
102392 /* Generate code to skip over the creation and initialization of the
102393 ** transient index on 2nd and subsequent iterations of the loop. */
102394 v = pParse->pVdbe;
102395 assert( v!=0 );
102396 regIsInit = ++pParse->nMem;
102397 addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit);
102398 sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit);
102399
102400 /* Count the number of columns that will be added to the index
102401 ** and used to match WHERE clause constraints */
102402 nColumn = 0;
102403 pTable = pSrc->pTab;
@@ -105583,11 +105531,10 @@
105583 return;
105584 }
105585
105586 /************** End of where.c ***********************************************/
105587 /************** Begin file parse.c *******************************************/
105588 #line 1 "tsrc/parse.c"
105589 /* Driver template for the LEMON parser generator.
105590 ** The author disclaims copyright to this source code.
105591 **
105592 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105593 ** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105543,10 @@
105596 ** specific grammar used by SQLite.
105597 */
105598 /* First off, code is included that follows the "include" declaration
105599 ** in the input grammar file. */
105600 /* #include <stdio.h> */
105601 #line 51 "parse.y"
105602
105603
105604 /*
105605 ** Disable all error recovery processing in the parser push-down
105606 ** automaton.
@@ -105644,11 +105590,10 @@
105644 /*
105645 ** An instance of this structure holds the ATTACH key and the key type.
105646 */
105647 struct AttachKey { int type; Token key; };
105648
105649 #line 722 "parse.y"
105650
105651 /* This is a utility routine used to set the ExprSpan.zStart and
105652 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105653 ** range of text beginning with pStart and going to the end of pEnd.
105654 */
@@ -105664,11 +105609,10 @@
105664 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105665 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105666 pOut->zStart = pValue->z;
105667 pOut->zEnd = &pValue->z[pValue->n];
105668 }
105669 #line 817 "parse.y"
105670
105671 /* This routine constructs a binary expression node out of two ExprSpan
105672 ** objects and uses the result to populate a new ExprSpan object.
105673 */
105674 static void spanBinaryExpr(
@@ -105680,11 +105624,10 @@
105680 ){
105681 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105682 pOut->zStart = pLeft->zStart;
105683 pOut->zEnd = pRight->zEnd;
105684 }
105685 #line 873 "parse.y"
105686
105687 /* Construct an expression node for a unary postfix operator
105688 */
105689 static void spanUnaryPostfix(
105690 ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105638,10 @@
105695 ){
105696 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105697 pOut->zStart = pOperand->zStart;
105698 pOut->zEnd = &pPostOp->z[pPostOp->n];
105699 }
105700 #line 892 "parse.y"
105701
105702 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105703 ** unary TK_ISNULL or TK_NOTNULL expression. */
105704 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105705 sqlite3 *db = pParse->db;
@@ -105707,11 +105649,10 @@
105707 pA->op = (u8)op;
105708 sqlite3ExprDelete(db, pA->pRight);
105709 pA->pRight = 0;
105710 }
105711 }
105712 #line 920 "parse.y"
105713
105714 /* Construct an expression node for a unary prefix operator
105715 */
105716 static void spanUnaryPrefix(
105717 ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105663,10 @@
105722 ){
105723 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105724 pOut->zStart = pPreOp->z;
105725 pOut->zEnd = pOperand->zEnd;
105726 }
105727 #line 141 "parse.c"
105728 /* Next is all token values, in a form suitable for use by makeheaders.
105729 ** This section will be null unless lemon is run with the -m switch.
105730 */
105731 /*
105732 ** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106918,17 @@
106978 ** inside the C code.
106979 */
106980 case 160: /* select */
106981 case 194: /* oneselect */
106982 {
106983 #line 403 "parse.y"
106984 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
106985 #line 1399 "parse.c"
106986 }
106987 break;
106988 case 174: /* term */
106989 case 175: /* expr */
106990 {
106991 #line 720 "parse.y"
106992 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
106993 #line 1407 "parse.c"
106994 }
106995 break;
106996 case 179: /* idxlist_opt */
106997 case 187: /* idxlist */
106998 case 197: /* selcollist */
@@ -107004,23 +106940,19 @@
107004 case 217: /* setlist */
107005 case 220: /* itemlist */
107006 case 221: /* exprlist */
107007 case 226: /* case_exprlist */
107008 {
107009 #line 1103 "parse.y"
107010 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107011 #line 1425 "parse.c"
107012 }
107013 break;
107014 case 193: /* fullname */
107015 case 198: /* from */
107016 case 206: /* seltablist */
107017 case 207: /* stl_prefix */
107018 {
107019 #line 534 "parse.y"
107020 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107021 #line 1435 "parse.c"
107022 }
107023 break;
107024 case 199: /* where_opt */
107025 case 201: /* having_opt */
107026 case 210: /* on_opt */
@@ -107028,37 +106960,29 @@
107028 case 225: /* case_operand */
107029 case 227: /* case_else */
107030 case 238: /* when_clause */
107031 case 243: /* key_opt */
107032 {
107033 #line 644 "parse.y"
107034 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107035 #line 1449 "parse.c"
107036 }
107037 break;
107038 case 211: /* using_opt */
107039 case 213: /* inscollist */
107040 case 219: /* inscollist_opt */
107041 {
107042 #line 566 "parse.y"
107043 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107044 #line 1458 "parse.c"
107045 }
107046 break;
107047 case 234: /* trigger_cmd_list */
107048 case 239: /* trigger_cmd */
107049 {
107050 #line 1210 "parse.y"
107051 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107052 #line 1466 "parse.c"
107053 }
107054 break;
107055 case 236: /* trigger_event */
107056 {
107057 #line 1196 "parse.y"
107058 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107059 #line 1473 "parse.c"
107060 }
107061 break;
107062 default: break; /* If no destructor action specified: do nothing */
107063 }
107064 }
@@ -107240,16 +107164,14 @@
107240 }
107241 #endif
107242 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107243 /* Here code is inserted which will execute if the parser
107244 ** stack every overflows */
107245 #line 38 "parse.y"
107246
107247 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107248 sqlite3ErrorMsg(pParse, "parser stack overflow");
107249 pParse->parseError = 1;
107250 #line 1664 "parse.c"
107251 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107252 }
107253
107254 /*
107255 ** Perform a shift action.
@@ -107686,94 +107608,66 @@
107686 ** { ... } // User supplied code
107687 ** #line <lineno> <thisfile>
107688 ** break;
107689 */
107690 case 5: /* explain ::= */
107691 #line 107 "parse.y"
107692 { sqlite3BeginParse(pParse, 0); }
107693 #line 2107 "parse.c"
107694 break;
107695 case 6: /* explain ::= EXPLAIN */
107696 #line 109 "parse.y"
107697 { sqlite3BeginParse(pParse, 1); }
107698 #line 2112 "parse.c"
107699 break;
107700 case 7: /* explain ::= EXPLAIN QUERY PLAN */
107701 #line 110 "parse.y"
107702 { sqlite3BeginParse(pParse, 2); }
107703 #line 2117 "parse.c"
107704 break;
107705 case 8: /* cmdx ::= cmd */
107706 #line 112 "parse.y"
107707 { sqlite3FinishCoding(pParse); }
107708 #line 2122 "parse.c"
107709 break;
107710 case 9: /* cmd ::= BEGIN transtype trans_opt */
107711 #line 117 "parse.y"
107712 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
107713 #line 2127 "parse.c"
107714 break;
107715 case 13: /* transtype ::= */
107716 #line 122 "parse.y"
107717 {yygotominor.yy4 = TK_DEFERRED;}
107718 #line 2132 "parse.c"
107719 break;
107720 case 14: /* transtype ::= DEFERRED */
107721 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107722 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107723 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107724 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
107725 #line 123 "parse.y"
107726 {yygotominor.yy4 = yymsp[0].major;}
107727 #line 2141 "parse.c"
107728 break;
107729 case 17: /* cmd ::= COMMIT trans_opt */
107730 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
107731 #line 126 "parse.y"
107732 {sqlite3CommitTransaction(pParse);}
107733 #line 2147 "parse.c"
107734 break;
107735 case 19: /* cmd ::= ROLLBACK trans_opt */
107736 #line 128 "parse.y"
107737 {sqlite3RollbackTransaction(pParse);}
107738 #line 2152 "parse.c"
107739 break;
107740 case 22: /* cmd ::= SAVEPOINT nm */
107741 #line 132 "parse.y"
107742 {
107743 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107744 }
107745 #line 2159 "parse.c"
107746 break;
107747 case 23: /* cmd ::= RELEASE savepoint_opt nm */
107748 #line 135 "parse.y"
107749 {
107750 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107751 }
107752 #line 2166 "parse.c"
107753 break;
107754 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
107755 #line 138 "parse.y"
107756 {
107757 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107758 }
107759 #line 2173 "parse.c"
107760 break;
107761 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
107762 #line 145 "parse.y"
107763 {
107764 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107765 }
107766 #line 2180 "parse.c"
107767 break;
107768 case 27: /* createkw ::= CREATE */
107769 #line 148 "parse.y"
107770 {
107771 pParse->db->lookaside.bEnabled = 0;
107772 yygotominor.yy0 = yymsp[0].minor.yy0;
107773 }
107774 #line 2188 "parse.c"
107775 break;
107776 case 28: /* ifnotexists ::= */
107777 case 31: /* temp ::= */ yytestcase(yyruleno==31);
107778 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107779 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107677,44 @@
107783 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107784 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107785 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107786 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107787 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
107788 #line 153 "parse.y"
107789 {yygotominor.yy4 = 0;}
107790 #line 2204 "parse.c"
107791 break;
107792 case 29: /* ifnotexists ::= IF NOT EXISTS */
107793 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107794 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107795 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107796 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107797 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107798 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107799 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
107800 #line 154 "parse.y"
107801 {yygotominor.yy4 = 1;}
107802 #line 2216 "parse.c"
107803 break;
107804 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
107805 #line 160 "parse.y"
107806 {
107807 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107808 }
107809 #line 2223 "parse.c"
107810 break;
107811 case 33: /* create_table_args ::= AS select */
107812 #line 163 "parse.y"
107813 {
107814 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107815 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107816 }
107817 #line 2231 "parse.c"
107818 break;
107819 case 36: /* column ::= columnid type carglist */
107820 #line 175 "parse.y"
107821 {
107822 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107823 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107824 }
107825 #line 2239 "parse.c"
107826 break;
107827 case 37: /* columnid ::= nm */
107828 #line 179 "parse.y"
107829 {
107830 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107831 yygotominor.yy0 = yymsp[0].minor.yy0;
107832 }
107833 #line 2247 "parse.c"
107834 break;
107835 case 38: /* id ::= ID */
107836 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107837 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107838 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107734,256 @@
107852 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107853 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107854 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107855 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107856 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
107857 #line 189 "parse.y"
107858 {yygotominor.yy0 = yymsp[0].minor.yy0;}
107859 #line 2273 "parse.c"
107860 break;
107861 case 45: /* type ::= typetoken */
107862 #line 251 "parse.y"
107863 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
107864 #line 2278 "parse.c"
107865 break;
107866 case 47: /* typetoken ::= typename LP signed RP */
107867 #line 253 "parse.y"
107868 {
107869 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107870 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107871 }
107872 #line 2286 "parse.c"
107873 break;
107874 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
107875 #line 257 "parse.y"
107876 {
107877 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107878 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107879 }
107880 #line 2294 "parse.c"
107881 break;
107882 case 50: /* typename ::= typename ids */
107883 #line 263 "parse.y"
107884 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
107885 #line 2299 "parse.c"
107886 break;
107887 case 57: /* ccons ::= DEFAULT term */
107888 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
107889 #line 274 "parse.y"
107890 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
107891 #line 2305 "parse.c"
107892 break;
107893 case 58: /* ccons ::= DEFAULT LP expr RP */
107894 #line 275 "parse.y"
107895 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
107896 #line 2310 "parse.c"
107897 break;
107898 case 60: /* ccons ::= DEFAULT MINUS term */
107899 #line 277 "parse.y"
107900 {
107901 ExprSpan v;
107902 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107903 v.zStart = yymsp[-1].minor.yy0.z;
107904 v.zEnd = yymsp[0].minor.yy118.zEnd;
107905 sqlite3AddDefaultValue(pParse,&v);
107906 }
107907 #line 2321 "parse.c"
107908 break;
107909 case 61: /* ccons ::= DEFAULT id */
107910 #line 284 "parse.y"
107911 {
107912 ExprSpan v;
107913 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107914 sqlite3AddDefaultValue(pParse,&v);
107915 }
107916 #line 2330 "parse.c"
107917 break;
107918 case 63: /* ccons ::= NOT NULL onconf */
107919 #line 294 "parse.y"
107920 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
107921 #line 2335 "parse.c"
107922 break;
107923 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
107924 #line 296 "parse.y"
107925 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
107926 #line 2340 "parse.c"
107927 break;
107928 case 65: /* ccons ::= UNIQUE onconf */
107929 #line 297 "parse.y"
107930 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
107931 #line 2345 "parse.c"
107932 break;
107933 case 66: /* ccons ::= CHECK LP expr RP */
107934 #line 298 "parse.y"
107935 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
107936 #line 2350 "parse.c"
107937 break;
107938 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
107939 #line 300 "parse.y"
107940 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
107941 #line 2355 "parse.c"
107942 break;
107943 case 68: /* ccons ::= defer_subclause */
107944 #line 301 "parse.y"
107945 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
107946 #line 2360 "parse.c"
107947 break;
107948 case 69: /* ccons ::= COLLATE ids */
107949 #line 302 "parse.y"
107950 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
107951 #line 2365 "parse.c"
107952 break;
107953 case 72: /* refargs ::= */
107954 #line 315 "parse.y"
107955 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
107956 #line 2370 "parse.c"
107957 break;
107958 case 73: /* refargs ::= refargs refarg */
107959 #line 316 "parse.y"
107960 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
107961 #line 2375 "parse.c"
107962 break;
107963 case 74: /* refarg ::= MATCH nm */
107964 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
107965 #line 318 "parse.y"
107966 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
107967 #line 2381 "parse.c"
107968 break;
107969 case 76: /* refarg ::= ON DELETE refact */
107970 #line 320 "parse.y"
107971 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
107972 #line 2386 "parse.c"
107973 break;
107974 case 77: /* refarg ::= ON UPDATE refact */
107975 #line 321 "parse.y"
107976 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
107977 #line 2391 "parse.c"
107978 break;
107979 case 78: /* refact ::= SET NULL */
107980 #line 323 "parse.y"
107981 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
107982 #line 2396 "parse.c"
107983 break;
107984 case 79: /* refact ::= SET DEFAULT */
107985 #line 324 "parse.y"
107986 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
107987 #line 2401 "parse.c"
107988 break;
107989 case 80: /* refact ::= CASCADE */
107990 #line 325 "parse.y"
107991 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
107992 #line 2406 "parse.c"
107993 break;
107994 case 81: /* refact ::= RESTRICT */
107995 #line 326 "parse.y"
107996 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
107997 #line 2411 "parse.c"
107998 break;
107999 case 82: /* refact ::= NO ACTION */
108000 #line 327 "parse.y"
108001 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108002 #line 2416 "parse.c"
108003 break;
108004 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108005 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108006 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108007 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108008 #line 330 "parse.y"
108009 {yygotominor.yy4 = yymsp[0].minor.yy4;}
108010 #line 2424 "parse.c"
108011 break;
108012 case 88: /* conslist_opt ::= */
108013 #line 339 "parse.y"
108014 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108015 #line 2429 "parse.c"
108016 break;
108017 case 89: /* conslist_opt ::= COMMA conslist */
108018 #line 340 "parse.y"
108019 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
108020 #line 2434 "parse.c"
108021 break;
108022 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108023 #line 346 "parse.y"
108024 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108025 #line 2439 "parse.c"
108026 break;
108027 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108028 #line 348 "parse.y"
108029 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108030 #line 2444 "parse.c"
108031 break;
108032 case 96: /* tcons ::= CHECK LP expr RP onconf */
108033 #line 350 "parse.y"
108034 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108035 #line 2449 "parse.c"
108036 break;
108037 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108038 #line 352 "parse.y"
108039 {
108040 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108041 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108042 }
108043 #line 2457 "parse.c"
108044 break;
108045 case 100: /* onconf ::= */
108046 #line 366 "parse.y"
108047 {yygotominor.yy4 = OE_Default;}
108048 #line 2462 "parse.c"
108049 break;
108050 case 102: /* orconf ::= */
108051 #line 368 "parse.y"
108052 {yygotominor.yy210 = OE_Default;}
108053 #line 2467 "parse.c"
108054 break;
108055 case 103: /* orconf ::= OR resolvetype */
108056 #line 369 "parse.y"
108057 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108058 #line 2472 "parse.c"
108059 break;
108060 case 105: /* resolvetype ::= IGNORE */
108061 #line 371 "parse.y"
108062 {yygotominor.yy4 = OE_Ignore;}
108063 #line 2477 "parse.c"
108064 break;
108065 case 106: /* resolvetype ::= REPLACE */
108066 #line 372 "parse.y"
108067 {yygotominor.yy4 = OE_Replace;}
108068 #line 2482 "parse.c"
108069 break;
108070 case 107: /* cmd ::= DROP TABLE ifexists fullname */
108071 #line 376 "parse.y"
108072 {
108073 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108074 }
108075 #line 2489 "parse.c"
108076 break;
108077 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108078 #line 386 "parse.y"
108079 {
108080 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108081 }
108082 #line 2496 "parse.c"
108083 break;
108084 case 111: /* cmd ::= DROP VIEW ifexists fullname */
108085 #line 389 "parse.y"
108086 {
108087 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108088 }
108089 #line 2503 "parse.c"
108090 break;
108091 case 112: /* cmd ::= select */
108092 #line 396 "parse.y"
108093 {
108094 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108095 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108096 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108097 }
108098 #line 2512 "parse.c"
108099 break;
108100 case 113: /* select ::= oneselect */
108101 #line 407 "parse.y"
108102 {yygotominor.yy387 = yymsp[0].minor.yy387;}
108103 #line 2517 "parse.c"
108104 break;
108105 case 114: /* select ::= select multiselect_op oneselect */
108106 #line 409 "parse.y"
108107 {
108108 if( yymsp[0].minor.yy387 ){
108109 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108110 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108111 }else{
108112 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108113 }
108114 yygotominor.yy387 = yymsp[0].minor.yy387;
108115 }
108116 #line 2530 "parse.c"
108117 break;
108118 case 116: /* multiselect_op ::= UNION ALL */
108119 #line 420 "parse.y"
108120 {yygotominor.yy4 = TK_ALL;}
108121 #line 2535 "parse.c"
108122 break;
108123 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108124 #line 424 "parse.y"
108125 {
108126 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108127 }
108128 #line 2542 "parse.c"
108129 break;
108130 case 122: /* sclp ::= selcollist COMMA */
108131 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108132 #line 445 "parse.y"
108133 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
108134 #line 2548 "parse.c"
108135 break;
108136 case 123: /* sclp ::= */
108137 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108138 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108139 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108140 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108141 #line 446 "parse.y"
108142 {yygotominor.yy322 = 0;}
108143 #line 2557 "parse.c"
108144 break;
108145 case 124: /* selcollist ::= sclp expr as */
108146 #line 447 "parse.y"
108147 {
108148 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108149 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108150 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108151 }
108152 #line 2566 "parse.c"
108153 break;
108154 case 125: /* selcollist ::= sclp STAR */
108155 #line 452 "parse.y"
108156 {
108157 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108158 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108159 }
108160 #line 2574 "parse.c"
108161 break;
108162 case 126: /* selcollist ::= sclp nm DOT STAR */
108163 #line 456 "parse.y"
108164 {
108165 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108166 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108167 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108168 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108169 }
108170 #line 2584 "parse.c"
108171 break;
108172 case 129: /* as ::= */
108173 #line 469 "parse.y"
108174 {yygotominor.yy0.n = 0;}
108175 #line 2589 "parse.c"
108176 break;
108177 case 130: /* from ::= */
108178 #line 481 "parse.y"
108179 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108180 #line 2594 "parse.c"
108181 break;
108182 case 131: /* from ::= FROM seltablist */
108183 #line 482 "parse.y"
108184 {
108185 yygotominor.yy259 = yymsp[0].minor.yy259;
108186 sqlite3SrcListShiftJoinType(yygotominor.yy259);
108187 }
108188 #line 2602 "parse.c"
108189 break;
108190 case 132: /* stl_prefix ::= seltablist joinop */
108191 #line 490 "parse.y"
108192 {
108193 yygotominor.yy259 = yymsp[-1].minor.yy259;
108194 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108195 }
108196 #line 2610 "parse.c"
108197 break;
108198 case 133: /* stl_prefix ::= */
108199 #line 494 "parse.y"
108200 {yygotominor.yy259 = 0;}
108201 #line 2615 "parse.c"
108202 break;
108203 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108204 #line 495 "parse.y"
108205 {
108206 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108207 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108208 }
108209 #line 2623 "parse.c"
108210 break;
108211 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108212 #line 501 "parse.y"
108213 {
108214 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108215 }
108216 #line 2630 "parse.c"
108217 break;
108218 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108219 #line 505 "parse.y"
108220 {
108221 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108222 yygotominor.yy259 = yymsp[-4].minor.yy259;
108223 }else{
108224 Select *pSubquery;
@@ -108225,260 +107990,180 @@
108225 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108226 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108227 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108228 }
108229 }
108230 #line 2644 "parse.c"
108231 break;
108232 case 137: /* dbnm ::= */
108233 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108234 #line 530 "parse.y"
108235 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108236 #line 2650 "parse.c"
108237 break;
108238 case 139: /* fullname ::= nm dbnm */
108239 #line 535 "parse.y"
108240 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108241 #line 2655 "parse.c"
108242 break;
108243 case 140: /* joinop ::= COMMA|JOIN */
108244 #line 539 "parse.y"
108245 { yygotominor.yy4 = JT_INNER; }
108246 #line 2660 "parse.c"
108247 break;
108248 case 141: /* joinop ::= JOIN_KW JOIN */
108249 #line 540 "parse.y"
108250 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108251 #line 2665 "parse.c"
108252 break;
108253 case 142: /* joinop ::= JOIN_KW nm JOIN */
108254 #line 541 "parse.y"
108255 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108256 #line 2670 "parse.c"
108257 break;
108258 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108259 #line 543 "parse.y"
108260 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108261 #line 2675 "parse.c"
108262 break;
108263 case 144: /* on_opt ::= ON expr */
108264 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108265 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108266 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108267 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108268 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108269 #line 547 "parse.y"
108270 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108271 #line 2685 "parse.c"
108272 break;
108273 case 145: /* on_opt ::= */
108274 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108275 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108276 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108277 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108278 #line 548 "parse.y"
108279 {yygotominor.yy314 = 0;}
108280 #line 2694 "parse.c"
108281 break;
108282 case 148: /* indexed_opt ::= NOT INDEXED */
108283 #line 563 "parse.y"
108284 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108285 #line 2699 "parse.c"
108286 break;
108287 case 149: /* using_opt ::= USING LP inscollist RP */
108288 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108289 #line 567 "parse.y"
108290 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
108291 #line 2705 "parse.c"
108292 break;
108293 case 150: /* using_opt ::= */
108294 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108295 #line 568 "parse.y"
108296 {yygotominor.yy384 = 0;}
108297 #line 2711 "parse.c"
108298 break;
108299 case 152: /* orderby_opt ::= ORDER BY sortlist */
108300 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108301 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108302 #line 579 "parse.y"
108303 {yygotominor.yy322 = yymsp[0].minor.yy322;}
108304 #line 2718 "parse.c"
108305 break;
108306 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108307 #line 580 "parse.y"
108308 {
108309 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108310 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108311 }
108312 #line 2726 "parse.c"
108313 break;
108314 case 154: /* sortlist ::= sortitem sortorder */
108315 #line 584 "parse.y"
108316 {
108317 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108318 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108319 }
108320 #line 2734 "parse.c"
108321 break;
108322 case 156: /* sortorder ::= ASC */
108323 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108324 #line 592 "parse.y"
108325 {yygotominor.yy4 = SQLITE_SO_ASC;}
108326 #line 2740 "parse.c"
108327 break;
108328 case 157: /* sortorder ::= DESC */
108329 #line 593 "parse.y"
108330 {yygotominor.yy4 = SQLITE_SO_DESC;}
108331 #line 2745 "parse.c"
108332 break;
108333 case 163: /* limit_opt ::= */
108334 #line 619 "parse.y"
108335 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108336 #line 2750 "parse.c"
108337 break;
108338 case 164: /* limit_opt ::= LIMIT expr */
108339 #line 620 "parse.y"
108340 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108341 #line 2755 "parse.c"
108342 break;
108343 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108344 #line 622 "parse.y"
108345 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108346 #line 2760 "parse.c"
108347 break;
108348 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108349 #line 624 "parse.y"
108350 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108351 #line 2765 "parse.c"
108352 break;
108353 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108354 #line 637 "parse.y"
108355 {
108356 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108357 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108358 }
108359 #line 2773 "parse.c"
108360 break;
108361 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108362 #line 660 "parse.y"
108363 {
108364 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108365 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108366 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108367 }
108368 #line 2782 "parse.c"
108369 break;
108370 case 171: /* setlist ::= setlist COMMA nm EQ expr */
108371 #line 670 "parse.y"
108372 {
108373 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108374 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108375 }
108376 #line 2790 "parse.c"
108377 break;
108378 case 172: /* setlist ::= nm EQ expr */
108379 #line 674 "parse.y"
108380 {
108381 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108382 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108383 }
108384 #line 2798 "parse.c"
108385 break;
108386 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108387 #line 683 "parse.y"
108388 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108389 #line 2803 "parse.c"
108390 break;
108391 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108392 #line 685 "parse.y"
108393 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108394 #line 2808 "parse.c"
108395 break;
108396 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108397 #line 687 "parse.y"
108398 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108399 #line 2813 "parse.c"
108400 break;
108401 case 176: /* insert_cmd ::= INSERT orconf */
108402 #line 690 "parse.y"
108403 {yygotominor.yy210 = yymsp[0].minor.yy210;}
108404 #line 2818 "parse.c"
108405 break;
108406 case 177: /* insert_cmd ::= REPLACE */
108407 #line 691 "parse.y"
108408 {yygotominor.yy210 = OE_Replace;}
108409 #line 2823 "parse.c"
108410 break;
108411 case 178: /* itemlist ::= itemlist COMMA expr */
108412 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108413 #line 698 "parse.y"
108414 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108415 #line 2829 "parse.c"
108416 break;
108417 case 179: /* itemlist ::= expr */
108418 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108419 #line 700 "parse.y"
108420 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108421 #line 2835 "parse.c"
108422 break;
108423 case 182: /* inscollist ::= inscollist COMMA nm */
108424 #line 710 "parse.y"
108425 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108426 #line 2840 "parse.c"
108427 break;
108428 case 183: /* inscollist ::= nm */
108429 #line 712 "parse.y"
108430 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108431 #line 2845 "parse.c"
108432 break;
108433 case 184: /* expr ::= term */
108434 #line 743 "parse.y"
108435 {yygotominor.yy118 = yymsp[0].minor.yy118;}
108436 #line 2850 "parse.c"
108437 break;
108438 case 185: /* expr ::= LP expr RP */
108439 #line 744 "parse.y"
108440 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108441 #line 2855 "parse.c"
108442 break;
108443 case 186: /* term ::= NULL */
108444 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108445 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108446 #line 745 "parse.y"
108447 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108448 #line 2862 "parse.c"
108449 break;
108450 case 187: /* expr ::= id */
108451 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108452 #line 746 "parse.y"
108453 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108454 #line 2868 "parse.c"
108455 break;
108456 case 189: /* expr ::= nm DOT nm */
108457 #line 748 "parse.y"
108458 {
108459 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108460 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108461 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108462 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108463 }
108464 #line 2878 "parse.c"
108465 break;
108466 case 190: /* expr ::= nm DOT nm DOT nm */
108467 #line 754 "parse.y"
108468 {
108469 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108470 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108471 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108472 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108473 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108474 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108475 }
108476 #line 2890 "parse.c"
108477 break;
108478 case 193: /* expr ::= REGISTER */
108479 #line 764 "parse.y"
108480 {
108481 /* When doing a nested parse, one can include terms in an expression
108482 ** that look like this: #1 #2 ... These terms refer to registers
108483 ** in the virtual machine. #N is the N-th register. */
108484 if( pParse->nested==0 ){
@@ -108488,40 +108173,32 @@
108488 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108489 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108490 }
108491 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108492 }
108493 #line 2907 "parse.c"
108494 break;
108495 case 194: /* expr ::= VARIABLE */
108496 #line 777 "parse.y"
108497 {
108498 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108499 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108500 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108501 }
108502 #line 2916 "parse.c"
108503 break;
108504 case 195: /* expr ::= expr COLLATE ids */
108505 #line 782 "parse.y"
108506 {
108507 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108508 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108509 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108510 }
108511 #line 2925 "parse.c"
108512 break;
108513 case 196: /* expr ::= CAST LP expr AS typetoken RP */
108514 #line 788 "parse.y"
108515 {
108516 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108517 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108518 }
108519 #line 2933 "parse.c"
108520 break;
108521 case 197: /* expr ::= ID LP distinct exprlist RP */
108522 #line 793 "parse.y"
108523 {
108524 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108525 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108526 }
108527 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108205,47 @@
108528 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108529 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108530 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108531 }
108532 }
108533 #line 2947 "parse.c"
108534 break;
108535 case 198: /* expr ::= ID LP STAR RP */
108536 #line 803 "parse.y"
108537 {
108538 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108539 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108540 }
108541 #line 2955 "parse.c"
108542 break;
108543 case 199: /* term ::= CTIME_KW */
108544 #line 807 "parse.y"
108545 {
108546 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108547 ** treated as functions that return constants */
108548 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108549 if( yygotominor.yy118.pExpr ){
108550 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108551 }
108552 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108553 }
108554 #line 2968 "parse.c"
108555 break;
108556 case 200: /* expr ::= expr AND expr */
108557 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108558 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108559 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108560 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108561 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108562 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108563 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108564 #line 834 "parse.y"
108565 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108566 #line 2980 "parse.c"
108567 break;
108568 case 208: /* likeop ::= LIKE_KW */
108569 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108570 #line 847 "parse.y"
108571 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108572 #line 2986 "parse.c"
108573 break;
108574 case 209: /* likeop ::= NOT LIKE_KW */
108575 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108576 #line 848 "parse.y"
108577 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108578 #line 2992 "parse.c"
108579 break;
108580 case 212: /* expr ::= expr likeop expr */
108581 #line 851 "parse.y"
108582 {
108583 ExprList *pList;
108584 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108585 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108586 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108252,12 @@
108587 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108588 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108589 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108590 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108591 }
108592 #line 3006 "parse.c"
108593 break;
108594 case 213: /* expr ::= expr likeop expr ESCAPE expr */
108595 #line 861 "parse.y"
108596 {
108597 ExprList *pList;
108598 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108599 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108600 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108265,40 @@
108602 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108603 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108604 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108605 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108606 }
108607 #line 3021 "parse.c"
108608 break;
108609 case 214: /* expr ::= expr ISNULL|NOTNULL */
108610 #line 889 "parse.y"
108611 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
108612 #line 3026 "parse.c"
108613 break;
108614 case 215: /* expr ::= expr NOT NULL */
108615 #line 890 "parse.y"
108616 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
108617 #line 3031 "parse.c"
108618 break;
108619 case 216: /* expr ::= expr IS expr */
108620 #line 911 "parse.y"
108621 {
108622 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108623 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108624 }
108625 #line 3039 "parse.c"
108626 break;
108627 case 217: /* expr ::= expr IS NOT expr */
108628 #line 915 "parse.y"
108629 {
108630 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108631 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108632 }
108633 #line 3047 "parse.c"
108634 break;
108635 case 218: /* expr ::= NOT expr */
108636 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
108637 #line 938 "parse.y"
108638 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108639 #line 3053 "parse.c"
108640 break;
108641 case 220: /* expr ::= MINUS expr */
108642 #line 941 "parse.y"
108643 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108644 #line 3058 "parse.c"
108645 break;
108646 case 221: /* expr ::= PLUS expr */
108647 #line 943 "parse.y"
108648 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
108649 #line 3063 "parse.c"
108650 break;
108651 case 224: /* expr ::= expr between_op expr AND expr */
108652 #line 948 "parse.y"
108653 {
108654 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108655 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108656 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108657 if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108308,12 @@
108661 }
108662 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108663 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108664 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108665 }
108666 #line 3080 "parse.c"
108667 break;
108668 case 227: /* expr ::= expr in_op LP exprlist RP */
108669 #line 965 "parse.y"
108670 {
108671 if( yymsp[-1].minor.yy322==0 ){
108672 /* Expressions of the form
108673 **
108674 ** expr1 IN ()
@@ -108690,14 +108335,12 @@
108690 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108691 }
108692 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108693 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108694 }
108695 #line 3109 "parse.c"
108696 break;
108697 case 228: /* expr ::= LP select RP */
108698 #line 990 "parse.y"
108699 {
108700 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108701 if( yygotominor.yy118.pExpr ){
108702 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108703 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108349,12 @@
108706 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108707 }
108708 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108709 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108710 }
108711 #line 3125 "parse.c"
108712 break;
108713 case 229: /* expr ::= expr in_op LP select RP */
108714 #line 1002 "parse.y"
108715 {
108716 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108717 if( yygotominor.yy118.pExpr ){
108718 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108719 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108364,12 @@
108723 }
108724 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108725 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108726 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108727 }
108728 #line 3142 "parse.c"
108729 break;
108730 case 230: /* expr ::= expr in_op nm dbnm */
108731 #line 1015 "parse.y"
108732 {
108733 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108734 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108735 if( yygotominor.yy118.pExpr ){
108736 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108380,12 @@
108741 }
108742 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108743 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108744 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108745 }
108746 #line 3160 "parse.c"
108747 break;
108748 case 231: /* expr ::= EXISTS LP select RP */
108749 #line 1029 "parse.y"
108750 {
108751 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108752 if( p ){
108753 p->x.pSelect = yymsp[-1].minor.yy387;
108754 ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108394,12 @@
108757 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108758 }
108759 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108760 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108761 }
108762 #line 3176 "parse.c"
108763 break;
108764 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
108765 #line 1044 "parse.y"
108766 {
108767 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108768 if( yygotominor.yy118.pExpr ){
108769 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108770 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108407,38 @@
108772 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108773 }
108774 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108775 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108776 }
108777 #line 3191 "parse.c"
108778 break;
108779 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
108780 #line 1057 "parse.y"
108781 {
108782 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108783 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108784 }
108785 #line 3199 "parse.c"
108786 break;
108787 case 234: /* case_exprlist ::= WHEN expr THEN expr */
108788 #line 1061 "parse.y"
108789 {
108790 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108791 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108792 }
108793 #line 3207 "parse.c"
108794 break;
108795 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
108796 #line 1090 "parse.y"
108797 {
108798 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108799 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108800 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108801 }
108802 #line 3216 "parse.c"
108803 break;
108804 case 244: /* uniqueflag ::= UNIQUE */
108805 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
108806 #line 1097 "parse.y"
108807 {yygotominor.yy4 = OE_Abort;}
108808 #line 3222 "parse.c"
108809 break;
108810 case 245: /* uniqueflag ::= */
108811 #line 1098 "parse.y"
108812 {yygotominor.yy4 = OE_None;}
108813 #line 3227 "parse.c"
108814 break;
108815 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
108816 #line 1107 "parse.y"
108817 {
108818 Expr *p = 0;
108819 if( yymsp[-1].minor.yy0.n>0 ){
108820 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108821 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108446,12 @@
108823 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108824 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108825 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108826 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108827 }
108828 #line 3242 "parse.c"
108829 break;
108830 case 249: /* idxlist ::= nm collate sortorder */
108831 #line 1118 "parse.y"
108832 {
108833 Expr *p = 0;
108834 if( yymsp[-1].minor.yy0.n>0 ){
108835 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108836 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108459,214 @@
108838 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108839 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108840 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108841 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108842 }
108843 #line 3257 "parse.c"
108844 break;
108845 case 250: /* collate ::= */
108846 #line 1131 "parse.y"
108847 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
108848 #line 3262 "parse.c"
108849 break;
108850 case 252: /* cmd ::= DROP INDEX ifexists fullname */
108851 #line 1137 "parse.y"
108852 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
108853 #line 3267 "parse.c"
108854 break;
108855 case 253: /* cmd ::= VACUUM */
108856 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
108857 #line 1143 "parse.y"
108858 {sqlite3Vacuum(pParse);}
108859 #line 3273 "parse.c"
108860 break;
108861 case 255: /* cmd ::= PRAGMA nm dbnm */
108862 #line 1151 "parse.y"
108863 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
108864 #line 3278 "parse.c"
108865 break;
108866 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
108867 #line 1152 "parse.y"
108868 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
108869 #line 3283 "parse.c"
108870 break;
108871 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
108872 #line 1153 "parse.y"
108873 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
108874 #line 3288 "parse.c"
108875 break;
108876 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
108877 #line 1155 "parse.y"
108878 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
108879 #line 3293 "parse.c"
108880 break;
108881 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
108882 #line 1157 "parse.y"
108883 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
108884 #line 3298 "parse.c"
108885 break;
108886 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
108887 #line 1175 "parse.y"
108888 {
108889 Token all;
108890 all.z = yymsp[-3].minor.yy0.z;
108891 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108892 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108893 }
108894 #line 3308 "parse.c"
108895 break;
108896 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
108897 #line 1184 "parse.y"
108898 {
108899 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108900 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108901 }
108902 #line 3316 "parse.c"
108903 break;
108904 case 272: /* trigger_time ::= BEFORE */
108905 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
108906 #line 1190 "parse.y"
108907 { yygotominor.yy4 = TK_BEFORE; }
108908 #line 3322 "parse.c"
108909 break;
108910 case 273: /* trigger_time ::= AFTER */
108911 #line 1191 "parse.y"
108912 { yygotominor.yy4 = TK_AFTER; }
108913 #line 3327 "parse.c"
108914 break;
108915 case 274: /* trigger_time ::= INSTEAD OF */
108916 #line 1192 "parse.y"
108917 { yygotominor.yy4 = TK_INSTEAD;}
108918 #line 3332 "parse.c"
108919 break;
108920 case 276: /* trigger_event ::= DELETE|INSERT */
108921 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
108922 #line 1197 "parse.y"
108923 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
108924 #line 3338 "parse.c"
108925 break;
108926 case 278: /* trigger_event ::= UPDATE OF inscollist */
108927 #line 1199 "parse.y"
108928 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
108929 #line 3343 "parse.c"
108930 break;
108931 case 281: /* when_clause ::= */
108932 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
108933 #line 1206 "parse.y"
108934 { yygotominor.yy314 = 0; }
108935 #line 3349 "parse.c"
108936 break;
108937 case 282: /* when_clause ::= WHEN expr */
108938 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
108939 #line 1207 "parse.y"
108940 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
108941 #line 3355 "parse.c"
108942 break;
108943 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
108944 #line 1211 "parse.y"
108945 {
108946 assert( yymsp[-2].minor.yy203!=0 );
108947 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108948 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108949 yygotominor.yy203 = yymsp[-2].minor.yy203;
108950 }
108951 #line 3365 "parse.c"
108952 break;
108953 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
108954 #line 1217 "parse.y"
108955 {
108956 assert( yymsp[-1].minor.yy203!=0 );
108957 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108958 yygotominor.yy203 = yymsp[-1].minor.yy203;
108959 }
108960 #line 3374 "parse.c"
108961 break;
108962 case 286: /* trnm ::= nm DOT nm */
108963 #line 1229 "parse.y"
108964 {
108965 yygotominor.yy0 = yymsp[0].minor.yy0;
108966 sqlite3ErrorMsg(pParse,
108967 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108968 "statements within triggers");
108969 }
108970 #line 3384 "parse.c"
108971 break;
108972 case 288: /* tridxby ::= INDEXED BY nm */
108973 #line 1241 "parse.y"
108974 {
108975 sqlite3ErrorMsg(pParse,
108976 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108977 "within triggers");
108978 }
108979 #line 3393 "parse.c"
108980 break;
108981 case 289: /* tridxby ::= NOT INDEXED */
108982 #line 1246 "parse.y"
108983 {
108984 sqlite3ErrorMsg(pParse,
108985 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108986 "within triggers");
108987 }
108988 #line 3402 "parse.c"
108989 break;
108990 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
108991 #line 1259 "parse.y"
108992 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
108993 #line 3407 "parse.c"
108994 break;
108995 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
108996 #line 1264 "parse.y"
108997 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
108998 #line 3412 "parse.c"
108999 break;
109000 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109001 #line 1267 "parse.y"
109002 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109003 #line 3417 "parse.c"
109004 break;
109005 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109006 #line 1271 "parse.y"
109007 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109008 #line 3422 "parse.c"
109009 break;
109010 case 294: /* trigger_cmd ::= select */
109011 #line 1274 "parse.y"
109012 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109013 #line 3427 "parse.c"
109014 break;
109015 case 295: /* expr ::= RAISE LP IGNORE RP */
109016 #line 1277 "parse.y"
109017 {
109018 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109019 if( yygotominor.yy118.pExpr ){
109020 yygotominor.yy118.pExpr->affinity = OE_Ignore;
109021 }
109022 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109023 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109024 }
109025 #line 3439 "parse.c"
109026 break;
109027 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109028 #line 1285 "parse.y"
109029 {
109030 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109031 if( yygotominor.yy118.pExpr ) {
109032 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109033 }
109034 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109035 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109036 }
109037 #line 3451 "parse.c"
109038 break;
109039 case 297: /* raisetype ::= ROLLBACK */
109040 #line 1296 "parse.y"
109041 {yygotominor.yy4 = OE_Rollback;}
109042 #line 3456 "parse.c"
109043 break;
109044 case 299: /* raisetype ::= FAIL */
109045 #line 1298 "parse.y"
109046 {yygotominor.yy4 = OE_Fail;}
109047 #line 3461 "parse.c"
109048 break;
109049 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109050 #line 1303 "parse.y"
109051 {
109052 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109053 }
109054 #line 3468 "parse.c"
109055 break;
109056 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109057 #line 1310 "parse.y"
109058 {
109059 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109060 }
109061 #line 3475 "parse.c"
109062 break;
109063 case 302: /* cmd ::= DETACH database_kw_opt expr */
109064 #line 1313 "parse.y"
109065 {
109066 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109067 }
109068 #line 3482 "parse.c"
109069 break;
109070 case 307: /* cmd ::= REINDEX */
109071 #line 1328 "parse.y"
109072 {sqlite3Reindex(pParse, 0, 0);}
109073 #line 3487 "parse.c"
109074 break;
109075 case 308: /* cmd ::= REINDEX nm dbnm */
109076 #line 1329 "parse.y"
109077 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109078 #line 3492 "parse.c"
109079 break;
109080 case 309: /* cmd ::= ANALYZE */
109081 #line 1334 "parse.y"
109082 {sqlite3Analyze(pParse, 0, 0);}
109083 #line 3497 "parse.c"
109084 break;
109085 case 310: /* cmd ::= ANALYZE nm dbnm */
109086 #line 1335 "parse.y"
109087 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109088 #line 3502 "parse.c"
109089 break;
109090 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109091 #line 1340 "parse.y"
109092 {
109093 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109094 }
109095 #line 3509 "parse.c"
109096 break;
109097 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109098 #line 1343 "parse.y"
109099 {
109100 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109101 }
109102 #line 3516 "parse.c"
109103 break;
109104 case 313: /* add_column_fullname ::= fullname */
109105 #line 1346 "parse.y"
109106 {
109107 pParse->db->lookaside.bEnabled = 0;
109108 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109109 }
109110 #line 3524 "parse.c"
109111 break;
109112 case 316: /* cmd ::= create_vtab */
109113 #line 1356 "parse.y"
109114 {sqlite3VtabFinishParse(pParse,0);}
109115 #line 3529 "parse.c"
109116 break;
109117 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109118 #line 1357 "parse.y"
109119 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109120 #line 3534 "parse.c"
109121 break;
109122 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109123 #line 1358 "parse.y"
109124 {
109125 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109126 }
109127 #line 3541 "parse.c"
109128 break;
109129 case 321: /* vtabarg ::= */
109130 #line 1363 "parse.y"
109131 {sqlite3VtabArgInit(pParse);}
109132 #line 3546 "parse.c"
109133 break;
109134 case 323: /* vtabargtoken ::= ANY */
109135 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109136 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109137 #line 1365 "parse.y"
109138 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109139 #line 3553 "parse.c"
109140 break;
109141 default:
109142 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109143 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109144 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108764,15 @@
109236 int yymajor, /* The major type of the error token */
109237 YYMINORTYPE yyminor /* The minor type of the error token */
109238 ){
109239 sqlite3ParserARG_FETCH;
109240 #define TOKEN (yyminor.yy0)
109241 #line 32 "parse.y"
109242
109243 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109244 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109245 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109246 pParse->parseError = 1;
109247 #line 3661 "parse.c"
109248 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109249 }
109250
109251 /*
109252 ** The following is executed when the parser accepts
@@ -109436,11 +108962,10 @@
109436 return;
109437 }
109438
109439 /************** End of parse.c ***********************************************/
109440 /************** Begin file tokenize.c ****************************************/
109441 #line 1 "tsrc/tokenize.c"
109442 /*
109443 ** 2001 September 15
109444 **
109445 ** The author disclaims copyright to this source code. In place of
109446 ** a legal notice, here is a blessing:
@@ -109502,11 +109027,10 @@
109502 ** named keywordhash.h and then included into this source file by
109503 ** the #include below.
109504 */
109505 /************** Include keywordhash.h in the middle of tokenize.c ************/
109506 /************** Begin file keywordhash.h *************************************/
109507 #line 1 "tsrc/keywordhash.h"
109508 /***** This file contains automatically generated code ******
109509 **
109510 ** The code in this file has been automatically generated by
109511 **
109512 ** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109300,10 @@
109776 }
109777 #define SQLITE_N_KEYWORD 121
109778
109779 /************** End of keywordhash.h *****************************************/
109780 /************** Continuing where we left off in tokenize.c *******************/
109781 #line 66 "tsrc/tokenize.c"
109782
109783
109784 /*
109785 ** If X is a character that can be used in an identifier then
109786 ** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109764,10 @@
110241 return nErr;
110242 }
110243
110244 /************** End of tokenize.c ********************************************/
110245 /************** Begin file complete.c ****************************************/
110246 #line 1 "tsrc/complete.c"
110247 /*
110248 ** 2001 September 15
110249 **
110250 ** The author disclaims copyright to this source code. In place of
110251 ** a legal notice, here is a blessing:
@@ -110527,11 +110049,10 @@
110527 #endif /* SQLITE_OMIT_UTF16 */
110528 #endif /* SQLITE_OMIT_COMPLETE */
110529
110530 /************** End of complete.c ********************************************/
110531 /************** Begin file main.c ********************************************/
110532 #line 1 "tsrc/main.c"
110533 /*
110534 ** 2001 September 15
110535 **
110536 ** The author disclaims copyright to this source code. In place of
110537 ** a legal notice, here is a blessing:
@@ -110548,11 +110069,10 @@
110548 */
110549
110550 #ifdef SQLITE_ENABLE_FTS3
110551 /************** Include fts3.h in the middle of main.c ***********************/
110552 /************** Begin file fts3.h ********************************************/
110553 #line 1 "tsrc/fts3.h"
110554 /*
110555 ** 2006 Oct 10
110556 **
110557 ** The author disclaims copyright to this source code. In place of
110558 ** a legal notice, here is a blessing:
@@ -110577,16 +110097,14 @@
110577 } /* extern "C" */
110578 #endif /* __cplusplus */
110579
110580 /************** End of fts3.h ************************************************/
110581 /************** Continuing where we left off in main.c ***********************/
110582 #line 21 "tsrc/main.c"
110583 #endif
110584 #ifdef SQLITE_ENABLE_RTREE
110585 /************** Include rtree.h in the middle of main.c **********************/
110586 /************** Begin file rtree.h *******************************************/
110587 #line 1 "tsrc/rtree.h"
110588 /*
110589 ** 2008 May 26
110590 **
110591 ** The author disclaims copyright to this source code. In place of
110592 ** a legal notice, here is a blessing:
@@ -110611,16 +110129,14 @@
110611 } /* extern "C" */
110612 #endif /* __cplusplus */
110613
110614 /************** End of rtree.h ***********************************************/
110615 /************** Continuing where we left off in main.c ***********************/
110616 #line 24 "tsrc/main.c"
110617 #endif
110618 #ifdef SQLITE_ENABLE_ICU
110619 /************** Include sqliteicu.h in the middle of main.c ******************/
110620 /************** Begin file sqliteicu.h ***************************************/
110621 #line 1 "tsrc/sqliteicu.h"
110622 /*
110623 ** 2008 May 26
110624 **
110625 ** The author disclaims copyright to this source code. In place of
110626 ** a legal notice, here is a blessing:
@@ -110646,11 +110162,10 @@
110646 #endif /* __cplusplus */
110647
110648
110649 /************** End of sqliteicu.h *******************************************/
110650 /************** Continuing where we left off in main.c ***********************/
110651 #line 27 "tsrc/main.c"
110652 #endif
110653
110654 #ifndef SQLITE_AMALGAMATION
110655 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110656 ** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113092,10 @@
113577 return 0;
113578 }
113579
113580 /************** End of main.c ************************************************/
113581 /************** Begin file notify.c ******************************************/
113582 #line 1 "tsrc/notify.c"
113583 /*
113584 ** 2009 March 3
113585 **
113586 ** The author disclaims copyright to this source code. In place of
113587 ** a legal notice, here is a blessing:
@@ -113911,11 +113425,10 @@
113911 }
113912 #endif
113913
113914 /************** End of notify.c **********************************************/
113915 /************** Begin file fts3.c ********************************************/
113916 #line 1 "tsrc/fts3.c"
113917 /*
113918 ** 2006 Oct 10
113919 **
113920 ** The author disclaims copyright to this source code. In place of
113921 ** a legal notice, here is a blessing:
@@ -114208,11 +113721,10 @@
114208 ** into a single segment.
114209 */
114210
114211 /************** Include fts3Int.h in the middle of fts3.c ********************/
114212 /************** Begin file fts3Int.h *****************************************/
114213 #line 1 "tsrc/fts3Int.h"
114214 /*
114215 ** 2009 Nov 12
114216 **
114217 ** The author disclaims copyright to this source code. In place of
114218 ** a legal notice, here is a blessing:
@@ -114247,11 +113759,10 @@
114247 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114248 #endif
114249
114250 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114251 /************** Begin file fts3_tokenizer.h **********************************/
114252 #line 1 "tsrc/fts3_tokenizer.h"
114253 /*
114254 ** 2006 July 10
114255 **
114256 ** The author disclaims copyright to this source code.
114257 **
@@ -114402,14 +113913,12 @@
114402
114403 #endif /* _FTS3_TOKENIZER_H_ */
114404
114405 /************** End of fts3_tokenizer.h **************************************/
114406 /************** Continuing where we left off in fts3Int.h ********************/
114407 #line 40 "tsrc/fts3Int.h"
114408 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114409 /************** Begin file fts3_hash.h ***************************************/
114410 #line 1 "tsrc/fts3_hash.h"
114411 /*
114412 ** 2001 September 22
114413 **
114414 ** The author disclaims copyright to this source code. In place of
114415 ** a legal notice, here is a blessing:
@@ -114521,11 +114030,10 @@
114521
114522 #endif /* _FTS3_HASH_H_ */
114523
114524 /************** End of fts3_hash.h *******************************************/
114525 /************** Continuing where we left off in fts3Int.h ********************/
114526 #line 41 "tsrc/fts3Int.h"
114527
114528 /*
114529 ** This constant controls how often segments are merged. Once there are
114530 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114531 ** segment of level N+1.
@@ -114998,11 +114506,10 @@
114998 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114999 #endif /* _FTSINT_H */
115000
115001 /************** End of fts3Int.h *********************************************/
115002 /************** Continuing where we left off in fts3.c ***********************/
115003 #line 296 "tsrc/fts3.c"
115004 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115005
115006 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115007 # define SQLITE_CORE 1
115008 #endif
@@ -119548,11 +119055,10 @@
119548
119549 #endif
119550
119551 /************** End of fts3.c ************************************************/
119552 /************** Begin file fts3_aux.c ****************************************/
119553 #line 1 "tsrc/fts3_aux.c"
119554 /*
119555 ** 2011 Jan 27
119556 **
119557 ** The author disclaims copyright to this source code. In place of
119558 ** a legal notice, here is a blessing:
@@ -120025,11 +119531,10 @@
120025
120026 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120027
120028 /************** End of fts3_aux.c ********************************************/
120029 /************** Begin file fts3_expr.c ***************************************/
120030 #line 1 "tsrc/fts3_expr.c"
120031 /*
120032 ** 2008 Nov 28
120033 **
120034 ** The author disclaims copyright to this source code. In place of
120035 ** a legal notice, here is a blessing:
@@ -120992,11 +120497,10 @@
120992 #endif
120993 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120994
120995 /************** End of fts3_expr.c *******************************************/
120996 /************** Begin file fts3_hash.c ***************************************/
120997 #line 1 "tsrc/fts3_hash.c"
120998 /*
120999 ** 2001 September 22
121000 **
121001 ** The author disclaims copyright to this source code. In place of
121002 ** a legal notice, here is a blessing:
@@ -121377,11 +120881,10 @@
121377
121378 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121379
121380 /************** End of fts3_hash.c *******************************************/
121381 /************** Begin file fts3_porter.c *************************************/
121382 #line 1 "tsrc/fts3_porter.c"
121383 /*
121384 ** 2006 September 30
121385 **
121386 ** The author disclaims copyright to this source code. In place of
121387 ** a legal notice, here is a blessing:
@@ -122024,11 +121527,10 @@
122024
122025 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122026
122027 /************** End of fts3_porter.c *****************************************/
122028 /************** Begin file fts3_tokenizer.c **********************************/
122029 #line 1 "tsrc/fts3_tokenizer.c"
122030 /*
122031 ** 2007 June 22
122032 **
122033 ** The author disclaims copyright to this source code. In place of
122034 ** a legal notice, here is a blessing:
@@ -122516,11 +122018,10 @@
122516
122517 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122518
122519 /************** End of fts3_tokenizer.c **************************************/
122520 /************** Begin file fts3_tokenizer1.c *********************************/
122521 #line 1 "tsrc/fts3_tokenizer1.c"
122522 /*
122523 ** 2006 Oct 10
122524 **
122525 ** The author disclaims copyright to this source code. In place of
122526 ** a legal notice, here is a blessing:
@@ -122751,11 +122252,10 @@
122751
122752 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122753
122754 /************** End of fts3_tokenizer1.c *************************************/
122755 /************** Begin file fts3_write.c **************************************/
122756 #line 1 "tsrc/fts3_write.c"
122757 /*
122758 ** 2009 Oct 23
122759 **
122760 ** The author disclaims copyright to this source code. In place of
122761 ** a legal notice, here is a blessing:
@@ -126022,11 +125522,10 @@
126022
126023 #endif
126024
126025 /************** End of fts3_write.c ******************************************/
126026 /************** Begin file fts3_snippet.c ************************************/
126027 #line 1 "tsrc/fts3_snippet.c"
126028 /*
126029 ** 2009 Oct 23
126030 **
126031 ** The author disclaims copyright to this source code. In place of
126032 ** a legal notice, here is a blessing:
@@ -127524,11 +127023,10 @@
127524
127525 #endif
127526
127527 /************** End of fts3_snippet.c ****************************************/
127528 /************** Begin file rtree.c *******************************************/
127529 #line 1 "tsrc/rtree.c"
127530 /*
127531 ** 2001 September 15
127532 **
127533 ** The author disclaims copyright to this source code. In place of
127534 ** a legal notice, here is a blessing:
@@ -130806,11 +130304,10 @@
130806
130807 #endif
130808
130809 /************** End of rtree.c ***********************************************/
130810 /************** Begin file icu.c *********************************************/
130811 #line 1 "tsrc/icu.c"
130812 /*
130813 ** 2007 May 6
130814 **
130815 ** The author disclaims copyright to this source code. In place of
130816 ** a legal notice, here is a blessing:
@@ -131309,11 +130806,10 @@
131309
131310 #endif
131311
131312 /************** End of icu.c *************************************************/
131313 /************** Begin file fts3_icu.c ****************************************/
131314 #line 1 "tsrc/fts3_icu.c"
131315 /*
131316 ** 2007 June 22
131317 **
131318 ** The author disclaims copyright to this source code. In place of
131319 ** a legal notice, here is a blessing:
131320
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
 
29 /*
30 ** 2001 September 15
31 **
32 ** The author disclaims copyright to this source code. In place of
33 ** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
78 #include "config.h"
79 #endif
80
81 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
82 /************** Begin file sqliteLimit.h *************************************/
 
83 /*
84 ** 2007 May 7
85 **
86 ** The author disclaims copyright to this source code. In place of
87 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
289 # define SQLITE_MAX_TRIGGER_DEPTH 1000
290 #endif
291
292 /************** End of sqliteLimit.h *****************************************/
293 /************** Continuing where we left off in sqliteInt.h ******************/
 
294
295 /* Disable nuisance warnings on Borland compilers */
296 #if defined(__BORLANDC__)
297 #pragma warn -rch /* unreachable code */
298 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
545 # define unlikely(X) !!(X)
546 #endif
547
548 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
549 /************** Begin file sqlite3.h *****************************************/
 
550 /*
551 ** 2001 September 15
552 **
553 ** The author disclaims copyright to this source code. In place of
554 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
656 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
657 ** [sqlite_version()] and [sqlite_source_id()].
658 */
659 #define SQLITE_VERSION "3.7.8"
660 #define SQLITE_VERSION_NUMBER 3007008
661 #define SQLITE_SOURCE_ID "2011-09-19 14:49:19 3e0da808d2f5b4d12046e05980ca04578f581177"
662
663 /*
664 ** CAPI3REF: Run-Time Library Version Numbers
665 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
666 **
@@ -7309,14 +7305,12 @@
7305 #endif /* ifndef _SQLITE3RTREE_H_ */
7306
7307
7308 /************** End of sqlite3.h *********************************************/
7309 /************** Continuing where we left off in sqliteInt.h ******************/
 
7310 /************** Include hash.h in the middle of sqliteInt.h ******************/
7311 /************** Begin file hash.h ********************************************/
 
7312 /*
7313 ** 2001 September 22
7314 **
7315 ** The author disclaims copyright to this source code. In place of
7316 ** a legal notice, here is a blessing:
@@ -7412,14 +7406,12 @@
7406
7407 #endif /* _SQLITE_HASH_H_ */
7408
7409 /************** End of hash.h ************************************************/
7410 /************** Continuing where we left off in sqliteInt.h ******************/
 
7411 /************** Include parse.h in the middle of sqliteInt.h *****************/
7412 /************** Begin file parse.h *******************************************/
 
7413 #define TK_SEMI 1
7414 #define TK_EXPLAIN 2
7415 #define TK_QUERY 3
7416 #define TK_PLAN 4
7417 #define TK_BEGIN 5
@@ -7576,11 +7568,10 @@
7568 #define TK_UMINUS 156
7569 #define TK_UPLUS 157
7570
7571 /************** End of parse.h ***********************************************/
7572 /************** Continuing where we left off in sqliteInt.h ******************/
 
7573 #include <stdio.h>
7574 #include <stdlib.h>
7575 #include <string.h>
7576 #include <assert.h>
7577 #include <stddef.h>
@@ -7920,11 +7911,10 @@
7911 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7912 ** pointer types (i.e. FuncDef) defined above.
7913 */
7914 /************** Include btree.h in the middle of sqliteInt.h *****************/
7915 /************** Begin file btree.h *******************************************/
 
7916 /*
7917 ** 2001 September 15
7918 **
7919 ** The author disclaims copyright to this source code. In place of
7920 ** a legal notice, here is a blessing:
@@ -8165,14 +8155,12 @@
8155
8156 #endif /* _BTREE_H_ */
8157
8158 /************** End of btree.h ***********************************************/
8159 /************** Continuing where we left off in sqliteInt.h ******************/
 
8160 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8161 /************** Begin file vdbe.h ********************************************/
 
8162 /*
8163 ** 2001 September 15
8164 **
8165 ** The author disclaims copyright to this source code. In place of
8166 ** a legal notice, here is a blessing:
@@ -8333,11 +8321,10 @@
8321 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8322 ** header file that defines a number for each opcode used by the VDBE.
8323 */
8324 /************** Include opcodes.h in the middle of vdbe.h ********************/
8325 /************** Begin file opcodes.h *****************************************/
 
8326 /* Automatically generated. Do not edit */
8327 /* See the mkopcodeh.awk script for details */
8328 #define OP_Goto 1
8329 #define OP_Gosub 2
8330 #define OP_Return 3
@@ -8387,108 +8374,109 @@
8374 #define OP_Jump 25
8375 #define OP_And 69 /* same as TK_AND */
8376 #define OP_Or 68 /* same as TK_OR */
8377 #define OP_Not 19 /* same as TK_NOT */
8378 #define OP_BitNot 93 /* same as TK_BITNOT */
8379 #define OP_Once 26
8380 #define OP_If 27
8381 #define OP_IfNot 28
8382 #define OP_IsNull 73 /* same as TK_ISNULL */
8383 #define OP_NotNull 74 /* same as TK_NOTNULL */
8384 #define OP_Column 29
8385 #define OP_Affinity 30
8386 #define OP_MakeRecord 31
8387 #define OP_Count 32
8388 #define OP_Savepoint 33
8389 #define OP_AutoCommit 34
8390 #define OP_Transaction 35
8391 #define OP_ReadCookie 36
8392 #define OP_SetCookie 37
8393 #define OP_VerifyCookie 38
8394 #define OP_OpenRead 39
8395 #define OP_OpenWrite 40
8396 #define OP_OpenAutoindex 41
8397 #define OP_OpenEphemeral 42
8398 #define OP_SorterOpen 43
8399 #define OP_OpenPseudo 44
8400 #define OP_Close 45
8401 #define OP_SeekLt 46
8402 #define OP_SeekLe 47
8403 #define OP_SeekGe 48
8404 #define OP_SeekGt 49
8405 #define OP_Seek 50
8406 #define OP_NotFound 51
8407 #define OP_Found 52
8408 #define OP_IsUnique 53
8409 #define OP_NotExists 54
8410 #define OP_Sequence 55
8411 #define OP_NewRowid 56
8412 #define OP_Insert 57
8413 #define OP_InsertInt 58
8414 #define OP_Delete 59
8415 #define OP_ResetCount 60
8416 #define OP_SorterCompare 61
8417 #define OP_SorterData 62
8418 #define OP_RowKey 63
8419 #define OP_RowData 64
8420 #define OP_Rowid 65
8421 #define OP_NullRow 66
8422 #define OP_Last 67
8423 #define OP_SorterSort 70
8424 #define OP_Sort 71
8425 #define OP_Rewind 72
8426 #define OP_SorterNext 81
8427 #define OP_Prev 92
8428 #define OP_Next 95
8429 #define OP_SorterInsert 96
8430 #define OP_IdxInsert 97
8431 #define OP_IdxDelete 98
8432 #define OP_IdxRowid 99
8433 #define OP_IdxLT 100
8434 #define OP_IdxGE 101
8435 #define OP_Destroy 102
8436 #define OP_Clear 103
8437 #define OP_CreateIndex 104
8438 #define OP_CreateTable 105
8439 #define OP_ParseSchema 106
8440 #define OP_LoadAnalysis 107
8441 #define OP_DropTable 108
8442 #define OP_DropIndex 109
8443 #define OP_DropTrigger 110
8444 #define OP_IntegrityCk 111
8445 #define OP_RowSetAdd 112
8446 #define OP_RowSetRead 113
8447 #define OP_RowSetTest 114
8448 #define OP_Program 115
8449 #define OP_Param 116
8450 #define OP_FkCounter 117
8451 #define OP_FkIfZero 118
8452 #define OP_MemMax 119
8453 #define OP_IfPos 120
8454 #define OP_IfNeg 121
8455 #define OP_IfZero 122
8456 #define OP_AggStep 123
8457 #define OP_AggFinal 124
8458 #define OP_Checkpoint 125
8459 #define OP_JournalMode 126
8460 #define OP_Vacuum 127
8461 #define OP_IncrVacuum 128
8462 #define OP_Expire 129
8463 #define OP_TableLock 131
8464 #define OP_VBegin 132
8465 #define OP_VCreate 133
8466 #define OP_VDestroy 134
8467 #define OP_VOpen 135
8468 #define OP_VFilter 136
8469 #define OP_VColumn 137
8470 #define OP_VNext 138
8471 #define OP_VRename 139
8472 #define OP_VUpdate 140
8473 #define OP_Pagecount 146
8474 #define OP_MaxPgcnt 147
8475 #define OP_Trace 148
8476 #define OP_Noop 149
8477 #define OP_Explain 150
8478
8479
8480 /* Properties such as "out2" or "jump" that are specified in
8481 ** comments following the "case" for each opcode in the vdbe.c
8482 ** are encoded into bitvectors as follows:
@@ -8502,30 +8490,29 @@
8490 #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
8491 #define OPFLG_INITIALIZER {\
8492 /* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\
8493 /* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\
8494 /* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\
8495 /* 24 */ 0x00, 0x01, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00,\
8496 /* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\
8497 /* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,\
8498 /* 48 */ 0x11, 0x11, 0x08, 0x11, 0x11, 0x11, 0x11, 0x02,\
8499 /* 56 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8500 /* 64 */ 0x00, 0x02, 0x00, 0x01, 0x4c, 0x4c, 0x01, 0x01,\
8501 /* 72 */ 0x01, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8502 /* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\
8503 /* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x01,\
8504 /* 96 */ 0x08, 0x08, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8505 /* 104 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8506 /* 112 */ 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\
8507 /* 120 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00,\
8508 /* 128 */ 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\
8509 /* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8510 /* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
8511
8512 /************** End of opcodes.h *********************************************/
8513 /************** Continuing where we left off in vdbe.h ***********************/
 
8514
8515 /*
8516 ** Prototypes for the VDBE interface. See comments on the implementation
8517 ** for a description of what each of these routines does.
8518 */
@@ -8541,11 +8528,11 @@
8528 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
8529 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
8530 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
8531 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
8532 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
8533 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
8534 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
8535 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
8536 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
8537 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
8538 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
@@ -8596,14 +8583,12 @@
8583
8584 #endif
8585
8586 /************** End of vdbe.h ************************************************/
8587 /************** Continuing where we left off in sqliteInt.h ******************/
 
8588 /************** Include pager.h in the middle of sqliteInt.h *****************/
8589 /************** Begin file pager.h *******************************************/
 
8590 /*
8591 ** 2001 September 15
8592 **
8593 ** The author disclaims copyright to this source code. In place of
8594 ** a legal notice, here is a blessing:
@@ -8662,11 +8647,10 @@
8647 ** NOTE: These values must match the corresponding BTREE_ values in btree.h.
8648 */
8649 #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
8650 #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
8651 #define PAGER_MEMORY 0x0004 /* In-memory database */
 
8652
8653 /*
8654 ** Valid values for the second argument to sqlite3PagerLockingMode().
8655 */
8656 #define PAGER_LOCKINGMODE_QUERY -1
@@ -8785,14 +8769,12 @@
8769
8770 #endif /* _PAGER_H_ */
8771
8772 /************** End of pager.h ***********************************************/
8773 /************** Continuing where we left off in sqliteInt.h ******************/
 
8774 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8775 /************** Begin file pcache.h ******************************************/
 
8776 /*
8777 ** 2008 August 05
8778 **
8779 ** The author disclaims copyright to this source code. In place of
8780 ** a legal notice, here is a blessing:
@@ -8947,15 +8929,13 @@
8929
8930 #endif /* _PCACHE_H_ */
8931
8932 /************** End of pcache.h **********************************************/
8933 /************** Continuing where we left off in sqliteInt.h ******************/
 
8934
8935 /************** Include os.h in the middle of sqliteInt.h ********************/
8936 /************** Begin file os.h **********************************************/
 
8937 /*
8938 ** 2001 September 16
8939 **
8940 ** The author disclaims copyright to this source code. In place of
8941 ** a legal notice, here is a blessing:
@@ -9234,14 +9214,12 @@
9214
9215 #endif /* _SQLITE_OS_H_ */
9216
9217 /************** End of os.h **************************************************/
9218 /************** Continuing where we left off in sqliteInt.h ******************/
 
9219 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9220 /************** Begin file mutex.h *******************************************/
 
9221 /*
9222 ** 2007 August 28
9223 **
9224 ** The author disclaims copyright to this source code. In place of
9225 ** a legal notice, here is a blessing:
@@ -9312,11 +9290,10 @@
9290 #define sqlite3MutexEnd()
9291 #endif /* defined(SQLITE_MUTEX_OMIT) */
9292
9293 /************** End of mutex.h ***********************************************/
9294 /************** Continuing where we left off in sqliteInt.h ******************/
 
9295
9296
9297 /*
9298 ** Each database file to be accessed by the system is an instance
9299 ** of the following structure. There are normally two of these structures
@@ -10509,11 +10486,12 @@
10486 char *zDatabase; /* Name of database holding this table */
10487 char *zName; /* Name of the table */
10488 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
10489 Table *pTab; /* An SQL table corresponding to zName */
10490 Select *pSelect; /* A SELECT statement used in place of a table name */
10491 int addrFillSub; /* Address of subroutine to manifest a subquery */
10492 int regReturn; /* Register holding return address of addrFillSub */
10493 u8 jointype; /* Type of join between this able and the previous */
10494 u8 notIndexed; /* True if there is a NOT INDEXED clause */
10495 u8 isCorrelated; /* True if sub-query is correlated */
10496 #ifndef SQLITE_OMIT_EXPLAIN
10497 u8 iSelectId; /* If pSelect!=0, the id of the sub-select in EQP */
@@ -11915,11 +11893,10 @@
11893
11894 #endif /* _SQLITEINT_H_ */
11895
11896 /************** End of sqliteInt.h *******************************************/
11897 /************** Begin file global.c ******************************************/
 
11898 /*
11899 ** 2008 June 13
11900 **
11901 ** The author disclaims copyright to this source code. In place of
11902 ** a legal notice, here is a blessing:
@@ -12060,11 +12037,11 @@
12037 SQLITE_DEFAULT_MEMSTATUS, /* bMemstat */
12038 1, /* bCoreMutex */
12039 SQLITE_THREADSAFE==1, /* bFullMutex */
12040 SQLITE_USE_URI, /* bOpenUri */
12041 0x7ffffffe, /* mxStrlen */
12042 128, /* szLookaside */
12043 500, /* nLookaside */
12044 {0,0,0,0,0,0,0,0}, /* m */
12045 {0,0,0,0,0,0,0,0,0}, /* mutex */
12046 {0,0,0,0,0,0,0,0,0,0,0}, /* pcache */
12047 (void*)0, /* pHeap */
@@ -12138,11 +12115,10 @@
12115 */
12116 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12117
12118 /************** End of global.c **********************************************/
12119 /************** Begin file ctime.c *******************************************/
 
12120 /*
12121 ** 2010 February 23
12122 **
12123 ** The author disclaims copyright to this source code. In place of
12124 ** a legal notice, here is a blessing:
@@ -12543,11 +12519,10 @@
12519
12520 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12521
12522 /************** End of ctime.c ***********************************************/
12523 /************** Begin file status.c ******************************************/
 
12524 /*
12525 ** 2008 June 18
12526 **
12527 ** The author disclaims copyright to this source code. In place of
12528 ** a legal notice, here is a blessing:
@@ -12561,11 +12536,10 @@
12536 ** This module implements the sqlite3_status() interface and related
12537 ** functionality.
12538 */
12539 /************** Include vdbeInt.h in the middle of status.c ******************/
12540 /************** Begin file vdbeInt.h *****************************************/
 
12541 /*
12542 ** 2003 September 6
12543 **
12544 ** The author disclaims copyright to this source code. In place of
12545 ** a legal notice, here is a blessing:
@@ -13013,11 +12987,10 @@
12987
12988 #endif /* !defined(_VDBEINT_H_) */
12989
12990 /************** End of vdbeInt.h *********************************************/
12991 /************** Continuing where we left off in status.c *********************/
 
12992
12993 /*
12994 ** Variables in which to record status information.
12995 */
12996 typedef struct sqlite3StatType sqlite3StatType;
@@ -13227,11 +13200,10 @@
13200 return rc;
13201 }
13202
13203 /************** End of status.c **********************************************/
13204 /************** Begin file date.c ********************************************/
 
13205 /*
13206 ** 2003 October 31
13207 **
13208 ** The author disclaims copyright to this source code. In place of
13209 ** a legal notice, here is a blessing:
@@ -14355,11 +14327,10 @@
14327 }
14328 }
14329
14330 /************** End of date.c ************************************************/
14331 /************** Begin file os.c **********************************************/
 
14332 /*
14333 ** 2005 November 29
14334 **
14335 ** The author disclaims copyright to this source code. In place of
14336 ** a legal notice, here is a blessing:
@@ -14565,11 +14536,11 @@
14536 int flags,
14537 int *pOutFlags
14538 ){
14539 int rc = SQLITE_NOMEM;
14540 sqlite3_file *pFile;
14541 pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
14542 if( pFile ){
14543 rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
14544 if( rc!=SQLITE_OK ){
14545 sqlite3_free(pFile);
14546 }else{
@@ -14689,11 +14660,10 @@
14660 return SQLITE_OK;
14661 }
14662
14663 /************** End of os.c **************************************************/
14664 /************** Begin file fault.c *******************************************/
 
14665 /*
14666 ** 2008 Jan 22
14667 **
14668 ** The author disclaims copyright to this source code. In place of
14669 ** a legal notice, here is a blessing:
@@ -14779,11 +14749,10 @@
14749
14750 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14751
14752 /************** End of fault.c ***********************************************/
14753 /************** Begin file mem0.c ********************************************/
 
14754 /*
14755 ** 2008 October 28
14756 **
14757 ** The author disclaims copyright to this source code. In place of
14758 ** a legal notice, here is a blessing:
@@ -14841,11 +14810,10 @@
14810
14811 #endif /* SQLITE_ZERO_MALLOC */
14812
14813 /************** End of mem0.c ************************************************/
14814 /************** Begin file mem1.c ********************************************/
 
14815 /*
14816 ** 2007 August 14
14817 **
14818 ** The author disclaims copyright to this source code. In place of
14819 ** a legal notice, here is a blessing:
@@ -14994,11 +14962,10 @@
14962
14963 #endif /* SQLITE_SYSTEM_MALLOC */
14964
14965 /************** End of mem1.c ************************************************/
14966 /************** Begin file mem2.c ********************************************/
 
14967 /*
14968 ** 2007 August 15
14969 **
14970 ** The author disclaims copyright to this source code. In place of
14971 ** a legal notice, here is a blessing:
@@ -15525,11 +15492,10 @@
15492
15493 #endif /* SQLITE_MEMDEBUG */
15494
15495 /************** End of mem2.c ************************************************/
15496 /************** Begin file mem3.c ********************************************/
 
15497 /*
15498 ** 2007 October 14
15499 **
15500 ** The author disclaims copyright to this source code. In place of
15501 ** a legal notice, here is a blessing:
@@ -16215,11 +16181,10 @@
16181
16182 #endif /* SQLITE_ENABLE_MEMSYS3 */
16183
16184 /************** End of mem3.c ************************************************/
16185 /************** Begin file mem5.c ********************************************/
 
16186 /*
16187 ** 2007 October 14
16188 **
16189 ** The author disclaims copyright to this source code. In place of
16190 ** a legal notice, here is a blessing:
@@ -16799,11 +16764,10 @@
16764
16765 #endif /* SQLITE_ENABLE_MEMSYS5 */
16766
16767 /************** End of mem5.c ************************************************/
16768 /************** Begin file mutex.c *******************************************/
 
16769 /*
16770 ** 2007 August 14
16771 **
16772 ** The author disclaims copyright to this source code. In place of
16773 ** a legal notice, here is a blessing:
@@ -16955,11 +16919,10 @@
16919
16920 #endif /* SQLITE_MUTEX_OMIT */
16921
16922 /************** End of mutex.c ***********************************************/
16923 /************** Begin file mutex_noop.c **************************************/
 
16924 /*
16925 ** 2008 October 07
16926 **
16927 ** The author disclaims copyright to this source code. In place of
16928 ** a legal notice, here is a blessing:
@@ -17164,11 +17127,10 @@
17127 #endif /* SQLITE_MUTEX_NOOP */
17128 #endif /* SQLITE_MUTEX_OMIT */
17129
17130 /************** End of mutex_noop.c ******************************************/
17131 /************** Begin file mutex_os2.c ***************************************/
 
17132 /*
17133 ** 2007 August 28
17134 **
17135 ** The author disclaims copyright to this source code. In place of
17136 ** a legal notice, here is a blessing:
@@ -17441,11 +17403,10 @@
17403 }
17404 #endif /* SQLITE_MUTEX_OS2 */
17405
17406 /************** End of mutex_os2.c *******************************************/
17407 /************** Begin file mutex_unix.c **************************************/
 
17408 /*
17409 ** 2007 August 28
17410 **
17411 ** The author disclaims copyright to this source code. In place of
17412 ** a legal notice, here is a blessing:
@@ -17795,11 +17756,10 @@
17756
17757 #endif /* SQLITE_MUTEX_PTHREAD */
17758
17759 /************** End of mutex_unix.c ******************************************/
17760 /************** Begin file mutex_w32.c ***************************************/
 
17761 /*
17762 ** 2007 August 14
17763 **
17764 ** The author disclaims copyright to this source code. In place of
17765 ** a legal notice, here is a blessing:
@@ -18130,11 +18090,10 @@
18090 }
18091 #endif /* SQLITE_MUTEX_W32 */
18092
18093 /************** End of mutex_w32.c *******************************************/
18094 /************** Begin file malloc.c ******************************************/
 
18095 /*
18096 ** 2001 September 15
18097 **
18098 ** The author disclaims copyright to this source code. In place of
18099 ** a legal notice, here is a blessing:
@@ -18910,11 +18869,10 @@
18869 return rc & (db ? db->errMask : 0xff);
18870 }
18871
18872 /************** End of malloc.c **********************************************/
18873 /************** Begin file printf.c ******************************************/
 
18874 /*
18875 ** The "printf" code that follows dates from the 1980's. It is in
18876 ** the public domain. The original comments are included here for
18877 ** completeness. They are very out-of-date but might be useful as
18878 ** an historical reference. Most of the "enhancements" have been backed
@@ -19942,11 +19900,10 @@
19900 }
19901 #endif
19902
19903 /************** End of printf.c **********************************************/
19904 /************** Begin file random.c ******************************************/
 
19905 /*
19906 ** 2001 September 15
19907 **
19908 ** The author disclaims copyright to this source code. In place of
19909 ** a legal notice, here is a blessing:
@@ -20090,11 +20047,10 @@
20047 }
20048 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20049
20050 /************** End of random.c **********************************************/
20051 /************** Begin file utf.c *********************************************/
 
20052 /*
20053 ** 2004 April 13
20054 **
20055 ** The author disclaims copyright to this source code. In place of
20056 ** a legal notice, here is a blessing:
@@ -20652,11 +20608,10 @@
20608 #endif /* SQLITE_TEST */
20609 #endif /* SQLITE_OMIT_UTF16 */
20610
20611 /************** End of utf.c *************************************************/
20612 /************** Begin file util.c ********************************************/
 
20613 /*
20614 ** 2001 September 15
20615 **
20616 ** The author disclaims copyright to this source code. In place of
20617 ** a legal notice, here is a blessing:
@@ -21835,11 +21790,10 @@
21790 }
21791 #endif
21792
21793 /************** End of util.c ************************************************/
21794 /************** Begin file hash.c ********************************************/
 
21795 /*
21796 ** 2001 September 22
21797 **
21798 ** The author disclaims copyright to this source code. In place of
21799 ** a legal notice, here is a blessing:
@@ -22115,11 +22069,10 @@
22069 return 0;
22070 }
22071
22072 /************** End of hash.c ************************************************/
22073 /************** Begin file opcodes.c *****************************************/
 
22074 /* Automatically generated. Do not edit */
22075 /* See the mkopcodec.awk script for details. */
22076 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22077 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22078 static const char *const azName[] = { "?",
@@ -22146,66 +22099,66 @@
22099 /* 21 */ "MustBeInt",
22100 /* 22 */ "RealAffinity",
22101 /* 23 */ "Permutation",
22102 /* 24 */ "Compare",
22103 /* 25 */ "Jump",
22104 /* 26 */ "Once",
22105 /* 27 */ "If",
22106 /* 28 */ "IfNot",
22107 /* 29 */ "Column",
22108 /* 30 */ "Affinity",
22109 /* 31 */ "MakeRecord",
22110 /* 32 */ "Count",
22111 /* 33 */ "Savepoint",
22112 /* 34 */ "AutoCommit",
22113 /* 35 */ "Transaction",
22114 /* 36 */ "ReadCookie",
22115 /* 37 */ "SetCookie",
22116 /* 38 */ "VerifyCookie",
22117 /* 39 */ "OpenRead",
22118 /* 40 */ "OpenWrite",
22119 /* 41 */ "OpenAutoindex",
22120 /* 42 */ "OpenEphemeral",
22121 /* 43 */ "SorterOpen",
22122 /* 44 */ "OpenPseudo",
22123 /* 45 */ "Close",
22124 /* 46 */ "SeekLt",
22125 /* 47 */ "SeekLe",
22126 /* 48 */ "SeekGe",
22127 /* 49 */ "SeekGt",
22128 /* 50 */ "Seek",
22129 /* 51 */ "NotFound",
22130 /* 52 */ "Found",
22131 /* 53 */ "IsUnique",
22132 /* 54 */ "NotExists",
22133 /* 55 */ "Sequence",
22134 /* 56 */ "NewRowid",
22135 /* 57 */ "Insert",
22136 /* 58 */ "InsertInt",
22137 /* 59 */ "Delete",
22138 /* 60 */ "ResetCount",
22139 /* 61 */ "SorterCompare",
22140 /* 62 */ "SorterData",
22141 /* 63 */ "RowKey",
22142 /* 64 */ "RowData",
22143 /* 65 */ "Rowid",
22144 /* 66 */ "NullRow",
22145 /* 67 */ "Last",
22146 /* 68 */ "Or",
22147 /* 69 */ "And",
22148 /* 70 */ "SorterSort",
22149 /* 71 */ "Sort",
22150 /* 72 */ "Rewind",
22151 /* 73 */ "IsNull",
22152 /* 74 */ "NotNull",
22153 /* 75 */ "Ne",
22154 /* 76 */ "Eq",
22155 /* 77 */ "Gt",
22156 /* 78 */ "Le",
22157 /* 79 */ "Lt",
22158 /* 80 */ "Ge",
22159 /* 81 */ "SorterNext",
22160 /* 82 */ "BitAnd",
22161 /* 83 */ "BitOr",
22162 /* 84 */ "ShiftLeft",
22163 /* 85 */ "ShiftRight",
22164 /* 86 */ "Add",
@@ -22212,76 +22165,76 @@
22165 /* 87 */ "Subtract",
22166 /* 88 */ "Multiply",
22167 /* 89 */ "Divide",
22168 /* 90 */ "Remainder",
22169 /* 91 */ "Concat",
22170 /* 92 */ "Prev",
22171 /* 93 */ "BitNot",
22172 /* 94 */ "String8",
22173 /* 95 */ "Next",
22174 /* 96 */ "SorterInsert",
22175 /* 97 */ "IdxInsert",
22176 /* 98 */ "IdxDelete",
22177 /* 99 */ "IdxRowid",
22178 /* 100 */ "IdxLT",
22179 /* 101 */ "IdxGE",
22180 /* 102 */ "Destroy",
22181 /* 103 */ "Clear",
22182 /* 104 */ "CreateIndex",
22183 /* 105 */ "CreateTable",
22184 /* 106 */ "ParseSchema",
22185 /* 107 */ "LoadAnalysis",
22186 /* 108 */ "DropTable",
22187 /* 109 */ "DropIndex",
22188 /* 110 */ "DropTrigger",
22189 /* 111 */ "IntegrityCk",
22190 /* 112 */ "RowSetAdd",
22191 /* 113 */ "RowSetRead",
22192 /* 114 */ "RowSetTest",
22193 /* 115 */ "Program",
22194 /* 116 */ "Param",
22195 /* 117 */ "FkCounter",
22196 /* 118 */ "FkIfZero",
22197 /* 119 */ "MemMax",
22198 /* 120 */ "IfPos",
22199 /* 121 */ "IfNeg",
22200 /* 122 */ "IfZero",
22201 /* 123 */ "AggStep",
22202 /* 124 */ "AggFinal",
22203 /* 125 */ "Checkpoint",
22204 /* 126 */ "JournalMode",
22205 /* 127 */ "Vacuum",
22206 /* 128 */ "IncrVacuum",
22207 /* 129 */ "Expire",
22208 /* 130 */ "Real",
22209 /* 131 */ "TableLock",
22210 /* 132 */ "VBegin",
22211 /* 133 */ "VCreate",
22212 /* 134 */ "VDestroy",
22213 /* 135 */ "VOpen",
22214 /* 136 */ "VFilter",
22215 /* 137 */ "VColumn",
22216 /* 138 */ "VNext",
22217 /* 139 */ "VRename",
22218 /* 140 */ "VUpdate",
22219 /* 141 */ "ToText",
22220 /* 142 */ "ToBlob",
22221 /* 143 */ "ToNumeric",
22222 /* 144 */ "ToInt",
22223 /* 145 */ "ToReal",
22224 /* 146 */ "Pagecount",
22225 /* 147 */ "MaxPgcnt",
22226 /* 148 */ "Trace",
22227 /* 149 */ "Noop",
22228 /* 150 */ "Explain",
22229 };
22230 return azName[i];
22231 }
22232 #endif
22233
22234 /************** End of opcodes.c *********************************************/
22235 /************** Begin file os_os2.c ******************************************/
 
22236 /*
22237 ** 2006 Feb 14
22238 **
22239 ** The author disclaims copyright to this source code. In place of
22240 ** a legal notice, here is a blessing:
@@ -22334,11 +22287,10 @@
22287 /*
22288 ** Include code that is common to all os_*.c files
22289 */
22290 /************** Include os_common.h in the middle of os_os2.c ****************/
22291 /************** Begin file os_common.h ***************************************/
 
22292 /*
22293 ** 2004 May 22
22294 **
22295 ** The author disclaims copyright to this source code. In place of
22296 ** a legal notice, here is a blessing:
@@ -22388,11 +22340,10 @@
22340 ** hwtime.h contains inline assembler code for implementing
22341 ** high-performance timing routines.
22342 */
22343 /************** Include hwtime.h in the middle of os_common.h ****************/
22344 /************** Begin file hwtime.h ******************************************/
 
22345 /*
22346 ** 2008 May 27
22347 **
22348 ** The author disclaims copyright to this source code. In place of
22349 ** a legal notice, here is a blessing:
@@ -22477,11 +22428,10 @@
22428
22429 #endif /* !defined(_HWTIME_H_) */
22430
22431 /************** End of hwtime.h **********************************************/
22432 /************** Continuing where we left off in os_common.h ******************/
 
22433
22434 static sqlite_uint64 g_start;
22435 static sqlite_uint64 g_elapsed;
22436 #define TIMER_START g_start=sqlite3Hwtime()
22437 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22544,11 +22494,10 @@
22494
22495 #endif /* !defined(_OS_COMMON_H_) */
22496
22497 /************** End of os_common.h *******************************************/
22498 /************** Continuing where we left off in os_os2.c *********************/
 
22499
22500 /* Forward references */
22501 typedef struct os2File os2File; /* The file structure */
22502 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22503 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24416,11 +24365,10 @@
24365
24366 #endif /* SQLITE_OS_OS2 */
24367
24368 /************** End of os_os2.c **********************************************/
24369 /************** Begin file os_unix.c *****************************************/
 
24370 /*
24371 ** 2004 May 22
24372 **
24373 ** The author disclaims copyright to this source code. In place of
24374 ** a legal notice, here is a blessing:
@@ -24681,11 +24629,10 @@
24629 /*
24630 ** Include code that is common to all os_*.c files
24631 */
24632 /************** Include os_common.h in the middle of os_unix.c ***************/
24633 /************** Begin file os_common.h ***************************************/
 
24634 /*
24635 ** 2004 May 22
24636 **
24637 ** The author disclaims copyright to this source code. In place of
24638 ** a legal notice, here is a blessing:
@@ -24735,11 +24682,10 @@
24682 ** hwtime.h contains inline assembler code for implementing
24683 ** high-performance timing routines.
24684 */
24685 /************** Include hwtime.h in the middle of os_common.h ****************/
24686 /************** Begin file hwtime.h ******************************************/
 
24687 /*
24688 ** 2008 May 27
24689 **
24690 ** The author disclaims copyright to this source code. In place of
24691 ** a legal notice, here is a blessing:
@@ -24824,11 +24770,10 @@
24770
24771 #endif /* !defined(_HWTIME_H_) */
24772
24773 /************** End of hwtime.h **********************************************/
24774 /************** Continuing where we left off in os_common.h ******************/
 
24775
24776 static sqlite_uint64 g_start;
24777 static sqlite_uint64 g_elapsed;
24778 #define TIMER_START g_start=sqlite3Hwtime()
24779 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24891,11 +24836,10 @@
24836
24837 #endif /* !defined(_OS_COMMON_H_) */
24838
24839 /************** End of os_common.h *******************************************/
24840 /************** Continuing where we left off in os_unix.c ********************/
 
24841
24842 /*
24843 ** Define various macros that are missing from some systems.
24844 */
24845 #ifndef O_LARGEFILE
@@ -31401,11 +31345,10 @@
31345
31346 #endif /* SQLITE_OS_UNIX */
31347
31348 /************** End of os_unix.c *********************************************/
31349 /************** Begin file os_win.c ******************************************/
 
31350 /*
31351 ** 2004 May 22
31352 **
31353 ** The author disclaims copyright to this source code. In place of
31354 ** a legal notice, here is a blessing:
@@ -31463,11 +31406,10 @@
31406 /*
31407 ** Include code that is common to all os_*.c files
31408 */
31409 /************** Include os_common.h in the middle of os_win.c ****************/
31410 /************** Begin file os_common.h ***************************************/
 
31411 /*
31412 ** 2004 May 22
31413 **
31414 ** The author disclaims copyright to this source code. In place of
31415 ** a legal notice, here is a blessing:
@@ -31517,11 +31459,10 @@
31459 ** hwtime.h contains inline assembler code for implementing
31460 ** high-performance timing routines.
31461 */
31462 /************** Include hwtime.h in the middle of os_common.h ****************/
31463 /************** Begin file hwtime.h ******************************************/
 
31464 /*
31465 ** 2008 May 27
31466 **
31467 ** The author disclaims copyright to this source code. In place of
31468 ** a legal notice, here is a blessing:
@@ -31606,11 +31547,10 @@
31547
31548 #endif /* !defined(_HWTIME_H_) */
31549
31550 /************** End of hwtime.h **********************************************/
31551 /************** Continuing where we left off in os_common.h ******************/
 
31552
31553 static sqlite_uint64 g_start;
31554 static sqlite_uint64 g_elapsed;
31555 #define TIMER_START g_start=sqlite3Hwtime()
31556 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31673,11 +31613,10 @@
31613
31614 #endif /* !defined(_OS_COMMON_H_) */
31615
31616 /************** End of os_common.h *******************************************/
31617 /************** Continuing where we left off in os_win.c *********************/
 
31618
31619 /*
31620 ** Some microsoft compilers lack this definition.
31621 */
31622 #ifndef INVALID_FILE_ATTRIBUTES
@@ -32860,13 +32799,23 @@
32799
32800 /*
32801 ** Make sure all writes to a particular file are committed to disk.
32802 */
32803 static int winSync(sqlite3_file *id, int flags){
32804 #ifndef SQLITE_NO_SYNC
32805 /*
32806 ** Used only when SQLITE_NO_SYNC is not defined.
32807 */
32808 BOOL rc;
32809 #endif
32810 #if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \
32811 (defined(SQLITE_TEST) && defined(SQLITE_DEBUG))
32812 /*
32813 ** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or
32814 ** OSTRACE() macros.
32815 */
32816 winFile *pFile = (winFile*)id;
32817 #else
32818 UNUSED_PARAMETER(id);
32819 #endif
32820
32821 assert( pFile );
@@ -34809,11 +34758,10 @@
34758
34759 #endif /* SQLITE_OS_WIN */
34760
34761 /************** End of os_win.c **********************************************/
34762 /************** Begin file bitvec.c ******************************************/
 
34763 /*
34764 ** 2008 February 16
34765 **
34766 ** The author disclaims copyright to this source code. In place of
34767 ** a legal notice, here is a blessing:
@@ -35220,11 +35168,10 @@
35168 }
35169 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35170
35171 /************** End of bitvec.c **********************************************/
35172 /************** Begin file pcache.c ******************************************/
 
35173 /*
35174 ** 2008 August 05
35175 **
35176 ** The author disclaims copyright to this source code. In place of
35177 ** a legal notice, here is a blessing:
@@ -35817,11 +35764,10 @@
35764 }
35765 #endif
35766
35767 /************** End of pcache.c **********************************************/
35768 /************** Begin file pcache1.c *****************************************/
 
35769 /*
35770 ** 2008 November 05
35771 **
35772 ** The author disclaims copyright to this source code. In place of
35773 ** a legal notice, here is a blessing:
@@ -37034,11 +36980,10 @@
36980 }
36981 #endif
36982
36983 /************** End of pcache1.c *********************************************/
36984 /************** Begin file rowset.c ******************************************/
 
36985 /*
36986 ** 2008 December 3
36987 **
36988 ** The author disclaims copyright to this source code. In place of
36989 ** a legal notice, here is a blessing:
@@ -37459,11 +37404,10 @@
37404 return 0;
37405 }
37406
37407 /************** End of rowset.c **********************************************/
37408 /************** Begin file pager.c *******************************************/
 
37409 /*
37410 ** 2001 September 15
37411 **
37412 ** The author disclaims copyright to this source code. In place of
37413 ** a legal notice, here is a blessing:
@@ -37483,11 +37427,10 @@
37427 ** another is writing.
37428 */
37429 #ifndef SQLITE_OMIT_DISKIO
37430 /************** Include wal.h in the middle of pager.c ***********************/
37431 /************** Begin file wal.h *********************************************/
 
37432 /*
37433 ** 2010 February 1
37434 **
37435 ** The author disclaims copyright to this source code. In place of
37436 ** a legal notice, here is a blessing:
@@ -37608,11 +37551,10 @@
37551 #endif /* ifndef SQLITE_OMIT_WAL */
37552 #endif /* _WAL_H_ */
37553
37554 /************** End of wal.h *************************************************/
37555 /************** Continuing where we left off in pager.c **********************/
 
37556
37557
37558 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37559 **
37560 ** This comment block describes invariants that hold when using a rollback
@@ -38208,11 +38150,10 @@
38150 u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */
38151 u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */
38152 u8 tempFile; /* zFilename is a temporary file */
38153 u8 readOnly; /* True for a read-only database */
38154 u8 memDb; /* True to inhibit all file I/O */
 
38155
38156 /**************************************************************************
38157 ** The following block contains those class members that change during
38158 ** routine opertion. Class members not in this block are either fixed
38159 ** when the pager is first created or else only change when there is a
@@ -41763,11 +41704,10 @@
41704 ** is impossible for sqlite3PCacheFetch() to be called with createFlag==1
41705 ** while in the error state, hence it is impossible for this routine to
41706 ** be called in the error state. Nevertheless, we include a NEVER()
41707 ** test for the error state as a safeguard against future changes.
41708 */
 
41709 if( NEVER(pPager->errCode) ) return SQLITE_OK;
41710 if( pPager->doNotSpill ) return SQLITE_OK;
41711 if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
41712 return SQLITE_OK;
41713 }
@@ -44422,11 +44362,10 @@
44362
44363 #endif /* SQLITE_OMIT_DISKIO */
44364
44365 /************** End of pager.c ***********************************************/
44366 /************** Begin file wal.c *********************************************/
 
44367 /*
44368 ** 2010 February 1
44369 **
44370 ** The author disclaims copyright to this source code. In place of
44371 ** a legal notice, here is a blessing:
@@ -47377,11 +47316,10 @@
47316
47317 #endif /* #ifndef SQLITE_OMIT_WAL */
47318
47319 /************** End of wal.c *************************************************/
47320 /************** Begin file btmutex.c *****************************************/
 
47321 /*
47322 ** 2007 August 27
47323 **
47324 ** The author disclaims copyright to this source code. In place of
47325 ** a legal notice, here is a blessing:
@@ -47397,11 +47335,10 @@
47335 ** big and we want to break it down some. This packaged seemed like
47336 ** a good breakout.
47337 */
47338 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47339 /************** Begin file btreeInt.h ****************************************/
 
47340 /*
47341 ** 2004 April 6
47342 **
47343 ** The author disclaims copyright to this source code. In place of
47344 ** a legal notice, here is a blessing:
@@ -48043,11 +47980,10 @@
47980 #define get4byte sqlite3Get4byte
47981 #define put4byte sqlite3Put4byte
47982
47983 /************** End of btreeInt.h ********************************************/
47984 /************** Continuing where we left off in btmutex.c ********************/
 
47985 #ifndef SQLITE_OMIT_SHARED_CACHE
47986 #if SQLITE_THREADSAFE
47987
47988 /*
47989 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48316,11 +48252,10 @@
48252 #endif /* if SQLITE_THREADSAFE */
48253 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48254
48255 /************** End of btmutex.c *********************************************/
48256 /************** Begin file btree.c *******************************************/
 
48257 /*
48258 ** 2004 April 6
48259 **
48260 ** The author disclaims copyright to this source code. In place of
48261 ** a legal notice, here is a blessing:
@@ -48982,11 +48917,11 @@
48917 assert( nKey==(i64)(int)nKey );
48918 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
48919 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
48920 );
48921 if( pIdxKey==0 ) return SQLITE_NOMEM;
48922 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
48923 }else{
48924 pIdxKey = 0;
48925 }
48926 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
48927 if( pFree ){
@@ -56504,11 +56439,10 @@
56439 return rc;
56440 }
56441
56442 /************** End of btree.c ***********************************************/
56443 /************** Begin file backup.c ******************************************/
 
56444 /*
56445 ** 2009 January 28
56446 **
56447 ** The author disclaims copyright to this source code. In place of
56448 ** a legal notice, here is a blessing:
@@ -57211,11 +57145,10 @@
57145 }
57146 #endif /* SQLITE_OMIT_VACUUM */
57147
57148 /************** End of backup.c **********************************************/
57149 /************** Begin file vdbemem.c *****************************************/
 
57150 /*
57151 ** 2004 May 26
57152 **
57153 ** The author disclaims copyright to this source code. In place of
57154 ** a legal notice, here is a blessing:
@@ -58366,11 +58299,10 @@
58299 return 0;
58300 }
58301
58302 /************** End of vdbemem.c *********************************************/
58303 /************** Begin file vdbeaux.c *****************************************/
 
58304 /*
58305 ** 2003 September 6
58306 **
58307 ** The author disclaims copyright to this source code. In place of
58308 ** a legal notice, here is a blessing:
@@ -59037,22 +58969,19 @@
58969 p->pNext = pVdbe->pProgram;
58970 pVdbe->pProgram = p;
58971 }
58972
58973 /*
58974 ** Change the opcode at addr into OP_Noop
58975 */
58976 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
58977 if( p->aOp ){
58978 VdbeOp *pOp = &p->aOp[addr];
58979 sqlite3 *db = p->db;
58980 freeP4(db, pOp->p4type, pOp->p4.p);
58981 memset(pOp, 0, sizeof(pOp[0]));
58982 pOp->opcode = OP_Noop;
 
 
 
58983 }
58984 }
58985
58986 /*
58987 ** Change the value of the P4 operand for a specific instruction.
@@ -59204,11 +59133,11 @@
59133 ** check the value of p->nOp-1 before continuing.
59134 */
59135 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
59136 /* C89 specifies that the constant "dummy" will be initialized to all
59137 ** zeros, which is correct. MSVC generates a warning, nevertheless. */
59138 static VdbeOp dummy; /* Ignore the MSVC warning about no initializer */
59139 assert( p->magic==VDBE_MAGIC_INIT );
59140 if( addr<0 ){
59141 #ifdef SQLITE_OMIT_TRACE
59142 if( p->nOp==0 ) return (VdbeOp*)&dummy;
59143 #endif
@@ -61609,11 +61538,10 @@
61538 }
61539 }
61540
61541 /************** End of vdbeaux.c *********************************************/
61542 /************** Begin file vdbeapi.c *****************************************/
 
61543 /*
61544 ** 2004 May 26
61545 **
61546 ** The author disclaims copyright to this source code. In place of
61547 ** a legal notice, here is a blessing:
@@ -62917,11 +62845,10 @@
62845 return v;
62846 }
62847
62848 /************** End of vdbeapi.c *********************************************/
62849 /************** Begin file vdbetrace.c ***************************************/
 
62850 /*
62851 ** 2009 November 25
62852 **
62853 ** The author disclaims copyright to this source code. In place of
62854 ** a legal notice, here is a blessing:
@@ -63073,11 +63000,10 @@
63000
63001 #endif /* #ifndef SQLITE_OMIT_TRACE */
63002
63003 /************** End of vdbetrace.c *******************************************/
63004 /************** Begin file vdbe.c ********************************************/
 
63005 /*
63006 ** 2001 September 15
63007 **
63008 ** The author disclaims copyright to this source code. In place of
63009 ** a legal notice, here is a blessing:
@@ -63543,11 +63469,10 @@
63469 ** hwtime.h contains inline assembler code for implementing
63470 ** high-performance timing routines.
63471 */
63472 /************** Include hwtime.h in the middle of vdbe.c *********************/
63473 /************** Begin file hwtime.h ******************************************/
 
63474 /*
63475 ** 2008 May 27
63476 **
63477 ** The author disclaims copyright to this source code. In place of
63478 ** a legal notice, here is a blessing:
@@ -63632,11 +63557,10 @@
63557
63558 #endif /* !defined(_HWTIME_H_) */
63559
63560 /************** End of hwtime.h **********************************************/
63561 /************** Continuing where we left off in vdbe.c ***********************/
 
63562
63563 #endif
63564
63565 /*
63566 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -65627,10 +65551,20 @@
65551 sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1));
65552 }
65553 break;
65554 }
65555
65556 /* Opcode: Once P1 P2 * * *
65557 **
65558 ** Jump to P2 if the value in register P1 is a not null or zero. If
65559 ** the value is NULL or zero, fall through and change the P1 register
65560 ** to an integer 1.
65561 **
65562 ** When P1 is not used otherwise in a program, this opcode falls through
65563 ** once and jumps on all subsequent invocations. It is the equivalent
65564 ** of "OP_If P1 P2", followed by "OP_Integer 1 P1".
65565 */
65566 /* Opcode: If P1 P2 P3 * *
65567 **
65568 ** Jump to P2 if the value in register P1 is true. The value
65569 ** is considered true if it is numeric and non-zero. If the value
65570 ** in P1 is NULL then take the jump if P3 is true.
@@ -65639,10 +65573,11 @@
65573 **
65574 ** Jump to P2 if the value in register P1 is False. The value
65575 ** is considered true if it has a numeric value of zero. If the value
65576 ** in P1 is NULL then take the jump if P3 is true.
65577 */
65578 case OP_Once: /* jump, in1 */
65579 case OP_If: /* jump, in1 */
65580 case OP_IfNot: { /* jump, in1 */
65581 #if 0 /* local variables moved into u.al */
65582 int c;
65583 #endif /* local variables moved into u.al */
@@ -65657,10 +65592,16 @@
65592 #endif
65593 if( pOp->opcode==OP_IfNot ) u.al.c = !u.al.c;
65594 }
65595 if( u.al.c ){
65596 pc = pOp->p2-1;
65597 }else if( pOp->opcode==OP_Once ){
65598 assert( (pIn1->flags & (MEM_Agg|MEM_Dyn|MEM_RowSet|MEM_Frame))==0 );
65599 memAboutToChange(p, pIn1);
65600 pIn1->flags = MEM_Int;
65601 pIn1->u.i = 1;
65602 REGISTER_TRACE(pOp->p1, pIn1);
65603 }
65604 break;
65605 }
65606
65607 /* Opcode: IsNull P1 P2 * * *
@@ -69860,11 +69801,10 @@
69801 goto vdbe_error_halt;
69802 }
69803
69804 /************** End of vdbe.c ************************************************/
69805 /************** Begin file vdbeblob.c ****************************************/
 
69806 /*
69807 ** 2007 May 1
69808 **
69809 ** The author disclaims copyright to this source code. In place of
69810 ** a legal notice, here is a blessing:
@@ -70134,21 +70074,21 @@
70074 /* Make sure a mutex is held on the table to be accessed */
70075 sqlite3VdbeUsesBtree(v, iDb);
70076
70077 /* Configure the OP_TableLock instruction */
70078 #ifdef SQLITE_OMIT_SHARED_CACHE
70079 sqlite3VdbeChangeToNoop(v, 2);
70080 #else
70081 sqlite3VdbeChangeP1(v, 2, iDb);
70082 sqlite3VdbeChangeP2(v, 2, pTab->tnum);
70083 sqlite3VdbeChangeP3(v, 2, flags);
70084 sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT);
70085 #endif
70086
70087 /* Remove either the OP_OpenWrite or OpenRead. Set the P2
70088 ** parameter of the other to pTab->tnum. */
70089 sqlite3VdbeChangeToNoop(v, 4 - flags);
70090 sqlite3VdbeChangeP2(v, 3 + flags, pTab->tnum);
70091 sqlite3VdbeChangeP3(v, 3 + flags, iDb);
70092
70093 /* Configure the number of columns. Configure the cursor to
70094 ** think that the table has one more column than it really
@@ -70331,11 +70271,10 @@
70271
70272 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70273
70274 /************** End of vdbeblob.c ********************************************/
70275 /************** Begin file vdbesort.c ****************************************/
 
70276 /*
70277 ** 2011 July 9
70278 **
70279 ** The author disclaims copyright to this source code. In place of
70280 ** a legal notice, here is a blessing:
@@ -70492,12 +70431,16 @@
70431 int rc; /* Return Code */
70432 int nRead; /* Number of bytes read */
70433 int nRec = 0; /* Size of record in bytes */
70434 int iOff = 0; /* Size of serialized size varint in bytes */
70435
70436 assert( pIter->iEof>=pIter->iReadOff );
70437 if( pIter->iEof-pIter->iReadOff>5 ){
70438 nRead = 5;
70439 }else{
70440 nRead = (int)(pIter->iEof - pIter->iReadOff);
70441 }
70442 if( nRead<=0 ){
70443 /* This is an EOF condition */
70444 vdbeSorterIterZero(db, pIter);
70445 return SQLITE_OK;
70446 }
@@ -71211,11 +71154,10 @@
71154
71155 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71156
71157 /************** End of vdbesort.c ********************************************/
71158 /************** Begin file journal.c *****************************************/
 
71159 /*
71160 ** 2007 August 22
71161 **
71162 ** The author disclaims copyright to this source code. In place of
71163 ** a legal notice, here is a blessing:
@@ -71452,11 +71394,10 @@
71394 }
71395 #endif
71396
71397 /************** End of journal.c *********************************************/
71398 /************** Begin file memjournal.c **************************************/
 
71399 /*
71400 ** 2008 October 7
71401 **
71402 ** The author disclaims copyright to this source code. In place of
71403 ** a legal notice, here is a blessing:
@@ -71714,11 +71655,10 @@
71655 return sizeof(MemJournal);
71656 }
71657
71658 /************** End of memjournal.c ******************************************/
71659 /************** Begin file walker.c ******************************************/
 
71660 /*
71661 ** 2008 August 16
71662 **
71663 ** The author disclaims copyright to this source code. In place of
71664 ** a legal notice, here is a blessing:
@@ -71853,11 +71793,10 @@
71793 return rc & WRC_Abort;
71794 }
71795
71796 /************** End of walker.c **********************************************/
71797 /************** Begin file resolve.c *****************************************/
 
71798 /*
71799 ** 2008 August 18
71800 **
71801 ** The author disclaims copyright to this source code. In place of
71802 ** a legal notice, here is a blessing:
@@ -73074,11 +73013,10 @@
73013 sqlite3WalkSelect(&w, p);
73014 }
73015
73016 /************** End of resolve.c *********************************************/
73017 /************** Begin file expr.c ********************************************/
 
73018 /*
73019 ** 2001 September 15
73020 **
73021 ** The author disclaims copyright to this source code. In place of
73022 ** a legal notice, here is a blessing:
@@ -73977,11 +73915,12 @@
73915 pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
73916 pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
73917 pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
73918 pNewItem->jointype = pOldItem->jointype;
73919 pNewItem->iCursor = pOldItem->iCursor;
73920 pNewItem->addrFillSub = pOldItem->addrFillSub;
73921 pNewItem->regReturn = pOldItem->regReturn;
73922 pNewItem->isCorrelated = pOldItem->isCorrelated;
73923 pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
73924 pNewItem->notIndexed = pOldItem->notIndexed;
73925 pNewItem->pIndex = pOldItem->pIndex;
73926 pTab = pNewItem->pTab = pOldItem->pTab;
@@ -74537,12 +74476,11 @@
74476 assert(v);
74477 if( iCol<0 ){
74478 int iMem = ++pParse->nMem;
74479 int iAddr;
74480
74481 iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
 
74482
74483 sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
74484 eType = IN_INDEX_ROWID;
74485
74486 sqlite3VdbeJumpHere(v, iAddr);
@@ -74569,12 +74507,11 @@
74507 int iMem = ++pParse->nMem;
74508 int iAddr;
74509 char *pKey;
74510
74511 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
74512 iAddr = sqlite3VdbeAddOp1(v, OP_Once, iMem);
 
74513
74514 sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
74515 pKey,P4_KEYINFO_HANDOFF);
74516 VdbeComment((v, "%s", pIdx->zName));
74517 eType = IN_INDEX_INDEX;
@@ -74651,11 +74588,11 @@
74588 Parse *pParse, /* Parsing context */
74589 Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
74590 int rMayHaveNull, /* Register that records whether NULLs exist in RHS */
74591 int isRowid /* If true, LHS of IN operator is a rowid */
74592 ){
74593 int testAddr = -1; /* One-time test address */
74594 int rReg = 0; /* Register storing resulting */
74595 Vdbe *v = sqlite3GetVdbe(pParse);
74596 if( NEVER(v==0) ) return 0;
74597 sqlite3ExprCachePush(pParse);
74598
@@ -74669,19 +74606,17 @@
74606 ** If all of the above are false, then we can run this code just once
74607 ** save the results, and reuse the same result on subsequent invocations.
74608 */
74609 if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->pTriggerTab ){
74610 int mem = ++pParse->nMem;
74611 testAddr = sqlite3VdbeAddOp1(v, OP_Once, mem);
 
 
74612 }
74613
74614 #ifndef SQLITE_OMIT_EXPLAIN
74615 if( pParse->explain==2 ){
74616 char *zMsg = sqlite3MPrintf(
74617 pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr>=0?"":"CORRELATED ",
74618 pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
74619 );
74620 sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
74621 }
74622 #endif
@@ -74769,13 +74704,13 @@
74704 /* If the expression is not constant then we will need to
74705 ** disable the test that was generated above that makes sure
74706 ** this code only executes once. Because for a non-constant
74707 ** expression we need to rerun this code each time.
74708 */
74709 if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){
74710 sqlite3VdbeChangeToNoop(v, testAddr);
74711 testAddr = -1;
74712 }
74713
74714 /* Evaluate the expression and insert it into the temp table */
74715 if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
74716 sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
@@ -74840,12 +74775,12 @@
74775 ExprSetIrreducible(pExpr);
74776 break;
74777 }
74778 }
74779
74780 if( testAddr>=0 ){
74781 sqlite3VdbeJumpHere(v, testAddr);
74782 }
74783 sqlite3ExprCachePop(pParse, 1);
74784
74785 return rReg;
74786 }
@@ -76835,11 +76770,10 @@
76770 }
76771 }
76772
76773 /************** End of expr.c ************************************************/
76774 /************** Begin file alter.c *******************************************/
 
76775 /*
76776 ** 2005 February 15
76777 **
76778 ** The author disclaims copyright to this source code. In place of
76779 ** a legal notice, here is a blessing:
@@ -77664,11 +77598,10 @@
77598 }
77599 #endif /* SQLITE_ALTER_TABLE */
77600
77601 /************** End of alter.c ***********************************************/
77602 /************** Begin file analyze.c *****************************************/
 
77603 /*
77604 ** 2005 July 8
77605 **
77606 ** The author disclaims copyright to this source code. In place of
77607 ** a legal notice, here is a blessing:
@@ -78386,11 +78319,10 @@
78319
78320 #endif /* SQLITE_OMIT_ANALYZE */
78321
78322 /************** End of analyze.c *********************************************/
78323 /************** Begin file attach.c ******************************************/
 
78324 /*
78325 ** 2003 April 6
78326 **
78327 ** The author disclaims copyright to this source code. In place of
78328 ** a legal notice, here is a blessing:
@@ -78946,11 +78878,10 @@
78878 }
78879 #endif
78880
78881 /************** End of attach.c **********************************************/
78882 /************** Begin file auth.c ********************************************/
 
78883 /*
78884 ** 2003 January 11
78885 **
78886 ** The author disclaims copyright to this source code. In place of
78887 ** a legal notice, here is a blessing:
@@ -79198,11 +79129,10 @@
79129
79130 #endif /* SQLITE_OMIT_AUTHORIZATION */
79131
79132 /************** End of auth.c ************************************************/
79133 /************** Begin file build.c *******************************************/
 
79134 /*
79135 ** 2001 September 15
79136 **
79137 ** The author disclaims copyright to this source code. In place of
79138 ** a legal notice, here is a blessing:
@@ -83002,11 +82932,10 @@
82932 return pKey;
82933 }
82934
82935 /************** End of build.c ***********************************************/
82936 /************** Begin file callback.c ****************************************/
 
82937 /*
82938 ** 2005 May 23
82939 **
82940 ** The author disclaims copyright to this source code. In place of
82941 ** a legal notice, here is a blessing:
@@ -83462,11 +83391,10 @@
83391 return p;
83392 }
83393
83394 /************** End of callback.c ********************************************/
83395 /************** Begin file delete.c ******************************************/
 
83396 /*
83397 ** 2001 September 15
83398 **
83399 ** The author disclaims copyright to this source code. In place of
83400 ** a legal notice, here is a blessing:
@@ -84117,11 +84045,10 @@
84045 return regBase;
84046 }
84047
84048 /************** End of delete.c **********************************************/
84049 /************** Begin file func.c ********************************************/
 
84050 /*
84051 ** 2002 February 23
84052 **
84053 ** The author disclaims copyright to this source code. In place of
84054 ** a legal notice, here is a blessing:
@@ -85726,11 +85653,10 @@
85653 #endif
85654 }
85655
85656 /************** End of func.c ************************************************/
85657 /************** Begin file fkey.c ********************************************/
 
85658 /*
85659 **
85660 ** The author disclaims copyright to this source code. In place of
85661 ** a legal notice, here is a blessing:
85662 **
@@ -86947,11 +86873,10 @@
86873 }
86874 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
86875
86876 /************** End of fkey.c ************************************************/
86877 /************** Begin file insert.c ******************************************/
 
86878 /*
86879 ** 2001 September 15
86880 **
86881 ** The author disclaims copyright to this source code. In place of
86882 ** a legal notice, here is a blessing:
@@ -88793,11 +88718,10 @@
88718 }
88719 #endif /* SQLITE_OMIT_XFER_OPT */
88720
88721 /************** End of insert.c **********************************************/
88722 /************** Begin file legacy.c ******************************************/
 
88723 /*
88724 ** 2001 September 15
88725 **
88726 ** The author disclaims copyright to this source code. In place of
88727 ** a legal notice, here is a blessing:
@@ -88941,11 +88865,10 @@
88865 return rc;
88866 }
88867
88868 /************** End of legacy.c **********************************************/
88869 /************** Begin file loadext.c *****************************************/
 
88870 /*
88871 ** 2006 June 7
88872 **
88873 ** The author disclaims copyright to this source code. In place of
88874 ** a legal notice, here is a blessing:
@@ -88962,11 +88885,10 @@
88885 #ifndef SQLITE_CORE
88886 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
88887 #endif
88888 /************** Include sqlite3ext.h in the middle of loadext.c **************/
88889 /************** Begin file sqlite3ext.h **************************************/
 
88890 /*
88891 ** 2006 June 7
88892 **
88893 ** The author disclaims copyright to this source code. In place of
88894 ** a legal notice, here is a blessing:
@@ -89391,11 +89313,10 @@
89313
89314 #endif /* _SQLITE3EXT_H_ */
89315
89316 /************** End of sqlite3ext.h ******************************************/
89317 /************** Continuing where we left off in loadext.c ********************/
 
89318 /* #include <string.h> */
89319
89320 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89321
89322 /*
@@ -90031,11 +89952,10 @@
89952 }
89953 }
89954
89955 /************** End of loadext.c *********************************************/
89956 /************** Begin file pragma.c ******************************************/
 
89957 /*
89958 ** 2003 April 6
89959 **
89960 ** The author disclaims copyright to this source code. In place of
89961 ** a legal notice, here is a blessing:
@@ -91560,11 +91480,10 @@
91480
91481 #endif /* SQLITE_OMIT_PRAGMA */
91482
91483 /************** End of pragma.c **********************************************/
91484 /************** Begin file prepare.c *****************************************/
 
91485 /*
91486 ** 2005 May 25
91487 **
91488 ** The author disclaims copyright to this source code. In place of
91489 ** a legal notice, here is a blessing:
@@ -92421,11 +92340,10 @@
92340
92341 #endif /* SQLITE_OMIT_UTF16 */
92342
92343 /************** End of prepare.c *********************************************/
92344 /************** Begin file select.c ******************************************/
 
92345 /*
92346 ** 2001 September 15
92347 **
92348 ** The author disclaims copyright to this source code. In place of
92349 ** a legal notice, here is a blessing:
@@ -92512,10 +92430,12 @@
92430 pNew->addrOpenEphm[2] = -1;
92431 if( db->mallocFailed ) {
92432 clearSelect(db, pNew);
92433 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92434 pNew = 0;
92435 }else{
92436 assert( pNew->pSrc!=0 || pParse->nErr>0 );
92437 }
92438 return pNew;
92439 }
92440
92441 /*
@@ -96224,11 +96144,15 @@
96144 struct SrcList_item *pItem = &pTabList->a[i];
96145 SelectDest dest;
96146 Select *pSub = pItem->pSelect;
96147 int isAggSub;
96148
96149 if( pSub==0 ) continue;
96150 if( pItem->addrFillSub ){
96151 sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
96152 continue;
96153 }
96154
96155 /* Increment Parse.nHeight by the height of the largest expression
96156 ** tree refered to by this, the parent select. The child select
96157 ** may contain expression trees of at most
96158 ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
@@ -96235,25 +96159,48 @@
96159 ** more conservative than necessary, but much easier than enforcing
96160 ** an exact limit.
96161 */
96162 pParse->nHeight += sqlite3SelectExprHeight(p);
96163
 
96164 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
96165 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
96166 /* This subquery can be absorbed into its parent. */
96167 if( isAggSub ){
96168 isAgg = 1;
96169 p->selFlags |= SF_Aggregate;
96170 }
96171 i = -1;
96172 }else{
96173 /* Generate a subroutine that will fill an ephemeral table with
96174 ** the content of this subquery. pItem->addrFillSub will point
96175 ** to the address of the generated subroutine. pItem->regReturn
96176 ** is a register allocated to hold the subroutine return address
96177 */
96178 int topAddr;
96179 int onceAddr = 0;
96180 int retAddr;
96181 assert( pItem->addrFillSub==0 );
96182 pItem->regReturn = ++pParse->nMem;
96183 topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
96184 pItem->addrFillSub = topAddr+1;
96185 VdbeNoopComment((v, "materialize %s", pItem->pTab->zName));
96186 if( pItem->isCorrelated==0 && pParse->pTriggerTab==0 ){
96187 /* If the subquery is no correlated and if we are not inside of
96188 ** a trigger, then we only need to compute the value of the subquery
96189 ** once. */
96190 int regOnce = ++pParse->nMem;
96191 onceAddr = sqlite3VdbeAddOp1(v, OP_Once, regOnce);
96192 }
96193 sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
 
96194 explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId);
96195 sqlite3Select(pParse, pSub, &dest);
 
96196 pItem->pTab->nRowEst = (unsigned)pSub->nSelectRow;
96197 if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
96198 retAddr = sqlite3VdbeAddOp1(v, OP_Return, pItem->regReturn);
96199 VdbeComment((v, "end %s", pItem->pTab->zName));
96200 sqlite3VdbeChangeP1(v, topAddr, retAddr);
96201
96202 }
96203 if( /*pParse->nErr ||*/ db->mallocFailed ){
96204 goto select_end;
96205 }
96206 pParse->nHeight -= sqlite3SelectExprHeight(p);
@@ -96390,11 +96337,11 @@
96337 /* If sorting index that was created by a prior OP_OpenEphemeral
96338 ** instruction ended up not being needed, then change the OP_OpenEphemeral
96339 ** into an OP_Noop.
96340 */
96341 if( addrSortIndex>=0 && pOrderBy==0 ){
96342 sqlite3VdbeChangeToNoop(v, addrSortIndex);
96343 p->addrOpenEphm[2] = -1;
96344 }
96345
96346 if( pWInfo->eDistinct ){
96347 VdbeOp *pOp; /* No longer required OpenEphemeral instr. */
@@ -96673,11 +96620,11 @@
96620 */
96621 if( groupBySort ){
96622 sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop);
96623 }else{
96624 sqlite3WhereEnd(pWInfo);
96625 sqlite3VdbeChangeToNoop(v, addrSortingIdx);
96626 }
96627
96628 /* Output the final row of result
96629 */
96630 sqlite3VdbeAddOp2(v, OP_Gosub, regOutputRow, addrOutputRow);
@@ -96981,11 +96928,10 @@
96928 *****************************************************************************/
96929 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
96930
96931 /************** End of select.c **********************************************/
96932 /************** Begin file table.c *******************************************/
 
96933 /*
96934 ** 2001 September 15
96935 **
96936 ** The author disclaims copyright to this source code. In place of
96937 ** a legal notice, here is a blessing:
@@ -97181,11 +97127,10 @@
97127
97128 #endif /* SQLITE_OMIT_GET_TABLE */
97129
97130 /************** End of table.c ***********************************************/
97131 /************** Begin file trigger.c *****************************************/
 
97132 /*
97133 **
97134 ** The author disclaims copyright to this source code. In place of
97135 ** a legal notice, here is a blessing:
97136 **
@@ -98307,11 +98252,10 @@
98252
98253 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98254
98255 /************** End of trigger.c *********************************************/
98256 /************** Begin file update.c ******************************************/
 
98257 /*
98258 ** 2001 September 15
98259 **
98260 ** The author disclaims copyright to this source code. In place of
98261 ** a legal notice, here is a blessing:
@@ -98980,11 +98924,10 @@
98924 }
98925 #endif /* SQLITE_OMIT_VIRTUALTABLE */
98926
98927 /************** End of update.c **********************************************/
98928 /************** Begin file vacuum.c ******************************************/
 
98929 /*
98930 ** 2003 April 6
98931 **
98932 ** The author disclaims copyright to this source code. In place of
98933 ** a legal notice, here is a blessing:
@@ -99327,11 +99270,10 @@
99270
99271 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99272
99273 /************** End of vacuum.c **********************************************/
99274 /************** Begin file vtab.c ********************************************/
 
99275 /*
99276 ** 2006 June 10
99277 **
99278 ** The author disclaims copyright to this source code. In place of
99279 ** a legal notice, here is a blessing:
@@ -100396,11 +100338,10 @@
100338
100339 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100340
100341 /************** End of vtab.c ************************************************/
100342 /************** Begin file where.c *******************************************/
 
100343 /*
100344 ** 2001 September 15
100345 **
100346 ** The author disclaims copyright to this source code. In place of
100347 ** a legal notice, here is a blessing:
@@ -100865,15 +100806,23 @@
100806 return mask;
100807 }
100808 static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
100809 Bitmask mask = 0;
100810 while( pS ){
100811 SrcList *pSrc = pS->pSrc;
100812 mask |= exprListTableUsage(pMaskSet, pS->pEList);
100813 mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
100814 mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
100815 mask |= exprTableUsage(pMaskSet, pS->pWhere);
100816 mask |= exprTableUsage(pMaskSet, pS->pHaving);
100817 if( ALWAYS(pSrc!=0) ){
100818 int i;
100819 for(i=0; i<pSrc->nSrc; i++){
100820 mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
100821 mask |= exprTableUsage(pMaskSet, pSrc->a[i].pOn);
100822 }
100823 }
100824 pS = pS->pPrior;
100825 }
100826 return mask;
100827 }
100828
@@ -102392,12 +102341,11 @@
102341 /* Generate code to skip over the creation and initialization of the
102342 ** transient index on 2nd and subsequent iterations of the loop. */
102343 v = pParse->pVdbe;
102344 assert( v!=0 );
102345 regIsInit = ++pParse->nMem;
102346 addrInit = sqlite3VdbeAddOp1(v, OP_Once, regIsInit);
 
102347
102348 /* Count the number of columns that will be added to the index
102349 ** and used to match WHERE clause constraints */
102350 nColumn = 0;
102351 pTable = pSrc->pTab;
@@ -105583,11 +105531,10 @@
105531 return;
105532 }
105533
105534 /************** End of where.c ***********************************************/
105535 /************** Begin file parse.c *******************************************/
 
105536 /* Driver template for the LEMON parser generator.
105537 ** The author disclaims copyright to this source code.
105538 **
105539 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105540 ** The only modifications are the addition of a couple of NEVER()
@@ -105596,11 +105543,10 @@
105543 ** specific grammar used by SQLite.
105544 */
105545 /* First off, code is included that follows the "include" declaration
105546 ** in the input grammar file. */
105547 /* #include <stdio.h> */
 
105548
105549
105550 /*
105551 ** Disable all error recovery processing in the parser push-down
105552 ** automaton.
@@ -105644,11 +105590,10 @@
105590 /*
105591 ** An instance of this structure holds the ATTACH key and the key type.
105592 */
105593 struct AttachKey { int type; Token key; };
105594
 
105595
105596 /* This is a utility routine used to set the ExprSpan.zStart and
105597 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105598 ** range of text beginning with pStart and going to the end of pEnd.
105599 */
@@ -105664,11 +105609,10 @@
105609 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105610 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105611 pOut->zStart = pValue->z;
105612 pOut->zEnd = &pValue->z[pValue->n];
105613 }
 
105614
105615 /* This routine constructs a binary expression node out of two ExprSpan
105616 ** objects and uses the result to populate a new ExprSpan object.
105617 */
105618 static void spanBinaryExpr(
@@ -105680,11 +105624,10 @@
105624 ){
105625 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105626 pOut->zStart = pLeft->zStart;
105627 pOut->zEnd = pRight->zEnd;
105628 }
 
105629
105630 /* Construct an expression node for a unary postfix operator
105631 */
105632 static void spanUnaryPostfix(
105633 ExprSpan *pOut, /* Write the new expression node here */
@@ -105695,11 +105638,10 @@
105638 ){
105639 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105640 pOut->zStart = pOperand->zStart;
105641 pOut->zEnd = &pPostOp->z[pPostOp->n];
105642 }
 
105643
105644 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
105645 ** unary TK_ISNULL or TK_NOTNULL expression. */
105646 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
105647 sqlite3 *db = pParse->db;
@@ -105707,11 +105649,10 @@
105649 pA->op = (u8)op;
105650 sqlite3ExprDelete(db, pA->pRight);
105651 pA->pRight = 0;
105652 }
105653 }
 
105654
105655 /* Construct an expression node for a unary prefix operator
105656 */
105657 static void spanUnaryPrefix(
105658 ExprSpan *pOut, /* Write the new expression node here */
@@ -105722,11 +105663,10 @@
105663 ){
105664 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
105665 pOut->zStart = pPreOp->z;
105666 pOut->zEnd = pOperand->zEnd;
105667 }
 
105668 /* Next is all token values, in a form suitable for use by makeheaders.
105669 ** This section will be null unless lemon is run with the -m switch.
105670 */
105671 /*
105672 ** These constants (all generated automatically by the parser generator)
@@ -106978,21 +106918,17 @@
106918 ** inside the C code.
106919 */
106920 case 160: /* select */
106921 case 194: /* oneselect */
106922 {
 
106923 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
 
106924 }
106925 break;
106926 case 174: /* term */
106927 case 175: /* expr */
106928 {
 
106929 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
 
106930 }
106931 break;
106932 case 179: /* idxlist_opt */
106933 case 187: /* idxlist */
106934 case 197: /* selcollist */
@@ -107004,23 +106940,19 @@
106940 case 217: /* setlist */
106941 case 220: /* itemlist */
106942 case 221: /* exprlist */
106943 case 226: /* case_exprlist */
106944 {
 
106945 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
 
106946 }
106947 break;
106948 case 193: /* fullname */
106949 case 198: /* from */
106950 case 206: /* seltablist */
106951 case 207: /* stl_prefix */
106952 {
 
106953 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
 
106954 }
106955 break;
106956 case 199: /* where_opt */
106957 case 201: /* having_opt */
106958 case 210: /* on_opt */
@@ -107028,37 +106960,29 @@
106960 case 225: /* case_operand */
106961 case 227: /* case_else */
106962 case 238: /* when_clause */
106963 case 243: /* key_opt */
106964 {
 
106965 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
 
106966 }
106967 break;
106968 case 211: /* using_opt */
106969 case 213: /* inscollist */
106970 case 219: /* inscollist_opt */
106971 {
 
106972 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
 
106973 }
106974 break;
106975 case 234: /* trigger_cmd_list */
106976 case 239: /* trigger_cmd */
106977 {
 
106978 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
 
106979 }
106980 break;
106981 case 236: /* trigger_event */
106982 {
 
106983 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
 
106984 }
106985 break;
106986 default: break; /* If no destructor action specified: do nothing */
106987 }
106988 }
@@ -107240,16 +107164,14 @@
107164 }
107165 #endif
107166 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107167 /* Here code is inserted which will execute if the parser
107168 ** stack every overflows */
 
107169
107170 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107171 sqlite3ErrorMsg(pParse, "parser stack overflow");
107172 pParse->parseError = 1;
 
107173 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107174 }
107175
107176 /*
107177 ** Perform a shift action.
@@ -107686,94 +107608,66 @@
107608 ** { ... } // User supplied code
107609 ** #line <lineno> <thisfile>
107610 ** break;
107611 */
107612 case 5: /* explain ::= */
 
107613 { sqlite3BeginParse(pParse, 0); }
 
107614 break;
107615 case 6: /* explain ::= EXPLAIN */
 
107616 { sqlite3BeginParse(pParse, 1); }
 
107617 break;
107618 case 7: /* explain ::= EXPLAIN QUERY PLAN */
 
107619 { sqlite3BeginParse(pParse, 2); }
 
107620 break;
107621 case 8: /* cmdx ::= cmd */
 
107622 { sqlite3FinishCoding(pParse); }
 
107623 break;
107624 case 9: /* cmd ::= BEGIN transtype trans_opt */
 
107625 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
 
107626 break;
107627 case 13: /* transtype ::= */
 
107628 {yygotominor.yy4 = TK_DEFERRED;}
 
107629 break;
107630 case 14: /* transtype ::= DEFERRED */
107631 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107632 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107633 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107634 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
 
107635 {yygotominor.yy4 = yymsp[0].major;}
 
107636 break;
107637 case 17: /* cmd ::= COMMIT trans_opt */
107638 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
 
107639 {sqlite3CommitTransaction(pParse);}
 
107640 break;
107641 case 19: /* cmd ::= ROLLBACK trans_opt */
 
107642 {sqlite3RollbackTransaction(pParse);}
 
107643 break;
107644 case 22: /* cmd ::= SAVEPOINT nm */
 
107645 {
107646 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
107647 }
 
107648 break;
107649 case 23: /* cmd ::= RELEASE savepoint_opt nm */
 
107650 {
107651 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
107652 }
 
107653 break;
107654 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
 
107655 {
107656 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
107657 }
 
107658 break;
107659 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
 
107660 {
107661 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
107662 }
 
107663 break;
107664 case 27: /* createkw ::= CREATE */
 
107665 {
107666 pParse->db->lookaside.bEnabled = 0;
107667 yygotominor.yy0 = yymsp[0].minor.yy0;
107668 }
 
107669 break;
107670 case 28: /* ifnotexists ::= */
107671 case 31: /* temp ::= */ yytestcase(yyruleno==31);
107672 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
107673 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -107783,56 +107677,44 @@
107677 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
107678 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
107679 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
107680 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
107681 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
 
107682 {yygotominor.yy4 = 0;}
 
107683 break;
107684 case 29: /* ifnotexists ::= IF NOT EXISTS */
107685 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
107686 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
107687 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
107688 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
107689 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
107690 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
107691 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
 
107692 {yygotominor.yy4 = 1;}
 
107693 break;
107694 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
 
107695 {
107696 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
107697 }
 
107698 break;
107699 case 33: /* create_table_args ::= AS select */
 
107700 {
107701 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
107702 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107703 }
 
107704 break;
107705 case 36: /* column ::= columnid type carglist */
 
107706 {
107707 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
107708 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
107709 }
 
107710 break;
107711 case 37: /* columnid ::= nm */
 
107712 {
107713 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
107714 yygotominor.yy0 = yymsp[0].minor.yy0;
107715 }
 
107716 break;
107717 case 38: /* id ::= ID */
107718 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
107719 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
107720 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -107852,373 +107734,256 @@
107734 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
107735 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
107736 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
107737 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
107738 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
 
107739 {yygotominor.yy0 = yymsp[0].minor.yy0;}
 
107740 break;
107741 case 45: /* type ::= typetoken */
 
107742 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
 
107743 break;
107744 case 47: /* typetoken ::= typename LP signed RP */
 
107745 {
107746 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
107747 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
107748 }
 
107749 break;
107750 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
 
107751 {
107752 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
107753 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
107754 }
 
107755 break;
107756 case 50: /* typename ::= typename ids */
 
107757 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
 
107758 break;
107759 case 57: /* ccons ::= DEFAULT term */
107760 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
 
107761 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
 
107762 break;
107763 case 58: /* ccons ::= DEFAULT LP expr RP */
 
107764 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
 
107765 break;
107766 case 60: /* ccons ::= DEFAULT MINUS term */
 
107767 {
107768 ExprSpan v;
107769 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
107770 v.zStart = yymsp[-1].minor.yy0.z;
107771 v.zEnd = yymsp[0].minor.yy118.zEnd;
107772 sqlite3AddDefaultValue(pParse,&v);
107773 }
 
107774 break;
107775 case 61: /* ccons ::= DEFAULT id */
 
107776 {
107777 ExprSpan v;
107778 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
107779 sqlite3AddDefaultValue(pParse,&v);
107780 }
 
107781 break;
107782 case 63: /* ccons ::= NOT NULL onconf */
 
107783 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
 
107784 break;
107785 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
 
107786 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
 
107787 break;
107788 case 65: /* ccons ::= UNIQUE onconf */
 
107789 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
 
107790 break;
107791 case 66: /* ccons ::= CHECK LP expr RP */
 
107792 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
 
107793 break;
107794 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
 
107795 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
 
107796 break;
107797 case 68: /* ccons ::= defer_subclause */
 
107798 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
 
107799 break;
107800 case 69: /* ccons ::= COLLATE ids */
 
107801 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
 
107802 break;
107803 case 72: /* refargs ::= */
 
107804 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
 
107805 break;
107806 case 73: /* refargs ::= refargs refarg */
 
107807 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
 
107808 break;
107809 case 74: /* refarg ::= MATCH nm */
107810 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
 
107811 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
 
107812 break;
107813 case 76: /* refarg ::= ON DELETE refact */
 
107814 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
 
107815 break;
107816 case 77: /* refarg ::= ON UPDATE refact */
 
107817 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
 
107818 break;
107819 case 78: /* refact ::= SET NULL */
 
107820 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
 
107821 break;
107822 case 79: /* refact ::= SET DEFAULT */
 
107823 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
 
107824 break;
107825 case 80: /* refact ::= CASCADE */
 
107826 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
 
107827 break;
107828 case 81: /* refact ::= RESTRICT */
 
107829 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
 
107830 break;
107831 case 82: /* refact ::= NO ACTION */
 
107832 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
 
107833 break;
107834 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
107835 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
107836 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
107837 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
 
107838 {yygotominor.yy4 = yymsp[0].minor.yy4;}
 
107839 break;
107840 case 88: /* conslist_opt ::= */
 
107841 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
 
107842 break;
107843 case 89: /* conslist_opt ::= COMMA conslist */
 
107844 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
 
107845 break;
107846 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
 
107847 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
 
107848 break;
107849 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
 
107850 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
 
107851 break;
107852 case 96: /* tcons ::= CHECK LP expr RP onconf */
 
107853 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
 
107854 break;
107855 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
 
107856 {
107857 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
107858 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
107859 }
 
107860 break;
107861 case 100: /* onconf ::= */
 
107862 {yygotominor.yy4 = OE_Default;}
 
107863 break;
107864 case 102: /* orconf ::= */
 
107865 {yygotominor.yy210 = OE_Default;}
 
107866 break;
107867 case 103: /* orconf ::= OR resolvetype */
 
107868 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
 
107869 break;
107870 case 105: /* resolvetype ::= IGNORE */
 
107871 {yygotominor.yy4 = OE_Ignore;}
 
107872 break;
107873 case 106: /* resolvetype ::= REPLACE */
 
107874 {yygotominor.yy4 = OE_Replace;}
 
107875 break;
107876 case 107: /* cmd ::= DROP TABLE ifexists fullname */
 
107877 {
107878 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
107879 }
 
107880 break;
107881 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
 
107882 {
107883 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
107884 }
 
107885 break;
107886 case 111: /* cmd ::= DROP VIEW ifexists fullname */
 
107887 {
107888 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
107889 }
 
107890 break;
107891 case 112: /* cmd ::= select */
 
107892 {
107893 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
107894 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
107895 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
107896 }
 
107897 break;
107898 case 113: /* select ::= oneselect */
 
107899 {yygotominor.yy387 = yymsp[0].minor.yy387;}
 
107900 break;
107901 case 114: /* select ::= select multiselect_op oneselect */
 
107902 {
107903 if( yymsp[0].minor.yy387 ){
107904 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
107905 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
107906 }else{
107907 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
107908 }
107909 yygotominor.yy387 = yymsp[0].minor.yy387;
107910 }
 
107911 break;
107912 case 116: /* multiselect_op ::= UNION ALL */
 
107913 {yygotominor.yy4 = TK_ALL;}
 
107914 break;
107915 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
 
107916 {
107917 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
107918 }
 
107919 break;
107920 case 122: /* sclp ::= selcollist COMMA */
107921 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
 
107922 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
 
107923 break;
107924 case 123: /* sclp ::= */
107925 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
107926 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
107927 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
107928 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
 
107929 {yygotominor.yy322 = 0;}
 
107930 break;
107931 case 124: /* selcollist ::= sclp expr as */
 
107932 {
107933 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
107934 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
107935 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
107936 }
 
107937 break;
107938 case 125: /* selcollist ::= sclp STAR */
 
107939 {
107940 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
107941 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
107942 }
 
107943 break;
107944 case 126: /* selcollist ::= sclp nm DOT STAR */
 
107945 {
107946 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
107947 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
107948 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
107949 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
107950 }
 
107951 break;
107952 case 129: /* as ::= */
 
107953 {yygotominor.yy0.n = 0;}
 
107954 break;
107955 case 130: /* from ::= */
 
107956 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
 
107957 break;
107958 case 131: /* from ::= FROM seltablist */
 
107959 {
107960 yygotominor.yy259 = yymsp[0].minor.yy259;
107961 sqlite3SrcListShiftJoinType(yygotominor.yy259);
107962 }
 
107963 break;
107964 case 132: /* stl_prefix ::= seltablist joinop */
 
107965 {
107966 yygotominor.yy259 = yymsp[-1].minor.yy259;
107967 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
107968 }
 
107969 break;
107970 case 133: /* stl_prefix ::= */
 
107971 {yygotominor.yy259 = 0;}
 
107972 break;
107973 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
 
107974 {
107975 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107976 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
107977 }
 
107978 break;
107979 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
 
107980 {
107981 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107982 }
 
107983 break;
107984 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
 
107985 {
107986 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
107987 yygotominor.yy259 = yymsp[-4].minor.yy259;
107988 }else{
107989 Select *pSubquery;
@@ -108225,260 +107990,180 @@
107990 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
107991 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
107992 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
107993 }
107994 }
 
107995 break;
107996 case 137: /* dbnm ::= */
107997 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
 
107998 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
 
107999 break;
108000 case 139: /* fullname ::= nm dbnm */
 
108001 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
 
108002 break;
108003 case 140: /* joinop ::= COMMA|JOIN */
 
108004 { yygotominor.yy4 = JT_INNER; }
 
108005 break;
108006 case 141: /* joinop ::= JOIN_KW JOIN */
 
108007 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
 
108008 break;
108009 case 142: /* joinop ::= JOIN_KW nm JOIN */
 
108010 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
 
108011 break;
108012 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
 
108013 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
 
108014 break;
108015 case 144: /* on_opt ::= ON expr */
108016 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108017 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108018 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108019 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108020 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
 
108021 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
 
108022 break;
108023 case 145: /* on_opt ::= */
108024 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108025 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108026 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108027 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
 
108028 {yygotominor.yy314 = 0;}
 
108029 break;
108030 case 148: /* indexed_opt ::= NOT INDEXED */
 
108031 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
 
108032 break;
108033 case 149: /* using_opt ::= USING LP inscollist RP */
108034 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
 
108035 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
 
108036 break;
108037 case 150: /* using_opt ::= */
108038 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
 
108039 {yygotominor.yy384 = 0;}
 
108040 break;
108041 case 152: /* orderby_opt ::= ORDER BY sortlist */
108042 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108043 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
 
108044 {yygotominor.yy322 = yymsp[0].minor.yy322;}
 
108045 break;
108046 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
 
108047 {
108048 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108049 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108050 }
 
108051 break;
108052 case 154: /* sortlist ::= sortitem sortorder */
 
108053 {
108054 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108055 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108056 }
 
108057 break;
108058 case 156: /* sortorder ::= ASC */
108059 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
 
108060 {yygotominor.yy4 = SQLITE_SO_ASC;}
 
108061 break;
108062 case 157: /* sortorder ::= DESC */
 
108063 {yygotominor.yy4 = SQLITE_SO_DESC;}
 
108064 break;
108065 case 163: /* limit_opt ::= */
 
108066 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
 
108067 break;
108068 case 164: /* limit_opt ::= LIMIT expr */
 
108069 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
 
108070 break;
108071 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
 
108072 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
 
108073 break;
108074 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
 
108075 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
 
108076 break;
108077 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
 
108078 {
108079 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108080 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108081 }
 
108082 break;
108083 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
 
108084 {
108085 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108086 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108087 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108088 }
 
108089 break;
108090 case 171: /* setlist ::= setlist COMMA nm EQ expr */
 
108091 {
108092 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108093 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108094 }
 
108095 break;
108096 case 172: /* setlist ::= nm EQ expr */
 
108097 {
108098 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108099 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108100 }
 
108101 break;
108102 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
 
108103 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
 
108104 break;
108105 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
 
108106 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
 
108107 break;
108108 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
 
108109 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
 
108110 break;
108111 case 176: /* insert_cmd ::= INSERT orconf */
 
108112 {yygotominor.yy210 = yymsp[0].minor.yy210;}
 
108113 break;
108114 case 177: /* insert_cmd ::= REPLACE */
 
108115 {yygotominor.yy210 = OE_Replace;}
 
108116 break;
108117 case 178: /* itemlist ::= itemlist COMMA expr */
108118 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
 
108119 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
 
108120 break;
108121 case 179: /* itemlist ::= expr */
108122 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
 
108123 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
 
108124 break;
108125 case 182: /* inscollist ::= inscollist COMMA nm */
 
108126 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
 
108127 break;
108128 case 183: /* inscollist ::= nm */
 
108129 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
 
108130 break;
108131 case 184: /* expr ::= term */
 
108132 {yygotominor.yy118 = yymsp[0].minor.yy118;}
 
108133 break;
108134 case 185: /* expr ::= LP expr RP */
 
108135 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
 
108136 break;
108137 case 186: /* term ::= NULL */
108138 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108139 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
 
108140 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
 
108141 break;
108142 case 187: /* expr ::= id */
108143 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
 
108144 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
 
108145 break;
108146 case 189: /* expr ::= nm DOT nm */
 
108147 {
108148 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108149 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108150 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108151 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108152 }
 
108153 break;
108154 case 190: /* expr ::= nm DOT nm DOT nm */
 
108155 {
108156 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108157 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108158 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108159 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108160 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108161 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108162 }
 
108163 break;
108164 case 193: /* expr ::= REGISTER */
 
108165 {
108166 /* When doing a nested parse, one can include terms in an expression
108167 ** that look like this: #1 #2 ... These terms refer to registers
108168 ** in the virtual machine. #N is the N-th register. */
108169 if( pParse->nested==0 ){
@@ -108488,40 +108173,32 @@
108173 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108174 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108175 }
108176 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108177 }
 
108178 break;
108179 case 194: /* expr ::= VARIABLE */
 
108180 {
108181 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108182 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108183 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108184 }
 
108185 break;
108186 case 195: /* expr ::= expr COLLATE ids */
 
108187 {
108188 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108189 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108190 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108191 }
 
108192 break;
108193 case 196: /* expr ::= CAST LP expr AS typetoken RP */
 
108194 {
108195 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108196 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108197 }
 
108198 break;
108199 case 197: /* expr ::= ID LP distinct exprlist RP */
 
108200 {
108201 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108202 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108203 }
108204 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108528,59 +108205,47 @@
108205 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108206 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108207 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108208 }
108209 }
 
108210 break;
108211 case 198: /* expr ::= ID LP STAR RP */
 
108212 {
108213 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108214 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108215 }
 
108216 break;
108217 case 199: /* term ::= CTIME_KW */
 
108218 {
108219 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108220 ** treated as functions that return constants */
108221 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108222 if( yygotominor.yy118.pExpr ){
108223 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108224 }
108225 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108226 }
 
108227 break;
108228 case 200: /* expr ::= expr AND expr */
108229 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108230 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108231 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108232 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108233 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108234 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108235 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
 
108236 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
 
108237 break;
108238 case 208: /* likeop ::= LIKE_KW */
108239 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
 
108240 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
 
108241 break;
108242 case 209: /* likeop ::= NOT LIKE_KW */
108243 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
 
108244 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
 
108245 break;
108246 case 212: /* expr ::= expr likeop expr */
 
108247 {
108248 ExprList *pList;
108249 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108250 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108251 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108587,14 +108252,12 @@
108252 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108253 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108254 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108255 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108256 }
 
108257 break;
108258 case 213: /* expr ::= expr likeop expr ESCAPE expr */
 
108259 {
108260 ExprList *pList;
108261 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108262 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108263 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -108602,56 +108265,40 @@
108265 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108266 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108267 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108268 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108269 }
 
108270 break;
108271 case 214: /* expr ::= expr ISNULL|NOTNULL */
 
108272 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
 
108273 break;
108274 case 215: /* expr ::= expr NOT NULL */
 
108275 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
 
108276 break;
108277 case 216: /* expr ::= expr IS expr */
 
108278 {
108279 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108280 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108281 }
 
108282 break;
108283 case 217: /* expr ::= expr IS NOT expr */
 
108284 {
108285 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108286 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108287 }
 
108288 break;
108289 case 218: /* expr ::= NOT expr */
108290 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
 
108291 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108292 break;
108293 case 220: /* expr ::= MINUS expr */
 
108294 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108295 break;
108296 case 221: /* expr ::= PLUS expr */
 
108297 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108298 break;
108299 case 224: /* expr ::= expr between_op expr AND expr */
 
108300 {
108301 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108302 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108303 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108304 if( yygotominor.yy118.pExpr ){
@@ -108661,14 +108308,12 @@
108308 }
108309 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108310 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108311 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108312 }
 
108313 break;
108314 case 227: /* expr ::= expr in_op LP exprlist RP */
 
108315 {
108316 if( yymsp[-1].minor.yy322==0 ){
108317 /* Expressions of the form
108318 **
108319 ** expr1 IN ()
@@ -108690,14 +108335,12 @@
108335 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108336 }
108337 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108338 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108339 }
 
108340 break;
108341 case 228: /* expr ::= LP select RP */
 
108342 {
108343 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108344 if( yygotominor.yy118.pExpr ){
108345 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108346 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108706,14 +108349,12 @@
108349 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108350 }
108351 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108352 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108353 }
 
108354 break;
108355 case 229: /* expr ::= expr in_op LP select RP */
 
108356 {
108357 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108358 if( yygotominor.yy118.pExpr ){
108359 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108360 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -108723,14 +108364,12 @@
108364 }
108365 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108366 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108367 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108368 }
 
108369 break;
108370 case 230: /* expr ::= expr in_op nm dbnm */
 
108371 {
108372 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108373 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108374 if( yygotominor.yy118.pExpr ){
108375 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -108741,14 +108380,12 @@
108380 }
108381 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108382 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108383 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108384 }
 
108385 break;
108386 case 231: /* expr ::= EXISTS LP select RP */
 
108387 {
108388 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108389 if( p ){
108390 p->x.pSelect = yymsp[-1].minor.yy387;
108391 ExprSetProperty(p, EP_xIsSelect);
@@ -108757,14 +108394,12 @@
108394 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108395 }
108396 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108397 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108398 }
 
108399 break;
108400 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
 
108401 {
108402 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108403 if( yygotominor.yy118.pExpr ){
108404 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108405 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -108772,50 +108407,38 @@
108407 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108408 }
108409 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108410 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108411 }
 
108412 break;
108413 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
 
108414 {
108415 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108416 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108417 }
 
108418 break;
108419 case 234: /* case_exprlist ::= WHEN expr THEN expr */
 
108420 {
108421 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108422 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108423 }
 
108424 break;
108425 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
 
108426 {
108427 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108428 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108429 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108430 }
 
108431 break;
108432 case 244: /* uniqueflag ::= UNIQUE */
108433 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
 
108434 {yygotominor.yy4 = OE_Abort;}
 
108435 break;
108436 case 245: /* uniqueflag ::= */
 
108437 {yygotominor.yy4 = OE_None;}
 
108438 break;
108439 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
 
108440 {
108441 Expr *p = 0;
108442 if( yymsp[-1].minor.yy0.n>0 ){
108443 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108444 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108823,14 +108446,12 @@
108446 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108447 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108448 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108449 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108450 }
 
108451 break;
108452 case 249: /* idxlist ::= nm collate sortorder */
 
108453 {
108454 Expr *p = 0;
108455 if( yymsp[-1].minor.yy0.n>0 ){
108456 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108457 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -108838,307 +108459,214 @@
108459 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108460 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108461 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108462 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108463 }
 
108464 break;
108465 case 250: /* collate ::= */
 
108466 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
 
108467 break;
108468 case 252: /* cmd ::= DROP INDEX ifexists fullname */
 
108469 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
 
108470 break;
108471 case 253: /* cmd ::= VACUUM */
108472 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
 
108473 {sqlite3Vacuum(pParse);}
 
108474 break;
108475 case 255: /* cmd ::= PRAGMA nm dbnm */
 
108476 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
 
108477 break;
108478 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
 
108479 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
 
108480 break;
108481 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
 
108482 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
 
108483 break;
108484 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
 
108485 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
 
108486 break;
108487 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
 
108488 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
 
108489 break;
108490 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
 
108491 {
108492 Token all;
108493 all.z = yymsp[-3].minor.yy0.z;
108494 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108495 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108496 }
 
108497 break;
108498 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
 
108499 {
108500 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108501 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108502 }
 
108503 break;
108504 case 272: /* trigger_time ::= BEFORE */
108505 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
 
108506 { yygotominor.yy4 = TK_BEFORE; }
 
108507 break;
108508 case 273: /* trigger_time ::= AFTER */
 
108509 { yygotominor.yy4 = TK_AFTER; }
 
108510 break;
108511 case 274: /* trigger_time ::= INSTEAD OF */
 
108512 { yygotominor.yy4 = TK_INSTEAD;}
 
108513 break;
108514 case 276: /* trigger_event ::= DELETE|INSERT */
108515 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
 
108516 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
 
108517 break;
108518 case 278: /* trigger_event ::= UPDATE OF inscollist */
 
108519 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
 
108520 break;
108521 case 281: /* when_clause ::= */
108522 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
 
108523 { yygotominor.yy314 = 0; }
 
108524 break;
108525 case 282: /* when_clause ::= WHEN expr */
108526 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
 
108527 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
 
108528 break;
108529 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
 
108530 {
108531 assert( yymsp[-2].minor.yy203!=0 );
108532 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108533 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108534 yygotominor.yy203 = yymsp[-2].minor.yy203;
108535 }
 
108536 break;
108537 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
 
108538 {
108539 assert( yymsp[-1].minor.yy203!=0 );
108540 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108541 yygotominor.yy203 = yymsp[-1].minor.yy203;
108542 }
 
108543 break;
108544 case 286: /* trnm ::= nm DOT nm */
 
108545 {
108546 yygotominor.yy0 = yymsp[0].minor.yy0;
108547 sqlite3ErrorMsg(pParse,
108548 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108549 "statements within triggers");
108550 }
 
108551 break;
108552 case 288: /* tridxby ::= INDEXED BY nm */
 
108553 {
108554 sqlite3ErrorMsg(pParse,
108555 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108556 "within triggers");
108557 }
 
108558 break;
108559 case 289: /* tridxby ::= NOT INDEXED */
 
108560 {
108561 sqlite3ErrorMsg(pParse,
108562 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108563 "within triggers");
108564 }
 
108565 break;
108566 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
 
108567 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
 
108568 break;
108569 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
 
108570 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
 
108571 break;
108572 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
 
108573 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
 
108574 break;
108575 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
 
108576 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
 
108577 break;
108578 case 294: /* trigger_cmd ::= select */
 
108579 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
 
108580 break;
108581 case 295: /* expr ::= RAISE LP IGNORE RP */
 
108582 {
108583 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
108584 if( yygotominor.yy118.pExpr ){
108585 yygotominor.yy118.pExpr->affinity = OE_Ignore;
108586 }
108587 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108588 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108589 }
 
108590 break;
108591 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
 
108592 {
108593 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
108594 if( yygotominor.yy118.pExpr ) {
108595 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
108596 }
108597 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
108598 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108599 }
 
108600 break;
108601 case 297: /* raisetype ::= ROLLBACK */
 
108602 {yygotominor.yy4 = OE_Rollback;}
 
108603 break;
108604 case 299: /* raisetype ::= FAIL */
 
108605 {yygotominor.yy4 = OE_Fail;}
 
108606 break;
108607 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
 
108608 {
108609 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
108610 }
 
108611 break;
108612 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
 
108613 {
108614 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
108615 }
 
108616 break;
108617 case 302: /* cmd ::= DETACH database_kw_opt expr */
 
108618 {
108619 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
108620 }
 
108621 break;
108622 case 307: /* cmd ::= REINDEX */
 
108623 {sqlite3Reindex(pParse, 0, 0);}
 
108624 break;
108625 case 308: /* cmd ::= REINDEX nm dbnm */
 
108626 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108627 break;
108628 case 309: /* cmd ::= ANALYZE */
 
108629 {sqlite3Analyze(pParse, 0, 0);}
 
108630 break;
108631 case 310: /* cmd ::= ANALYZE nm dbnm */
 
108632 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108633 break;
108634 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
 
108635 {
108636 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
108637 }
 
108638 break;
108639 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
 
108640 {
108641 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
108642 }
 
108643 break;
108644 case 313: /* add_column_fullname ::= fullname */
 
108645 {
108646 pParse->db->lookaside.bEnabled = 0;
108647 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
108648 }
 
108649 break;
108650 case 316: /* cmd ::= create_vtab */
 
108651 {sqlite3VtabFinishParse(pParse,0);}
 
108652 break;
108653 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
 
108654 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
 
108655 break;
108656 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
 
108657 {
108658 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
108659 }
 
108660 break;
108661 case 321: /* vtabarg ::= */
 
108662 {sqlite3VtabArgInit(pParse);}
 
108663 break;
108664 case 323: /* vtabargtoken ::= ANY */
108665 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
108666 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
 
108667 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
108668 break;
108669 default:
108670 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
108671 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
108672 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109236,17 +108764,15 @@
108764 int yymajor, /* The major type of the error token */
108765 YYMINORTYPE yyminor /* The minor type of the error token */
108766 ){
108767 sqlite3ParserARG_FETCH;
108768 #define TOKEN (yyminor.yy0)
 
108769
108770 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
108771 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
108772 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
108773 pParse->parseError = 1;
 
108774 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
108775 }
108776
108777 /*
108778 ** The following is executed when the parser accepts
@@ -109436,11 +108962,10 @@
108962 return;
108963 }
108964
108965 /************** End of parse.c ***********************************************/
108966 /************** Begin file tokenize.c ****************************************/
 
108967 /*
108968 ** 2001 September 15
108969 **
108970 ** The author disclaims copyright to this source code. In place of
108971 ** a legal notice, here is a blessing:
@@ -109502,11 +109027,10 @@
109027 ** named keywordhash.h and then included into this source file by
109028 ** the #include below.
109029 */
109030 /************** Include keywordhash.h in the middle of tokenize.c ************/
109031 /************** Begin file keywordhash.h *************************************/
 
109032 /***** This file contains automatically generated code ******
109033 **
109034 ** The code in this file has been automatically generated by
109035 **
109036 ** sqlite/tool/mkkeywordhash.c
@@ -109776,11 +109300,10 @@
109300 }
109301 #define SQLITE_N_KEYWORD 121
109302
109303 /************** End of keywordhash.h *****************************************/
109304 /************** Continuing where we left off in tokenize.c *******************/
 
109305
109306
109307 /*
109308 ** If X is a character that can be used in an identifier then
109309 ** IdChar(X) will be true. Otherwise it is false.
@@ -110241,11 +109764,10 @@
109764 return nErr;
109765 }
109766
109767 /************** End of tokenize.c ********************************************/
109768 /************** Begin file complete.c ****************************************/
 
109769 /*
109770 ** 2001 September 15
109771 **
109772 ** The author disclaims copyright to this source code. In place of
109773 ** a legal notice, here is a blessing:
@@ -110527,11 +110049,10 @@
110049 #endif /* SQLITE_OMIT_UTF16 */
110050 #endif /* SQLITE_OMIT_COMPLETE */
110051
110052 /************** End of complete.c ********************************************/
110053 /************** Begin file main.c ********************************************/
 
110054 /*
110055 ** 2001 September 15
110056 **
110057 ** The author disclaims copyright to this source code. In place of
110058 ** a legal notice, here is a blessing:
@@ -110548,11 +110069,10 @@
110069 */
110070
110071 #ifdef SQLITE_ENABLE_FTS3
110072 /************** Include fts3.h in the middle of main.c ***********************/
110073 /************** Begin file fts3.h ********************************************/
 
110074 /*
110075 ** 2006 Oct 10
110076 **
110077 ** The author disclaims copyright to this source code. In place of
110078 ** a legal notice, here is a blessing:
@@ -110577,16 +110097,14 @@
110097 } /* extern "C" */
110098 #endif /* __cplusplus */
110099
110100 /************** End of fts3.h ************************************************/
110101 /************** Continuing where we left off in main.c ***********************/
 
110102 #endif
110103 #ifdef SQLITE_ENABLE_RTREE
110104 /************** Include rtree.h in the middle of main.c **********************/
110105 /************** Begin file rtree.h *******************************************/
 
110106 /*
110107 ** 2008 May 26
110108 **
110109 ** The author disclaims copyright to this source code. In place of
110110 ** a legal notice, here is a blessing:
@@ -110611,16 +110129,14 @@
110129 } /* extern "C" */
110130 #endif /* __cplusplus */
110131
110132 /************** End of rtree.h ***********************************************/
110133 /************** Continuing where we left off in main.c ***********************/
 
110134 #endif
110135 #ifdef SQLITE_ENABLE_ICU
110136 /************** Include sqliteicu.h in the middle of main.c ******************/
110137 /************** Begin file sqliteicu.h ***************************************/
 
110138 /*
110139 ** 2008 May 26
110140 **
110141 ** The author disclaims copyright to this source code. In place of
110142 ** a legal notice, here is a blessing:
@@ -110646,11 +110162,10 @@
110162 #endif /* __cplusplus */
110163
110164
110165 /************** End of sqliteicu.h *******************************************/
110166 /************** Continuing where we left off in main.c ***********************/
 
110167 #endif
110168
110169 #ifndef SQLITE_AMALGAMATION
110170 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110171 ** contains the text of SQLITE_VERSION macro.
@@ -113577,11 +113092,10 @@
113092 return 0;
113093 }
113094
113095 /************** End of main.c ************************************************/
113096 /************** Begin file notify.c ******************************************/
 
113097 /*
113098 ** 2009 March 3
113099 **
113100 ** The author disclaims copyright to this source code. In place of
113101 ** a legal notice, here is a blessing:
@@ -113911,11 +113425,10 @@
113425 }
113426 #endif
113427
113428 /************** End of notify.c **********************************************/
113429 /************** Begin file fts3.c ********************************************/
 
113430 /*
113431 ** 2006 Oct 10
113432 **
113433 ** The author disclaims copyright to this source code. In place of
113434 ** a legal notice, here is a blessing:
@@ -114208,11 +113721,10 @@
113721 ** into a single segment.
113722 */
113723
113724 /************** Include fts3Int.h in the middle of fts3.c ********************/
113725 /************** Begin file fts3Int.h *****************************************/
 
113726 /*
113727 ** 2009 Nov 12
113728 **
113729 ** The author disclaims copyright to this source code. In place of
113730 ** a legal notice, here is a blessing:
@@ -114247,11 +113759,10 @@
113759 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
113760 #endif
113761
113762 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
113763 /************** Begin file fts3_tokenizer.h **********************************/
 
113764 /*
113765 ** 2006 July 10
113766 **
113767 ** The author disclaims copyright to this source code.
113768 **
@@ -114402,14 +113913,12 @@
113913
113914 #endif /* _FTS3_TOKENIZER_H_ */
113915
113916 /************** End of fts3_tokenizer.h **************************************/
113917 /************** Continuing where we left off in fts3Int.h ********************/
 
113918 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
113919 /************** Begin file fts3_hash.h ***************************************/
 
113920 /*
113921 ** 2001 September 22
113922 **
113923 ** The author disclaims copyright to this source code. In place of
113924 ** a legal notice, here is a blessing:
@@ -114521,11 +114030,10 @@
114030
114031 #endif /* _FTS3_HASH_H_ */
114032
114033 /************** End of fts3_hash.h *******************************************/
114034 /************** Continuing where we left off in fts3Int.h ********************/
 
114035
114036 /*
114037 ** This constant controls how often segments are merged. Once there are
114038 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114039 ** segment of level N+1.
@@ -114998,11 +114506,10 @@
114506 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114507 #endif /* _FTSINT_H */
114508
114509 /************** End of fts3Int.h *********************************************/
114510 /************** Continuing where we left off in fts3.c ***********************/
 
114511 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
114512
114513 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
114514 # define SQLITE_CORE 1
114515 #endif
@@ -119548,11 +119055,10 @@
119055
119056 #endif
119057
119058 /************** End of fts3.c ************************************************/
119059 /************** Begin file fts3_aux.c ****************************************/
 
119060 /*
119061 ** 2011 Jan 27
119062 **
119063 ** The author disclaims copyright to this source code. In place of
119064 ** a legal notice, here is a blessing:
@@ -120025,11 +119531,10 @@
119531
119532 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
119533
119534 /************** End of fts3_aux.c ********************************************/
119535 /************** Begin file fts3_expr.c ***************************************/
 
119536 /*
119537 ** 2008 Nov 28
119538 **
119539 ** The author disclaims copyright to this source code. In place of
119540 ** a legal notice, here is a blessing:
@@ -120992,11 +120497,10 @@
120497 #endif
120498 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120499
120500 /************** End of fts3_expr.c *******************************************/
120501 /************** Begin file fts3_hash.c ***************************************/
 
120502 /*
120503 ** 2001 September 22
120504 **
120505 ** The author disclaims copyright to this source code. In place of
120506 ** a legal notice, here is a blessing:
@@ -121377,11 +120881,10 @@
120881
120882 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120883
120884 /************** End of fts3_hash.c *******************************************/
120885 /************** Begin file fts3_porter.c *************************************/
 
120886 /*
120887 ** 2006 September 30
120888 **
120889 ** The author disclaims copyright to this source code. In place of
120890 ** a legal notice, here is a blessing:
@@ -122024,11 +121527,10 @@
121527
121528 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121529
121530 /************** End of fts3_porter.c *****************************************/
121531 /************** Begin file fts3_tokenizer.c **********************************/
 
121532 /*
121533 ** 2007 June 22
121534 **
121535 ** The author disclaims copyright to this source code. In place of
121536 ** a legal notice, here is a blessing:
@@ -122516,11 +122018,10 @@
122018
122019 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122020
122021 /************** End of fts3_tokenizer.c **************************************/
122022 /************** Begin file fts3_tokenizer1.c *********************************/
 
122023 /*
122024 ** 2006 Oct 10
122025 **
122026 ** The author disclaims copyright to this source code. In place of
122027 ** a legal notice, here is a blessing:
@@ -122751,11 +122252,10 @@
122252
122253 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122254
122255 /************** End of fts3_tokenizer1.c *************************************/
122256 /************** Begin file fts3_write.c **************************************/
 
122257 /*
122258 ** 2009 Oct 23
122259 **
122260 ** The author disclaims copyright to this source code. In place of
122261 ** a legal notice, here is a blessing:
@@ -126022,11 +125522,10 @@
125522
125523 #endif
125524
125525 /************** End of fts3_write.c ******************************************/
125526 /************** Begin file fts3_snippet.c ************************************/
 
125527 /*
125528 ** 2009 Oct 23
125529 **
125530 ** The author disclaims copyright to this source code. In place of
125531 ** a legal notice, here is a blessing:
@@ -127524,11 +127023,10 @@
127023
127024 #endif
127025
127026 /************** End of fts3_snippet.c ****************************************/
127027 /************** Begin file rtree.c *******************************************/
 
127028 /*
127029 ** 2001 September 15
127030 **
127031 ** The author disclaims copyright to this source code. In place of
127032 ** a legal notice, here is a blessing:
@@ -130806,11 +130304,10 @@
130304
130305 #endif
130306
130307 /************** End of rtree.c ***********************************************/
130308 /************** Begin file icu.c *********************************************/
 
130309 /*
130310 ** 2007 May 6
130311 **
130312 ** The author disclaims copyright to this source code. In place of
130313 ** a legal notice, here is a blessing:
@@ -131309,11 +130806,10 @@
130806
130807 #endif
130808
130809 /************** End of icu.c *************************************************/
130810 /************** Begin file fts3_icu.c ****************************************/
 
130811 /*
130812 ** 2007 June 22
130813 **
130814 ** The author disclaims copyright to this source code. In place of
130815 ** a legal notice, here is a blessing:
130816
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.7.8"
111111
#define SQLITE_VERSION_NUMBER 3007008
112
-#define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
112
+#define SQLITE_SOURCE_ID "2011-09-19 14:49:19 3e0da808d2f5b4d12046e05980ca04578f581177"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.8"
111 #define SQLITE_VERSION_NUMBER 3007008
112 #define SQLITE_SOURCE_ID "2011-09-14 13:41:40 a1f3aeeb0988c848d40ce8f6da6e902935a997e2"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.8"
111 #define SQLITE_VERSION_NUMBER 3007008
112 #define SQLITE_SOURCE_ID "2011-09-19 14:49:19 3e0da808d2f5b4d12046e05980ca04578f581177"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/style.c
+++ src/style.c
@@ -805,10 +805,11 @@
805805
void page_test_env(void){
806806
char c;
807807
int i;
808808
char zCap[30];
809809
login_check_credentials();
810
+ if( !g.perm.Admin && !g.perm.Setup ){ login_needed(); return; }
810811
style_header("Environment Test");
811812
#if !defined(_WIN32)
812813
@ uid=%d(getuid()), gid=%d(getgid())<br />
813814
#endif
814815
@ g.zBaseURL = %h(g.zBaseURL)<br />
815816
--- src/style.c
+++ src/style.c
@@ -805,10 +805,11 @@
805 void page_test_env(void){
806 char c;
807 int i;
808 char zCap[30];
809 login_check_credentials();
 
810 style_header("Environment Test");
811 #if !defined(_WIN32)
812 @ uid=%d(getuid()), gid=%d(getgid())<br />
813 #endif
814 @ g.zBaseURL = %h(g.zBaseURL)<br />
815
--- src/style.c
+++ src/style.c
@@ -805,10 +805,11 @@
805 void page_test_env(void){
806 char c;
807 int i;
808 char zCap[30];
809 login_check_credentials();
810 if( !g.perm.Admin && !g.perm.Setup ){ login_needed(); return; }
811 style_header("Environment Test");
812 #if !defined(_WIN32)
813 @ uid=%d(getuid()), gid=%d(getgid())<br />
814 #endif
815 @ g.zBaseURL = %h(g.zBaseURL)<br />
816
+5 -4
--- src/tar.c
+++ src/tar.c
@@ -44,11 +44,11 @@
4444
/*
4545
** Begin the process of generating a tarball.
4646
**
4747
** Initialize the GZIP compressor and the table of directory names.
4848
*/
49
-static void tar_begin(void){
49
+static void tar_begin(sqlite3_int64 mTime){
5050
assert( tball.aHdr==0 );
5151
tball.aHdr = fossil_malloc(512+512);
5252
memset(tball.aHdr, 0, 512+512);
5353
tball.zSpaces = (char*)&tball.aHdr[512];
5454
/* zPrevDir init */
@@ -60,11 +60,11 @@
6060
memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */
6161
memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */
6262
memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */
6363
memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */
6464
memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */
65
- gzip_begin();
65
+ gzip_begin(mTime);
6666
db_multi_exec(
6767
"CREATE TEMP TABLE dir(name UNIQUE);"
6868
);
6969
}
7070
@@ -427,11 +427,11 @@
427427
Blob file;
428428
if( g.argc<3 ){
429429
usage("ARCHIVE FILE....");
430430
}
431431
sqlite3_open(":memory:", &g.db);
432
- tar_begin();
432
+ tar_begin(0);
433433
for(i=3; i<g.argc; i++){
434434
blob_zero(&file);
435435
blob_read_from_file(&file, g.argv[i]);
436436
tar_add_file(g.argv[i], &file,
437437
file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
@@ -473,20 +473,20 @@
473473
blob_zero(pTar);
474474
return;
475475
}
476476
blob_zero(&hash);
477477
blob_zero(&filename);
478
- tar_begin();
479478
480479
if( zDir && zDir[0] ){
481480
blob_appendf(&filename, "%s/", zDir);
482481
}
483482
nPrefix = blob_size(&filename);
484483
485484
pManifest = manifest_get(rid, CFTYPE_MANIFEST);
486485
if( pManifest ){
487486
mTime = (pManifest->rDate - 2440587.5)*86400.0;
487
+ tar_begin(mTime);
488488
if( db_get_boolean("manifest", 0) ){
489489
blob_append(&filename, "manifest", -1);
490490
zName = blob_str(&filename);
491491
tar_add_file(zName, &mfile, 0, mTime);
492492
sha1sum_blob(&mfile, &hash);
@@ -513,10 +513,11 @@
513513
}else{
514514
sha1sum_blob(&mfile, &hash);
515515
blob_append(&filename, blob_str(&hash), 16);
516516
zName = blob_str(&filename);
517517
mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;");
518
+ tar_begin(mTime);
518519
tar_add_file(zName, &mfile, 0, mTime);
519520
}
520521
manifest_destroy(pManifest);
521522
blob_reset(&mfile);
522523
blob_reset(&filename);
523524
--- src/tar.c
+++ src/tar.c
@@ -44,11 +44,11 @@
44 /*
45 ** Begin the process of generating a tarball.
46 **
47 ** Initialize the GZIP compressor and the table of directory names.
48 */
49 static void tar_begin(void){
50 assert( tball.aHdr==0 );
51 tball.aHdr = fossil_malloc(512+512);
52 memset(tball.aHdr, 0, 512+512);
53 tball.zSpaces = (char*)&tball.aHdr[512];
54 /* zPrevDir init */
@@ -60,11 +60,11 @@
60 memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */
61 memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */
62 memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */
63 memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */
64 memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */
65 gzip_begin();
66 db_multi_exec(
67 "CREATE TEMP TABLE dir(name UNIQUE);"
68 );
69 }
70
@@ -427,11 +427,11 @@
427 Blob file;
428 if( g.argc<3 ){
429 usage("ARCHIVE FILE....");
430 }
431 sqlite3_open(":memory:", &g.db);
432 tar_begin();
433 for(i=3; i<g.argc; i++){
434 blob_zero(&file);
435 blob_read_from_file(&file, g.argv[i]);
436 tar_add_file(g.argv[i], &file,
437 file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
@@ -473,20 +473,20 @@
473 blob_zero(pTar);
474 return;
475 }
476 blob_zero(&hash);
477 blob_zero(&filename);
478 tar_begin();
479
480 if( zDir && zDir[0] ){
481 blob_appendf(&filename, "%s/", zDir);
482 }
483 nPrefix = blob_size(&filename);
484
485 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
486 if( pManifest ){
487 mTime = (pManifest->rDate - 2440587.5)*86400.0;
 
488 if( db_get_boolean("manifest", 0) ){
489 blob_append(&filename, "manifest", -1);
490 zName = blob_str(&filename);
491 tar_add_file(zName, &mfile, 0, mTime);
492 sha1sum_blob(&mfile, &hash);
@@ -513,10 +513,11 @@
513 }else{
514 sha1sum_blob(&mfile, &hash);
515 blob_append(&filename, blob_str(&hash), 16);
516 zName = blob_str(&filename);
517 mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;");
 
518 tar_add_file(zName, &mfile, 0, mTime);
519 }
520 manifest_destroy(pManifest);
521 blob_reset(&mfile);
522 blob_reset(&filename);
523
--- src/tar.c
+++ src/tar.c
@@ -44,11 +44,11 @@
44 /*
45 ** Begin the process of generating a tarball.
46 **
47 ** Initialize the GZIP compressor and the table of directory names.
48 */
49 static void tar_begin(sqlite3_int64 mTime){
50 assert( tball.aHdr==0 );
51 tball.aHdr = fossil_malloc(512+512);
52 memset(tball.aHdr, 0, 512+512);
53 tball.zSpaces = (char*)&tball.aHdr[512];
54 /* zPrevDir init */
@@ -60,11 +60,11 @@
60 memcpy(&tball.aHdr[108], "0000000", 8); /* Owner ID */
61 memcpy(&tball.aHdr[116], "0000000", 8); /* Group ID */
62 memcpy(&tball.aHdr[257], "ustar\00000", 8); /* POSIX.1 format */
63 memcpy(&tball.aHdr[265], "nobody", 7); /* Owner name */
64 memcpy(&tball.aHdr[297], "nobody", 7); /* Group name */
65 gzip_begin(mTime);
66 db_multi_exec(
67 "CREATE TEMP TABLE dir(name UNIQUE);"
68 );
69 }
70
@@ -427,11 +427,11 @@
427 Blob file;
428 if( g.argc<3 ){
429 usage("ARCHIVE FILE....");
430 }
431 sqlite3_open(":memory:", &g.db);
432 tar_begin(0);
433 for(i=3; i<g.argc; i++){
434 blob_zero(&file);
435 blob_read_from_file(&file, g.argv[i]);
436 tar_add_file(g.argv[i], &file,
437 file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i]));
@@ -473,20 +473,20 @@
473 blob_zero(pTar);
474 return;
475 }
476 blob_zero(&hash);
477 blob_zero(&filename);
 
478
479 if( zDir && zDir[0] ){
480 blob_appendf(&filename, "%s/", zDir);
481 }
482 nPrefix = blob_size(&filename);
483
484 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
485 if( pManifest ){
486 mTime = (pManifest->rDate - 2440587.5)*86400.0;
487 tar_begin(mTime);
488 if( db_get_boolean("manifest", 0) ){
489 blob_append(&filename, "manifest", -1);
490 zName = blob_str(&filename);
491 tar_add_file(zName, &mfile, 0, mTime);
492 sha1sum_blob(&mfile, &hash);
@@ -513,10 +513,11 @@
513 }else{
514 sha1sum_blob(&mfile, &hash);
515 blob_append(&filename, blob_str(&hash), 16);
516 zName = blob_str(&filename);
517 mTime = db_int64(0, "SELECT (julianday('now') - 2440587.5)*86400.0;");
518 tar_begin(mTime);
519 tar_add_file(zName, &mfile, 0, mTime);
520 }
521 manifest_destroy(pManifest);
522 blob_reset(&mfile);
523 blob_reset(&filename);
524
+2 -2
--- src/update.c
+++ src/update.c
@@ -302,11 +302,11 @@
302302
blob_zero(&sql);
303303
blob_append(&sql, "DELETE FROM fv WHERE ", -1);
304304
zSep = "";
305305
for(i=3; i<g.argc; i++){
306306
file_tree_name(g.argv[i], &treename, 1);
307
- if( file_isdir(g.argv[i])==1 ){
307
+ if( file_wd_isdir(g.argv[i])==1 ){
308308
if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){
309309
blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename);
310310
}else{
311311
blob_reset(&sql);
312312
break;
@@ -513,11 +513,11 @@
513513
514514
blob_zero(&path);
515515
blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
516516
zPath = blob_str(&path);
517517
/* Handle various cases of existence of the directory */
518
- switch( file_isdir(zPath) ){
518
+ switch( file_wd_isdir(zPath) ){
519519
case 0: { /* doesn't exist */
520520
if( file_mkdir(zPath, 0)!=0 ) {
521521
fossil_warning("couldn't create directory %s as "
522522
"required by empty-dirs setting", zDir);
523523
}
524524
--- src/update.c
+++ src/update.c
@@ -302,11 +302,11 @@
302 blob_zero(&sql);
303 blob_append(&sql, "DELETE FROM fv WHERE ", -1);
304 zSep = "";
305 for(i=3; i<g.argc; i++){
306 file_tree_name(g.argv[i], &treename, 1);
307 if( file_isdir(g.argv[i])==1 ){
308 if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){
309 blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename);
310 }else{
311 blob_reset(&sql);
312 break;
@@ -513,11 +513,11 @@
513
514 blob_zero(&path);
515 blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
516 zPath = blob_str(&path);
517 /* Handle various cases of existence of the directory */
518 switch( file_isdir(zPath) ){
519 case 0: { /* doesn't exist */
520 if( file_mkdir(zPath, 0)!=0 ) {
521 fossil_warning("couldn't create directory %s as "
522 "required by empty-dirs setting", zDir);
523 }
524
--- src/update.c
+++ src/update.c
@@ -302,11 +302,11 @@
302 blob_zero(&sql);
303 blob_append(&sql, "DELETE FROM fv WHERE ", -1);
304 zSep = "";
305 for(i=3; i<g.argc; i++){
306 file_tree_name(g.argv[i], &treename, 1);
307 if( file_wd_isdir(g.argv[i])==1 ){
308 if( blob_size(&treename) != 1 || blob_str(&treename)[0] != '.' ){
309 blob_appendf(&sql, "%sfn NOT GLOB '%b/*' ", zSep, &treename);
310 }else{
311 blob_reset(&sql);
312 break;
@@ -513,11 +513,11 @@
513
514 blob_zero(&path);
515 blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
516 zPath = blob_str(&path);
517 /* Handle various cases of existence of the directory */
518 switch( file_wd_isdir(zPath) ){
519 case 0: { /* doesn't exist */
520 if( file_mkdir(zPath, 0)!=0 ) {
521 fossil_warning("couldn't create directory %s as "
522 "required by empty-dirs setting", zDir);
523 }
524
+2 -2
--- src/vfile.c
+++ src/vfile.c
@@ -272,11 +272,11 @@
272272
blob_reset(&content);
273273
continue;
274274
}
275275
}
276276
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
277
- if( file_isdir(zName) == 1 ){
277
+ if( file_wd_isdir(zName) == 1 ){
278278
/*TODO(dchest): remove directories? */
279279
fossil_fatal("%s is directory, cannot overwrite\n", zName);
280280
}
281281
if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
282282
file_delete(zName);
@@ -389,11 +389,11 @@
389389
blob_appendf(pPath, "/%s", zUtf8);
390390
fossil_mbcs_free(zUtf8);
391391
zPath = blob_str(pPath);
392392
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
393393
/* do nothing */
394
- }else if( file_isdir(zPath)==1 ){
394
+ }else if( file_wd_isdir(zPath)==1 ){
395395
if( !vfile_top_of_checkout(zPath) ){
396396
vfile_scan(pPath, nPrefix, allFlag, pIgnore);
397397
}
398398
}else if( file_wd_isfile_or_link(zPath) ){
399399
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
400400
--- src/vfile.c
+++ src/vfile.c
@@ -272,11 +272,11 @@
272 blob_reset(&content);
273 continue;
274 }
275 }
276 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
277 if( file_isdir(zName) == 1 ){
278 /*TODO(dchest): remove directories? */
279 fossil_fatal("%s is directory, cannot overwrite\n", zName);
280 }
281 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
282 file_delete(zName);
@@ -389,11 +389,11 @@
389 blob_appendf(pPath, "/%s", zUtf8);
390 fossil_mbcs_free(zUtf8);
391 zPath = blob_str(pPath);
392 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
393 /* do nothing */
394 }else if( file_isdir(zPath)==1 ){
395 if( !vfile_top_of_checkout(zPath) ){
396 vfile_scan(pPath, nPrefix, allFlag, pIgnore);
397 }
398 }else if( file_wd_isfile_or_link(zPath) ){
399 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
400
--- src/vfile.c
+++ src/vfile.c
@@ -272,11 +272,11 @@
272 blob_reset(&content);
273 continue;
274 }
275 }
276 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
277 if( file_wd_isdir(zName) == 1 ){
278 /*TODO(dchest): remove directories? */
279 fossil_fatal("%s is directory, cannot overwrite\n", zName);
280 }
281 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
282 file_delete(zName);
@@ -389,11 +389,11 @@
389 blob_appendf(pPath, "/%s", zUtf8);
390 fossil_mbcs_free(zUtf8);
391 zPath = blob_str(pPath);
392 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
393 /* do nothing */
394 }else if( file_wd_isdir(zPath)==1 ){
395 if( !vfile_top_of_checkout(zPath) ){
396 vfile_scan(pPath, nPrefix, allFlag, pIgnore);
397 }
398 }else if( file_wd_isfile_or_link(zPath) ){
399 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
400
+1 -1
--- src/wiki.c
+++ src/wiki.c
@@ -229,11 +229,11 @@
229229
@ <li>
230230
if( g.perm.History && g.perm.Read ){
231231
@ <a href="%s(g.zTop)/attachview?page=%s(zPageName)&amp;file=%t(zFile)">
232232
@ %h(zFile)</a>
233233
}else{
234
- @ <li>%h(zFile)
234
+ @ %h(zFile)
235235
}
236236
@ added by %h(zUser) on
237237
hyperlink_to_date(zDate, ".");
238238
if( g.perm.WrWiki && g.perm.Attach ){
239239
@ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&amp;file=%t(zFile)&amp;from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>]
240240
--- src/wiki.c
+++ src/wiki.c
@@ -229,11 +229,11 @@
229 @ <li>
230 if( g.perm.History && g.perm.Read ){
231 @ <a href="%s(g.zTop)/attachview?page=%s(zPageName)&amp;file=%t(zFile)">
232 @ %h(zFile)</a>
233 }else{
234 @ <li>%h(zFile)
235 }
236 @ added by %h(zUser) on
237 hyperlink_to_date(zDate, ".");
238 if( g.perm.WrWiki && g.perm.Attach ){
239 @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&amp;file=%t(zFile)&amp;from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>]
240
--- src/wiki.c
+++ src/wiki.c
@@ -229,11 +229,11 @@
229 @ <li>
230 if( g.perm.History && g.perm.Read ){
231 @ <a href="%s(g.zTop)/attachview?page=%s(zPageName)&amp;file=%t(zFile)">
232 @ %h(zFile)</a>
233 }else{
234 @ %h(zFile)
235 }
236 @ added by %h(zUser) on
237 hyperlink_to_date(zDate, ".");
238 if( g.perm.WrWiki && g.perm.Attach ){
239 @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&amp;file=%t(zFile)&amp;from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>]
240
+2 -2
--- src/xfer.c
+++ src/xfer.c
@@ -573,11 +573,11 @@
573573
blob_zero(&combined);
574574
blob_copy(&combined, pNonce);
575575
blob_append(&combined, blob_buffer(&pw), szPw);
576576
sha1sum_blob(&combined, &hash);
577577
assert( blob_size(&hash)==40 );
578
- rc = blob_compare(&hash, pSig);
578
+ rc = blob_constant_time_cmp(&hash, pSig);
579579
blob_reset(&hash);
580580
blob_reset(&combined);
581581
if( rc!=0 && szPw!=40 ){
582582
/* If this server stores cleartext passwords and the password did not
583583
** match, then perhaps the client is sending SHA1 passwords. Try
@@ -588,11 +588,11 @@
588588
blob_zero(&combined);
589589
blob_copy(&combined, pNonce);
590590
blob_append(&combined, zSecret, -1);
591591
free(zSecret);
592592
sha1sum_blob(&combined, &hash);
593
- rc = blob_compare(&hash, pSig);
593
+ rc = blob_constant_time_cmp(&hash, pSig);
594594
blob_reset(&hash);
595595
blob_reset(&combined);
596596
}
597597
if( rc==0 ){
598598
const char *zCap;
599599
--- src/xfer.c
+++ src/xfer.c
@@ -573,11 +573,11 @@
573 blob_zero(&combined);
574 blob_copy(&combined, pNonce);
575 blob_append(&combined, blob_buffer(&pw), szPw);
576 sha1sum_blob(&combined, &hash);
577 assert( blob_size(&hash)==40 );
578 rc = blob_compare(&hash, pSig);
579 blob_reset(&hash);
580 blob_reset(&combined);
581 if( rc!=0 && szPw!=40 ){
582 /* If this server stores cleartext passwords and the password did not
583 ** match, then perhaps the client is sending SHA1 passwords. Try
@@ -588,11 +588,11 @@
588 blob_zero(&combined);
589 blob_copy(&combined, pNonce);
590 blob_append(&combined, zSecret, -1);
591 free(zSecret);
592 sha1sum_blob(&combined, &hash);
593 rc = blob_compare(&hash, pSig);
594 blob_reset(&hash);
595 blob_reset(&combined);
596 }
597 if( rc==0 ){
598 const char *zCap;
599
--- src/xfer.c
+++ src/xfer.c
@@ -573,11 +573,11 @@
573 blob_zero(&combined);
574 blob_copy(&combined, pNonce);
575 blob_append(&combined, blob_buffer(&pw), szPw);
576 sha1sum_blob(&combined, &hash);
577 assert( blob_size(&hash)==40 );
578 rc = blob_constant_time_cmp(&hash, pSig);
579 blob_reset(&hash);
580 blob_reset(&combined);
581 if( rc!=0 && szPw!=40 ){
582 /* If this server stores cleartext passwords and the password did not
583 ** match, then perhaps the client is sending SHA1 passwords. Try
@@ -588,11 +588,11 @@
588 blob_zero(&combined);
589 blob_copy(&combined, pNonce);
590 blob_append(&combined, zSecret, -1);
591 free(zSecret);
592 sha1sum_blob(&combined, &hash);
593 rc = blob_constant_time_cmp(&hash, pSig);
594 blob_reset(&hash);
595 blob_reset(&combined);
596 }
597 if( rc==0 ){
598 const char *zCap;
599
--- www/reviews.wiki
+++ www/reviews.wiki
@@ -8,10 +8,11 @@
88
by Juho Veps&#228;l&#228;inen.
99
* [http://blog.fupps.com/2010/12/04/exploring-the-fossil-dvcs |
1010
Exploring the Fossil DVCS] by Jan-Piet Mens.
1111
* [http://blog.mired.org/2011/02/fossil-sweet-spot-in-vcs-space.html |
1212
Fossil - a sweet spot in the VCS space] by Mike Meyer.
13
+ * [http://blog.s11n.net/?p=72|Four reasons to take a closer look at the Fossil SCM] by Stephan Beal
1314
1415
<b>See Also:</b>
1516
1617
* [./quotes.wiki | Short Quotes on Fossil, Git, And DVCSes]
1718
@@ -39,11 +40,11 @@
3940
life easier on most of my projects, and being able to move commits to
4041
another branch after the fact and shared-by-default branches are good
4142
features. Also not having a misanthropic command line interface.
4243
</blockquote>
4344
44
-<b>Stephen Beal writes on 2009-01-11:</b>
45
+<b>Stephan Beal writes on 2009-01-11:</b>
4546
4647
<blockquote>
4748
Sometime in late 2007 I came across a link to fossil on
4849
<a href="http://www.sqlite.org/">sqlite.org</a>. It
4950
was a good thing I bookmarked it, because I was never able to find the
@@ -136,12 +137,12 @@
136137
137138
138139
In summary:
139140
140141
I remember my first reaction to fossil being, "this will be an
141
-excellent solution for small projects [like the dozens we've all got
142
+excellent solution for small projects (like the dozens we've all got
142143
sitting on our hard drives but which don't justify the hassle of
143
-version control]." A year of daily use in over 15 source trees has
144
+version control)." A year of daily use in over 15 source trees has
144145
confirmed that, and I continue to heartily recommend fossil to other
145146
developers I know who also have their own collection of "unhosted" pet
146147
projects.
147148
</blockquote>
148149
--- www/reviews.wiki
+++ www/reviews.wiki
@@ -8,10 +8,11 @@
8 by Juho Veps&#228;l&#228;inen.
9 * [http://blog.fupps.com/2010/12/04/exploring-the-fossil-dvcs |
10 Exploring the Fossil DVCS] by Jan-Piet Mens.
11 * [http://blog.mired.org/2011/02/fossil-sweet-spot-in-vcs-space.html |
12 Fossil - a sweet spot in the VCS space] by Mike Meyer.
 
13
14 <b>See Also:</b>
15
16 * [./quotes.wiki | Short Quotes on Fossil, Git, And DVCSes]
17
@@ -39,11 +40,11 @@
39 life easier on most of my projects, and being able to move commits to
40 another branch after the fact and shared-by-default branches are good
41 features. Also not having a misanthropic command line interface.
42 </blockquote>
43
44 <b>Stephen Beal writes on 2009-01-11:</b>
45
46 <blockquote>
47 Sometime in late 2007 I came across a link to fossil on
48 <a href="http://www.sqlite.org/">sqlite.org</a>. It
49 was a good thing I bookmarked it, because I was never able to find the
@@ -136,12 +137,12 @@
136
137
138 In summary:
139
140 I remember my first reaction to fossil being, "this will be an
141 excellent solution for small projects [like the dozens we've all got
142 sitting on our hard drives but which don't justify the hassle of
143 version control]." A year of daily use in over 15 source trees has
144 confirmed that, and I continue to heartily recommend fossil to other
145 developers I know who also have their own collection of "unhosted" pet
146 projects.
147 </blockquote>
148
--- www/reviews.wiki
+++ www/reviews.wiki
@@ -8,10 +8,11 @@
8 by Juho Veps&#228;l&#228;inen.
9 * [http://blog.fupps.com/2010/12/04/exploring-the-fossil-dvcs |
10 Exploring the Fossil DVCS] by Jan-Piet Mens.
11 * [http://blog.mired.org/2011/02/fossil-sweet-spot-in-vcs-space.html |
12 Fossil - a sweet spot in the VCS space] by Mike Meyer.
13 * [http://blog.s11n.net/?p=72|Four reasons to take a closer look at the Fossil SCM] by Stephan Beal
14
15 <b>See Also:</b>
16
17 * [./quotes.wiki | Short Quotes on Fossil, Git, And DVCSes]
18
@@ -39,11 +40,11 @@
40 life easier on most of my projects, and being able to move commits to
41 another branch after the fact and shared-by-default branches are good
42 features. Also not having a misanthropic command line interface.
43 </blockquote>
44
45 <b>Stephan Beal writes on 2009-01-11:</b>
46
47 <blockquote>
48 Sometime in late 2007 I came across a link to fossil on
49 <a href="http://www.sqlite.org/">sqlite.org</a>. It
50 was a good thing I bookmarked it, because I was never able to find the
@@ -136,12 +137,12 @@
137
138
139 In summary:
140
141 I remember my first reaction to fossil being, "this will be an
142 excellent solution for small projects (like the dozens we've all got
143 sitting on our hard drives but which don't justify the hassle of
144 version control)." A year of daily use in over 15 source trees has
145 confirmed that, and I continue to heartily recommend fossil to other
146 developers I know who also have their own collection of "unhosted" pet
147 projects.
148 </blockquote>
149

Keyboard Shortcuts

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