Commit 37144afb authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: Simplify cmp_geometry_field() and cmp_whole_field()

Let us always compare DATA_GEOMETRY with cmp_geometry_field().
parent be1d9653
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2020, MariaDB Corporation. Copyright (c) 2020, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -224,7 +224,6 @@ static ...@@ -224,7 +224,6 @@ static
int int
cmp_geometry_field( cmp_geometry_field(
/*===============*/ /*===============*/
ulint prtype, /*!< in: precise type */
const byte* a, /*!< in: data field */ const byte* a, /*!< in: data field */
unsigned int a_length, /*!< in: data field length, unsigned int a_length, /*!< in: data field length,
not UNIV_SQL_NULL */ not UNIV_SQL_NULL */
...@@ -235,8 +234,6 @@ cmp_geometry_field( ...@@ -235,8 +234,6 @@ cmp_geometry_field(
double x1, x2; double x1, x2;
double y1, y2; double y1, y2;
ut_ad(prtype & DATA_GIS_MBR);
if (a_length < sizeof(double) || b_length < sizeof(double)) { if (a_length < sizeof(double) || b_length < sizeof(double)) {
return(0); return(0);
} }
...@@ -297,8 +294,7 @@ cmp_gis_field( ...@@ -297,8 +294,7 @@ cmp_gis_field(
not UNIV_SQL_NULL */ not UNIV_SQL_NULL */
{ {
if (mode == PAGE_CUR_MBR_EQUAL) { if (mode == PAGE_CUR_MBR_EQUAL) {
return cmp_geometry_field(DATA_GIS_MBR, return cmp_geometry_field(a, a_length, b, b_length);
a, a_length, b, b_length);
} else { } else {
return rtree_key_cmp(mode, a, int(a_length), b, int(b_length)); return rtree_key_cmp(mode, a, int(a_length), b, int(b_length));
} }
...@@ -370,8 +366,6 @@ cmp_whole_field( ...@@ -370,8 +366,6 @@ cmp_whole_field(
case DATA_MYSQL: case DATA_MYSQL:
return(innobase_mysql_cmp(prtype, return(innobase_mysql_cmp(prtype,
a, a_length, b, b_length)); a, a_length, b, b_length));
case DATA_GEOMETRY:
return cmp_geometry_field(prtype, a, a_length, b, b_length);
default: default:
ib::fatal() << "Unknown data type number " << mtype; ib::fatal() << "Unknown data type number " << mtype;
} }
...@@ -433,9 +427,8 @@ cmp_data( ...@@ -433,9 +427,8 @@ cmp_data(
ut_ad(prtype & DATA_BINARY_TYPE); ut_ad(prtype & DATA_BINARY_TYPE);
pad = ULINT_UNDEFINED; pad = ULINT_UNDEFINED;
if (prtype & DATA_GIS_MBR) { if (prtype & DATA_GIS_MBR) {
return(cmp_whole_field(mtype, prtype, return(cmp_geometry_field(data1, (unsigned) len1,
data1, (unsigned) len1, data2, (unsigned) len2));
data2, (unsigned) len2));
} }
break; break;
case DATA_BLOB: case DATA_BLOB:
......
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