Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Initial groundwork for fixing bug [b6eea9446d]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | tkt-b6eea9446d |
| Files: | files | file ages | folders |
| SHA1: |
d5407ff954c17f122ffcfc1825b28e79 |
| User & Date: | mistachkin 2013-10-07 20:24:11.105 |
Context
|
2013-10-07
| ||
| 20:26 | Comment fixes. check-in: 19d2a8db7c user: mistachkin tags: tkt-b6eea9446d | |
| 20:24 | Initial groundwork for fixing bug [b6eea9446d]. check-in: d5407ff954 user: mistachkin tags: tkt-b6eea9446d | |
| 07:41 | Better error message in case of "manifest file (12892) is malformed". It will now give an additional line: "line ???: wrong size UUID on P-card" (or whatever other parsing error happens), and using the "-n" option it will print out the complete manifest as well. This would have made it much easier to investigate Ron Aaron's commit problem (many thanks for reporting this!), without adding special debugging code to fossil. check-in: ec81aee915 user: jan.nijtmans tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
*/
int db_step(Stmt *pStmt){
int rc;
rc = sqlite3_step(pStmt->pStmt);
pStmt->nStep++;
return rc;
}
/*
** Print warnings if a query is inefficient.
*/
static void db_stats(Stmt *pStmt){
#ifdef FOSSIL_DEBUG
int c1, c2, c3;
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
*/
int db_step(Stmt *pStmt){
int rc;
rc = sqlite3_step(pStmt->pStmt);
pStmt->nStep++;
return rc;
}
/*
** Steps the SQL statement until there are no more rows. Returns the
** total number of rows processed by this function. If the pazValue
** parameter is non-zero, captures the iCol'th column value from each
** row (as text) and stores the resulting final array pointer into the
** pazValue parameter. The caller of this function is responsible for
** calling the db_all_column_free() function later, passing it the
** result of this function along with the values of the pazValue1 and
** paiValue2 paramters.
*/
int db_all_column_text_and_int64(
Stmt *pStmt, /* The statement handle. */
int iCol1, /* The first column number to fetch from the results. */
char ***pazValue1, /* Array of iCol1'th column values from query. */
int iCol2, /* The second column number to fetch from the results. */
i64 **paiValue2 /* Array of iCol2'th column values from query. */
){
int count = 0;
char **azValue = 0;
i64 *aiValue = 0;
while( db_step(pStmt)==SQLITE_ROW ){
count++;
if( pazValue1 ){
azValue = fossil_realloc(azValue, count * sizeof(char*));
azValue[count] = fossil_strdup(db_column_text(pStmt, iCol1));
}
if( paiValue2 ){
aiValue = fossil_realloc(aiValue, count * sizeof(i64));
aiValue[count] = db_column_int64(pStmt, iCol2);
}
}
if( pazValue1 ){
*pazValue1 = azValue;
}
if( paiValue2 ){
*paiValue2 = aiValue;
}
return count;
}
/*
** This function frees all the storage that was allocated by the
** db_all_column_text() function.
*/
void db_all_column_free(
int count, /* Number of string elements in the array. */
char ***pazValue1, /* Array of iCol1'th column values from query. */
i64 **paiValue2 /* Array of iCol2'th column values from query. */
){
if( pazValue1 ){
char **azValue = *pazValue1;
int i;
for(i=0; i<count; i++){
fossil_free(azValue[i]);
azValue[i] = 0;
}
fossil_free(azValue);
*pazValue1 = 0;
}
if( paiValue2 ){
fossil_free(*paiValue2);
*paiValue2 = 0;
}
}
/*
** Print warnings if a query is inefficient.
*/
static void db_stats(Stmt *pStmt){
#ifdef FOSSIL_DEBUG
int c1, c2, c3;
|
| ︙ | ︙ |