/ Check-in [d1afdd8c]
Login

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

Overview
Comment:Fix a crash that can occur if an error happens in a virtual table xSync() function. (CVS 3860)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d1afdd8c9c756409275c116e662fc1e04bbe829e
User & Date: danielk1977 2007-04-19 14:28:09
Context
2007-04-19
14:48
Better fix than (3860) for the same problem. (3860) could leave file-handles open in some circumstances. (CVS 3861) check-in: 5ad64533 user: danielk1977 tags: trunk
14:28
Fix a crash that can occur if an error happens in a virtual table xSync() function. (CVS 3860) check-in: d1afdd8c user: danielk1977 tags: trunk
12:30
Comment changes in the ioerr tests. No changes to code. (CVS 3859) check-in: b7ed0e1e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vtab.c.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code used to help implement virtual tables.
**
** $Id: vtab.c,v 1.43 2007/04/19 00:24:35 drh Exp $
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
#include "sqliteInt.h"

/*
** External API function used to create a new virtual-table module.
*/
................................................................................
** called is identified by the second argument, "offset", which is
** the offset of the method to call in the sqlite3_module structure.
**
** The array is cleared after invoking the callbacks. 
*/
static void callFinaliser(sqlite3 *db, int offset){
  int i;
  for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
    sqlite3_vtab *pVtab = db->aVTrans[i];
    int (*x)(sqlite3_vtab *);
    x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
    if( x ) x(pVtab);
    sqlite3VtabUnlock(db, pVtab);
  }
  sqliteFree(db->aVTrans);







|







 







|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code used to help implement virtual tables.
**
** $Id: vtab.c,v 1.44 2007/04/19 14:28:09 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
#include "sqliteInt.h"

/*
** External API function used to create a new virtual-table module.
*/
................................................................................
** called is identified by the second argument, "offset", which is
** the offset of the method to call in the sqlite3_module structure.
**
** The array is cleared after invoking the callbacks. 
*/
static void callFinaliser(sqlite3 *db, int offset){
  int i;
  for(i=0; i<db->nVTrans && db->aVTrans && db->aVTrans[i]; i++){
    sqlite3_vtab *pVtab = db->aVTrans[i];
    int (*x)(sqlite3_vtab *);
    x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
    if( x ) x(pVtab);
    sqlite3VtabUnlock(db, pVtab);
  }
  sqliteFree(db->aVTrans);