/ OpenDB: Data Base open routine for MONGO access method. */ /
| 315 | /* OpenDB: Data Base open routine for MONGO access method. */ |
| 316 | /***********************************************************************/ |
| 317 | bool TDBCMG::OpenDB(PGLOBAL g) |
| 318 | { |
| 319 | if (Use == USE_OPEN) { |
| 320 | /*******************************************************************/ |
| 321 | /* Table already open replace it at its beginning. */ |
| 322 | /*******************************************************************/ |
| 323 | Cmgp->Rewind(); |
| 324 | Fpos = -1; |
| 325 | return false; |
| 326 | } // endif Use |
| 327 | |
| 328 | /*********************************************************************/ |
| 329 | /* First opening. */ |
| 330 | /*********************************************************************/ |
| 331 | if (Pcg.Pipe && Mode != MODE_READ) { |
| 332 | strcpy(g->Message, "Pipeline tables are read only"); |
| 333 | return true; |
| 334 | } // endif Pipe |
| 335 | |
| 336 | Use = USE_OPEN; // Do it now in case we are recursively called |
| 337 | |
| 338 | if (Init(g)) |
| 339 | return true; |
| 340 | |
| 341 | if (Mode == MODE_DELETE && !Next) |
| 342 | // Delete all documents |
| 343 | return Cmgp->DocDelete(g); |
| 344 | else if (Mode == MODE_INSERT) |
| 345 | Cmgp->MakeColumnGroups(g); |
| 346 | |
| 347 | return false; |
| 348 | } // end of OpenDB |
| 349 | |
| 350 | /***********************************************************************/ |
| 351 | /* Data Base indexed read routine for ODBC access method. */ |
nothing calls this directly
no test coverage detected