Fossil SCM

Make db_stats() conditional on the appropriate global option.

mistachkin 2020-06-09 17:50 trunk
Commit 2a0c020313c29b7c61ce21d926f97aa161f5828e8085ce82b5119d5f4fcef87f
1 file changed +2 -2
+2 -2
--- src/db.c
+++ src/db.c
@@ -489,11 +489,11 @@
489489
/*
490490
** Reset or finalize a statement.
491491
*/
492492
int db_reset(Stmt *pStmt){
493493
int rc;
494
- db_stats(pStmt);
494
+ if( g.fSqlStats ){ db_stats(pStmt); }
495495
rc = sqlite3_reset(pStmt->pStmt);
496496
db_check_result(rc, pStmt);
497497
return rc;
498498
}
499499
int db_finalize(Stmt *pStmt){
@@ -506,11 +506,11 @@
506506
}else if( db.pAllStmt==pStmt ){
507507
db.pAllStmt = pStmt->pNext;
508508
}
509509
pStmt->pNext = 0;
510510
pStmt->pPrev = 0;
511
- db_stats(pStmt);
511
+ if( g.fSqlStats ){ db_stats(pStmt); }
512512
blob_reset(&pStmt->sql);
513513
rc = sqlite3_finalize(pStmt->pStmt);
514514
db_check_result(rc, pStmt);
515515
pStmt->pStmt = 0;
516516
return rc;
517517
--- src/db.c
+++ src/db.c
@@ -489,11 +489,11 @@
489 /*
490 ** Reset or finalize a statement.
491 */
492 int db_reset(Stmt *pStmt){
493 int rc;
494 db_stats(pStmt);
495 rc = sqlite3_reset(pStmt->pStmt);
496 db_check_result(rc, pStmt);
497 return rc;
498 }
499 int db_finalize(Stmt *pStmt){
@@ -506,11 +506,11 @@
506 }else if( db.pAllStmt==pStmt ){
507 db.pAllStmt = pStmt->pNext;
508 }
509 pStmt->pNext = 0;
510 pStmt->pPrev = 0;
511 db_stats(pStmt);
512 blob_reset(&pStmt->sql);
513 rc = sqlite3_finalize(pStmt->pStmt);
514 db_check_result(rc, pStmt);
515 pStmt->pStmt = 0;
516 return rc;
517
--- src/db.c
+++ src/db.c
@@ -489,11 +489,11 @@
489 /*
490 ** Reset or finalize a statement.
491 */
492 int db_reset(Stmt *pStmt){
493 int rc;
494 if( g.fSqlStats ){ db_stats(pStmt); }
495 rc = sqlite3_reset(pStmt->pStmt);
496 db_check_result(rc, pStmt);
497 return rc;
498 }
499 int db_finalize(Stmt *pStmt){
@@ -506,11 +506,11 @@
506 }else if( db.pAllStmt==pStmt ){
507 db.pAllStmt = pStmt->pNext;
508 }
509 pStmt->pNext = 0;
510 pStmt->pPrev = 0;
511 if( g.fSqlStats ){ db_stats(pStmt); }
512 blob_reset(&pStmt->sql);
513 rc = sqlite3_finalize(pStmt->pStmt);
514 db_check_result(rc, pStmt);
515 pStmt->pStmt = 0;
516 return rc;
517

Keyboard Shortcuts

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