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

Method buildBlr

src/remote/client/BlrFromMessage.cpp:63–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void BlrFromMessage::buildBlr(IMessageMetadata* metadata)
64{
65 if (!metadata)
66 return;
67
68 LocalStatus ls;
69 CheckStatusWrapper st(&ls);
70
71 expectedMessageLength = metadata->getMessageLength(&st);
72 check(&st);
73
74 getBlrData().clear();
75
76 const unsigned count = metadata->getCount(&st);
77 fb_assert(count < MAX_USHORT / 2);
78
79 if (count == 0)
80 return; // If there isn't an SQLDA, don't bother with anything else.
81
82 appendVersion();
83 appendUChar(blr_begin);
84 appendUChar(blr_message);
85 appendUChar(0);
86 appendUShort(count * 2);
87
88 unsigned msgLen = 0;
89
90 for (unsigned i = 0; i < count; ++i)
91 {
92 unsigned dtype = metadata->getType(&st, i) & ~1;
93 check(&st);
94 unsigned len = metadata->getLength(&st, i);
95 check(&st);
96 int scale = metadata->getScale(&st, i);
97 check(&st);
98 unsigned charSet = metadata->getCharSet(&st, i);
99 check(&st);
100 int subType = metadata->getSubType(&st, i);
101 check(&st);
102
103 switch (dtype)
104 {
105 case SQL_VARYING:
106 appendUChar(blr_varying2);
107 appendUShort(charSet);
108 appendUShort(len);
109 dtype = dtype_varying;
110 len += sizeof(USHORT);
111 break;
112
113 case SQL_TEXT:
114 appendUChar(blr_text2);
115 appendUShort(charSet);
116 appendUShort(len);
117 dtype = dtype_text;
118 break;
119
120 case SQL_DEC16:

Callers

nothing calls this directly

Calls 12

GdsClass · 0.85
FB_ALIGNFunction · 0.85
checkFunction · 0.50
getMessageLengthMethod · 0.45
clearMethod · 0.45
getCountMethod · 0.45
getTypeMethod · 0.45
getLengthMethod · 0.45
getScaleMethod · 0.45
getCharSetMethod · 0.45
getSubTypeMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected