MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / create2

Method create2

src/jrd/blb.cpp:260–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258
259
260blb* blb::create2(thread_db* tdbb,
261 jrd_tra* transaction, bid* blob_id,
262 USHORT bpb_length, const UCHAR* bpb,
263 bool userBlob)
264{
265/**************************************
266 *
267 * b l b : : c r e a t e 2
268 *
269 **************************************
270 *
271 * Functional description
272 * Create a shiney, new, empty blob.
273 * Basically blb::create() with BPB structure.
274 *
275 **************************************/
276 transaction = transaction->getOuter();
277
278 SET_TDBB(tdbb);
279 Database* dbb = tdbb->getDatabase();
280 CHECK_DBB(dbb);
281
282 const int maxTempBlobs = MAX_TEMP_BLOBS;
283 if (maxTempBlobs > 0 && transaction->tra_temp_blobs_count >= maxTempBlobs)
284 {
285 const Request* request = tdbb->getRequest();
286 string info;
287
288 if (userBlob)
289 {
290 Attachment* att = tdbb->getAttachment();
291 info = "By user application";
292 if (att->att_remote_process.hasData())
293 {
294 info += string(" (") + att->att_remote_process.c_str() + ")";
295 }
296 }
297 else if (request)
298 {
299 const Statement* const statement = request->getStatement();
300 if (statement && statement->sqlText)
301 info = string("By query: ") + *statement->sqlText;
302
303 string stack;
304 if (EXE_get_stack_trace(request, stack))
305 {
306 info += "\n";
307 info += stack;
308 }
309 }
310
311 gds__log("Too many temporary blobs (%i allowed)\n%s", maxTempBlobs, info.c_str());
312
313 ERR_post(Arg::Gds(isc_random) << Arg::Str("Too many temporary blobs"));
314 }
315
316 // Create a blob large enough to hold a single data page
317 SSHORT from, to;

Callers

nothing calls this directly

Calls 15

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
EXE_get_stack_traceFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
find_filterFunction · 0.85
BLF_create_blobFunction · 0.85
getOuterMethod · 0.80
getDatabaseMethod · 0.80
readOnlyMethod · 0.80
getTempPageSpaceIDMethod · 0.80
set_temporaryMethod · 0.80

Tested by

no test coverage detected