SQLite
Check-in [399e28283b]
Not logged in
Overview
SHA1 Hash:399e28283bca5ec20b6201adf2f09509667fa9f2
Date: 2013-06-12 02:53:39
User: drh
Comment:Another attempt at disabling virtual tables. This one leaks memory.
Tags And Properties
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vtab.c

85
86
87
88
89
90
91














92
93
94
95
96
97
98

  sqlite3_mutex_enter(db->mutex);
  nName = sqlite3Strlen30(zName);
  if( (pMod = sqlite3HashFind(&db->aModule, zName, nName))!=0 ){
    if( pModule!=0 ){
      rc = SQLITE_MISUSE_BKPT;
    }else{














      pMod->pModule = &errorModule;
    }
  }else{
    pMod = (Module *)sqlite3DbMallocRaw(db, sizeof(Module) + nName + 1);
    if( pMod ){
      Module *pDel;
      char *zCopy = (char *)(&pMod[1]);







>
>
>
>
>
>
>
>
>
>
>
>
>
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

  sqlite3_mutex_enter(db->mutex);
  nName = sqlite3Strlen30(zName);
  if( (pMod = sqlite3HashFind(&db->aModule, zName, nName))!=0 ){
    if( pModule!=0 ){
      rc = SQLITE_MISUSE_BKPT;
    }else{
      int iDb;
      HashElem *j;
      VTable *pVTab;
      for(iDb=0; iDb<db->nDb; iDb++){
        Schema *pSchema = db->aDb[iDb].pSchema;
        for(j=sqliteHashFirst(&pSchema->tblHash); j; j=sqliteHashNext(j)){
          Table *pTab = (Table*)sqliteHashData(j);
          if( !IsVirtual(pTab) ) continue;
          pVTab = pTab->pVTable;
          if( pVTab->pMod!=pMod ) continue;
          pVTab->pVtab->pModule = &errorModule;
        }
      }
      if( pMod->xDestroy ) pMod->xDestroy(pMod->pAux);
      pMod->pModule = &errorModule;
    }
  }else{
    pMod = (Module *)sqlite3DbMallocRaw(db, sizeof(Module) + nName + 1);
    if( pMod ){
      Module *pDel;
      char *zCopy = (char *)(&pMod[1]);