summaryrefslogtreecommitdiff
path: root/storage/mroonga/mysql-test/mroonga/wrapper/r/geometry_update.result
blob: e982e0b95cea864304706338b6dc838350dcd3cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
drop table if exists shops;
create table shops (
id int primary key auto_increment,
name text,
location geometry NOT NULL,
spatial key location_index (location)
) comment = 'engine "innodb"';
show create table shops;
Table	Create Table
shops	CREATE TABLE `shops` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text,
  `location` geometry NOT NULL,
  PRIMARY KEY (`id`),
  SPATIAL KEY `location_index` (`location`)
) ENGINE=Mroonga DEFAULT CHARSET=latin1 COMMENT='engine "innodb"'
insert into shops (name, location)
values ('sazare',
GeomFromText('POINT(139.685043 35.714653)'));
select id, name, AsText(location) as location_text from shops
where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
id	name	location_text
1	sazare	POINT(139.685043 35.714653)
select id, name, AsText(location) as location_text from shops
where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location);
id	name	location_text
update shops set location = GeomFromText('POINT(139.66116 35.57566)')
where name = 'sazare';
select id, name, AsText(location) as location_text from shops
where MBRContains(GeomFromText('LineString(139.68466 35.71592, 139.68804 35.71411)'), location);
id	name	location_text
select id, name, AsText(location) as location_text from shops
where MBRContains(GeomFromText('LineString(139.65659 35.57903, 139.66489 35.57262)'), location);
id	name	location_text
1	sazare	POINT(139.66116 35.57566)
drop table shops;