| 1196 | |
| 1197 | |
| 1198 | void makeBin(DataTypeUtilBase*, const SysFunction* function, dsc* result, |
| 1199 | int argsCount, const dsc** args) |
| 1200 | { |
| 1201 | fb_assert(argsCount >= function->minArgCount); |
| 1202 | |
| 1203 | bool isNullable = false; |
| 1204 | bool isNull = false; |
| 1205 | UCHAR t = dtype_long; |
| 1206 | |
| 1207 | for (int i = 0; i < argsCount; ++i) |
| 1208 | { |
| 1209 | if (args[i]->isNullable()) |
| 1210 | isNullable = true; |
| 1211 | |
| 1212 | if (args[i]->isNull()) |
| 1213 | { |
| 1214 | isNull = true; |
| 1215 | continue; |
| 1216 | } |
| 1217 | |
| 1218 | if (!args[i]->isExact() || args[i]->dsc_scale != 0) |
| 1219 | { |
| 1220 | status_exception::raise( |
| 1221 | Arg::Gds(isc_expression_eval_err) << |
| 1222 | Arg::Gds(isc_sysf_argmustbe_exact) << Arg::Str(function->name)); |
| 1223 | } |
| 1224 | |
| 1225 | if (args[i]->isExact()) |
| 1226 | t = MAX(t, args[i]->dsc_dtype); |
| 1227 | } |
| 1228 | |
| 1229 | result->clear(); |
| 1230 | result->dsc_dtype = t; |
| 1231 | result->dsc_length = type_lengths[t]; |
| 1232 | result->setNullable(isNullable); |
| 1233 | if (isNull) |
| 1234 | result->setNull(); |
| 1235 | } |
| 1236 | |
| 1237 | |
| 1238 | void makeBinShift(DataTypeUtilBase*, const SysFunction* function, dsc* result, |
nothing calls this directly
no test coverage detected