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

Method OpenDB

storage/connect/tabcmg.cpp:317–348  ·  view source on GitHub ↗

/ OpenDB: Data Base open routine for MONGO access method. */ /

Source from the content-addressed store, hash-verified

315/* OpenDB: Data Base open routine for MONGO access method. */
316/***********************************************************************/
317bool TDBCMG::OpenDB(PGLOBAL g)
318{
319 if (Use == USE_OPEN) {
320 /*******************************************************************/
321 /* Table already open replace it at its beginning. */
322 /*******************************************************************/
323 Cmgp->Rewind();
324 Fpos = -1;
325 return false;
326 } // endif Use
327
328 /*********************************************************************/
329 /* First opening. */
330 /*********************************************************************/
331 if (Pcg.Pipe && Mode != MODE_READ) {
332 strcpy(g->Message, "Pipeline tables are read only");
333 return true;
334 } // endif Pipe
335
336 Use = USE_OPEN; // Do it now in case we are recursively called
337
338 if (Init(g))
339 return true;
340
341 if (Mode == MODE_DELETE && !Next)
342 // Delete all documents
343 return Cmgp->DocDelete(g);
344 else if (Mode == MODE_INSERT)
345 Cmgp->MakeColumnGroups(g);
346
347 return false;
348} // end of OpenDB
349
350/***********************************************************************/
351/* Data Base indexed read routine for ODBC access method. */

Callers

nothing calls this directly

Calls 4

InitFunction · 0.85
RewindMethod · 0.45
DocDeleteMethod · 0.45
MakeColumnGroupsMethod · 0.45

Tested by

no test coverage detected