1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Use a global variable protected by a mutex instead of thread-specific-data to record malloc() failures. (CVS 2972)

FossilOrigin-Name: ac090f2ab3b5a792c2fdf897e10060f263e0d408
This commit is contained in:
danielk1977
2006-01-18 16:51:35 +00:00
parent 1de57847f8
commit 9e12800dec
27 changed files with 201 additions and 216 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
** $Id: attach.c,v 1.47 2006/01/17 13:21:40 danielk1977 Exp $
** $Id: attach.c,v 1.48 2006/01/18 16:51:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -272,7 +272,7 @@ static void codeAttach(
sqlite3* db = pParse->db;
#ifndef SQLITE_OMIT_AUTHORIZATION
assert( sqlite3ThreadDataReadOnly()->mallocFailed || pAuthArg );
assert( sqlite3MallocFailed() || pAuthArg );
if( pAuthArg ){
char *zAuthArg = sqlite3NameFromToken(&pAuthArg->span);
if( !zAuthArg ){
@@ -303,7 +303,7 @@ static void codeAttach(
sqlite3ExprCode(pParse, pDbname);
sqlite3ExprCode(pParse, pKey);
assert(v || sqlite3ThreadDataReadOnly()->mallocFailed);
assert( v || sqlite3MallocFailed() );
if( v ){
sqlite3VdbeAddOp(v, OP_Function, 0, nFunc);
pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, SQLITE_UTF8,0);