/ ReadColumn: what this routine does is to access the last line */ read from the corresponding table and extract from it the field */ corresponding to this column. */ /
| 459 | /* corresponding to this column. */ |
| 460 | /***********************************************************************/ |
| 461 | void BINCOL::ReadColumn(PGLOBAL g) |
| 462 | { |
| 463 | char *p = NULL; |
| 464 | int rc; |
| 465 | PTDBFIX tdbp = (PTDBFIX)To_Tdb; |
| 466 | |
| 467 | if (trace(2)) |
| 468 | htrc("BIN ReadColumn: col %s R%d coluse=%.4X status=%.4X buf_type=%d\n", |
| 469 | Name, tdbp->GetTdb_No(), ColUse, Status, Buf_Type); |
| 470 | |
| 471 | /*********************************************************************/ |
| 472 | /* If physical reading of the line was deferred, do it now. */ |
| 473 | /*********************************************************************/ |
| 474 | if (!tdbp->IsRead()) |
| 475 | if ((rc = tdbp->ReadBuffer(g)) != RC_OK) { |
| 476 | if (rc == RC_EF) |
| 477 | snprintf(g->Message, sizeof(g->Message), MSG(INV_DEF_READ), rc); |
| 478 | |
| 479 | throw 11; |
| 480 | } // endif |
| 481 | |
| 482 | p = tdbp->To_Line + Deplac; |
| 483 | |
| 484 | /*********************************************************************/ |
| 485 | /* Set Value from the line field. */ |
| 486 | /*********************************************************************/ |
| 487 | if (Eds) { |
| 488 | for (int i = 0; i < Lim; i++) |
| 489 | if (Eds == 'B' && Endian == 'L') |
| 490 | Buff[i] = p[N - i - 1]; |
| 491 | else if (Eds == 'L' && Endian == 'B') |
| 492 | Buff[M - i - 1] = p[i]; |
| 493 | else if (Endian == 'B') |
| 494 | Buff[M - i - 1] = p[N - i - 1]; |
| 495 | else |
| 496 | Buff[i] = p[i]; |
| 497 | |
| 498 | p = Buff; |
| 499 | } // endif Eds |
| 500 | |
| 501 | switch (Fmt) { |
| 502 | case 'X': // Standard not converted values |
| 503 | if (Eds && IsTypeChar(Buf_Type)) |
| 504 | Value->SetValueNonAligned<longlong>(p); |
| 505 | else |
| 506 | Value->SetBinValue(p); |
| 507 | |
| 508 | break; |
| 509 | case 'S': // Short integer |
| 510 | Value->SetValueNonAligned<short>(p); |
| 511 | break; |
| 512 | case 'T': // Tiny integer |
| 513 | Value->SetValue(*p); |
| 514 | break; |
| 515 | case 'I': // Integer |
| 516 | Value->SetValueNonAligned<int>(p); |
| 517 | break; |
| 518 | case 'G': // Large (great) integer |
nothing calls this directly
no test coverage detected