diff options
author | unknown <gkodinov/kgeorge@magare.gmz[kgeorge]> | 2007-03-26 13:17:40 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz[kgeorge]> | 2007-03-26 13:17:40 +0300 |
commit | 3335f68d8902fdbbebb2c41d09253a4cafe675bb (patch) | |
tree | 08da49132f3c350c9a4235951b7913751c075156 /sql/field.h | |
parent | 55f991c24d584d57d21fd780f0e51fceb5e2321a (diff) | |
download | mariadb-git-3335f68d8902fdbbebb2c41d09253a4cafe675bb.tar.gz |
Bug #27164: not reseting the data pointer
to 0 causes wrong (large) length to be read
from the row in _mi_calc_blob_length() when
storing NULL values in (e.g) POINT columns.
This large length is then used to allocate
a block of memory that (on some OSes) causes
trouble.
Fixed by calling the base class's
Field_blob::reset() from Field_geom::reset()
that is called when storing a NULL value into
the column.
mysql-test/r/gis.result:
Bug #27164: test case
mysql-test/t/gis.test:
Bug #27164: test case
sql/field.h:
Bug #27164: not reseting the data pointer
to 0 causes wrong (large) length to be read
from the row in _mi_calc_blob_length() when
storing NULL values in (e.g) POINT columns.
This large length is then used to allocate
a block of memory that (on some OSes) causes
trouble.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h index d3e38db83d1..58177747120 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1115,7 +1115,7 @@ public: int store(const char *to, uint length, CHARSET_INFO *charset); int store(double nr) { return 1; } int store(longlong nr) { return 1; } - int reset(void) { return !maybe_null(); } + int reset(void) { return !maybe_null() || Field_blob::reset(); } void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); |