939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
/*
** Close the database connection.
*/
void db_close(void){
sqlite3_stmt *pStmt;
if( g.db==0 ) return;
while( pAllStmt ){
db_finalize(pAllStmt);
}
db_end_transaction(1);
pStmt = 0;
while( (pStmt = sqlite3_next_stmt(g.db, pStmt))!=0 ){
fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
|
/*
** Close the database connection.
*/
void db_close(void){
sqlite3_stmt *pStmt;
if( g.db==0 ) return;
if( g.fSqlTrace ){
int cur, hiwtr;
sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &hiwtr, 0);
fprintf(stderr, "-- LOOKASIDE_USED %10d %10d\n", cur, hiwtr);
sqlite3_db_status(g.db, SQLITE_DBSTATUS_CACHE_USED, &cur, &hiwtr, 0);
fprintf(stderr, "-- CACHE_USED %10d\n", cur);
sqlite3_db_status(g.db, SQLITE_DBSTATUS_SCHEMA_USED, &cur, &hiwtr, 0);
fprintf(stderr, "-- SCHEMA_USED %10d\n", cur);
sqlite3_db_status(g.db, SQLITE_DBSTATUS_STMT_USED, &cur, &hiwtr, 0);
fprintf(stderr, "-- STMT_USED %10d\n", cur);
sqlite3_status(SQLITE_STATUS_MEMORY_USED, &cur, &hiwtr, 0);
fprintf(stderr, "-- MEMORY_USED %10d %10d\n", cur, hiwtr);
sqlite3_status(SQLITE_STATUS_MALLOC_SIZE, &cur, &hiwtr, 0);
fprintf(stderr, "-- MALLOC_SIZE %10d\n", hiwtr);
sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &cur, &hiwtr, 0);
fprintf(stderr, "-- MALLOC_COUNT %10d %10d\n", cur, hiwtr);
sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &cur, &hiwtr, 0);
fprintf(stderr, "-- PCACHE_OVFLOW %10d %10d\n", cur, hiwtr);
}
while( pAllStmt ){
db_finalize(pAllStmt);
}
db_end_transaction(1);
pStmt = 0;
while( (pStmt = sqlite3_next_stmt(g.db, pStmt))!=0 ){
fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
|