207
207
return drizzleclient_unpack_fields(query, drizzle->field_count, 1);
211
/**************************************************************************
212
List all fields in a table
213
If wild is given then only the fields matching wild is returned
214
Instead of this use query:
215
show fields in 'table' like "wild"
216
**************************************************************************/
219
drizzleclient_list_fields(DRIZZLE *drizzle, const char *table, const char *wild)
222
DRIZZLE_FIELD *fields;
223
char buff[257], *end;
225
end= strncpy(buff, table, 128) + 128;
226
end= strncpy(end+1, wild ? wild : "", 128) + 128;
228
drizzleclient_free_old_query(drizzle);
229
if (simple_command(drizzle, COM_FIELD_LIST, (unsigned char*) buff,
230
(uint32_t) (end-buff), 1) ||
231
!(fields= (*drizzle->methods->list_fields)(drizzle)))
234
if (!(result = (DRIZZLE_RES *) malloc(sizeof(DRIZZLE_RES))))
237
memset(result, 0, sizeof(DRIZZLE_RES));
239
result->methods= drizzle->methods;
241
result->field_count = drizzle->field_count;
242
result->fields= fields;
248
211
drizzleclient_shutdown(DRIZZLE *drizzle)