~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/rpl_utility.cc

  • Committer: Patrick Galbraith
  • Date: 2008-07-28 01:47:41 UTC
  • mto: (212.1.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 217.
  • Revision ID: patg@ishvara-20080728014741-yoasv5trt1ef9rha
Renamed FIELD_TYPE to DRIZZLE_TYPE

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
  uint32_t length= 0;
30
30
 
31
31
  switch (type(col)) {
32
 
  case FIELD_TYPE_NEWDECIMAL:
 
32
  case DRIZZLE_TYPE_NEWDECIMAL:
33
33
    length= my_decimal_get_binary_size(m_field_metadata[col] >> 8, 
34
34
                                       m_field_metadata[col] & 0xff);
35
35
    break;
36
 
  case FIELD_TYPE_DOUBLE:
 
36
  case DRIZZLE_TYPE_DOUBLE:
37
37
    length= m_field_metadata[col];
38
38
    break;
39
39
  /*
40
40
    The cases for SET and ENUM are include for completeness, however
41
 
    both are mapped to type FIELD_TYPE_STRING and their real types
 
41
    both are mapped to type DRIZZLE_TYPE_STRING and their real types
42
42
    are encoded in the field metadata.
43
43
  */
44
 
  case FIELD_TYPE_SET:
45
 
  case FIELD_TYPE_ENUM:
46
 
  case FIELD_TYPE_STRING:
 
44
  case DRIZZLE_TYPE_SET:
 
45
  case DRIZZLE_TYPE_ENUM:
 
46
  case DRIZZLE_TYPE_STRING:
47
47
  {
48
48
    uchar type= m_field_metadata[col] >> 8U;
49
 
    if ((type == FIELD_TYPE_SET) || (type == FIELD_TYPE_ENUM))
 
49
    if ((type == DRIZZLE_TYPE_SET) || (type == DRIZZLE_TYPE_ENUM))
50
50
      length= m_field_metadata[col] & 0x00ff;
51
51
    else
52
52
    {
60
60
    }
61
61
    break;
62
62
  }
63
 
  case FIELD_TYPE_YEAR:
64
 
  case FIELD_TYPE_TINY:
 
63
  case DRIZZLE_TYPE_YEAR:
 
64
  case DRIZZLE_TYPE_TINY:
65
65
    length= 1;
66
66
    break;
67
 
  case FIELD_TYPE_SHORT:
 
67
  case DRIZZLE_TYPE_SHORT:
68
68
    length= 2;
69
69
    break;
70
 
  case FIELD_TYPE_LONG:
 
70
  case DRIZZLE_TYPE_LONG:
71
71
    length= 4;
72
72
    break;
73
 
  case FIELD_TYPE_LONGLONG:
 
73
  case DRIZZLE_TYPE_LONGLONG:
74
74
    length= 8;
75
75
    break;
76
 
  case FIELD_TYPE_NULL:
 
76
  case DRIZZLE_TYPE_NULL:
77
77
    length= 0;
78
78
    break;
79
 
  case FIELD_TYPE_NEWDATE:
80
 
    length= 3;
81
 
    break;
82
 
  case FIELD_TYPE_TIME:
83
 
    length= 3;
84
 
    break;
85
 
  case FIELD_TYPE_TIMESTAMP:
 
79
  case DRIZZLE_TYPE_NEWDATE:
 
80
    length= 3;
 
81
    break;
 
82
  case DRIZZLE_TYPE_TIME:
 
83
    length= 3;
 
84
    break;
 
85
  case DRIZZLE_TYPE_TIMESTAMP:
86
86
    length= 4;
87
87
    break;
88
 
  case FIELD_TYPE_DATETIME:
 
88
  case DRIZZLE_TYPE_DATETIME:
89
89
    length= 8;
90
90
    break;
91
 
  case FIELD_TYPE_VARCHAR:
 
91
  case DRIZZLE_TYPE_VARCHAR:
92
92
  {
93
93
    length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length()
94
94
    assert(uint2korr(master_data) > 0);
95
95
    length+= length == 1 ? (uint32_t) *master_data : uint2korr(master_data);
96
96
    break;
97
97
  }
98
 
  case FIELD_TYPE_BLOB:
 
98
  case DRIZZLE_TYPE_BLOB:
99
99
  {
100
100
    length= uint4korr(master_data);
101
101
    length+= m_field_metadata[col];