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

Method Init

storage/connect/tabutil.cpp:699–729  ·  view source on GitHub ↗

/ PRXCOL initialization routine. */ Look for the matching column in the object table. */ /

Source from the content-addressed store, hash-verified

697/* Look for the matching column in the object table. */
698/***********************************************************************/
699bool PRXCOL::Init(PGLOBAL g, PTDB tp)
700 {
701 if (!tp)
702 tp = ((PTDBPRX)To_Tdb)->Tdbp;
703
704 if (!(Colp = tp->ColDB(g, Name, 0)) && Colnum)
705 Colp = tp->ColDB(g, NULL, Colnum);
706
707 if (Colp) {
708 MODE mode = To_Tdb->GetMode();
709
710 // Needed for MYSQL subtables
711 ((COLBLK*)Colp)->SetName(Decode(g, Colp->GetName()));
712
713 // May not have been done elsewhere
714 Colp->InitValue(g);
715 To_Val = Colp->GetValue();
716
717 if (mode == MODE_INSERT || mode == MODE_UPDATE)
718 if (Colp->SetBuffer(g, Colp->GetValue(), true, false))
719 return true;
720
721 // this may be needed by some tables (which?)
722 Colp->SetColUse(ColUse);
723 } else {
724 snprintf(g->Message, sizeof(g->Message), MSG(NO_MATCHING_COL), Name, tp->GetName());
725 return true;
726 } // endif Colp
727
728 return false;
729 } // end of Init
730
731/***********************************************************************/
732/* Reset the column descriptor to non evaluated yet. */

Callers 1

OpenDBMethod · 0.45

Calls 6

SetNameMethod · 0.80
InitValueMethod · 0.80
ColDBMethod · 0.45
GetNameMethod · 0.45
GetValueMethod · 0.45
SetBufferMethod · 0.45

Tested by

no test coverage detected