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

Method ReadDB

storage/connect/tabmul.cpp:426–472  ·  view source on GitHub ↗

/ ReadDB: Data Base read routine for MUL access method. */ /

Source from the content-addressed store, hash-verified

424/* ReadDB: Data Base read routine for MUL access method. */
425/***********************************************************************/
426int TDBMUL::ReadDB(PGLOBAL g)
427 {
428 int rc;
429
430 if (NumFiles == 0)
431 return RC_EF;
432 else if (To_Kindex) {
433 /*******************************************************************/
434 /* Reading is by an index table. */
435 /*******************************************************************/
436 strcpy(g->Message, MSG(NO_INDEX_READ));
437 rc = RC_FX;
438 } else {
439 /*******************************************************************/
440 /* Now start the reading process. */
441 /*******************************************************************/
442 retry:
443 rc = Tdbp->ReadDB(g);
444
445 if (rc == RC_EF) {
446 if (Tdbp->GetDef()->GetPseudo() & 1)
447 // Total number of rows met so far
448 Rows += Tdbp->RowNumber(g) - 1;
449
450 if (++iFile < NumFiles) {
451 /***************************************************************/
452 /* Continue reading from next table file. */
453 /***************************************************************/
454 Tdbp->CloseDB(g);
455 Tdbp->SetUse(USE_READY);
456 Tdbp->SetFile(g, Filenames[iFile]);
457 Tdbp->ResetSize();
458 ResetDB();
459
460 if (Tdbp->OpenDB(g)) // Re-open with new file name
461 return RC_FX;
462
463 goto retry;
464 } // endif iFile
465
466 } else if (rc == RC_FX)
467 strcat(strcat(strcat(g->Message, " ("), Tdbp->GetFile(g)), ")");
468
469 } // endif To_Kindex
470
471 return rc;
472 } // end of ReadDB
473
474/***********************************************************************/
475/* Data Base write routine for MUL access method. */

Callers 1

InitFileNamesMethod · 0.45

Calls 13

_splitpathFunction · 0.85
_makepathFunction · 0.85
PlugSubAllocFunction · 0.85
PlgGetUserFunction · 0.85
GetLastErrorFunction · 0.85
ResetDBFunction · 0.70
PlugSetPathFunction · 0.70
RowNumberMethod · 0.45
CloseDBMethod · 0.45
SetFileMethod · 0.45
ResetSizeMethod · 0.45
OpenDBMethod · 0.45

Tested by

no test coverage detected