MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / setType

Method setType

src/common/MsgMetadata.cpp:47–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void 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
74void MetadataBuilder::setSubType(CheckStatusWrapper* status, unsigned index, int subType)
75{

Callers

nothing calls this directly

Calls 2

sqlTypeToDscFunction · 0.85
stuffExceptionMethod · 0.45

Tested by

no test coverage detected