I'm performing a mySQL query to check if a point is within a multipolygon field. I've got a database field storing a multipolygon and I want to check if a point is within any of those polygons. However ST_Within seems to only be checking the first polygon. Here is an example of my query:
select name, ST_Within(ST_PointFromText('POINT(-34.9216954 138.6308949)'), service_polygons) as within, ST_AsText(service_polygons)
And service polygons contains a column with the value:
MULTIPOLYGON(((58.077876267875 108.80859375,55.578344672182 126.38671875,50.289339253292 136.58203125,32.546813173515 147.83203125,34.307143856288 107.75390625,58.077876267875 108.80859375),(-14.944784875088 138.69140625,-36.315125147481 126.73828125,-55.776573018668 155.91796875,-45.089035564831 167.16796875,-18.979025953255 151.34765625,-13.239945499286 139.39453125,-0.35156029399227 142.91015625,-14.944784875088 138.69140625)))
If I reverse the order of the polygons it returns true, for example if service polygons contains
MULTIPOLYGON(((42.811521745098 156.26953125,-5.9657536710655 162.24609375,-28.613459424004 167.51953125,-62.431074232921 164.70703125,-47.989921667414 115.48828125,42.811521745098 156.26953125),(58.077876267875 108.80859375,34.307143856288 107.75390625,32.546813173515 147.83203125,50.289339253292 136.58203125,55.578344672182 126.38671875,58.077876267875 108.80859375)))
Then true is returned.
Am I missing something when dealing with multipolygons?