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

Method buildStatementKey

src/dsql/DsqlStatementCache.cpp:256–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void DsqlStatementCache::buildStatementKey(thread_db* tdbb, RefStrPtr& key, const string& text, USHORT clientDialect,
257 bool isInternalRequest)
258{
259 const auto attachment = tdbb->getAttachment();
260
261 const SSHORT charSetId = isInternalRequest ? CS_METADATA : attachment->att_charset;
262 const int debugOptions = (int) attachment->getDebugOptions().getDsqlKeepBlr();
263
264 key = FB_NEW_POOL(getPool()) RefString(getPool());
265
266 key->resize(1 + sizeof(charSetId) + text.length());
267 char* p = key->begin();
268 *p = (clientDialect << 2) | (int(isInternalRequest) << 1) | debugOptions;
269 memcpy(p + 1, &charSetId, sizeof(charSetId));
270 memcpy(p + 1 + sizeof(charSetId), text.c_str(), text.length());
271}
272
273void DsqlStatementCache::buildVerifyKey(thread_db* tdbb, string& key, bool isInternalRequest)
274{

Callers

nothing calls this directly

Calls 6

getDsqlKeepBlrMethod · 0.80
getAttachmentMethod · 0.45
resizeMethod · 0.45
lengthMethod · 0.45
beginMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected