/ Check-in [3ddc7e4c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a missing mutex around calls to clear the KeyInfo cache when closing a database connection.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.8.7
Files: files | file ages | folders
SHA1:3ddc7e4c7778a6708856776471ded65f78825487
User & Date: drh 2014-12-08 17:45:04
Context
2014-12-08
18:02
Increase the version number to 3.8.7.4. check-in: 33c90027 user: drh tags: branch-3.8.7
17:45
Add a missing mutex around calls to clear the KeyInfo cache when closing a database connection. check-in: 3ddc7e4c user: drh tags: branch-3.8.7
2014-12-05
22:29
Version 3.8.7.3 check-in: 647e77e8 user: drh tags: release, version-3.8.7.3, branch-3.8.7
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

928
929
930
931
932
933
934

935
936
937
938
939

940
941
942
943
944
945
946

  /* Close all database connections */
  for(j=0; j<db->nDb; j++){
    struct Db *pDb = &db->aDb[j];
    if( pDb->pBt ){
      if( pDb->pSchema ){
        /* Must clear the KeyInfo cache.  See ticket [e4a18565a36884b00edf] */

        for(i=sqliteHashFirst(&pDb->pSchema->idxHash); i; i=sqliteHashNext(i)){
          Index *pIdx = sqliteHashData(i);
          sqlite3KeyInfoUnref(pIdx->pKeyInfo);
          pIdx->pKeyInfo = 0;
        }

      }
      sqlite3BtreeClose(pDb->pBt);
      pDb->pBt = 0;
      if( j!=1 ){
        pDb->pSchema = 0;
      }
    }







>





>







928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948

  /* Close all database connections */
  for(j=0; j<db->nDb; j++){
    struct Db *pDb = &db->aDb[j];
    if( pDb->pBt ){
      if( pDb->pSchema ){
        /* Must clear the KeyInfo cache.  See ticket [e4a18565a36884b00edf] */
        sqlite3BtreeEnter(pDb->pBt);
        for(i=sqliteHashFirst(&pDb->pSchema->idxHash); i; i=sqliteHashNext(i)){
          Index *pIdx = sqliteHashData(i);
          sqlite3KeyInfoUnref(pIdx->pKeyInfo);
          pIdx->pKeyInfo = 0;
        }
        sqlite3BtreeLeave(pDb->pBt);
      }
      sqlite3BtreeClose(pDb->pBt);
      pDb->pBt = 0;
      if( j!=1 ){
        pDb->pSchema = 0;
      }
    }