~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/client.c

  • Committer: Brian Aker
  • Date: 2008-09-16 09:41:23 UTC
  • Revision ID: brian@gir.lan-20080916094123-2ws792vn896n2g53
Fixed uint/ushort issue in libdrizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
        strcpy(net->sqlstate, sqlstate_get_unknown());
147
147
      }
148
148
 
149
 
      strncpy(net->last_error,(char*) pos, min((uint) len,
 
149
      strncpy(net->last_error,(char*) pos, min((uint32_t) len,
150
150
              (uint32_t) sizeof(net->last_error)-1));
151
151
    }
152
152
    else
380
380
static int32_t
381
381
read_one_row(DRIZZLE *drizzle, uint32_t fields, DRIZZLE_ROW row, uint32_t *lengths)
382
382
{
383
 
  uint field;
 
383
  uint32_t field;
384
384
  uint32_t pkt_len,len;
385
385
  unsigned char *pos, *prev_pos, *end_pos;
386
386
  NET *net= &drizzle->net;
502
502
{
503
503
  switch (option) {
504
504
  case DRIZZLE_OPT_CONNECT_TIMEOUT:
505
 
    drizzle->options.connect_timeout= *(uint*) arg;
 
505
    drizzle->options.connect_timeout= *(uint32_t*) arg;
506
506
    break;
507
507
  case DRIZZLE_OPT_READ_TIMEOUT:
508
 
    drizzle->options.read_timeout= *(uint*) arg;
 
508
    drizzle->options.read_timeout= *(uint32_t*) arg;
509
509
    break;
510
510
  case DRIZZLE_OPT_WRITE_TIMEOUT:
511
 
    drizzle->options.write_timeout= *(uint*) arg;
 
511
    drizzle->options.write_timeout= *(uint32_t*) arg;
512
512
    break;
513
513
  case DRIZZLE_OPT_COMPRESS:
514
514
    drizzle->options.compress= 1;      /* Remember for connect */
515
515
    drizzle->options.client_flag|= CLIENT_COMPRESS;
516
516
    break;
517
517
  case DRIZZLE_OPT_LOCAL_INFILE:      /* Allow LOAD DATA LOCAL ?*/
518
 
    if (!arg || (*(uint*) arg) ? 1 : 0)
 
518
    if (!arg || (*(uint32_t*) arg) ? 1 : 0)
519
519
      drizzle->options.client_flag|= CLIENT_LOCAL_FILES;
520
520
    else
521
521
      drizzle->options.client_flag&= ~CLIENT_LOCAL_FILES;
598
598
uint32_t
599
599
drizzle_get_server_version(const DRIZZLE *drizzle)
600
600
{
601
 
  uint major, minor, version;
 
601
  uint32_t major, minor, version;
602
602
  char *pos= drizzle->server_version, *end_pos;
603
 
  major=   (uint) strtoul(pos, &end_pos, 10);  pos=end_pos+1;
604
 
  minor=   (uint) strtoul(pos, &end_pos, 10);  pos=end_pos+1;
605
 
  version= (uint) strtoul(pos, &end_pos, 10);
 
603
  major=   (uint32_t) strtoul(pos, &end_pos, 10);  pos=end_pos+1;
 
604
  minor=   (uint32_t) strtoul(pos, &end_pos, 10);  pos=end_pos+1;
 
605
  version= (uint32_t) strtoul(pos, &end_pos, 10);
606
606
  return (uint32_t) major*10000L+(uint32_t) (minor*100+version);
607
607
}
608
608