mysql 插入 point,无法在MySQL中插入GeomFromText('POINT(..)')

I've created a database where one of the tables stores the geolocation of some points.

I'm trying to fill that table, which a priori seems pretty easy with GeomFromText('POINT(39.48280 -0.34804)'), but it doesn't work. All the other columns, like id, name... do get their values, but the location column remains empty.

So then I try to update the row I've just added with:

UPDATE `pfc_db`.`poi`

SET

`location` = GeomFromText('POINT(39.48280 -0.34804)')

WHERE id = 'poi00001';

And MySQLWorkbench shows its output:

0 row(s) affected

Rows matched: 1 Changed: 0 Warnings: 0

Why does it find the row it has to update but doesn't do it? If I try to update another column it works perfect, but not with the location.

I've been googling for a solution, I've found posts like MySQL INSERT/UPDATE on POINT column and I've tried the proposed solutions but still nothing.

So, anyone knows what I'm doing wrong?

Thanks for reading.

解决方案

I don't know why but the MySQLWorkbench GUI didn't display the Point variables, at least in my computer.

Then I tried to query the DB from a php script and it printed the Points perfectly, so the DB actually stored them. It was just a GUI display problem. Should I report it as a bug to MySQL?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值