| 562 | // |
| 563 | |
| 564 | static void cmp_blob(blb* blob, bool sql_flag) |
| 565 | { |
| 566 | blob->blb_ident = CMP_next_ident(); |
| 567 | blob->blb_buff_ident = CMP_next_ident(); |
| 568 | blob->blb_len_ident = CMP_next_ident(); |
| 569 | |
| 570 | if (sql_flag) |
| 571 | { |
| 572 | for (ref* reference = blob->blb_reference; reference; reference = reference->ref_next) |
| 573 | { |
| 574 | reference->ref_port = make_port(reference->ref_context->ctx_request, reference); |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | if (!blob->blb_const_to_type && !blob->blb_type) |
| 579 | return; |
| 580 | |
| 581 | blob->blb_bpb_ident = CMP_next_ident(); |
| 582 | UCHAR* p = blob->blb_bpb; |
| 583 | *p++ = isc_bpb_version1; |
| 584 | |
| 585 | if (blob->blb_const_to_type) |
| 586 | { |
| 587 | *p++ = isc_bpb_target_type; |
| 588 | *p++ = 2; |
| 589 | *p++ = (UCHAR) blob->blb_const_to_type; |
| 590 | *p++ = blob->blb_const_to_type >> 8; |
| 591 | } |
| 592 | |
| 593 | if (blob->blb_const_from_type) |
| 594 | { |
| 595 | *p++ = isc_bpb_source_type; |
| 596 | *p++ = 2; |
| 597 | *p++ = (UCHAR) blob->blb_const_from_type; |
| 598 | *p++ = blob->blb_const_from_type >> 8; |
| 599 | } |
| 600 | |
| 601 | if (blob->blb_type) |
| 602 | { |
| 603 | *p++ = isc_bpb_type; |
| 604 | *p++ = 1; |
| 605 | *p++ = (UCHAR) blob->blb_type; |
| 606 | } |
| 607 | |
| 608 | if (blob->blb_from_charset) |
| 609 | { |
| 610 | // create bpb instruction for source character set |
| 611 | |
| 612 | *p++ = isc_bpb_source_interp; |
| 613 | *p++ = 2; |
| 614 | *p++ = (UCHAR) blob->blb_from_charset; |
| 615 | *p++ = blob->blb_from_charset >> 8; |
| 616 | } |
| 617 | |
| 618 | if (blob->blb_to_charset) |
| 619 | { |
| 620 | |
| 621 | // create bpb instruction for target character set |
no test coverage detected