| query_len = sprintf(query, "CREATE TEMPORARY TABLE temp SELECT ");
try it out with asprintf().
but you have to define at compile time the following -D_GNU_SOURCE
maybe you allocates not enough place for query. asprintf do it for you.
char *query;
int query_len;
query_len=asprintf(&query
Hello,
I seem to have a problem with the C API, briefly I try to select something
into a temporary table and then do three selects, two of which are from the
temporary table created. Program segfaults.
When I comment all but temp table creation, program works, and same happens
for a non-temp tab