Write out field data type. Taking special care to declare international text.
| 83 | // Write out field data type. |
| 84 | // Taking special care to declare international text. |
| 85 | void DsqlCompilerScratch::putDtype(const TypeClause* field, bool useSubType) |
| 86 | { |
| 87 | #ifdef DEV_BUILD |
| 88 | // Check if the field describes a known datatype |
| 89 | |
| 90 | if (field->dtype > FB_NELEM(blr_dtypes) || !blr_dtypes[field->dtype]) |
| 91 | { |
| 92 | SCHAR buffer[100]; |
| 93 | |
| 94 | sprintf(buffer, "Invalid dtype %d in BlockNode::putDtype", field->dtype); |
| 95 | ERRD_bugcheck(buffer); |
| 96 | } |
| 97 | #endif |
| 98 | |
| 99 | if (field->notNull) |
| 100 | appendUChar(blr_not_nullable); |
| 101 | |
| 102 | if (field->typeOfName.hasData()) |
| 103 | { |
| 104 | if (field->typeOfTable.hasData()) |
| 105 | { |
| 106 | if (field->explicitCollation) |
| 107 | { |
| 108 | appendUChar(blr_column_name2); |
| 109 | appendUChar(field->fullDomain ? blr_domain_full : blr_domain_type_of); |
| 110 | appendMetaString(field->typeOfTable.c_str()); |
| 111 | appendMetaString(field->typeOfName.c_str()); |
| 112 | appendUShort(field->textType); |
| 113 | } |
| 114 | else |
| 115 | { |
| 116 | appendUChar(blr_column_name); |
| 117 | appendUChar(field->fullDomain ? blr_domain_full : blr_domain_type_of); |
| 118 | appendMetaString(field->typeOfTable.c_str()); |
| 119 | appendMetaString(field->typeOfName.c_str()); |
| 120 | } |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | if (field->explicitCollation) |
| 125 | { |
| 126 | appendUChar(blr_domain_name2); |
| 127 | appendUChar(field->fullDomain ? blr_domain_full : blr_domain_type_of); |
| 128 | appendMetaString(field->typeOfName.c_str()); |
| 129 | appendUShort(field->textType); |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | appendUChar(blr_domain_name); |
| 134 | appendUChar(field->fullDomain ? blr_domain_full : blr_domain_type_of); |
| 135 | appendMetaString(field->typeOfName.c_str()); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | switch (field->dtype) |
no test coverage detected