| 261 | |
| 262 | |
| 263 | static void post_nothrow(const unsigned lenToAdd, const ISC_STATUS* toAdd, FbStatusVector* statusVector) |
| 264 | /************************************** |
| 265 | * |
| 266 | * E R R _ p o s t _ n o t h r o w |
| 267 | * |
| 268 | ************************************** |
| 269 | * |
| 270 | * Functional description |
| 271 | * Populate a status vector. |
| 272 | * |
| 273 | **************************************/ |
| 274 | { |
| 275 | // check status to add |
| 276 | if (lenToAdd == 0) // nothing to do |
| 277 | return; |
| 278 | fb_assert(toAdd[0] == isc_arg_gds); |
| 279 | |
| 280 | // use default from tdbb when no vector specified |
| 281 | if (!statusVector) |
| 282 | statusVector = JRD_get_thread_data()->tdbb_status_vector; |
| 283 | |
| 284 | if (!(statusVector->getState() & IStatus::STATE_ERRORS)) |
| 285 | { |
| 286 | // this is a blank status vector just stuff the status |
| 287 | statusVector->setErrors2(lenToAdd, toAdd); |
| 288 | return; |
| 289 | } |
| 290 | |
| 291 | const ISC_STATUS* oldVector = statusVector->getErrors(); |
| 292 | unsigned lenOld = fb_utils::statusLength(oldVector); |
| 293 | |
| 294 | // check for duplicated error code |
| 295 | if (fb_utils::subStatus(oldVector, lenOld, toAdd, lenToAdd) != ~0u) |
| 296 | return; |
| 297 | |
| 298 | // copy memory from/to |
| 299 | StaticStatusVector tmp; |
| 300 | tmp.assign(oldVector, lenOld); |
| 301 | tmp.append(toAdd, lenToAdd); |
| 302 | statusVector->setErrors2(tmp.getCount(), tmp.begin()); |
| 303 | } |
| 304 | |
| 305 | |
| 306 | void ERR_post(const Arg::StatusVector& v) |
no test coverage detected