/ VCT Access Method opening routine. */ New method now that this routine is called recursively (last table */ first in reverse order): index blocks are immediately linked to */ join block of next table if it exists or else are discarted. */ /
| 301 | /* join block of next table if it exists or else are discarted. */ |
| 302 | /***********************************************************************/ |
| 303 | bool TDBVCT::OpenDB(PGLOBAL g) |
| 304 | { |
| 305 | if (trace(1)) |
| 306 | htrc("VCT OpenDB: tdbp=%p tdb=R%d use=%d key=%p mode=%d\n", |
| 307 | this, Tdb_No, Use, To_Key_Col, Mode); |
| 308 | |
| 309 | if (Use == USE_OPEN) { |
| 310 | /*******************************************************************/ |
| 311 | /* Table already open, just replace it at its beginning. */ |
| 312 | /*******************************************************************/ |
| 313 | if (To_Kindex) |
| 314 | // Table is to be accessed through a sorted index table |
| 315 | To_Kindex->Reset(); |
| 316 | |
| 317 | Txfp->Rewind(); |
| 318 | ResetBlockFilter(g); |
| 319 | return false; |
| 320 | } // endif Use |
| 321 | |
| 322 | /*********************************************************************/ |
| 323 | /* Delete all is not handled using file mapping. */ |
| 324 | /*********************************************************************/ |
| 325 | if (Mode == MODE_DELETE && !Next && Txfp->GetAmType() == TYPE_AM_VMP) { |
| 326 | if (IsSplit()) |
| 327 | Txfp = new(g) VECFAM((PVCTDEF)To_Def); |
| 328 | else |
| 329 | Txfp = new(g) VCTFAM((PVCTDEF)To_Def); |
| 330 | |
| 331 | Txfp->SetTdbp(this); |
| 332 | } // endif Mode |
| 333 | |
| 334 | /*********************************************************************/ |
| 335 | /* Open according to input/output mode required and */ |
| 336 | /* allocate the block buffers for columns used in the query. */ |
| 337 | /*********************************************************************/ |
| 338 | if (Txfp->OpenTableFile(g)) |
| 339 | return true; |
| 340 | |
| 341 | // This was not done in previous version |
| 342 | Use = USE_OPEN; // Do it now in case we are recursively called |
| 343 | |
| 344 | /*********************************************************************/ |
| 345 | /* Allocate the block filter tree if evaluation is possible. */ |
| 346 | /*********************************************************************/ |
| 347 | To_BlkFil = InitBlockFilter(g, To_Filter); |
| 348 | |
| 349 | /*********************************************************************/ |
| 350 | /* Reset buffer access according to indexing and to mode. */ |
| 351 | /*********************************************************************/ |
| 352 | Txfp->ResetBuffer(g); |
| 353 | |
| 354 | return false; |
| 355 | } // end of OpenDB |
| 356 | |
| 357 | /***********************************************************************/ |
| 358 | /* Data Base read routine for VCT access method. */ |
nothing calls this directly
no test coverage detected