Bug #49836 Replication of geometric fields is broken after WL#5151
Submitted: 21 Dec 2009 4:29 Modified: 7 Mar 2010 23:58
Reporter: Alfranio Junior Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S3 (Non-critical)
Version:5.1-rep+2 OS:Any
Assigned to: Luis Soares CPU Architecture:Any
Tags: geometric types, RBR

[21 Dec 2009 4:29] Alfranio Junior
Description:
Replication of geometric fields is broken after WL#5151 as the slave 
stops with the following messages:

1 - ALL_NON_LOSSY
Last_SQL_Error  Can't create conversion table for table 'test.t1'

2 - ALL_LOSSY
Last_SQL_Error  Column 1 of table 'test.t1' cannot be converted from type
'geometrycollection' to type 'geometry'

How to repeat:
--source include/master-slave.inc
--source include/have_geometry.inc
--source include/have_binlog_format_row.inc

drop table if exists t1;
create table `t1` (`a` int(11) not null,
  `col000` geometry,
  primary key (`a`)) engine=myisam  default charset=latin1;

INSERT INTO t1 (a, col000) VALUES(1, PointFromText('POINT(10 10)'));

select * from t1;

--sync_slave_with_master

select * from t1;

exit;
[21 Dec 2009 19:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/95307

3144 Luis Soares	2009-12-21
      BUG#49836: Replication of geometric fields is broken after WL#5151
      
      Metadata for geometric fields was not being properly stored by
      the slave in its the table definition. This happened because
      MYSQL_TYPE_GEOMETRY was not included in the 'switch... case' that
      handles field metadata according to the field type. Therefore, it
      would default to 0, leading to always have a mismatch between
      master's field and slave fields'. 
      
      We fix this by deploying the missing 'case MYSQL_TYPE_GEOMETRY:'.
[24 Dec 2009 1:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/95593

3148 Luis Soares	2009-12-24
      BUG#49836: Replication of geometric fields is broken after WL#5151
      
      Metadata for geometric fields was not being properly stored by
      the slave in its the table definition. This happened because
      MYSQL_TYPE_GEOMETRY was not included in the 'switch... case' that
      handles field metadata according to the field type. Therefore, it
      would default to 0, leading to always have a mismatch between
      master's field and slave fields'. 
      
      We fix this by deploying the missing 'case MYSQL_TYPE_GEOMETRY:'.
     @ mysql-test/extra/rpl_tests/type_conversions.test
        Added some tests for blob fields and also the particular
        case for replicating from/into BLOB into/from GEOMETRY.
     @ sql/field.h
        As requested by Mats, reverted function added by him in
        changeset:
        http://lists.mysql.com/commits/95313
[7 Jan 2010 9:03] Zhenxing He
see also bug#48776
[18 Jan 2010 12:06] Bugs System
Pushed into 6.0.14-alpha (revid:alik@ibmvm-20100118120357-hnzhgadkpzqfnvsc) (version source revid:alik@ibmvm-20100118115413-kd3klpine09yyktw) (merge vers: 6.0.14-alpha) (pib:16)
[18 Jan 2010 12:07] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100118120111-73dulkgc893it4r9) (version source revid:alik@ibmvm-20100118115335-0stecyzftqm7bqx6) (pib:16)
[19 Jan 2010 11:18] Jon Stephens
Documented bugfix in the 5.6.0 and 6.0.14 changelogs, as follows:

      Metadata for GEOMETRY fields was not properly stored by
      the slave in its definitions of tables.

Set NDI state, waiting for merges to 5.1+.
[2 Mar 2010 12:04] Bugs System
Pushed into 5.1.41-ndb-6.3.33 (revid:martin.skold@mysql.com-20100302115132-qhkzoqk0ksqgziiv) (version source revid:martin.skold@mysql.com-20100302115132-qhkzoqk0ksqgziiv) (merge vers: 5.1.41-ndb-6.3.33) (pib:16)
[2 Mar 2010 12:05] Bugs System
Pushed into 5.1.41-ndb-7.0.14 (revid:martin.skold@mysql.com-20100302120047-al65h1bcqmd3cem0) (version source revid:martin.skold@mysql.com-20100302115137-ewrkhhxkkj0q1yza) (merge vers: 5.1.41-ndb-7.0.14) (pib:16)
[3 Mar 2010 5:03] Jon Stephens
Also documented in the NDB-6.3.33 and 7.0.14 changelogs.

NDI: Will this go into 5.1 mainline or not?
[3 Mar 2010 14:51] Jon Stephens
No additional pushes expected; closed.
[6 Mar 2010 10:51] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@linux-rbsx-20100118220048-5vnyqi5ghsbgmdsd) (merge vers: 5.5.99-m3) (pib:16)
[7 Mar 2010 23:58] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.