[MDEV-21678] innodb_gis.gis_split_nan fails with ER_CANT_CREATE_GEOMETRY_OBJECT Created: 2020-02-06  Updated: 2023-09-11  Resolved: 2023-09-11

Status: Closed
Project: MariaDB Server
Component/s: GIS, Tests
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-21664 Add opt files for have_innodb_Xk.inc Closed

 Description   

10.2 a241d411

$ perl ./mtr innodb_gis.gis_split_nan --mysqld=--innodb-page-size=4k
 
innodb_gis.gis_split_nan 'innodb'        [ fail ]
        Test ended at 2020-02-06 21:26:16
 
CURRENT_TEST: innodb_gis.gis_split_nan
mysqltest: At line 285: query 'INSERT INTO geom_index SELECT * FROM gis_geometrycollection' failed: 1416: Cannot get geometry object from data you send to the GEOMETRY field
 
The result from queries just before the failure was:
< snip >
                                                                      'LINESTRING(0 0,10 10),'
                                                                      'GEOMETRYCOLLECTION('
                                                                            'GEOMETRYCOLLECTION())),'
                                                                'GEOMETRYCOLLECTION(),'
                                                                'GEOMETRYCOLLECTION('
                                                                       'GEOMETRYCOLLECTION()),'
                                                                'POLYGON((0 0,0 10,10 10,10 0,0 0)),'
                                                                'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10),'
                                                                'MULTILINESTRING((0 0,10 10),(0 10,10 0)),'
                                                                'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))'))));
# Creating a table with spatial index column
CREATE TABLE geom_index (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY NOT NULL, SPATIAL INDEX(g));
# Inserting geometry values
INSERT INTO geom_index SELECT * FROM gis_point;
INSERT INTO geom_index SELECT * FROM gis_linestring;
INSERT INTO geom_index SELECT * FROM gis_polygon;
INSERT INTO geom_index SELECT * FROM gis_multi_point;
INSERT INTO geom_index SELECT * FROM gis_multi_linestring;
INSERT INTO geom_index SELECT * FROM gis_multi_polygon;
INSERT INTO geom_index SELECT * FROM gis_geometrycollection;
 
More results from queries before failure can be found in /data/bld/10.2-debug-nightly/mysql-test/var/log/gis_split_nan.log

The test never runs anywhere, because it has an include file which requires innodb-page-size=4K, but the test doesn't have the option file, and the include file doesn't set it, it only checks the value. So the test always gets skipped.

The failure was revealed when I tried to do MDEV-21664, which makes these include files enforce the setting rather than just check it. So, it should be enough to fix the test itself without adding the opt file for it, after MDEV-21664 is pushed, the opt file won't be necessary.

Reproducible on 10.2-10.5.

The test was added to 10.2 long time ago, by this commit:

commit 42e3e574260dc6ccfe161f8c0d8e8af41e599353
Author: Jan Lindström
Date:   Thu Oct 12 16:21:21 2017 +0300
 
    MDEV-13626: Merge InnoDB test cases from MySQL 5.7
    
    Add missing innodb_gis tests.



 Comments   
Comment by Marko Mäkelä [ 2022-05-04 ]

This happens on 10.6 as well. I would suggest the following changes to the test:

diff --git a/mysql-test/suite/innodb_gis/t/gis_split_nan.test b/mysql-test/suite/innodb_gis/t/gis_split_nan.test
index 0c55a210475..1df4218b7d4 100644
--- a/mysql-test/suite/innodb_gis/t/gis_split_nan.test
+++ b/mysql-test/suite/innodb_gis/t/gis_split_nan.test
@@ -1,7 +1,6 @@
 --source include/have_innodb.inc
---source include/have_debug.inc
 --source include/have_geometry.inc
---source include/have_innodb_4k.inc
+--source include/innodb_page_size.inc
 
 ############################################################################################
 # Creating the spatial objects                                                             #

The test does not seem to depend on any debug instrumentation, and we might as well test it with every page size.

Comment by Marko Mäkelä [ 2023-09-11 ]

The reason why the test would fail becomes clearer if we slightly modify the test:

mysqltest: At line 284: query 'ALTER TABLE gis_geometrycollection ADD SPATIAL INDEX(g)' failed: ER_SPATIAL_CANT_HAVE_NULL (1252): All parts of a SPATIAL index must be NOT NULL

It turns out that we have two NULL values of g, for fid=714 and fid=715. If those two rows are omitted, the test will pass.

Generated at Thu Feb 08 09:08:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.