| 254 | } |
| 255 | |
| 256 | void 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 | |
| 273 | void DsqlStatementCache::buildVerifyKey(thread_db* tdbb, string& key, bool isInternalRequest) |
| 274 | { |
nothing calls this directly
no test coverage detected