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"';
insert into shops (name, location)
values ('sazare',
ST_GeomFromText('POINT(35.714653 139.685043)'));
select id, name, ST_AsText(location) as location_text from shops
where MBRContains(ST_GeomFromText('LineString(35.71592 139.68466, 35.71411 139.68804)'), location);
id	name	location_text
1	sazare	POINT(35.714653 139.685043)
select id, name, ST_AsText(location) as location_text from shops
where MBRContains(ST_GeomFromText('LineString(35.57903 139.65659, 35.57262 139.66489)'), location);
id	name	location_text
update shops set location = ST_GeomFromText('POINT(35.57566 139.66116)')
where name = 'sazare';
select id, name, ST_AsText(location) as location_text from shops
where MBRContains(ST_GeomFromText('LineString(35.71592 139.68466, 35.71411 139.68804)'), location);
id	name	location_text
select id, name, ST_AsText(location) as location_text from shops
where MBRContains(ST_GeomFromText('LineString(35.57903 139.65659, 35.57262 139.66489)'), location);
id	name	location_text
1	sazare	POINT(35.57566 139.66116)
drop table shops;
