summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-07-04 13:53:07 +0200
committerTor Didriksen <tor.didriksen@oracle.com>2011-07-04 13:53:07 +0200
commit3d60c6c159810e047e6714423481e67a06fa9830 (patch)
tree87a2c93295b84f83e7b2fd5aa0b018533889f70f /sql/field.h
parentaabea4c044c53ec4c171e70f8f41c18477544441 (diff)
downloadmariadb-git-3d60c6c159810e047e6714423481e67a06fa9830.tar.gz
Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
Field_geom::reset() failed to reset its base Field_blob. The range optimizer used the un-initilized field during optimization and execution.
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index 304e75494e2..9c2cd52cfa5 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1906,7 +1906,13 @@ public:
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
uint size_of() const { return sizeof(*this); }
- int reset(void) { return !maybe_null() || Field_blob::reset(); }
+
+ /**
+ Non-nullable GEOMETRY types cannot have defaults,
+ but the underlying blob must still be reset.
+ */
+ int reset(void) { return Field_blob::reset() || !maybe_null(); }
+
geometry_type get_geometry_type() { return geom_type; };
};
#endif /*HAVE_SPATIAL*/