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

Method append_header

tools/cdb2sql/cdb2sql.cpp:1168–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166};
1167
1168int Result_buffer::append_header(cdb2_hndl_tp *hndl) {
1169 std::list<std::string> header;
1170 int ncols;
1171 char *col;
1172
1173 ncols = cdb2_numcolumns(cdb2h);
1174 if (ncols == 0) {
1175 return 0;
1176 }
1177
1178 for (int i = 0; i < ncols; i ++) {
1179 col = (char *) cdb2_column_name(cdb2h, i);
1180 if (printmode & DISP_COLTYPE) {
1181 std::string typeStr(col);
1182 typeStr.append(" COLTYPE");
1183 header.push_back(typeStr);
1184 width.push_back(typeStr.length());
1185 }
1186 header.push_back(std::string(col));
1187 width.push_back(strlen(col));
1188 }
1189 result.push_back(header);
1190 return 0;
1191}
1192
1193int Result_buffer::append_row(cdb2_hndl_tp *hndl) {
1194 std::list<std::string> row;

Callers 1

run_statementFunction · 0.80

Calls 2

cdb2_numcolumnsFunction · 0.85
cdb2_column_nameFunction · 0.85

Tested by

no test coverage detected