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

Function dscToMetaItem

src/jrd/PreparedStatement.cpp:49–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 };
48
49 void dscToMetaItem(const dsc* desc, MsgMetadata::Item& item)
50 {
51 item.finished = true;
52
53 switch (desc->dsc_dtype)
54 {
55 case dtype_text:
56 item.type = SQL_TEXT;
57 item.charSet = desc->dsc_ttype();
58 item.length = desc->dsc_length;
59 break;
60
61 case dtype_varying:
62 item.type = SQL_VARYING;
63 item.charSet = desc->dsc_ttype();
64 fb_assert(desc->dsc_length >= sizeof(USHORT));
65 item.length = desc->dsc_length - sizeof(USHORT);
66 break;
67
68 case dtype_short:
69 item.type = SQL_SHORT;
70 item.scale = desc->dsc_scale;
71 item.length = sizeof(SSHORT);
72 break;
73
74 case dtype_long:
75 item.type = SQL_LONG;
76 item.scale = desc->dsc_scale;
77 item.length = sizeof(SLONG);
78 break;
79
80 case dtype_quad:
81 item.type = SQL_QUAD;
82 item.scale = desc->dsc_scale;
83 item.length = sizeof(SLONG) * 2;
84 break;
85
86 case dtype_int64:
87 item.type = SQL_INT64;
88 item.scale = desc->dsc_scale;
89 item.length = sizeof(SINT64);
90 break;
91
92 case dtype_real:
93 item.type = SQL_FLOAT;
94 item.length = sizeof(float);
95 break;
96
97 case dtype_double:
98 item.type = SQL_DOUBLE;
99 item.length = sizeof(double);
100 break;
101
102 case dtype_dec64:
103 item.type = SQL_DEC16;
104 item.length = sizeof(Decimal64);
105 break;
106

Callers 1

parseDsqlMessageMethod · 0.85

Calls 2

dsc_ttypeMethod · 0.80
getTextTypeMethod · 0.80

Tested by

no test coverage detected