4526 Jon Olav Hauglid 2012-11-01
Bug#14838882: INIT_IO_CACHE() HAS SUSPICIOUS MEMSET()
The problem was that init_io_cache() contained a memset() that with
SAFE_MUTEX was used to clear a mutex - IO_CACHE::append_buffer_lock.
However the size of memory cleared was the size of the IO_CACHE pointer
rather than the size of the IO_CACHE::append_buffer_lock mutex.
This patch fixes the problem by clearing the appropriate number
of bytes.
modified:
mysys/mf_iocache.c
4525 Jon Olav Hauglid 2012-11-01
Bug#14756206: ALTER TABLE: MYSQL_CREATE_FRM DOESN'T CLEAN
UP PROPERLY, MEMORY LEAKED
This memory leak happend if ALTER TABLE ... SET DEFAULT was
used to set a default value for a TINY|MEDIUM|LONG BLOB|TEXT
column.
According to the manual,
"BLOB and TEXT columns cannot be assigned a default value."
This was true for CREATE TABLE and ALTER TABLE ADD/MODIFY
COLUMN. However, for ALTER TABLE ... SET DEFAULT it was only
enforced for plain BLOB|TEXT columns and not for their
tiny/medium/long variations.
When creating the record buffer for the default values of
blob columns (represented internally by Field_blob),
Field_blob::free() and ~Field_blob() were never called and
memory allocated for Field_blob::value was therefore never
released.
This patch fixes the problem by reporting
ER_BLOB_CANT_HAVE_DEFAULT error for TINY|MEDIUM|LONG BLOB|TEXT
columns, similarly to what is already done for BLOB|TEXT columns
and similar to what is already done for CREATE TABLE and
ALTER TABLE ADD/MODIFY COLUMN.
Note that this also disallows ALTER TABLE ... SET DEFAULT NULL
for geometry column types (Field_geom). Such columns are
not supposed to support SET DEFAULT and everything but
SET DEFAULT NULL was already disallowed.
modified:
internal/mysql-test/suite/i_main/r/alter_table.result
internal/mysql-test/suite/i_main/r/gis.result
internal/mysql-test/suite/i_main/t/alter_table.test
internal/mysql-test/suite/i_main/t/gis.test
sql/sql_table.cc
sql/unireg.cc
=== modified file 'mysys/mf_iocache.c'
--- a/mysys/mf_iocache.c 2012-07-25 09:33:25 +0000
+++ b/mysys/mf_iocache.c 2012-11-01 13:36:39 +0000
@@ -259,7 +259,7 @@ int init_io_cache(IO_CACHE *info, File f
else
{
/* Clear mutex so that safe_mutex will notice that it's not initialized */
- memset(&info->append_buffer_lock, 0, sizeof(info));
+ memset(&info->append_buffer_lock, 0, sizeof(info->append_buffer_lock));
}
#endif
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.6 branch (jon.hauglid:4525 to 4526) Bug#14838882 | Jon Olav Hauglid | 6 Nov |