I cleaned up most of the tests. There were some minor result differences.
The remaining failures are mostly behaviour differences. I suspect that the geometry functions in MariaDB are sloppier than those in MySQL. Here is one example of an invalid (zero-area) triangle that MySQL would reject but MariaDB would accept:
CURRENT_TEST: innodb_gis.rtree_multi_pk
mysqltest: At line 79: query 'SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))')' succeeded - should have failed with errno 3037...
Marko Mäkelä
added a comment - I cleaned up most of the tests. There were some minor result differences.
The remaining failures are mostly behaviour differences. I suspect that the geometry functions in MariaDB are sloppier than those in MySQL. Here is one example of an invalid (zero-area) triangle that MySQL would reject but MariaDB would accept:
CURRENT_TEST: innodb_gis.rtree_multi_pk
mysqltest: At line 79: query 'SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))')' succeeded - should have failed with errno 3037...
See also the dubious debug code change in that I had to add back in MDEV-14059 to get the innodb_gis.rtree_concurrent_srch test to pass, most of the time.
The test would appear to expose a race condition between SELECT and ROLLBACK. Occasionally the test does return a different result for COUNT.
Marko Mäkelä
added a comment - See also the dubious debug code change in that I had to add back in MDEV-14059 to get the innodb_gis.rtree_concurrent_srch test to pass, most of the time.
The test would appear to expose a race condition between SELECT and ROLLBACK . Occasionally the test does return a different result for COUNT .
While adding some assertions to InnoDB in MDEV-21924, I found out that TABLE_SHARE::init_from_binary_frm_image() is calculating the MBR length as 34 bytes:
InnoDB does not expect adding any key_part_length_bytes. It internally stores 32 bytes (DATA_MBR_LEN = SPDIMS * 2 * sizeof(double)).
In cmp_dtuple_rec_with_gis(), I wrote a comment about this:
int cmp_dtuple_rec_with_gis(const dtuple_t *dtuple, const rec_t *rec,
Marko Mäkelä
added a comment - While adding some assertions to InnoDB in MDEV-21924 , I found out that TABLE_SHARE::init_from_binary_frm_image() is calculating the MBR length as 34 bytes:
key_part->key_part_flag|= field->key_part_flag();
uint16 key_part_length_bytes= field->key_part_length_bytes();
key_part->store_length+= key_part_length_bytes;
keyinfo->key_length+= key_part_length_bytes;
InnoDB does not expect adding any key_part_length_bytes . It internally stores 32 bytes ( DATA_MBR_LEN = SPDIMS * 2 * sizeof(double) ).
In cmp_dtuple_rec_with_gis() , I wrote a comment about this:
int cmp_dtuple_rec_with_gis( const dtuple_t *dtuple, const rec_t *rec,
page_cur_mode_t mode)
{
const dfield_t *dtuple_field= dtuple_get_nth_field(dtuple, 0);
/* FIXME: TABLE_SHARE::init_from_binary_frm_image() is adding
field->key_part_length_bytes() to the key length */
ut_ad(dfield_get_len(dtuple_field) == DATA_MBR_LEN ||
dfield_get_len(dtuple_field) == DATA_MBR_LEN + 2);
return cmp_gis_field(mode, dfield_get_data(dtuple_field), rec);
}
innodb_gis.rtree_old 'innodb' [ fail ]
Test ended at 2017-10-12 17:05:36
CURRENT_TEST: innodb_gis.rtree_old
mysqltest: At line 134: query 'INSERT INTO t1 (name, kind, line) VALUES
("Aadaouane", "pp", ST_GeomFromText("POINT(32.816667 35.983333)")),
("Aadassiye", "pp", ST_GeomFromText("POINT(35.816667 36.216667)")),
("Aadbel", "pp", ST_GeomFromText("POINT(34.533333 36.100000)")),
("Aadchit", "pp", ST_GeomFromText("POINT(33.347222 35.423611)")),
("Aadchite", "pp", ST_GeomFromText("POINT(33.347222 35.423611)")),
("Aadchit el Qoussair", "pp", ST_GeomFromText("POINT(33.283333 35.483333)")),
("Aaddaye", "pp", ST_GeomFromText("POINT(36.716667 40.833333)")),
("'Aadeissa", "pp", ST_GeomFromText("POINT(32.823889 35.698889)")),
("Aaderup", "pp", ST_GeomFromText("POINT(55.216667 11.766667)")),
("Qalaat Aades", "pp", ST_GeomFromText("POINT(33.503333 35.377500)")),
("A ad'ino", "pp", ST_GeomFromText("POINT(54.812222 38.209167)")),
("Aadi Noia", "pp", ST_GeomFromText("POINT(13.800000 39.833333)")),
("Aad La Macta", "pp", ST_GeomFromText("POINT(35.779444 -0.129167)")),
("Aadland", "pp", ST_GeomFromText("POINT(60.366667 5.483333)")),
("Aadliye", "pp", ST_GeomFromText("POINT(33.366667 36.333333)")),
("Aadloun", "pp", ST_GeomFromText("POINT(33.403889 35.273889)")),
("Aadma", "pp", ST_GeomFromText("POINT(58.798333 22.663889)")),
("Aadma Asundus", "pp", ST_GeomFromText("POINT(58.798333 22.663889)")),
("Aadmoun", "pp", ST_GeomFromText("POINT(34.150000 35.650000)")),
("Aadneram", "pp", ST_GeomFromText("POINT(59.016667 6.933333)")),
("Aadneskaar", "pp", ST_GeomFromText("POINT(58.083333 6.983333)")),
("Aadorf", "pp", ST_GeomFromText("POINT(47.483333 8.900000)")),
("Aadorp", "pp", ST_GeomFromText("POINT(52.366667 6.633333)")),
("Aadouane", "pp", ST_GeomFromText("POINT(32.816667 35.983333)")),
("Aadoui", "pp", ST_GeomFromText("POINT(34.450000 35.983333)")),
("Aadouiye", "pp", ST_GeomFromText("POINT(34.583333 36.183333)")),
("Aadouss", "pp", ST_GeomFromText("POINT(33.512500 35.601389)")),
("Aadra", "pp", ST_GeomFromText("POINT(33.616667 36.500000)")),
("Aadzi", "pp", ST_GeomFromText("POINT(38.100000 64.850000)"))' failed with wrong errno 1366: 'Incorrect LINESTRING value: 'POINT' for column 'line' at row 1', instead of 1416...
The result from queries just before the failure was:
< snip >
("Qalaat Aades", "pp", ST_GeomFromText("POINT(33.503333 35.377500)")),
("A ad'ino", "pp", ST_GeomFromText("POINT(54.812222 38.209167)")),
("Aadi Noia", "pp", ST_GeomFromText("POINT(13.800000 39.833333)")),
("Aad La Macta", "pp", ST_GeomFromText("POINT(35.779444 -0.129167)")),
("Aadland", "pp", ST_GeomFromText("POINT(60.366667 5.483333)")),
("Aadliye", "pp", ST_GeomFromText("POINT(33.366667 36.333333)")),
("Aadloun", "pp", ST_GeomFromText("POINT(33.403889 35.273889)")),
("Aadma", "pp", ST_GeomFromText("POINT(58.798333 22.663889)")),
("Aadma Asundus", "pp", ST_GeomFromText("POINT(58.798333 22.663889)")),
("Aadmoun", "pp", ST_GeomFromText("POINT(34.150000 35.650000)")),
("Aadneram", "pp", ST_GeomFromText("POINT(59.016667 6.933333)")),
("Aadneskaar", "pp", ST_GeomFromText("POINT(58.083333 6.983333)")),
("Aadorf", "pp", ST_GeomFromText("POINT(47.483333 8.900000)")),
("Aadorp", "pp", ST_GeomFromText("POINT(52.366667 6.633333)")),
("Aadouane", "pp", ST_GeomFromText("POINT(32.816667 35.983333)")),
("Aadoui", "pp", ST_GeomFromText("POINT(34.450000 35.983333)")),
("Aadouiye", "pp", ST_GeomFromText("POINT(34.583333 36.183333)")),
("Aadouss", "pp", ST_GeomFromText("POINT(33.512500 35.601389)")),
("Aadra", "pp", ST_GeomFromText("POINT(33.616667 36.500000)")),
("Aadzi", "pp", ST_GeomFromText("POINT(38.100000 64.850000)"));
More results from queries before failure can be found in /dev/shm/log/rtree_old.log
- saving '/dev/shm/log/innodb_gis.rtree_old-innodb/' to '/dev/shm/log/innodb_gis.rtree_old-innodb/'