~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/rpl_utility.cc

  • Committer: Monty Taylor
  • Date: 2008-08-04 22:01:39 UTC
  • mto: (261.1.4 drizzle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804220139-fy862jc9lykayvka
Moved libdrizzle.ver.in to libdrizzle.ver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include <drizzled/server_includes.h>
17
16
#include "rpl_utility.h"
18
17
#include "rpl_rli.h"
19
18
#include <drizzled/drizzled_error_messages.h>
 
19
#include <libdrizzle/gettext.h>
20
20
 
21
21
/*********************************************************************
22
22
 *                   table_def member definitions                    *
26
26
  This function returns the field size in raw bytes based on the type
27
27
  and the encoded field data from the master's raw data.
28
28
*/
29
 
uint32_t table_def::calc_field_size(uint32_t col, unsigned char *master_data) const
 
29
uint32_t table_def::calc_field_size(uint col, uchar *master_data) const
30
30
{
31
31
  uint32_t length= 0;
32
32
 
43
43
    both are mapped to type DRIZZLE_TYPE_STRING and their real types
44
44
    are encoded in the field metadata.
45
45
  */
 
46
  case DRIZZLE_TYPE_SET:
46
47
  case DRIZZLE_TYPE_ENUM:
47
48
  {
48
49
    length= m_field_metadata[col] & 0x00ff;
51
52
  case DRIZZLE_TYPE_TINY:
52
53
    length= 1;
53
54
    break;
 
55
  case DRIZZLE_TYPE_SHORT:
 
56
    length= 2;
 
57
    break;
54
58
  case DRIZZLE_TYPE_LONG:
55
59
    length= 4;
56
60
    break;
96
100
 
97
101
*/
98
102
int
99
 
table_def::compatible_with(Relay_log_info const *rli_arg, Table *table)
 
103
table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table)
100
104
  const
101
105
{
102
106
  /*
103
107
    We only check the initial columns for the tables.
104
108
  */
105
 
  uint32_t const cols_to_check= cmin(table->s->fields, size());
 
109
  uint const cols_to_check= min(table->s->fields, size());
106
110
  int error= 0;
107
111
  Relay_log_info const *rli= const_cast<Relay_log_info*>(rli_arg);
108
112
 
109
113
  TABLE_SHARE const *const tsh= table->s;
110
114
 
111
 
  for (uint32_t col= 0 ; col < cols_to_check ; ++col)
 
115
  for (uint col= 0 ; col < cols_to_check ; ++col)
112
116
  {
113
117
    if (table->field[col]->type() != type(col))
114
118
    {