~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/libdrizzle.c

  • Committer: Brian Aker
  • Date: 2009-03-10 06:49:18 UTC
  • mto: This revision was merged to the branch mainline in revision 925.
  • Revision ID: brian@tangent.org-20090310064918-pz3pubqckvpqqioo
Remove dead COM for Field lists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
  return drizzleclient_unpack_fields(query, drizzle->field_count, 1);
208
208
}
209
209
 
210
 
 
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
 
**************************************************************************/
217
 
 
218
 
DRIZZLE_RES *
219
 
drizzleclient_list_fields(DRIZZLE *drizzle, const char *table, const char *wild)
220
 
{
221
 
  DRIZZLE_RES   *result;
222
 
  DRIZZLE_FIELD *fields;
223
 
  char buff[257], *end;
224
 
 
225
 
  end= strncpy(buff, table, 128) + 128;
226
 
  end= strncpy(end+1, wild ? wild : "", 128) + 128;
227
 
 
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)))
232
 
    return(NULL);
233
 
 
234
 
  if (!(result = (DRIZZLE_RES *) malloc(sizeof(DRIZZLE_RES))))
235
 
    return(NULL);
236
 
 
237
 
  memset(result, 0, sizeof(DRIZZLE_RES));
238
 
 
239
 
  result->methods= drizzle->methods;
240
 
  drizzle->fields=0;
241
 
  result->field_count = drizzle->field_count;
242
 
  result->fields= fields;
243
 
  result->eof=1;
244
 
  return(result);
245
 
}
246
 
 
247
210
int
248
211
drizzleclient_shutdown(DRIZZLE *drizzle)
249
212
{