Bug #110229 Spatial Intersects function returning true on non-intersecting shapes
Submitted: 28 Feb 2023 6:07 Modified: 28 Feb 2023 14:39
Reporter: Sangjun Jung Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.1.48 OS:Windows (Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: gis, intersects, Spatial functions

[28 Feb 2023 6:07] Sangjun Jung
Description:
When the linestring and polygon below are parameters, the "intersects" function returns the value of 1.

They do not intersect when shown in layers or spatial tools.

You can repeat the problem by running the query in "How to repeat" section.

How to repeat:
SELECT INTERSECTS(GEOMFROMTEXT('LINESTRING (129.057191920344 36.0476904468461, 129.057324189504 36.0477670322691, 129.057484310645 36.0478595573451, 129.057571608931 36.0479012177869, 129.057716285688 36.047968510795, 129.057717562075 36.047969123216, 129.057835005769 36.048027187508, 129.058058063475 36.0481347435985, 129.058402992751 36.048288197597, 129.058404052762 36.0482886812731, 129.058558911896 36.0483612037211, 129.058951796892 36.0485113373507, 129.058953072676 36.0485118407419, 129.059091345086 36.0485682285908, 129.059228102861 36.048611574432, 129.059335573193 36.0486360211623, 129.059339821961 36.0486371393353, 129.059391187263 36.0486525394767, 129.059535242206 36.0486741020249, 129.059679476424 36.0486949197566, 129.059833972834 36.0487059828101, 129.060184718234 36.0487014179161, 129.060345523194 36.0486889275478, 129.060513424423 36.0486629317213, 129.060632200336 36.048643031654, 129.060767204869 36.0486155710577, 129.060769392303 36.0486151649156, 129.061083706278 36.0485621033467, 129.061487829919 36.0484898455319, 129.061862456686 36.0484227828957, 129.062138027393 36.0483543861785, 129.062361463917 36.048278615322, 129.062377015327 36.04827334239, 129.062663692155 36.0481720183678, 129.063071046001 36.0480132398474, 129.063071586479 36.0480130323131, 129.063516446858 36.0478443997442, 129.063517145743 36.047844139923, 129.063820277802 36.0477333589962, 129.064164576085 36.047598952895, 129.064165376929 36.0475986462616, 129.06455035699 36.0474544558268, 129.064551354938 36.0474540917326, 129.064678122286 36.0474090532249, 129.064681320491 36.0474080114813, 129.064830287058 36.0473638148815, 129.064986837781 36.0473172654414, 129.0649889086 36.0473166873306, 129.065211159649 36.0472585696153, 129.065212931276 36.0472581336153, 129.065506017917 36.0471901689541, 129.065943284947 36.0470825852305, 129.066500897487 36.0469446401362, 129.067019818252 36.0468128237523, 129.06702030217 36.0468127027753, 129.067512281283 36.0466917208813, 129.067680859933 36.0466406462534, 129.067838839417 36.0465881423042, 129.067970618623 36.0465352639915, 129.067971024931 36.0465351029018, 129.068162401889 36.0464598781631, 129.06842879902 36.0463399802619, 129.068729432025 36.046198771291, 129.068730496598 36.0461982834703, 129.06877863451 36.0461768068811, 129.068782673727 36.0461751756452, 129.068845355054 36.0461523811411, 129.06884692732 36.0461518331957, 129.068920549221 36.0461272459291, 129.068994852872 36.0461020863984, 129.068998800282 36.0461008901427, 129.069103956214 36.0460726803903, 129.069109299397 36.0460714843614, 129.069234856972 36.0460487826559, 129.069236110657 36.0460485681863, 129.069357827727 36.0460289448547, 129.069362286441 36.046028377698, 129.069530564216 36.0460126527719, 129.069532096496 36.046012527197, 129.06968867211 36.0460014615936, 129.069691269302 36.0460013275375, 129.070012229042 36.0459909275957, 129.070469529179 36.0459753646739, 129.07091642593 36.0459571198634, 129.070916800587 36.0459571061809, 129.07122115795 36.0459463555542, 129.071222905515 36.0459463163415, 129.071387994623 36.0459447155279, 129.07138814106 36.045944714799, 129.071489333035 36.0459439506084, 129.071672839242 36.0459421076552, 129.071833519946 36.045939438106, 129.071838367574 36.0459395291047, 129.071955048633 36.0459458871139, 129.071957238436 36.0459460420787, 129.072064265121 36.0459553430084, 129.0720746802 36.0459570812591, 129.07222458926 36.0459945542212, 129.072227130395 36.0459952446337, 129.072386940119 36.0460421666453, 129.072388488167 36.0460426426587, 129.072494622043 36.0460767463602, 129.072496029036 36.0460772167021, 129.072647411107 36.0461298047973, 129.072779907691 36.0461747541052, 129.072781641378 36.0461753701687, 129.072868140516 36.0462075713279, 129.072961990082 36.0462313043192, 129.07309314597 36.0462579086848, 129.073337934144 36.0463047677376, 129.073339099727 36.0463050016672, 129.073513274214 36.0463415918591, 129.07351973646 36.0463432992585, 129.073594709835 36.0463673168895, 129.073604605661 36.0463714625685, 129.07366911308 36.0464055483915, 129.073669841199 36.0464059394605, 129.073743928154 36.0464464488198, 129.073744176956 36.0464465859784, 129.073850040589 36.0465051492635, 129.073900107152 36.0465244103884, 129.073967539049 36.046547061652, 129.074131284463 36.0465795361358, 129.074132085394 36.0465796997797, 129.074329844185 36.0466214652613, 129.074367732867 36.0466228034659, 129.074415591351 36.0466206190086, 129.074653870142 36.0466001214733, 129.074654453626 36.0466000744296, 129.074838717175 36.046585821438, 129.074843941018 36.046585618368, 129.074905254581 36.0465855876332, 129.074910802492 36.0465858105494, 129.074970565457 36.0465906596476, 129.074974333121 36.0465910719676, 129.075133387286 36.0466129984885, 129.075134269364 36.0466131255799, 129.075263204573 36.0466326450504, 129.075339821645 36.0466414397175, 129.075405041666 36.0466460913786, 129.075463335532 36.0466502160026, 129.075566636967 36.0466510373021, 129.075646668228 36.0466483456097, 129.075787279742 36.0466392460791, 129.076038192839 36.0466202056, 129.076411125481 36.0465899761479, 129.076861054733 36.0465502703097, 129.076864096232 36.0465500707314, 129.07697639294 36.0465452124366, 129.076980607766 36.0465451610159, 129.077265166267 36.0465504315928, 129.077267647333 36.0465505228437, 129.077614166473 36.0465695750026, 129.077931581437 36.0465799572674, 129.078426621327 36.0465790543155, 129.07872526778 36.0465739980273, 129.078989129634 36.0465660321597, 129.079224791124 36.0465550859603, 129.07935602873 36.046545733101, 129.07944483758 36.0465294799617, 129.079545669458 36.0465028228344, 129.079641488399 36.0464622900546, 129.079771716383 36.0464017579183, 129.080011746228 36.0462482551984, 129.080376322789 36.0460106690775, 129.080378733497 36.0460091837599, 129.080460601054 36.0459615517238, 129.080465347867 36.0459590770525, 129.080546889858 36.0459211674539, 129.080550367872 36.0459196807239, 129.080767446266 36.0458347298284, 129.081421659007 36.0455666994199, 129.081742006336 36.0454104440879, 129.082078631338 36.0452330577047, 129.082400851612 36.0450577038493, 129.082407831804 36.0450544739673, 129.082490012783 36.0450226123771, 129.082494938021 36.0450209346521, 129.0825974439 36.0449906345279, 129.082603663895 36.0449891244191, 129.082848949887 36.0449420730485, 129.083308764913 36.0448428025765, 129.083630405633 36.0447640670919, 129.083809426582 36.0447193182622, 129.083924084343 36.044684030201, 129.084071640174 36.0446260845092, 129.084240714083 36.0445478892332, 129.08448492277 36.0444169959933, 129.084485628586 36.0444166242012, 129.085321955594 36.043982990539, 129.085643297164 36.0438164736147, 129.08564529042 36.0438154883277, 129.085785492403 36.0437494032778, 129.085786410978 36.0437489800203, 129.085907418806 36.043694417116, 129.085908889724 36.0436937770045, 129.0860808833 36.0436216365251, 129.08608334621 36.0436206646811, 129.086190775566 36.0435809302174, 129.086192688316 36.0435802580833, 129.086294681954 36.0435462298364, 129.086297362741 36.0435454001641, 129.086380140533 36.0435217682867, 129.086382274528 36.04352119772, 129.086506531197 36.0434902552405, 129.086511870975 36.043489157615, 129.086632191509 36.043469535744, 129.086632921825 36.0434694203099, 129.086836267083 36.0434385574614, 129.086839176162 36.0434381806301, 129.087066238928 36.0434137640429, 129.087069684175 36.0434134823899, 129.087305295834 36.0434002209473, 129.087307903871 36.0434001241656, 129.087546471794 36.0433958382989, 129.087549025842 36.0433958397648, 129.087755846996 36.0433998617188, 129.087760213167 36.0434000866076, 129.087957572836 36.0434166290162, 129.08796165474 36.043417096725, 129.088167608721 36.0434470461289, 129.088169770365 36.0434473968143, 129.088421817779 36.0434925118175, 129.088424380861 36.0434930230967, 129.088714266406 36.043556791942, 129.088719629467 36.0435582140256, 129.0889486166 36.0436295509484, 129.088950630099 36.0436302150611, 129.089168610325 36.0437062044626, 129.08917410756 36.0437084207072, 129.089487819951 36.043853005682, 129.089490452557 36.0438542996318, 129.089675550762 36.0439510077536, 129.089679832276 36.043953484849, 129.089890669679 36.0440881642278, 129.089891732104 36.0440888602269, 129.090085833496 36.0442192538015, 129.090090521441 36.0442227924284, 129.090307905898 36.0444069654844, 129.090311470038 36.0444102975419, 129.090473005912 36.0445771820557, 129.090474626833 36.0445789423485, 129.090610967214 36.0447348923043, 129.090612875086 36.0447372242557, 129.09077818441 36.0449536394011, 129.090779430213 36.0449553530721, 129.090896623574 36.0451250793342, 129.090899772108 36.0451304396585, 129.091050251501 36.0454371991841, 129.091051780863 36.0454407397204, 129.091148549966 36.0456986302895, 129.091148758085 36.04569919972, 129.091289909775 36.0460939776172, 129.091290253686 36.0460949825836, 129.091381929684 36.0463754778946, 129.091382357229 36.0463768760569, 129.091454023315 36.0466283393509, 129.09145436459 36.0466296218832, 129.091523845916 36.0469104115693, 129.091524480271 36.0469135451298, 129.091622993444 36.0475361306299, 129.091744829438 36.0482147509541, 129.091744889559 36.0482150941022, 129.091848226111 36.0488234126844, 129.091901152693 36.0489700837141, 129.091976583034 36.0490795174475, 129.092081672072 36.0491978825784, 129.092206043765 36.0492852089271, 129.092460702294 36.0494175081716, 129.092460819304 36.0494175692014, 129.093125550616 36.049764819753, 129.093128092264 36.0497662305396, 129.093352390688 36.049898237254, 129.093615893222 36.0500477578335, 129.093619134776 36.0500497456617, 129.093849781413 36.0502021833114, 129.093854531851 36.0502057152815, 129.093990026488 36.0503188511701, 129.093993945578 36.0503224976764, 129.09416081137 36.0504956710969, 129.09459088094 36.0509222703031, 129.094592353897 36.0509237979498, 129.095117621577 36.0514931912129, 129.095120189731 36.0514962260659, 129.095547990759 36.0520488851077)', 4326), GEOMFROMTEXT('POLYGON((129.06769122137552 36.04385958130669,129.06785122137552 36.04385958130669,129.06785122137552 36.04397958130669,129.06769122137552 36.04397958130669,129.06769122137552 36.04385958130669))', 4326))

Suggested fix:
I have no idea.

Works fine(returns false) in postgres postgis.
[28 Feb 2023 14:39] MySQL Verification Team
Hi Mr. Jung,

Thank you very much for your bug report.

However, version 5.1 is unsupported for the last 9 (nine) years.

Please try with release 8.0.32.

Unsupported.