Bug #96756 https://bugs.mysql.com/bug.php?id=96711 closed whithout solution
Submitted: 4 Sep 20:00 Modified: 25 Oct 11:57
Reporter: Ronaldo Freitas Ronaldo Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.7.27-0ubuntu0.16.04.1 - (Ubuntu) OS:Ubuntu
Assigned to: CPU Architecture:Other (VM from DigitalOcean)

[4 Sep 20:00] Ronaldo Freitas Ronaldo
Description:
Hello, I changed to an ST_ function, but in your manual it says that one function is synonymous with other without ST_. but ok I changed as requested, including now I generated 2 geojson one is a point and other indicating that it is a polygon. I am now using the ST_ functions and I have the exact same error. If it is a misuse please can you tell me where my mistake is?

My code with adjusts its in how to repeat.

this point its inside a poligon, i see in MAP.

How to repeat:

set @lng = -46.76648;
set @lat = -23.65065;
set @GJs = '{"type": "Polygon", "coordinates": [[[-46.694211959838874, -23.637919505255393], [-46.711206436157234, -23.628169110847946], [-46.72313690185547, -23.64027836255608], [-46.72545433044434, -23.6443669478441], [-46.72528266906739, -23.647197432065852], [-46.72245025634766, -23.651757527860635], [-46.70931816101075, -23.665515474199104], [-46.69275283813477, -23.68532437353648], [-46.68519973754883, -23.695542075835473], [-46.6501808166504, -23.67023215115052], [-46.66906356811524, -23.658833223888845], [-46.68511390686036, -23.65152166473462], [-46.695413589477546, -23.640435618198072], [-46.694211959838874, -23.637919505255393]]]}';

set  @jsonpoint = '{ "type": "Point", "coordinates": [-46.76648, -23.65065]}';

SELECT @lng lng, @lat lat,  ST_Within(ST_GeomFromGeoJSON(@jsonpoint)  ,ST_GeomFromGeoJSON(@GJs))  ST_Within_ll_GJ;
[5 Sep 12:35] Sinisa Milivojevic
HI Mr. Ronaldo,

The other bug is closed because you did not provide no answers to our question.

Next, in this bug report we do not see what version of MySQL server are you actually using ???

Last, but not least, try using geometric functions, without usage of the user variables.
[13 Sep 13:41] Ronaldo Freitas Ronaldo
In my code I am not using user variables. I get values ​​directly from the database. But to be able to repeat the problem, I sent this simple and quick code to do. Then the problem occurs the same way you take the data from the bank.
If I sent you the query I use, as you do not have the data that is in the database could not reproduce the problem. This function works for many other situations, this case is an exception but should work in all cases and is not.

The version of Mysql is: 5.7.27-0ubuntu0.16.04.1 - (Ubuntu)
[13 Sep 14:02] Ronaldo Freitas Ronaldo
Now without variables, more siple impossible:

SELECT ST_Within(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [-46.76648, -23.65065]}')  ,
				ST_GeomFromGeoJSON('{"type": "Polygon", 
                                   "coordinates": [[[-46.694211959838874, -23.637919505255393], [-46.711206436157234, -23.628169110847946], [-46.72313690185547, -23.64027836255608],
                                   [-46.72545433044434, -23.6443669478441], [-46.72528266906739, -23.647197432065852], [-46.72245025634766, -23.651757527860635], [-46.70931816101075, -23.665515474199104],
                                   [-46.69275283813477, -23.68532437353648], [-46.68519973754883, -23.695542075835473], [-46.6501808166504, -23.67023215115052], [-46.66906356811524, -23.658833223888845],
                                   [-46.68511390686036, -23.65152166473462], [-46.695413589477546, -23.640435618198072], [-46.694211959838874, -23.637919505255393]]]}'
))  ST_Within_ll_GJ;
[24 Sep 13:55] Sinisa Milivojevic
Hi Mr. Ronaldo,

I managed to reproduce your test case and I got 0 as the output.

What we require is some kind of proof that this point is truly within the defined polygon.

Thanks in advance .......
[25 Oct 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".