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

Function runtag

tests/tools/bound.cpp:15–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13static string at("@");
14
15int runtag(cdb2_hndl_tp *h, string &sql, vector<int> &types)
16{
17 int rc =
18 cdb2_run_statement_typed(h, sql.c_str(), types.size(), types.data());
19 if (rc != 0) {
20 fprintf(stderr, "cdb2_run_statement_typed failed: %d %s\n", rc,
21 cdb2_errstr(h));
22 return rc;
23 }
24
25 rc = cdb2_next_record(h);
26 while (rc == CDB2_OK) {
27 int n = cdb2_numcolumns(h);
28 int i;
29 const char *c = "";
30 for (i = 0; i < n; ++i) {
31 printf("%s%s", c, (char *)cdb2_column_value(h, i));
32 c = ", ";
33 }
34 puts("");
35 rc = cdb2_next_record(h);
36 }
37
38 if (rc == CDB2_OK_DONE)
39 rc = 0;
40 else
41 fprintf(stderr, "cdb2_next_record failed: %d %s\n", rc, cdb2_errstr(h));
42 return rc;
43}
44
45void add_param(string &sp, string &sql, vector<int> &types, string name,
46 string extra1 = "", string extra2 = "")

Callers 1

mainFunction · 0.70

Calls 5

cdb2_run_statement_typedFunction · 0.85
cdb2_errstrFunction · 0.85
cdb2_next_recordFunction · 0.85
cdb2_numcolumnsFunction · 0.85
cdb2_column_valueFunction · 0.85

Tested by

no test coverage detected