| 3351 | } |
| 3352 | |
| 3353 | static int |
| 3354 | check_param_number(const PGresult *res, int param_num) |
| 3355 | { |
| 3356 | if (!res) |
| 3357 | return false; /* no way to display error message... */ |
| 3358 | if (param_num < 0 || param_num >= res->numParameters) |
| 3359 | { |
| 3360 | pqInternalNotice(&res->noticeHooks, |
| 3361 | "parameter number %d is out of range 0..%d", |
| 3362 | param_num, res->numParameters - 1); |
| 3363 | return false; |
| 3364 | } |
| 3365 | |
| 3366 | return true; |
| 3367 | } |
| 3368 | |
| 3369 | /* |
| 3370 | * returns NULL if the field_num is invalid |
no test coverage detected