mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Applying InnoDB snashot 5.1-ss6129
Detailed revision comments: r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines branches/5.1: Fix bug #47777. 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. Review: rb://180 approved by Marko Makela.
This commit is contained in:
parent
0b25d0877b
commit
1df8c9fab6
3 changed files with 41 additions and 1 deletions
13
mysql-test/r/innodb_bug47777.result
Normal file
13
mysql-test/r/innodb_bug47777.result
Normal file
|
@ -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;
|
24
mysql-test/t/innodb_bug47777.test
Normal file
24
mysql-test/t/innodb_bug47777.test
Normal file
|
@ -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;
|
|
@ -3243,7 +3243,10 @@ ha_innobase::store_key_val_for_row(
|
|||
} else if (mysql_type == MYSQL_TYPE_TINY_BLOB
|
||||
|| mysql_type == MYSQL_TYPE_MEDIUM_BLOB
|
||||
|| mysql_type == MYSQL_TYPE_BLOB
|
||||
|| mysql_type == MYSQL_TYPE_LONG_BLOB) {
|
||||
|| mysql_type == MYSQL_TYPE_LONG_BLOB
|
||||
/* MYSQL_TYPE_GEOMETRY data is treated
|
||||
as BLOB data in innodb. */
|
||||
|| mysql_type == MYSQL_TYPE_GEOMETRY) {
|
||||
|
||||
CHARSET_INFO* cs;
|
||||
ulint key_len;
|
||||
|
|
Loading…
Reference in a new issue