~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/rpl_utility.cc

Merging trunk changes from over weekend.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
  case MYSQL_TYPE_SHORT:
70
70
    length= 2;
71
71
    break;
72
 
  case MYSQL_TYPE_INT24:
73
 
    length= 3;
74
 
    break;
75
72
  case MYSQL_TYPE_LONG:
76
73
    length= 4;
77
74
    break;
78
 
#ifdef HAVE_LONG_LONG
79
75
  case MYSQL_TYPE_LONGLONG:
80
76
    length= 8;
81
77
    break;
82
 
#endif
83
78
  case MYSQL_TYPE_NULL:
84
79
    length= 0;
85
80
    break;
96
91
  case MYSQL_TYPE_DATETIME:
97
92
    length= 8;
98
93
    break;
99
 
  case MYSQL_TYPE_BIT:
100
 
  {
101
 
    /*
102
 
      Decode the size of the bit field from the master.
103
 
        from_len is the length in bytes from the master
104
 
        from_bit_len is the number of extra bits stored in the master record
105
 
      If from_bit_len is not 0, add 1 to the length to account for accurate
106
 
      number of bytes needed.
107
 
    */
108
 
    uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff;
109
 
    uint from_bit_len= m_field_metadata[col] & 0x00ff;
110
 
    DBUG_ASSERT(from_bit_len <= 7);
111
 
    length= from_len + ((from_bit_len > 0) ? 1 : 0);
112
 
    break;
113
 
  }
114
94
  case MYSQL_TYPE_VARCHAR:
115
95
  {
116
96
    length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length()
122
102
  case MYSQL_TYPE_MEDIUM_BLOB:
123
103
  case MYSQL_TYPE_LONG_BLOB:
124
104
  case MYSQL_TYPE_BLOB:
125
 
  case MYSQL_TYPE_GEOMETRY:
126
105
  {
127
106
    /*
128
107
      Compute the length of the data. We cannot use get_length() here