MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Satya B Date:November 25 2009 9:39am
Subject:bzr commit into mysql-5.0-bugteam branch (satya.bn:2851) Bug#47777
View as plain text  
#At file:///home/satya/WORK/mysql/mysql-5.0-bugteam/ based on revid:jimw@stripped

 2851 Satya B	2009-11-25
      Applying InnoDB snapshot 5.0-ss6230, Part 1. Fixes BUG#47777
      
      BUG#47777 - innodb dies with spatial pk: Failing assertion: buf <= original_buf + buf_len
      
      Detailed revision comments:
      
      r6178 | jyang | 2009-11-17 08:52:11 +0200 (Tue, 17 Nov 2009) | 6 lines
      branches/5.0: Merge fix for bug #47777 from branches/5.1 -r6045
      to bracnches/5.0. Treat the Geometry data same as Binary BLOB
      in ha_innobase::store_key_val_for_row(), since the Geometry
      data is stored as Binary BLOB in Innodb.

    added:
      mysql-test/r/innodb_bug47777.result
      mysql-test/t/innodb_bug47777.test
    modified:
      sql/ha_innodb.cc
=== added file 'mysql-test/r/innodb_bug47777.result'
--- a/mysql-test/r/innodb_bug47777.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_bug47777.result	2009-11-25 09:38:52 +0000
@@ -0,0 +1,13 @@
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+1
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+0
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+count(*)
+1
+drop table bug47777;

=== added file 'mysql-test/t/innodb_bug47777.test'
--- a/mysql-test/t/innodb_bug47777.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_bug47777.test	2009-11-25 09:38:52 +0000
@@ -0,0 +1,24 @@
+# This is the test for bug 47777. GEOMETRY
+# data is treated as BLOB data in innodb.
+# Consequently, its key value generation/storing
+# should follow the process for the BLOB
+# datatype as well.
+
+--source include/have_innodb.inc
+
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+
+# Verify correct row get inserted.
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+
+# Update table bug47777 should be successful.
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+
+# Verify the row get updated successfully. The original
+# c2 value should be changed to GeomFromText('POINT(1 1)').
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+
+drop table bug47777;

=== modified file 'sql/ha_innodb.cc'
--- a/sql/ha_innodb.cc	2009-10-27 13:11:06 +0000
+++ b/sql/ha_innodb.cc	2009-11-25 09:38:52 +0000
@@ -2767,7 +2767,10 @@ ha_innobase::store_key_val_for_row(
 		} else if (mysql_type == FIELD_TYPE_TINY_BLOB
 		    || mysql_type == FIELD_TYPE_MEDIUM_BLOB
 		    || mysql_type == FIELD_TYPE_BLOB
-		    || mysql_type == FIELD_TYPE_LONG_BLOB) {
+		    || mysql_type == FIELD_TYPE_LONG_BLOB
+		    /* MYSQL_TYPE_GEOMETRY data is treated
+		    as BLOB data in innodb. */
+		    ||  mysql_type == FIELD_TYPE_GEOMETRY) {
 
 			CHARSET_INFO*	cs;
 			ulint		key_len;


Attachment: [text/bzr-bundle] bzr/satya.bn@sun.com-20091125093852-vvd29igvjizra4xx.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (satya.bn:2851) Bug#47777Satya B25 Nov