Diff
Not logged in

Differences From Artifact [bed77f75c0]:

To Artifact [bca45c9eae]:


144
145
146
147
148
149
150
151
152


153
154
155
156
157
158
159
144
145
146
147
148
149
150


151
152
153
154
155
156
157
158
159







-
-
+
+







  int argc,
  sqlite3_value **argv
){
  gather_artifact_stats(1);
}

/*
** Add the content(), compress(), and decompress() SQL functions to
** database connection db.
** Add the content(), compress(), decompress(), and
** gather_artifact_stats() SQL functions to database connection db.
*/
int add_content_sql_commands(sqlite3 *db){
  sqlite3_create_function(db, "content", 1, SQLITE_UTF8, 0,
                          sqlcmd_content, 0, 0);
  sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
                          sqlcmd_compress, 0, 0);
  sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183

184
185
186
187
188
189
190
169
170
171
172
173
174
175

176
177
178
179
180
181
182

183
184
185
186
187
188
189
190







-
+






-
+







**     db_protect(X)
**     db_protect_pop(X)
**
** These invoke the corresponding C routines.
**
** WARNING:
** Do not instantiate these functions for any Fossil webpage or command
** method of than the "fossil sql" command.  If an attacker gains access
** method other than the "fossil sql" command.  If an attacker gains access
** to these functions, he will be able to disable other defense mechanisms.
**
** This routines are for interactiving testing only.  They are experimental
** and undocumented (apart from this comments) and might go away or change
** in future releases.
**
** 2020-11-29:  This functions are now only available if the "fossil sql"
** 2020-11-29:  These functions are now only available if the "fossil sql"
** command is started with the --test option.
*/
static void sqlcmd_db_protect(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
202
203
204
205
206
207
208



209
210
211
212
213
214
215







-
-
-







static void sqlcmd_db_protect_pop(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  if( !local_bSqlCmdTest ) db_protect_pop();
}




/*
** This is the "automatic extension" initializer that runs right after
** the connection to the repository database is opened.  Set up the
** database connection to be more useful to the human operator.
*/
static int sqlcmd_autoinit(