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

Method DefineAM

storage/connect/tabtbl.cpp:104–159  ·  view source on GitHub ↗

/ DefineAM: define specific AM block values from XDB file. */ /

Source from the content-addressed store, hash-verified

102/* DefineAM: define specific AM block values from XDB file. */
103/**************************************************************************/
104bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR, int)
105 {
106 char *tablist, *dbname, *def = NULL;
107
108 Desc = "Table list table";
109 tablist = GetStringCatInfo(g, "Tablist", "");
110 dbname = GetStringCatInfo(g, "Dbname", "*");
111 def = GetStringCatInfo(g, "Srcdef", NULL);
112 Ntables = 0;
113
114 if (*tablist) {
115 char *p, *pn, *pdb;
116 PTABLE tbl;
117
118 for (pdb = tablist; ;) {
119 if ((p = strchr(pdb, ',')))
120 *p = 0;
121
122 // Analyze the table name, it may have the format:
123 // [dbname.]tabname
124 if ((pn = strchr(pdb, '.'))) {
125 *pn++ = 0;
126 } else {
127 pn = pdb;
128 pdb = dbname;
129 } // endif p
130
131 // Allocate the TBLIST block for that table
132 tbl = new(g) XTAB(pn, def);
133 tbl->SetSchema(pdb);
134
135 if (trace(1))
136 htrc("TBL: Name=%s db=%s\n", tbl->GetName(), tbl->GetSchema());
137
138 // Link the blocks
139 if (Tablep)
140 Tablep->Link(tbl);
141 else
142 Tablep = tbl;
143
144 Ntables++;
145
146 if (p)
147 pdb = pn + strlen(pn) + 1;
148 else
149 break;
150
151 } // endfor pdb
152
153 Maxerr = GetIntCatInfo("Maxerr", 0);
154 Accept = GetBoolCatInfo("Accept", false);
155 Thread = GetBoolCatInfo("Thread", false);
156 } // endif tablist
157
158 return FALSE;
159 } // end of DefineAM
160
161/***********************************************************************/

Callers

nothing calls this directly

Calls 3

htrcFunction · 0.70
GetNameMethod · 0.45
LinkMethod · 0.45

Tested by

no test coverage detected