Loading mysql-test/r/gis.result +7 −0 Original line number Diff line number Diff line Loading @@ -485,3 +485,10 @@ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); AsText(a) POINT(1 1) drop table t1; create table t1 select POINT(1,3); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `POINT(1,3)` longblob NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; mysql-test/r/rpl_charset.result +8 −0 Original line number Diff line number Diff line Loading @@ -198,4 +198,12 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 stop slave; delete from t1; change master to master_log_pos=5801; start slave until master_log_file='master-bin.000001', master_log_pos=5937; start slave; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1; mysql-test/t/gis.test +4 −0 Original line number Diff line number Diff line Loading @@ -190,3 +190,7 @@ select AsText(a) from t1 where and MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); drop table t1; create table t1 select POINT(1,3); show create table t1; drop table t1; mysql-test/t/rpl_charset.test +18 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,24 @@ INSERT INTO t1 (c1, c2) VALUES (' select hex(c1), hex(c2) from t1; sync_slave_with_master; select hex(c1), hex(c2) from t1; # Now test for BUG##5705: SET CHARATER_SET_SERVERetc will be lost if # STOP SLAVE before following query stop slave; delete from t1; change master to master_log_pos=5801; start slave until master_log_file='master-bin.000001', master_log_pos=5937; # Slave is supposed to stop _after_ the INSERT, even though 5937 is # the position of the beginning of the INSERT; after SET slave is not # supposed to increment position. wait_for_slave_to_stop; # When you merge this into 5.0 you will have to adjust positions # above; the first master_log_pos above should be the one of the SET, # the second should be the one of the INSERT. start slave; sync_with_master; select hex(c1), hex(c2) from t1; connection master; drop table t1; sync_slave_with_master; sql/item_geofunc.cc +15 −18 Original line number Diff line number Diff line Loading @@ -27,6 +27,13 @@ #include "sql_acl.h" #include <m_ctype.h> void Item_geometry_func::fix_length_and_dec() { collation.set(&my_charset_bin); decimals=0; max_length=MAX_BLOB_WIDTH; } String *Item_func_geometry_from_text::val_str(String *str) { Loading @@ -44,6 +51,7 @@ String *Item_func_geometry_from_text::val_str(String *str) if ((arg_count == 2) && !args[1]->null_value) srid= (uint32)args[1]->val_int(); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading @@ -54,12 +62,6 @@ String *Item_func_geometry_from_text::val_str(String *str) } void Item_func_geometry_from_text::fix_length_and_dec() { max_length=MAX_BLOB_WIDTH; } String *Item_func_geometry_from_wkb::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading @@ -71,6 +73,7 @@ String *Item_func_geometry_from_wkb::val_str(String *str) if ((arg_count == 2) && !args[1]->null_value) srid= (uint32)args[1]->val_int(); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading @@ -84,12 +87,6 @@ String *Item_func_geometry_from_wkb::val_str(String *str) } void Item_func_geometry_from_wkb::fix_length_and_dec() { max_length=MAX_BLOB_WIDTH; } String *Item_func_as_wkt::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -138,12 +135,6 @@ String *Item_func_as_wkb::val_str(String *str) } void Item_func_as_wkb::fix_length_and_dec() { max_length= MAX_BLOB_WIDTH; } String *Item_func_geometry_type::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -180,6 +171,7 @@ String *Item_func_envelope::val_str(String *str) return 0; srid= uint4korr(swkb->ptr()); str->set_charset(&my_charset_bin); str->length(0); if (str->reserve(SRID_SIZE, 512)) return 0; Loading @@ -202,6 +194,7 @@ String *Item_func_centroid::val_str(String *str) swkb->length() - SRID_SIZE)))) return 0; str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading Loading @@ -232,6 +225,7 @@ String *Item_func_spatial_decomp::val_str(String *str) return 0; srid= uint4korr(swkb->ptr()); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) goto err; str->length(0); Loading Loading @@ -279,6 +273,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str) swkb->length() - SRID_SIZE))))) return 0; str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) goto err; srid= uint4korr(swkb->ptr()); Loading Loading @@ -333,6 +328,7 @@ String *Item_func_point::val_str(String *str) str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2)))) return 0; str->set_charset(&my_charset_bin); str->length(0); str->q_append((char)Geometry::wkb_ndr); str->q_append((uint32)Geometry::wkb_point); Loading @@ -358,6 +354,7 @@ String *Item_func_spatial_collection::val_str(String *str) String arg_value; uint i; str->set_charset(&my_charset_bin); str->length(0); if (str->reserve(1 + 4 + 4, 512)) goto err; Loading Loading
mysql-test/r/gis.result +7 −0 Original line number Diff line number Diff line Loading @@ -485,3 +485,10 @@ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); AsText(a) POINT(1 1) drop table t1; create table t1 select POINT(1,3); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `POINT(1,3)` longblob NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1;
mysql-test/r/rpl_charset.result +8 −0 Original line number Diff line number Diff line Loading @@ -198,4 +198,12 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 stop slave; delete from t1; change master to master_log_pos=5801; start slave until master_log_file='master-bin.000001', master_log_pos=5937; start slave; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1;
mysql-test/t/gis.test +4 −0 Original line number Diff line number Diff line Loading @@ -190,3 +190,7 @@ select AsText(a) from t1 where and MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); drop table t1; create table t1 select POINT(1,3); show create table t1; drop table t1;
mysql-test/t/rpl_charset.test +18 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,24 @@ INSERT INTO t1 (c1, c2) VALUES (' select hex(c1), hex(c2) from t1; sync_slave_with_master; select hex(c1), hex(c2) from t1; # Now test for BUG##5705: SET CHARATER_SET_SERVERetc will be lost if # STOP SLAVE before following query stop slave; delete from t1; change master to master_log_pos=5801; start slave until master_log_file='master-bin.000001', master_log_pos=5937; # Slave is supposed to stop _after_ the INSERT, even though 5937 is # the position of the beginning of the INSERT; after SET slave is not # supposed to increment position. wait_for_slave_to_stop; # When you merge this into 5.0 you will have to adjust positions # above; the first master_log_pos above should be the one of the SET, # the second should be the one of the INSERT. start slave; sync_with_master; select hex(c1), hex(c2) from t1; connection master; drop table t1; sync_slave_with_master;
sql/item_geofunc.cc +15 −18 Original line number Diff line number Diff line Loading @@ -27,6 +27,13 @@ #include "sql_acl.h" #include <m_ctype.h> void Item_geometry_func::fix_length_and_dec() { collation.set(&my_charset_bin); decimals=0; max_length=MAX_BLOB_WIDTH; } String *Item_func_geometry_from_text::val_str(String *str) { Loading @@ -44,6 +51,7 @@ String *Item_func_geometry_from_text::val_str(String *str) if ((arg_count == 2) && !args[1]->null_value) srid= (uint32)args[1]->val_int(); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading @@ -54,12 +62,6 @@ String *Item_func_geometry_from_text::val_str(String *str) } void Item_func_geometry_from_text::fix_length_and_dec() { max_length=MAX_BLOB_WIDTH; } String *Item_func_geometry_from_wkb::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading @@ -71,6 +73,7 @@ String *Item_func_geometry_from_wkb::val_str(String *str) if ((arg_count == 2) && !args[1]->null_value) srid= (uint32)args[1]->val_int(); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading @@ -84,12 +87,6 @@ String *Item_func_geometry_from_wkb::val_str(String *str) } void Item_func_geometry_from_wkb::fix_length_and_dec() { max_length=MAX_BLOB_WIDTH; } String *Item_func_as_wkt::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -138,12 +135,6 @@ String *Item_func_as_wkb::val_str(String *str) } void Item_func_as_wkb::fix_length_and_dec() { max_length= MAX_BLOB_WIDTH; } String *Item_func_geometry_type::val_str(String *str) { DBUG_ASSERT(fixed == 1); Loading Loading @@ -180,6 +171,7 @@ String *Item_func_envelope::val_str(String *str) return 0; srid= uint4korr(swkb->ptr()); str->set_charset(&my_charset_bin); str->length(0); if (str->reserve(SRID_SIZE, 512)) return 0; Loading @@ -202,6 +194,7 @@ String *Item_func_centroid::val_str(String *str) swkb->length() - SRID_SIZE)))) return 0; str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) return 0; str->length(0); Loading Loading @@ -232,6 +225,7 @@ String *Item_func_spatial_decomp::val_str(String *str) return 0; srid= uint4korr(swkb->ptr()); str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) goto err; str->length(0); Loading Loading @@ -279,6 +273,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str) swkb->length() - SRID_SIZE))))) return 0; str->set_charset(&my_charset_bin); if (str->reserve(SRID_SIZE, 512)) goto err; srid= uint4korr(swkb->ptr()); Loading Loading @@ -333,6 +328,7 @@ String *Item_func_point::val_str(String *str) str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2)))) return 0; str->set_charset(&my_charset_bin); str->length(0); str->q_append((char)Geometry::wkb_ndr); str->q_append((uint32)Geometry::wkb_point); Loading @@ -358,6 +354,7 @@ String *Item_func_spatial_collection::val_str(String *str) String arg_value; uint i; str->set_charset(&my_charset_bin); str->length(0); if (str->reserve(1 + 4 + 4, 512)) goto err; Loading