8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:03:02 +01:00

Be slightly more explicit in our memory allocation desires. Also fix savepoints breakage

This commit is contained in:
skidder 2004-06-26 22:12:50 +00:00
parent 2350973836
commit 9c03314ebc
4 changed files with 8 additions and 22 deletions

View File

@ -124,7 +124,7 @@ void JrdMemoryPool::noDbbDeletePool(JrdMemoryPool* pool) {
MemoryPool::deletePool(pool);
}
TEXT* ALL_cstring(const Firebird::string& in_string)
TEXT* ALL_cstring(JrdMemoryPool* pool, const Firebird::string& in_string)
{
/**************************************
*
@ -138,22 +138,7 @@ TEXT* ALL_cstring(const Firebird::string& in_string)
* return to the user or where ever.
*
**************************************/
thread_db* tdbb = JRD_get_thread_data();
JrdMemoryPool* pool = tdbb->tdbb_default;
if (!pool) {
if (tdbb->tdbb_transaction)
pool = tdbb->tdbb_transaction->tra_pool;
else if (tdbb->tdbb_request)
pool = tdbb->tdbb_request->req_pool;
/* theoretically this shouldn't happen, but just in case */
if (!pool)
return NULL;
}
TEXT* p = FB_NEW(*pool) TEXT[in_string.length()];
TEXT* p = FB_NEW(*pool) TEXT[in_string.length() + 1];
strcpy(p, in_string.c_str());
return p;
}

View File

@ -30,7 +30,6 @@
#include "../jrd/lls.h"
#include "fb_string.h"
TEXT* ALL_cstring(const Firebird::string& in_string);
void ALL_fini(void);
void ALL_init(void);
@ -66,5 +65,7 @@ public:
Jrd::DataComprControl* plb_dccs;
};
TEXT* ALL_cstring(JrdMemoryPool* pool, const Firebird::string& in_string);
#endif // JRD_ALL_H

View File

@ -52,7 +52,7 @@ typedef nod_t NOD_T;
#include "../jrd/err_proto.h"
// This macro enables DSQL tracing code
//#define CMP_DEBUG
#define CMP_DEBUG
#ifdef CMP_DEBUG
DEFINE_TRACE_ROUTINE(cmp_trace);

View File

@ -1648,7 +1648,7 @@ static jrd_nod* par_plan(thread_db* tdbb, CompilerScratch* csb)
access_type->nod_arg[0] = (jrd_nod*) (IPTR) relation_id;
access_type->nod_arg[1] = (jrd_nod*) (IPTR) index_id;
access_type->nod_arg[2] = (jrd_nod*) ALL_cstring(name);
access_type->nod_arg[2] = (jrd_nod*) ALL_cstring(tdbb->tdbb_default, name);
if (BLR_PEEK == blr_indices)
// dimitr: FALL INTO, if the plan item is ORDER ... INDEX (...)
@ -1703,7 +1703,7 @@ static jrd_nod* par_plan(thread_db* tdbb, CompilerScratch* csb)
*arg++ = (jrd_nod*) (IPTR) relation_id;
*arg++ = (jrd_nod*) (IPTR) index_id;
*arg++ = (jrd_nod*) ALL_cstring(name);
*arg++ = (jrd_nod*) ALL_cstring(tdbb->tdbb_default, name);
}
break;
}
@ -2418,7 +2418,7 @@ static jrd_nod* parse(thread_db* tdbb, CompilerScratch* csb, USHORT expected,
*arg++ = (jrd_nod*) (IPTR) BLR_BYTE;
Firebird::string name;
par_name(csb, name);
*arg++ = (jrd_nod*) ALL_cstring(name);
*arg++ = (jrd_nod*) ALL_cstring(tdbb->tdbb_default, name);
break;
}