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

Function new_col_info

lua/sp.c:1053–1069  ·  view source on GitHub ↗

** Call this with parent emit mutex held ** Will allocate space for 'ntypes' columns */

Source from the content-addressed store, hash-verified

1051** Will allocate space for 'ntypes' columns
1052*/
1053static void new_col_info(SP sp, int ntypes)
1054{
1055 SP parent = sp->parent;
1056 int prev = parent->ntypes;
1057 if (prev >= ntypes) {
1058 return;
1059 }
1060 parent->clntname =
1061 realloc(parent->clntname, ntypes * sizeof(parent->clntname[0]));
1062 parent->clnttype =
1063 realloc(parent->clnttype, ntypes * sizeof(parent->clnttype[0]));
1064 for (int i = prev; i < ntypes; ++i) {
1065 parent->clntname[i] = NULL;
1066 parent->clnttype[i] = -1;
1067 }
1068 parent->ntypes = ntypes;
1069}
1070
1071/* TODO: delete it once typestr_to_type starts giving decimals. */
1072static int sqlite_str_to_type(const char *ctype)

Callers 4

db_column_nameFunction · 0.85
db_column_typeFunction · 0.85
db_num_columnsFunction · 0.85
l_send_back_rowFunction · 0.85

Calls 1

reallocFunction · 0.85

Tested by

no test coverage detected