summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-07 19:40:59 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-07 19:40:59 +0300
commit6e7b8b6a7ab2b58016403304b1c49cf908a6479d (patch)
tree395144ff597d9d1ea027cb0f57f50c5a6e6ab90c /sql/sql_table.cc
parent61bd9ef6487829ae8106387dd4a1f5b32b67b4bb (diff)
parent63a88e137365c4158e22c1c8aba7847b5a0ffe86 (diff)
downloadmariadb-git-6e7b8b6a7ab2b58016403304b1c49cf908a6479d.tar.gz
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts: Text conflict in .bzr-mysql/default.conf Text conflict in mysql-test/r/explain.result Text conflict in mysql-test/r/having.result Text conflict in mysql-test/suite/rpl/t/disabled.def Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in storage/federated/ha_federated.cc
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc36
1 files changed, 21 insertions, 15 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4440380aed0..b6d9fd353a1 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7994,22 +7994,28 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
for (uint i= 0; i < t->s->fields; i++ )
{
Field *f= t->field[i];
- enum_field_types field_type= f->type();
- /*
- BLOB and VARCHAR have pointers in their field, we must convert
- to string; GEOMETRY is implemented on top of BLOB.
- */
- if ((field_type == MYSQL_TYPE_BLOB) ||
- (field_type == MYSQL_TYPE_VARCHAR) ||
- (field_type == MYSQL_TYPE_GEOMETRY))
- {
- String tmp;
- f->val_str(&tmp);
- row_crc= my_checksum(row_crc, (uchar*) tmp.ptr(), tmp.length());
+
+ /*
+ BLOB and VARCHAR have pointers in their field, we must convert
+ to string; GEOMETRY is implemented on top of BLOB.
+ BIT may store its data among NULL bits, convert as well.
+ */
+ switch (f->type()) {
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_GEOMETRY:
+ case MYSQL_TYPE_BIT:
+ {
+ String tmp;
+ f->val_str(&tmp);
+ row_crc= my_checksum(row_crc, (uchar*) tmp.ptr(),
+ tmp.length());
+ break;
+ }
+ default:
+ row_crc= my_checksum(row_crc, f->ptr, f->pack_length());
+ break;
}
- else
- row_crc= my_checksum(row_crc, f->ptr,
- f->pack_length());
}
crc+= row_crc;