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

Method MakeFnPattern

storage/connect/tabvct.cpp:173–198  ·  view source on GitHub ↗

/ Prepare the column file name pattern for a split table. */ This function returns the number of columns of the table. */ /

Source from the content-addressed store, hash-verified

171/* This function returns the number of columns of the table. */
172/***********************************************************************/
173int VCTDEF::MakeFnPattern(char *fpat)
174 {
175 char pat[16];
176#if defined(_WIN32)
177 char drive[_MAX_DRIVE];
178#else
179 char *drive = NULL;
180#endif
181 char direc[_MAX_DIR];
182 char fname[_MAX_FNAME];
183 char ftype[_MAX_EXT]; // File extention
184 int n, m, ncol = 0;
185 PCOLDEF cdp;
186
187 for (cdp = To_Cols; cdp; cdp = cdp->GetNext())
188 ncol++;
189
190 for (n = 1, m = ncol; m /= 10; n++) ;
191
192 snprintf(pat, sizeof(pat), "%%0%dd", n);
193 _splitpath(Fn, drive, direc, fname, ftype);
194 strcat(fname, pat);
195 _makepath(fpat, drive, direc, fname, ftype);
196 PlugSetPath(fpat, fpat, GetPath());
197 return ncol;
198 } // end of MakeFnPattern
199
200/***********************************************************************/
201/* GetTable: makes a new Table Description Block. */

Callers 3

GetFileLengthMethod · 0.80
CardinalityMethod · 0.80
OpenTableFileMethod · 0.80

Calls 4

_splitpathFunction · 0.85
_makepathFunction · 0.85
PlugSetPathFunction · 0.70
GetNextMethod · 0.45

Tested by

no test coverage detected