187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
Blob sql = empty_blob;
Stmt q;
int iBest;
char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
off the end of the
results. */
char const * zLimit = find_option("limit","n",1);
int const nLimit = zLimit ? atoi(zLimit) : -20; /* Max number of matching
lines/entries to list */
db_must_be_within_tree();
if( g.argc<2 ) return;
blob_init(&pattern, g.argv[2], -1);
for(i=3; i<g.argc; i++){
blob_appendf(&pattern, " %s", g.argv[i]);
|
|
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
Blob sql = empty_blob;
Stmt q;
int iBest;
char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
off the end of the
results. */
char const * zLimit = find_option("limit","n",1);
int nLimit = zLimit ? atoi(zLimit) : -1000; /* Max number of matching
lines/entries to list */
db_must_be_within_tree();
if( g.argc<2 ) return;
blob_init(&pattern, g.argv[2], -1);
for(i=3; i<g.argc; i++){
blob_appendf(&pattern, " %s", g.argv[i]);
|
220
221
222
223
224
225
226
227
228
229
|
"WHERE 1 ", -1);
if(!fAll){
blob_appendf(&sql,"AND x>%d ", iBest/3);
}
blob_append(&sql, "ORDER BY x DESC, date DESC ", -1);
db_prepare(&q, blob_str(&sql));
blob_reset(&sql);
print_timeline(&q, 1000, 79, 0);
db_finalize(&q);
}
|
|
|
220
221
222
223
224
225
226
227
228
229
|
"WHERE 1 ", -1);
if(!fAll){
blob_appendf(&sql,"AND x>%d ", iBest/3);
}
blob_append(&sql, "ORDER BY x DESC, date DESC ", -1);
db_prepare(&q, blob_str(&sql));
blob_reset(&sql);
print_timeline(&q, nLimit, 79, 0);
db_finalize(&q);
}
|