summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-13 18:48:41 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-13 18:48:41 +0300
commit2f7b37b02154748b223e385a7d7787900ab37b5e (patch)
tree49a5ab1928bd840c129bd14ce72c5cf2c0190e20 /sql/item_geofunc.cc
parent7f03b1d78f2aab738e38a1e33ac887757604585a (diff)
parentb811c6ecc74cc1421eedc92573447768d1eb7980 (diff)
downloadmariadb-git-2f7b37b02154748b223e385a7d7787900ab37b5e.tar.gz
Merge 10.3 into 10.4, except MDEV-22543
Also, fix GCC -Og -Wmaybe-uninitialized in run_backup_stage()
Diffstat (limited to 'sql/item_geofunc.cc')
-rw-r--r--sql/item_geofunc.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 9e6c8ea9008..ce52c6d246d 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -2380,12 +2380,15 @@ double Item_func_distance::val_real()
MBR mbr1, mbr2;
const char *c_end;
-
- if ((null_value= (args[0]->null_value || args[1]->null_value ||
- !(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
- !(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
- g1->get_mbr(&mbr1, &c_end) ||
- g2->get_mbr(&mbr2, &c_end))))
+ if (args[0]->null_value || args[1]->null_value)
+ goto mem_error;
+ g1= Geometry::construct(&buffer1, res1->ptr(), res1->length());
+ if (!g1)
+ goto mem_error;
+ g2= Geometry::construct(&buffer2, res2->ptr(), res2->length());
+ if (!g2)
+ goto mem_error;
+ if (g1->get_mbr(&mbr1, &c_end) || g2->get_mbr(&mbr2, &c_end))
goto mem_error;
mbr1.add_mbr(&mbr2);
@@ -2534,7 +2537,7 @@ String *Item_func_pointonsurface::val_str(String *str)
Geometry *g;
MBR mbr;
const char *c_end;
- double UNINIT_VAR(px), UNINIT_VAR(py), x0, y0;
+ double UNINIT_VAR(px), UNINIT_VAR(py), x0, UNINIT_VAR(y0);
String *result= 0;
const Gcalc_scan_iterator::point *pprev= NULL;
uint32 srid;