/ OpenTableFile: Open a MongoDB table. */ /
| 185 | /* OpenTableFile: Open a MongoDB table. */ |
| 186 | /***********************************************************************/ |
| 187 | bool CMGFAM::OpenTableFile(PGLOBAL g) |
| 188 | { |
| 189 | Mode = Tdbp->GetMode(); |
| 190 | |
| 191 | if (Pcg.Pipe && Mode != MODE_READ) { |
| 192 | strcpy(g->Message, "Pipeline tables are read only"); |
| 193 | return true; |
| 194 | } // endif Pipe |
| 195 | |
| 196 | if (Init(g)) |
| 197 | return true; |
| 198 | |
| 199 | if (Mode == MODE_DELETE && !Tdbp->GetNext()) |
| 200 | // Delete all documents |
| 201 | return Cmgp->DocDelete(g); |
| 202 | else if (Mode == MODE_INSERT) |
| 203 | Cmgp->MakeColumnGroups(g); |
| 204 | |
| 205 | return false; |
| 206 | } // end of OpenTableFile |
| 207 | |
| 208 | /***********************************************************************/ |
| 209 | /* GetRowID: return the RowID of last read record. */ |
no test coverage detected