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

Method GetStringCatInfo

storage/connect/reldef.cpp:263–300  ·  view source on GitHub ↗

/ This function returns string table information. */ Default parameter is "*" to get the handler default. */ /

Source from the content-addressed store, hash-verified

261/* Default parameter is "*" to get the handler default. */
262/***********************************************************************/
263char *RELDEF::GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef)
264 {
265 char *sval = NULL;
266 PCSZ name, s= Hc->GetStringOption(what, sdef);
267
268 if (s) {
269 if (!Hc->IsPartitioned() ||
270 (stricmp(what, "filename") && stricmp(what, "tabname")
271 && stricmp(what, "connect")))
272 sval= PlugDup(g, s);
273 else
274 sval= (char*)s;
275
276 } else if (!stricmp(what, "filename")) {
277 // Return default file name
278 PCSZ ftype= Hc->GetStringOption("Type", "*");
279 int i, n;
280
281 if (IsFileType(GetTypeID(ftype))) {
282 name= Hc->GetPartName();
283 sval= (char*)PlugSubAlloc(g, NULL, strlen(name) + 12);
284 snprintf(sval, strlen(name) + 12, "%s.", name);
285 n= strlen(sval);
286
287 // Fold ftype to lower case
288 for (i= 0; i < 12; i++)
289 if (!ftype[i]) {
290 sval[n+i]= 0;
291 break;
292 } else
293 sval[n+i]= tolower(ftype[i]);
294
295 } // endif FileType
296
297 } // endif s
298
299 return sval;
300 } // end of GetStringCatInfo
301
302/* --------------------------- Class TABDEF -------------------------- */
303

Callers 2

ReadColumnMethod · 0.80
OpenDBMethod · 0.80

Calls 7

PlugDupFunction · 0.85
IsFileTypeFunction · 0.85
GetTypeIDFunction · 0.85
PlugSubAllocFunction · 0.85
GetStringOptionMethod · 0.80
IsPartitionedMethod · 0.80
GetPartNameMethod · 0.80

Tested by

no test coverage detected