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

Method MakeColumnList

storage/connect/taboccur.cpp:348–376  ·  view source on GitHub ↗

/ Allocate OCCUR column description block. */ /

Source from the content-addressed store, hash-verified

346/* Allocate OCCUR column description block. */
347/***********************************************************************/
348bool TDBOCCUR::MakeColumnList(PGLOBAL g)
349{
350 char *pn;
351 int i;
352 PCOL colp;
353
354 for (colp = Columns; colp; colp = colp->GetNext())
355 if (colp->GetAmType() == TYPE_AM_PRX)
356 if (((PPRXCOL)colp)->Init(g, NULL))
357 return true;
358
359 Col = (PCOL*)PlugSubAlloc(g, NULL, Mult * sizeof(PCOL));
360
361 for (i = 0, pn = Colist; i < Mult; i++, pn += (strlen(pn) + 1)) {
362 if (!(Col[i] = Tdbp->ColDB(g, pn, 0))) {
363 // Column not found in table
364 snprintf(g->Message, sizeof(g->Message), MSG(COL_ISNOT_TABLE), pn, Tabname);
365 return true;
366 } // endif Col
367
368 if (Col[i]->InitValue(g)) {
369 strcpy(g->Message, "OCCUR InitValue failed");
370 return true;
371 } // endif InitValue
372
373 } // endfor i
374
375 return false;
376} // end of MakeColumnList
377
378/***********************************************************************/
379/* Allocate OCCUR column description block for a view. */

Callers

nothing calls this directly

Calls 6

PlugSubAllocFunction · 0.85
InitValueMethod · 0.80
GetNextMethod · 0.45
GetAmTypeMethod · 0.45
InitMethod · 0.45
ColDBMethod · 0.45

Tested by

no test coverage detected