| 45 | } |
| 46 | |
| 47 | void MetadataBuilder::setType(CheckStatusWrapper* status, unsigned index, unsigned type) |
| 48 | { |
| 49 | try |
| 50 | { |
| 51 | MutexLockGuard g(mtx, FB_FUNCTION); |
| 52 | |
| 53 | indexError(index, "setType"); |
| 54 | msgMetadata->items[index].type = type; |
| 55 | if (!msgMetadata->items[index].length) |
| 56 | { |
| 57 | unsigned dtype; |
| 58 | fb_utils::sqlTypeToDsc(0, type, 0, &dtype, NULL, NULL, NULL); |
| 59 | if (dtype < DTYPE_TYPE_MAX) |
| 60 | msgMetadata->items[index].length = type_lengths[dtype]; |
| 61 | } |
| 62 | msgMetadata->items[index].nullable = type & 1; |
| 63 | |
| 64 | // Setting type & length is enough for an item to be ready for use |
| 65 | if (msgMetadata->items[index].length) |
| 66 | msgMetadata->items[index].finished = true; |
| 67 | } |
| 68 | catch (const Exception& ex) |
| 69 | { |
| 70 | ex.stuffException(status); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | void MetadataBuilder::setSubType(CheckStatusWrapper* status, unsigned index, int subType) |
| 75 | { |
nothing calls this directly
no test coverage detected