Commit 3ff8fb51 authored by Marko Mäkelä's avatar Marko Mäkelä

InnoDB: Remove unused get_wkb_of_default_point()

The function get_wkb_of_default_point() should never have been
added, and the cleanup in commit 56ff6f1b
should have removed it.

The unnecessary code was added in
mysql/mysql-server@0a27b72171c4449f506ad4e93df8c29fead1ed72
and mostly disabled in
mysql/mysql-server@8f11af7734509821b654f2c330dff5374c89073c.

In MariaDB, the types DATA_POINT and DATA_VAR_POINT are never used.
Instead, DATA_GEOMETRY continues to be used since 10.2.2, introduced by
mysql/mysql-server@673bad7c7e17701b69e29d0fbc4e2d68c1a7b613
in MySQL 5.7.1.
parent c6ed37b8
...@@ -801,35 +801,3 @@ rtree_area_overlapping( ...@@ -801,35 +801,3 @@ rtree_area_overlapping(
return(area); return(area);
} }
/** Get the wkb of default POINT value, which represents POINT(0 0)
if it's of dimension 2, etc.
@param[in] n_dims dimensions
@param[out] wkb wkb buffer for default POINT
@param[in] len length of wkb buffer
@return non-0 indicate the length of wkb of the default POINT,
0 if the buffer is too small */
uint
get_wkb_of_default_point(
uint n_dims,
uchar* wkb,
uint len)
{
// JAN: TODO: MYSQL 5.7 GIS
#define GEOM_HEADER_SIZE 16
if (len < GEOM_HEADER_SIZE + sizeof(double) * n_dims) {
return(0);
}
/** POINT wkb comprises SRID, wkb header(byte order and type)
and coordinates of the POINT */
len = GEOM_HEADER_SIZE + sizeof(double) * n_dims;
/** We always use 0 as default coordinate */
memset(wkb, 0, len);
/** We don't need to write SRID, write 0x01 for Byte Order */
mach_write_to_n_little_endian(wkb + SRID_SIZE, 1, 0x01);
/** Write wkbType::wkbPoint for the POINT type */
mach_write_to_n_little_endian(wkb + SRID_SIZE + 1, 4, wkbPoint);
return(len);
}
...@@ -54,19 +54,6 @@ enum wkbByteOrder ...@@ -54,19 +54,6 @@ enum wkbByteOrder
wkbNDR = 1 /* Little Endian */ wkbNDR = 1 /* Little Endian */
}; };
/** Get the wkb of default POINT value, which represents POINT(0 0)
if it's of dimension 2, etc.
@param[in] n_dims dimensions
@param[out] wkb wkb buffer for default POINT
@param[in] len length of wkb buffer
@return non-0 indicate the length of wkb of the default POINT,
0 if the buffer is too small */
uint
get_wkb_of_default_point(
uint n_dims,
uchar* wkb,
uint len);
/*************************************************************//** /*************************************************************//**
Calculate minimal bounding rectangle (mbr) of the spatial object Calculate minimal bounding rectangle (mbr) of the spatial object
stored in "well-known binary representation" (wkb) format. stored in "well-known binary representation" (wkb) format.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment