/ DOSCOL public constructor (also called by MAPCOL). */ /
| 2345 | /* DOSCOL public constructor (also called by MAPCOL). */ |
| 2346 | /***********************************************************************/ |
| 2347 | DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am) |
| 2348 | : COLBLK(cdp, tp, i) |
| 2349 | { |
| 2350 | char *p; |
| 2351 | int prec = Format.Prec; |
| 2352 | PTXF txfp = ((PTDBDOS)tp)->Txfp; |
| 2353 | |
| 2354 | assert(cdp); |
| 2355 | |
| 2356 | if (cp) { |
| 2357 | Next = cp->GetNext(); |
| 2358 | cp->SetNext(this); |
| 2359 | } else { |
| 2360 | Next = tp->GetColumns(); |
| 2361 | tp->SetColumns(this); |
| 2362 | } // endif cprec |
| 2363 | |
| 2364 | // Set additional Dos access method information for column. |
| 2365 | Deplac = cdp->GetOffset(); |
| 2366 | Long = cdp->GetLong(); |
| 2367 | To_Val = NULL; |
| 2368 | Clustered = cdp->GetOpt(); |
| 2369 | Sorted = (cdp->GetOpt() == 2) ? 1 : 0; |
| 2370 | Ndv = 0; // Currently used only for XDB2 |
| 2371 | Nbm = 0; // Currently used only for XDB2 |
| 2372 | Min = NULL; |
| 2373 | Max = NULL; |
| 2374 | Bmap = NULL; |
| 2375 | Dval = NULL; |
| 2376 | Buf = NULL; |
| 2377 | |
| 2378 | if (txfp && txfp->Blocked && Opt && (cdp->GetMin() || cdp->GetDval())) { |
| 2379 | int nblk = txfp->GetBlock(); |
| 2380 | |
| 2381 | Clustered = (cdp->GetXdb2()) ? 2 : 1; |
| 2382 | Sorted = (cdp->GetOpt() > 1) ? 1 : 0; // Currently ascending only |
| 2383 | |
| 2384 | if (Clustered == 1) { |
| 2385 | Min = AllocValBlock(g, cdp->GetMin(), Buf_Type, nblk, Long, prec); |
| 2386 | Max = AllocValBlock(g, cdp->GetMax(), Buf_Type, nblk, Long, prec); |
| 2387 | } else { // Clustered == 2 |
| 2388 | // Ndv is the number of distinct values in Dval. Ndv and Nbm |
| 2389 | // may be 0 when optimizing because Ndval is not filled yet, |
| 2390 | // but the size of the passed Dval memory block is Ok. |
| 2391 | Ndv = cdp->GetNdv(); |
| 2392 | Dval = AllocValBlock(g, cdp->GetDval(), Buf_Type, Ndv, Long, prec); |
| 2393 | |
| 2394 | // Bmap cannot be allocated when optimizing, we must know Nbm first |
| 2395 | if ((Nbm = cdp->GetNbm())) |
| 2396 | Bmap = AllocValBlock(g, cdp->GetBmap(), TYPE_INT, Nbm * nblk); |
| 2397 | |
| 2398 | } // endif Clustered |
| 2399 | |
| 2400 | } // endif Opt |
| 2401 | |
| 2402 | OldVal = NULL; // Currently used only in MinMax |
| 2403 | Dsp = 0; |
| 2404 | Ldz = false; |
nothing calls this directly
no test coverage detected