diff options
author | Eugene Kosov <claprix@yandex.ru> | 2021-04-01 16:49:07 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2021-04-01 16:49:07 +0300 |
commit | 4c80dcda46e4183df00f9fdb35ed08975e55e8f8 (patch) | |
tree | f6d1d2749af2bbc7be6601300cf822bf21e3e90c | |
parent | 77ffbbca49064291817430cd29afc160dfe4a706 (diff) | |
download | mariadb-git-4c80dcda46e4183df00f9fdb35ed08975e55e8f8.tar.gz |
fix gcc optimized build
../sql/spatial.cc: In member function ‘double Gis_point::calculate_haversine(const Geometry*, double, int*)’:
../sql/spatial.cc:1093:45: error: ‘y1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1093 | res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
| ~~~^~~~~
../sql/spatial.cc:1092:20: error: ‘x1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1092 | dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
| ~~~~~^~~~~~
../sql/spatial.cc:1093:54: error: ‘y2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1093 | res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
| ~~~^~~~~
../sql/spatial.cc:1092:20: error: ‘x2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1092 | dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
| ~~~~~^~~~~~
c
-rw-r--r-- | sql/spatial.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc index 2482a21bb5f..319c1aaaef6 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -1050,7 +1050,7 @@ double Gis_point::calculate_haversine(const Geometry *g, int *error) { DBUG_ASSERT(sphere_radius > 0); - double x1r, x2r, y1r, y2r, dlong, dlat, res; + double x1r= 0.0, x2r= 0.0, y1r= 0.0, y2r= 0.0, dlong, dlat, res; // This check is done only for optimization purposes where we know it will // be one and only one point in Multipoint |