/ GetTable: makes a new Table Description Block. */ /
| 201 | /* GetTable: makes a new Table Description Block. */ |
| 202 | /***********************************************************************/ |
| 203 | PTDB VCTDEF::GetTable(PGLOBAL g, MODE mode) |
| 204 | { |
| 205 | /*********************************************************************/ |
| 206 | /* Allocate a TDB of the proper type. */ |
| 207 | /* Column blocks will be allocated only when needed. */ |
| 208 | /*********************************************************************/ |
| 209 | // Mapping not used for insert (except for true VEC not split tables) |
| 210 | // or when UseTemp is forced |
| 211 | bool map = Mapped && (Estimate || mode != MODE_INSERT) && |
| 212 | !(UseTemp() == TMP_FORCE && |
| 213 | (mode == MODE_UPDATE || mode == MODE_DELETE)); |
| 214 | PTXF txfp; |
| 215 | PTDB tdbp; |
| 216 | |
| 217 | if (Multiple) { |
| 218 | strcpy(g->Message, MSG(NO_MUL_VCT)); |
| 219 | return NULL; |
| 220 | } // endif Multiple |
| 221 | |
| 222 | if (Split) { |
| 223 | if (map) |
| 224 | txfp = new(g) VMPFAM(this); |
| 225 | else |
| 226 | txfp = new(g) VECFAM(this); |
| 227 | |
| 228 | } else if (Huge) |
| 229 | txfp = new(g) BGVFAM(this); |
| 230 | else if (map) |
| 231 | txfp = new(g) VCMFAM(this); |
| 232 | else |
| 233 | txfp = new(g) VCTFAM(this); |
| 234 | |
| 235 | tdbp = new(g) TDBVCT(this, txfp); |
| 236 | |
| 237 | /*********************************************************************/ |
| 238 | /* For block tables, get eventually saved optimization values. */ |
| 239 | /*********************************************************************/ |
| 240 | if (mode != MODE_INSERT) |
| 241 | if (tdbp->GetBlockValues(g)) |
| 242 | PushWarning(g, tdbp); |
| 243 | // return NULL; // causes a crash when deleting index |
| 244 | |
| 245 | return tdbp; |
| 246 | } // end of GetTable |
| 247 | |
| 248 | /* --------------------------- Class TDBVCT -------------------------- */ |
| 249 |
nothing calls this directly
no test coverage detected