diff options
author | Michael Widenius <monty@askmonty.org> | 2010-08-06 15:39:37 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-08-06 15:39:37 +0300 |
commit | 50b43cf8055819290f7155a052d52cc563928f22 (patch) | |
tree | eb25b4d03d9c554fed6f3c8f336591ec8de6c4a2 /sql/handler.cc | |
parent | 8b48a0aa28a7538d372146a19e836a5c3b63046a (diff) | |
download | mariadb-git-50b43cf8055819290f7155a052d52cc563928f22.tar.gz |
Fix for LP#614265 Crash in _ma_unpin_all_pages / _ma_search on DELETE with Aria search engine
Fixed compiler warnings
client/mysqlslap.c:
Fixed compiler warnings
mysql-test/suite/maria/r/maria.result:
Test case for LP#614265
mysql-test/suite/maria/t/maria.test:
Test case for LP#614265
mysql-test/suite/pbxt/t/skip_name_resolve-master.opt:
Ensure that we get restart before test (as test uses show processlist)
sql/handler.cc:
Added cloned marker if clone was called (for safety checks & debugging)
sql/handler.h:
Added cloned marker if clone was called (for safety checks & debugging)
storage/maria/ha_maria.cc:
In clone call, set file->trn if cloned file had this set. This is needed as maria_create_trn_for_mysql() and thus file->trn is never set for cloned table.
Ensure that file->trn is properly reset after calls to repair/check/zerofill.
Increment locked table count if file->trn is set (as we decrement this in the unlock call)
tests/mysql_client_test.c:
Fixed compiler warnings
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index afd9d08971d..7b1100ffe9d 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2027,6 +2027,10 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path, handler *handler::clone(MEM_ROOT *mem_root) { handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type()); + + if (!new_handler) + return NULL; + /* Allocate handler->ref here because otherwise ha_open will allocate it on this->table->mem_root and we will not be able to reclaim that memory @@ -2034,12 +2038,13 @@ handler *handler::clone(MEM_ROOT *mem_root) */ if (!(new_handler->ref= (uchar*) alloc_root(mem_root, ALIGN_SIZE(ref_length)*2))) return NULL; - if (new_handler && !new_handler->ha_open(table, - table->s->normalized_path.str, - table->db_stat, - HA_OPEN_IGNORE_IF_LOCKED)) - return new_handler; - return NULL; + if (new_handler->ha_open(table, + table->s->normalized_path.str, + table->db_stat, + HA_OPEN_IGNORE_IF_LOCKED)) + return NULL; + new_handler->cloned= 1; // Marker for debugging + return new_handler; } |