[MDEV-12462] SPATIAL index fails to work with CONTAINS Created: 2017-04-06 Updated: 2020-08-25 Resolved: 2017-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | GIS, Storage Engine - InnoDB |
| Affects Version/s: | 10.2.5 |
| Fix Version/s: | 10.2.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anders Karlsson | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-ga | ||
| Environment: |
Linux x86_64 CentOS 6.4 |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When there is a SPATIAL INDEX on a GEOMETRY it seems to fulfill a CONTAINS expression. If the spatial index isn't used, the condition works as expected.
As can be seen, running the same query with and without an index brings different results. Running the query with a "FORCE INDEX(PRIMARY)" hint also brings the correct result, but the SPATIAL INDEX fails. |
| Comments |
| Comment by Elena Stepanova [ 2017-04-20 ] | ||
|
To reproduce, the table should be created with InnoDB (significant in case of MTR). MyISAM does not seem to be affected. | ||
| Comment by Elena Stepanova [ 2017-04-20 ] | ||
|
Could be the same as | ||
| Comment by Alexey Botchkov [ 2017-05-02 ] | ||
|
http://lists.askmonty.org/pipermail/commits/2017-May/011071.html | ||
| Comment by Robert Sonnberger [ 2017-05-23 ] | ||
|
Sorry, this bug is not fixed for me! I just updated from 10.2.4 to 10.2.6 today. I tested different databases, recreated GEOMETRY and checked different queries with e.g. polygon instead of LineString -> made no difference. Query shows no results. This is an example query that does no longer show results: Whould it be possible to have a look at this again, please? | ||
| Comment by Wesley Haines [ 2017-08-17 ] | ||
|
Still seeing this bug even on 10.2.7, after upgrading from 10.2.4. Dropping and re-creating the SPATIAL index doesn't help. This query is now broken:
Switching it around to use Within works fine, as reported above:
stations.coordinates is a geometry column with a spatial index on just that column. | ||
| Comment by Claudio Nanni [ 2017-09-20 ] | ||
|
Still present on 10.2.7, dropping the index the results come back. | ||
| Comment by Claudio Nanni [ 2017-09-20 ] | ||
|
testcase.tar.gz | ||
| Comment by Alexey Botchkov [ 2017-09-20 ] | ||
|
The bug was fixed then reintroduced by an unlucky merge. |