SQLite

Check-in [9f09370661]
Login

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

Overview
Comment:Remove a mutex reference leak from sqlite3_reoptimize().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | experimental
Files: files | file ages | folders
SHA1: 9f0937066184421f23453ceb451fd726c75cb593
User & Date: dan 2009-10-16 15:19:08.000
Context
2009-10-16
16:21
Merge the sqlite3_reoptimize() changes into the trunk. (check-in: 50136840d5 user: drh tags: trunk)
15:59
Fix a problem in the analyze3.test script. (Closed-Leaf check-in: 61174aea74 user: dan tags: experimental)
15:19
Remove a mutex reference leak from sqlite3_reoptimize(). (check-in: 9f09370661 user: dan tags: experimental)
2009-10-15
18:35
Add the experimental sqlite3_reoptimize() API. (check-in: 9bd6f3d886 user: dan tags: experimental)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeapi.c.
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
  Vdbe *v = (Vdbe *)pStmt;
  sqlite3 *db = v->db;

  sqlite3_mutex_enter(db->mutex);
  if( v->isPrepareV2==0 || v->pc>0 ){
    rc = SQLITE_MISUSE;
  }else if( v->optimizable ){
    sqlite3 *db = v->db;
    sqlite3_mutex_enter(db->mutex);
    rc = sqlite3Reprepare(v);
    rc = sqlite3ApiExit(db, rc);
  }
  assert( rc!=SQLITE_OK || v->optimizable==0 );
  sqlite3_mutex_leave(db->mutex);

  return rc;







<
<







1229
1230
1231
1232
1233
1234
1235


1236
1237
1238
1239
1240
1241
1242
  Vdbe *v = (Vdbe *)pStmt;
  sqlite3 *db = v->db;

  sqlite3_mutex_enter(db->mutex);
  if( v->isPrepareV2==0 || v->pc>0 ){
    rc = SQLITE_MISUSE;
  }else if( v->optimizable ){


    rc = sqlite3Reprepare(v);
    rc = sqlite3ApiExit(db, rc);
  }
  assert( rc!=SQLITE_OK || v->optimizable==0 );
  sqlite3_mutex_leave(db->mutex);

  return rc;