~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/column.c

  • Committer: Monty Taylor
  • Date: 2010-12-27 18:39:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101227183911-atgh0kcubflay0b9
Added back INNOBASE_SKIP_WARNINGS for solaris. Also dealt with unused params.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
static drizzle_column_type_drizzle_t _column_type_drizzle_map_from[]=
66
66
{
67
67
 DRIZZLE_COLUMN_TYPE_DRIZZLE_MAX, /* 0 */
68
 
 DRIZZLE_COLUMN_TYPE_DRIZZLE_BOOLEAN,
 
68
 DRIZZLE_COLUMN_TYPE_DRIZZLE_TINY,
69
69
 DRIZZLE_COLUMN_TYPE_DRIZZLE_MAX,
70
70
 DRIZZLE_COLUMN_TYPE_DRIZZLE_LONG,
71
71
 DRIZZLE_COLUMN_TYPE_DRIZZLE_MAX,
364
364
      return NULL;
365
365
    }
366
366
 
367
 
    column->result = result;
368
 
    /* SET BELOW: column->next */
369
 
    column->prev = NULL;
370
 
    column->options= DRIZZLE_COLUMN_ALLOCATED;
371
 
    column->catalog[0] = '\0';
372
 
    column->db[0] = '\0';
373
 
    column->table[0] = '\0';
374
 
    column->orig_table[0] = '\0';
375
 
    column->name[0] = '\0';
376
 
    column->orig_name[0] = '\0';
377
 
    column->charset = 0;
378
 
    column->size = 0;
379
 
    column->max_size = 0;
380
 
    column->type = 0;
381
 
    column->flags = 0;
382
 
    column->decimals = 0;
383
 
    /* UNSET: column->default_value */
384
 
    column->default_value_size = 0;
385
 
 
 
367
    memset(column, 0, sizeof(drizzle_column_st));
 
368
    column->options|= DRIZZLE_COLUMN_ALLOCATED;
386
369
  }
387
370
  else
388
 
  {
389
 
    column->result = result;
390
 
    /* SET BELOW: column->next */
391
 
    column->prev = NULL;
392
 
    column->options= 0;
393
 
    column->catalog[0] = '\0';
394
 
    column->db[0] = '\0';
395
 
    column->table[0] = '\0';
396
 
    column->orig_table[0] = '\0';
397
 
    column->name[0] = '\0';
398
 
    column->orig_name[0] = '\0';
399
 
    column->charset = 0;
400
 
    column->size = 0;
401
 
    column->max_size = 0;
402
 
    column->type = 0;
403
 
    column->flags = 0;
404
 
    column->decimals = 0;
405
 
    /* UNSET: column->default_value */
406
 
    column->default_value_size = 0;
407
 
  }
 
371
    memset(column, 0, sizeof(drizzle_column_st));
408
372
 
409
373
  column->result= result;
410
374
 
518
482
 
519
483
drizzle_return_t drizzle_column_skip(drizzle_result_st *result)
520
484
{
521
 
  drizzle_return_t ret;
522
485
  if (drizzle_state_none(result->con))
523
486
  {
524
487
    result->options|= DRIZZLE_RESULT_SKIP_COLUMN;
526
489
    drizzle_state_push(result->con, drizzle_state_column_read);
527
490
    drizzle_state_push(result->con, drizzle_state_packet_read);
528
491
  }
529
 
  ret= drizzle_state_loop(result->con);
530
 
  result->options&= ~DRIZZLE_RESULT_SKIP_COLUMN;
531
 
  return ret;
532
 
}
533
 
 
534
 
drizzle_return_t drizzle_column_skip_all(drizzle_result_st *result)
535
 
{
536
 
  drizzle_return_t ret;
537
 
  uint16_t it;
538
 
 
539
 
  for (it= 1; it <= result->column_count; it++)
540
 
  {
541
 
    ret= drizzle_column_skip(result);
542
 
    if (ret != DRIZZLE_RETURN_OK)
543
 
      return ret;
544
 
  }
545
 
 
546
 
  return DRIZZLE_RETURN_OK;
 
492
 
 
493
  return drizzle_state_loop(result->con);
547
494
}
548
495
 
549
496
drizzle_column_st *drizzle_column_read(drizzle_result_st *result,
806
753
    con->buffer_ptr+= con->packet_size;
807
754
    con->buffer_size-= con->packet_size;
808
755
    con->packet_size= 0;
809
 
    con->result->column_current++;
810
756
 
811
 
    drizzle_state_pop(con);
 
757
    drizzle_state_push(con, drizzle_state_packet_read);
812
758
  }
813
759
  else
814
760
  {