static char * esql_mysac_escape(Esql *e, unsigned int *len, const char *fmt, va_list args) { MYSAC *m; Eina_Bool backslashes = EINA_TRUE; char *ret; m = e->backend.db; if (m->status & 512) /* SERVER_STATUS_NO_BACKSLASH_ESCAPES */ backslashes = EINA_FALSE; ret = esql_query_escape(backslashes, len, fmt, args); if (*len > m->bufsize - 5) /* mysac is dumb and uses a user-allocated buffer, so we have to manually resize it */ { char *tmp; tmp = realloc(m->buf, (*len) * 2); if (!tmp) /* we're so f****d */ { free(ret); ERR("Alloc! We're in trouble!"); return NULL; } m->buf = tmp; m->bufsize = (*len) * 2; } return ret; }
for (i = 0; i < res->row_count; i++) { r = esql_row_calloc(1); EINA_SAFETY_ON_NULL_RETURN(r); r->res = res; esql_postgresql_row_init(r, i); res->rows = eina_inlist_append(res->rows, EINA_INLIST_GET(r)); } } static char * esql_postgresql_escape(Esql *e __UNUSED__, unsigned int *len, const char *fmt, va_list args) { char *ret; ret = esql_query_escape(EINA_TRUE, len, fmt, args); return ret; } static void esql_postgresql_row_init(Esql_Row *r, int row_num) { PGresult *pres; Esql_Res *res; Eina_Value *sval; unsigned int i, cols; res = r->res; pres = res->backend.res; cols = res->desc->member_count; sval = &(r->value);