MCPcopy Create free account
hub / github.com/MariaDB/server / OpenTableFile

Method OpenTableFile

storage/connect/jmgfam.cpp:220–251  ·  view source on GitHub ↗

/ OpenTableFile: Open a MongoDB table. */ /

Source from the content-addressed store, hash-verified

218/* OpenTableFile: Open a MongoDB table. */
219/***********************************************************************/
220bool JMGFAM::OpenTableFile(PGLOBAL g)
221{
222 Mode = Tdbp->GetMode();
223
224 if (Pipe && Mode != MODE_READ) {
225 strcpy(g->Message, "Pipeline tables are read only");
226 return true;
227 } // endif Pipe
228
229 if (Init(g))
230 return true;
231
232 if (Jcp->GetMethodId(g, Mode))
233 return true;
234
235 if (Mode == MODE_DELETE && !Tdbp->GetNext()) {
236 // Delete all documents
237 if (!Jcp->MakeCursor(g, Tdbp, "all", Filter, false))
238 if (Jcp->DocDelete(g, true) == RC_OK)
239 return false;
240
241 return true;
242 } // endif Mode
243
244//if (Mode == MODE_INSERT)
245// Jcp->MakeColumnGroups(g, Tdbp);
246
247 if (Mode != MODE_UPDATE)
248 return Jcp->MakeCursor(g, Tdbp, Options, Filter, Pipe);
249
250 return false;
251 } // end of OpenTableFile
252
253/***********************************************************************/
254/* GetRowID: return the RowID of last read record. */

Callers

nothing calls this directly

Calls 5

InitFunction · 0.85
GetMethodIdMethod · 0.80
GetNextMethod · 0.45
MakeCursorMethod · 0.45
DocDeleteMethod · 0.45

Tested by

no test coverage detected