| 258 | |
| 259 | |
| 260 | blb* 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; |
nothing calls this directly
no test coverage detected