diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-12 13:58:45 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-12 18:13:53 +0200 |
commit | 8be3794b42b0df6a0eb5a420d49a5c6dff58e138 (patch) | |
tree | 44f1af91c6ec95cfee9780759411de888da49aee /tpool | |
parent | 0d767778728cd581d891f3727965558836497e87 (diff) | |
download | mariadb-git-8be3794b42b0df6a0eb5a420d49a5c6dff58e138.tar.gz |
MDEV-21924 Clean up InnoDB GIS record comparison
The extension of the record comparison functions for SPATIAL INDEX in
mysql/mysql-server@b66ad511b61fffe75c58d0a607cdb837c6e6c821
was suboptimal for multiple reasons:
Some functions used unnecessary temporary variables of the int type,
instead of the more appropriate size_t, causing type mismatch.
Many functions unnecessarily required rec_get_offsets() to be
computed, or a parameter for length, although the size of the
minimum bounding rectangle (MBR) is hard-coded as
SPDIMS * 2 * sizeof(double), or 32 bytes.
In InnoDB SPATIAL INDEX records, there always is a 32-byte key
followed by either a 4-byte child page number or the PRIMARY KEY value.
The length parameters were not properly validated.
The function cmp_geometry_field() was making an incorrect attempt
at checking that the lengths are at least sizeof(double) (8 bytes),
even though the function is accessing up to 32 bytes in both MBR.
Functions that are called from only one compilation unit are defined
in another compilation unit, making the code harder to follow and
potentially slower to execute.
cmp_dtuple_rec_with_gis(): FIXME: Correct the debug assertion
and possibly the function TABLE_SHARE::init_from_binary_frm_image()
or related code, which causes an unexpected length of
DATA_MBR_LEN + 2 bytes to be passed to this function.
Diffstat (limited to 'tpool')
0 files changed, 0 insertions, 0 deletions