* Fill the structure with data from database */
| 233 | * Fill the structure with data from database |
| 234 | */ |
| 235 | static int dbt_convert_result(db_con_t* _h, db_res_t* _r) |
| 236 | { |
| 237 | if (!_h || !_r) { |
| 238 | LM_ERR("invalid parameter\n"); |
| 239 | return -1; |
| 240 | } |
| 241 | if (dbt_get_columns(_h, _r) < 0) { |
| 242 | LM_ERR("failed to get column names\n"); |
| 243 | return -2; |
| 244 | } |
| 245 | |
| 246 | if (dbt_convert_rows(_h, _r) < 0) { |
| 247 | LM_ERR("failed to convert rows\n"); |
| 248 | db_free_columns(_r); |
| 249 | return -3; |
| 250 | } |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | /* |
| 255 | * Retrieve result set |
no test coverage detected