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

Method ReadColumn

storage/connect/tabsys.cpp:452–483  ·  view source on GitHub ↗

/ ReadColumn: what this routine does is to access the key buffer set */ from the corresponding section, extract from it the key value */ corresponding to this column name and convert it to buffer type. */ /

Source from the content-addressed store, hash-verified

450/* corresponding to this column name and convert it to buffer type. */
451/***********************************************************************/
452void INICOL::ReadColumn(PGLOBAL)
453 {
454 PTDBINI tdbp = (PTDBINI)To_Tdb;
455
456 if (trace(2))
457 htrc("INI ReadColumn: col %s R%d flag=%d\n",
458 Name, tdbp->GetTdb_No(), Flag);
459
460 /*********************************************************************/
461 /* Get the key value from the INI file. */
462 /*********************************************************************/
463 switch (Flag) {
464 case 1:
465 strncpy(Valbuf, tdbp->Section, Long); // Section name
466 Valbuf[Long] = '\0';
467 break;
468 default:
469 GetPrivateProfileString(tdbp->Section, Name, "\b",
470 Valbuf, Long + 1, tdbp->Ifile);
471 break;
472 } // endswitch Flag
473
474 // Missing keys are interpreted as null values
475 if (!strcmp(Valbuf, "\b")) {
476 if (Nullable)
477 Value->SetNull(true);
478
479 Value->Reset(); // Null value
480 } else
481 Value->SetValue_psz(Valbuf);
482
483 } // end of ReadColumn
484
485/***********************************************************************/
486/* WriteColumn: what this routine does is to access the last line */

Callers

nothing calls this directly

Calls 5

GetPrivateProfileStringFunction · 0.85
SetValue_pszMethod · 0.80
htrcFunction · 0.70
SetNullMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected