5
+---------+---------+------+-----+---------+----------------+
| Field   | Type    | Null | Key | Default | Extra          |
+---------+---------+------+-----+---------+----------------+
| id      | int(11) | NO   | PRI | NULL    | auto_increment |
| user_id | int(11) | NO   | UNI | NULL    |                |
| utm     | point   | NO   | MUL | NULL    |                |
+---------+---------+------+-----+---------+----------------+

insert into life(user_id, utm)  values(99,point(4,4));

ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field
OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080

1 Answers1

5

Have you tried:

insert into life(user_id, utm)  values(99,PointFromWKB(POINT(4,4)));
f3lix
  • 29,500
  • 10
  • 66
  • 86
  • 3
    According to http://bit.ly/9r97o5, this is only required on MySQL versions prior to 5.1.35. Starting with 5.1.35, you can insert the return value from Point() directly. – Michael Madsen Feb 15 '10 at 15:54
  • Are function names case sensitive in mySQL? – Pekka Feb 15 '10 at 16:05