** Call this with parent emit mutex held ** Will allocate space for 'ntypes' columns */
| 1051 | ** Will allocate space for 'ntypes' columns |
| 1052 | */ |
| 1053 | static 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. */ |
| 1072 | static int sqlite_str_to_type(const char *ctype) |
no test coverage detected