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

Method openCursor

src/jrd/jrd.cpp:5117–5169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5115
5116
5117JResultSet* JStatement::openCursor(CheckStatusWrapper* user_status, ITransaction* transaction,
5118 IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned int flags)
5119{
5120 JResultSet* rs = NULL;
5121
5122 try
5123 {
5124 JTransaction* jt = transaction ? getAttachment()->getTransactionInterface(user_status, transaction) : NULL;
5125
5126 EngineContextHolder tdbb(user_status, this, FB_FUNCTION);
5127
5128 jrd_tra* tra = jt ? jt->getHandle() : NULL;
5129
5130 if (tra)
5131 validateHandle(tdbb, tra);
5132
5133 check_database(tdbb);
5134
5135 try
5136 {
5137 RefPtr<IMessageMetadata> defaultOut;
5138 if (!outMetadata)
5139 {
5140 defaultOut.assignRefNoIncr(metadata.getOutputMetadata());
5141 if (defaultOut)
5142 {
5143 outMetadata = defaultOut;
5144 }
5145 }
5146
5147 const auto cursor = getHandle()->openCursor(tdbb, &tra,
5148 inMetadata, static_cast<UCHAR*>(inBuffer), outMetadata, flags);
5149
5150 rs = FB_NEW JResultSet(cursor, this);
5151 rs->addRef();
5152 cursor->setInterfacePtr(rs);
5153 }
5154 catch (const Exception& ex)
5155 {
5156 transliterateException(tdbb, ex, user_status, "JStatement::openCursor");
5157 return NULL;
5158 }
5159 trace_warning(tdbb, user_status, "JStatement::openCursor");
5160 }
5161 catch (const Exception& ex)
5162 {
5163 ex.stuffException(user_status);
5164 return NULL;
5165 }
5166
5167 successful_completion(user_status);
5168 return rs;
5169}
5170
5171
5172IResultSet* JAttachment::openCursor(CheckStatusWrapper* user_status, ITransaction* apiTra,

Callers 15

grantRevokeAdminMethod · 0.45
executeMethod · 0.45
openMethod · 0.45
populateMethod · 0.45
populateMethod · 0.45
populateMethod · 0.45
getListMethod · 0.45
checkCreateDatabaseGrantFunction · 0.45
getListMethod · 0.45
doOpenMethod · 0.45
initMethod · 0.45
SessionMethod · 0.45

Calls 15

validateHandleFunction · 0.85
check_databaseFunction · 0.85
transliterateExceptionFunction · 0.85
trace_warningFunction · 0.85
successful_completionFunction · 0.85
assignRefNoIncrMethod · 0.80
JResultSetClass · 0.70
getHandleMethod · 0.45
getOutputMetadataMethod · 0.45
addRefMethod · 0.45
setInterfacePtrMethod · 0.45

Tested by

no test coverage detected