diff options
author | drh <drh@noemail.net> | 2014-03-06 14:53:25 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-03-06 14:53:25 +0000 |
commit | b7bc8c984917c7ef714d4f1bfbea2916a35f1e3f (patch) | |
tree | 8c4b7357cac63ec49913bcccc97347de3b836a88 /ext/session/test_session.c | |
parent | f2eded23f593efc061694c04a8f987f0831700aa (diff) | |
download | sqlite-b7bc8c984917c7ef714d4f1bfbea2916a35f1e3f.tar.gz sqlite-b7bc8c984917c7ef714d4f1bfbea2916a35f1e3f.zip |
Enhance the test harness for the sessions interface so that it does not
use SQLite operations that can encounter an OOM error in places where it
is unable to report an OOM error back up to the test script.
FossilOrigin-Name: bc0e661033b78f27866932244e6204985ae39000
Diffstat (limited to 'ext/session/test_session.c')
-rw-r--r-- | ext/session/test_session.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/session/test_session.c b/ext/session/test_session.c index 4340921a6..022cbc667 100644 --- a/ext/session/test_session.c +++ b/ext/session/test_session.c @@ -159,7 +159,7 @@ static void test_session_del(void *clientData){ TestSession *p = (TestSession*)clientData; if( p->pFilterScript ) Tcl_DecrRefCount(p->pFilterScript); sqlite3session_delete(p->pSession); - ckfree(p); + ckfree((char*)p); } /* @@ -191,7 +191,7 @@ static int test_sqlite3session( memset(p, 0, sizeof(TestSession)); rc = sqlite3session_create(db, Tcl_GetString(objv[3]), &p->pSession); if( rc!=SQLITE_OK ){ - ckfree(p); + ckfree((char*)p); return test_session_error(interp, rc); } @@ -222,10 +222,13 @@ static void test_append_value(Tcl_Obj *pList, sqlite3_value *pVal){ Tcl_ListObjAppendElement(0, pList, Tcl_NewStringObj("f", 1)); pObj = Tcl_NewDoubleObj(sqlite3_value_double(pVal)); break; - case SQLITE_TEXT: + case SQLITE_TEXT: { + const char *z = (char*)sqlite3_value_blob(pVal); + int n = sqlite3_value_bytes(pVal); Tcl_ListObjAppendElement(0, pList, Tcl_NewStringObj("t", 1)); - pObj = Tcl_NewStringObj((char *)sqlite3_value_text(pVal), -1); + pObj = Tcl_NewStringObj(z, n); break; + } case SQLITE_BLOB: Tcl_ListObjAppendElement(0, pList, Tcl_NewStringObj("b", 1)); pObj = Tcl_NewByteArrayObj( |