diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 9 | ||||
-rw-r--r-- | src/test_malloc.c | 3 | ||||
-rw-r--r-- | src/test_md5.c | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c index 7b12c4415..12806b0a7 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.421 2008/03/07 21:37:19 drh Exp $ +** $Id: main.c,v 1.422 2008/03/18 13:01:38 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1002,13 +1002,12 @@ static int openDatabase( createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc, 0); createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc, 0); createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0); - if( db->mallocFailed || - (db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0))==0 - ){ - assert( db->mallocFailed ); + if( db->mallocFailed ){ db->magic = SQLITE_MAGIC_SICK; goto opendb_out; } + db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0); + assert( db->pDfltColl!=0 ); /* Also add a UTF-8 case-insensitive collation sequence. */ createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0); diff --git a/src/test_malloc.c b/src/test_malloc.c index 38708009a..c0daf4690 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -13,7 +13,7 @@ ** This file contains code used to implement test interfaces to the ** memory allocation subsystem. ** -** $Id: test_malloc.c,v 1.16 2008/03/18 00:07:11 drh Exp $ +** $Id: test_malloc.c,v 1.17 2008/03/18 13:01:38 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -437,6 +437,7 @@ static int test_memdebug_fail( } } + sqlite3_test_control(-12345); /* Just to stress the test_control interface */ nBenign = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_BENIGN_FAILURES, SQLITE_FAULTINJECTOR_MALLOC); nFail = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_FAILURES, diff --git a/src/test_md5.c b/src/test_md5.c index 792fc8598..f3613d001 100644 --- a/src/test_md5.c +++ b/src/test_md5.c @@ -383,6 +383,8 @@ static void md5finalize(sqlite3_context *context){ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); } int Md5_Register(sqlite3 *db){ - return sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0, + int rc = sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0, md5step, md5finalize); + sqlite3_overload_function(db, "md5sum", -1); /* To exercise this API */ + return rc; } |