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

Method init

src/jrd/PreparedStatement.cpp:312–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310
311
312void PreparedStatement::init(thread_db* tdbb, Attachment* attachment, jrd_tra* transaction,
313 const Firebird::string& text, bool isInternalRequest)
314{
315 AutoSetRestore<SSHORT> autoAttCharset(&attachment->att_charset,
316 (isInternalRequest ? CS_METADATA : attachment->att_charset));
317
318 dsqlRequest = NULL;
319 try
320 {
321 const Database& dbb = *tdbb->getDatabase();
322 const int dialect = isInternalRequest || (dbb.dbb_flags & DBB_DB_SQL_dialect_3) ?
323 SQL_DIALECT_V6 : SQL_DIALECT_V5;
324
325 dsqlRequest = DSQL_prepare(tdbb, attachment, transaction, text.length(), text.c_str(), dialect, 0,
326 NULL, NULL, isInternalRequest);
327
328 const auto dsqlStatement = dsqlRequest->getDsqlStatement();
329
330 if (dsqlStatement->getSendMsg())
331 parseDsqlMessage(dsqlStatement->getSendMsg(), inValues, inMetadata, inMessage);
332
333 if (dsqlStatement->getReceiveMsg())
334 parseDsqlMessage(dsqlStatement->getReceiveMsg(), outValues, outMetadata, outMessage);
335 }
336 catch (const Exception&)
337 {
338 if (dsqlRequest)
339 DSQL_free_statement(tdbb, dsqlRequest, DSQL_drop);
340 throw;
341 }
342}
343
344
345void PreparedStatement::setDesc(thread_db* tdbb, unsigned param, const dsc& value)

Callers

nothing calls this directly

Calls 8

DSQL_prepareFunction · 0.85
DSQL_free_statementFunction · 0.85
getDatabaseMethod · 0.80
getSendMsgMethod · 0.80
getReceiveMsgMethod · 0.80
lengthMethod · 0.45
c_strMethod · 0.45
getDsqlStatementMethod · 0.45

Tested by

no test coverage detected