1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for BUG#35570 "CHECKSUM TABLE unreliable if LINESTRING field (same content / differen checksum)"

This will be back-ported to 5.x trees but the work for R-tree logging critically needs this patch in Maria now.


mysql-test/r/myisam.result:
  checksums are identical; without the code fix they were all different
mysql-test/t/myisam.test:
  test that same tables give same checksums
sql/sql_table.cc:
  Type GEOMETRY is implemented on top of type BLOB, so, just like for BLOB, its 'field' contains pointers
  which it does not make sense to include in the checksum; it rather has to be converted to a string and
  then we can compute the checksum.
This commit is contained in:
unknown
2008-04-02 18:37:01 +02:00
parent 3651e3285d
commit 50808b2115
3 changed files with 38 additions and 3 deletions

View File

@@ -7261,8 +7261,14 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
if (! thd->variables.old_mode &&
f->is_real_null(0))
continue;
if ((f->type() == MYSQL_TYPE_BLOB) ||
(f->type() == MYSQL_TYPE_VARCHAR))
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);