MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / cdb2_column_value

Function cdb2_column_value

cdb2api/cdb2api.c:5296–5324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5294}
5295
5296void *cdb2_column_value(cdb2_hndl_tp *hndl, int col)
5297{
5298 if (hndl->fdb_hndl)
5299 hndl = hndl->fdb_hndl;
5300 CDB2SQLRESPONSE *lastresponse = hndl->lastresponse;
5301 /* sanity check. just in case. */
5302 if (lastresponse == NULL)
5303 return NULL;
5304 /* data came back in the child column structure */
5305 if (lastresponse->value != NULL) {
5306 /* handle empty values */
5307 if (lastresponse->value[col]->value.len == 0 && lastresponse->value[col]->has_isnull != 1 &&
5308 lastresponse->value[col]->isnull != 1) {
5309 return (void *)"";
5310 }
5311 return lastresponse->value[col]->value.data;
5312 }
5313 /* sqlite row */
5314 if (hndl->lastresponse->has_sqlite_row)
5315 return lastresponse->sqlite_row.data;
5316 /* data came back in the parent CDB2SQLRESPONSE structure */
5317 if (col_values_flattened(lastresponse)) {
5318 /* handle empty values */
5319 if (lastresponse->values[col].len == 0 && !lastresponse->isnulls[col])
5320 return (void *)"";
5321 return lastresponse->values[col].data;
5322 }
5323 return NULL;
5324}
5325
5326int cdb2_bind_param(cdb2_hndl_tp *hndl, const char *varname, int type,
5327 const void *varaddr, int length)

Callers 15

db_generatorFunction · 0.85
print_columnFunction · 0.85
append_columnMethod · 0.85
run_statementFunction · 0.85
get_portsMethod · 0.85
last_costFunction · 0.85
replayFunction · 0.85
find_match_lsnFunction · 0.85
update_records_thdFunction · 0.85
record_countFunction · 0.85
select_and_update_orphanFunction · 0.85
update_intFunction · 0.85

Calls 1

col_values_flattenedFunction · 0.85

Tested by 15

masterFunction · 0.68
read_nodeFunction · 0.68
updaterFunction · 0.68
test_01Function · 0.68
test_02Function · 0.68
test_03Function · 0.68
test_04Function · 0.68
test_bind_arrayFunction · 0.68
test_bind_array2Function · 0.68
test_bind_blob_arrayFunction · 0.68
test_pass_array_to_spFunction · 0.68
test_bind_array_in_spFunction · 0.68