| 1133 | |
| 1134 | |
| 1135 | void makeAbs(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result, |
| 1136 | int argsCount, const dsc** args) |
| 1137 | { |
| 1138 | fb_assert(argsCount == function->minArgCount); |
| 1139 | |
| 1140 | const dsc* value = args[0]; |
| 1141 | |
| 1142 | if (value->isNull()) |
| 1143 | { |
| 1144 | result->makeLong(0); |
| 1145 | result->setNull(); |
| 1146 | return; |
| 1147 | } |
| 1148 | |
| 1149 | switch (value->dsc_dtype) |
| 1150 | { |
| 1151 | case dtype_short: |
| 1152 | result->makeLong(value->dsc_scale); |
| 1153 | break; |
| 1154 | |
| 1155 | case dtype_long: |
| 1156 | if (dataTypeUtil->getDialect() == 1) |
| 1157 | result->makeDouble(); |
| 1158 | else |
| 1159 | result->makeInt64(value->dsc_scale); |
| 1160 | break; |
| 1161 | |
| 1162 | case dtype_real: |
| 1163 | case dtype_double: |
| 1164 | case dtype_int64: |
| 1165 | case dtype_int128: |
| 1166 | case dtype_dec64: |
| 1167 | case dtype_dec128: |
| 1168 | *result = *value; |
| 1169 | break; |
| 1170 | |
| 1171 | default: |
| 1172 | result->makeDouble(); |
| 1173 | break; |
| 1174 | } |
| 1175 | |
| 1176 | result->setNullable(value->isNullable()); |
| 1177 | } |
| 1178 | |
| 1179 | |
| 1180 | void makeAsciiChar(DataTypeUtilBase*, const SysFunction* function, dsc* result, |
nothing calls this directly
no test coverage detected