~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/rpl_utility.cc

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
 
189
189
  for (uint col= 0 ; col < cols_to_check ; ++col)
190
190
  {
191
 
    if (table->field[col]->type() != type(col))
 
191
    Field *const field= table->field[col];
 
192
    if (field->type() != type(col))
192
193
    {
193
194
      DBUG_ASSERT(col < size() && col < tsh->fields);
194
195
      DBUG_ASSERT(tsh->db.str && tsh->table_name.str);
197
198
      my_snprintf(buf, sizeof(buf), "Column %d type mismatch - "
198
199
                  "received type %d, %s.%s has type %d",
199
200
                  col, type(col), tsh->db.str, tsh->table_name.str,
200
 
                  table->field[col]->type());
 
201
                  field->type());
201
202
      rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
202
203
                  ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
203
204
    }
204
205
    /*
205
206
      Check the slave's field size against that of the master.
206
207
    */
207
 
    if (!error && 
208
 
        !table->field[col]->compatible_field_size(field_metadata(col)))
 
208
    if (!error &&
 
209
        !field->compatible_field_size(field_metadata(col), rli_arg))
209
210
    {
210
211
      error= 1;
211
212
      char buf[256];
213
214
                  "master has size %d, %s.%s on slave has size %d."
214
215
                  " Master's column size should be <= the slave's "
215
216
                  "column size.", col,
216
 
                  table->field[col]->pack_length_from_metadata(
217
 
                                       m_field_metadata[col]),
218
 
                  tsh->db.str, tsh->table_name.str, 
219
 
                  table->field[col]->row_pack_length());
 
217
                  field->pack_length_from_metadata(m_field_metadata[col]),
 
218
                  tsh->db.str, tsh->table_name.str,
 
219
                  field->row_pack_length());
220
220
      rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
221
221
                  ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
222
222
    }