diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hash.c | 6 | ||||
-rw-r--r-- | src/test8.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/hash.c b/src/hash.c index e917197d6..d01ab92f7 100644 --- a/src/hash.c +++ b/src/hash.c @@ -12,7 +12,7 @@ ** This is the implementation of generic hash-tables ** used in SQLite. ** -** $Id: hash.c,v 1.22 2007/08/29 12:31:26 danielk1977 Exp $ +** $Id: hash.c,v 1.23 2007/09/03 15:03:21 danielk1977 Exp $ */ #include "sqliteInt.h" #include <assert.h> @@ -362,6 +362,10 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){ removeElementGivenHash(pH,elem,h); }else{ elem->data = data; + if( !pH->copyKey ){ + elem->pKey = (void *)pKey; + } + assert(nKey==elem->nKey); } return old_data; } diff --git a/src/test8.c b/src/test8.c index d95612269..1a6baea59 100644 --- a/src/test8.c +++ b/src/test8.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test8.c,v 1.56 2007/09/03 11:51:50 danielk1977 Exp $ +** $Id: test8.c,v 1.57 2007/09/03 15:03:21 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -452,6 +452,14 @@ static int echoCreate( zSql = sqlite3MPrintf(0, "CREATE TABLE %Q(logmsg)", pVtab->zLogName); rc = sqlite3_exec(db, zSql, 0, 0, 0); sqlite3_free(zSql); + if( rc!=SQLITE_OK ){ + *pzErr = sqlite3StrDup(sqlite3_errmsg(db)); + } + } + + if( *ppVtab && rc!=SQLITE_OK ){ + echoDestructor(*ppVtab); + *ppVtab = 0; } return rc; |