rw_trx_hash_t::find() acquires element->mutex, then unpins pins, used for
lf_hash element search. After that the "element" can be deallocated and
reused by some other thread.
If we take a look rw_trx_hash_t::insert()->lf_hash_insert()->lf_alloc_new()
calls, we will not find any element->mutex acquisition, as it was not
initialized yet before it's allocation. rw_trx_hash_t::insert() can reuse
the chunk, unpinned in rw_trx_hash_t::find().
The scenario is the following:
1. Thread 1 have just executed lf_hash_search() in
rw_trx_hash_t::find(), but have not acquired element->mutex yet.
2. Thread 2 have removed the element from hash table with
rw_trx_hash_t::erase() call.
3. Thread 1 acquired element->mutex and unpinned pin 2 pin with
lf_hash_search_unpin(pins) call.
4. Some thread purged memory of the element.
5. Thread 3 reused the memory for the element, filled element->id,
element->trx.
6. Thread 1 crashes with failed "DBUG_ASSERT(trx_id == trx->id)"
assertion.
Note that trx_t objects are also reused, see the code around trx_pools
for details.
The fix is to invoke "lf_hash_search_unpin(pins);" after element->trx is
stored in local variable in rw_trx_hash_t::find().
Reviewed by: Nikita Malyavin, Marko Mäkelä.
MariaDB server crashes on ARM (weak memory model architecture) while
concurrently executing l_find to load node->key and add_to_purgatory
to store node->key = NULL. l_find then uses key (which is NULL), to
pass it to a comparison function.
The specific problem is the out-of-order execution that happens on a
weak memory model architecture. Two essential reorderings are possible,
which need to be prevented.
a) As l_find has no barriers in place between the optimistic read of
the key field lf_hash.cc#L117 and the verification of link lf_hash.cc#L124,
the processor can reorder the load to happen after the while-loop.
In that case, a concurrent thread executing add_to_purgatory on the same
node can be scheduled to store NULL at the key field lf_alloc-pin.c#L253
before key is loaded in l_find.
b) A node is marked as deleted by a CAS in l_delete lf_hash.cc#L247 and
taken off the list with an upfollowing CAS lf_hash.cc#L252. Only if both
CAS succeed, the key field is written to by add_to_purgatory. However,
due to a missing barrier, the relaxed store of key lf_alloc-pin.c#L253
can be moved ahead of the two CAS operations, which makes the value of
the local purgatory list stored by add_to_purgatory visible to all threads
operating on the list. As the node is not marked as deleted yet, the
same error occurs in l_find.
This change three accesses to be atomic.
* optimistic read of key in l_find lf_hash.cc#L117
* read of link for verification lf_hash.cc#L124
* write of key in add_to_purgatory lf_alloc-pin.c#L253
Reviewers: Sergei Vojtovich, Sergei Golubchik
Fixes: MDEV-23510 / d30c1331a18d875e553f3fcf544997e4f33fb943
MariaDB server crashes on ARM (weak memory model architecture) while
concurrently executing l_find to load node->key and add_to_purgatory
to store node->key = NULL. l_find then uses key (which is NULL), to
pass it to a comparison function.
The specific problem is the out-of-order execution that happens on a
weak memory model architecture. Two essential reorderings are possible,
which need to be prevented.
a) As l_find has no barriers in place between the optimistic read of
the key field lf_hash.cc#L117 and the verification of link lf_hash.cc#L124,
the processor can reorder the load to happen after the while-loop.
In that case, a concurrent thread executing add_to_purgatory on the same
node can be scheduled to store NULL at the key field lf_alloc-pin.c#L253
before key is loaded in l_find.
b) A node is marked as deleted by a CAS in l_delete lf_hash.cc#L247 and
taken off the list with an upfollowing CAS lf_hash.cc#L252. Only if both
CAS succeed, the key field is written to by add_to_purgatory. However,
due to a missing barrier, the relaxed store of key lf_alloc-pin.c#L253
can be moved ahead of the two CAS operations, which makes the value of
the local purgatory list stored by add_to_purgatory visible to all threads
operating on the list. As the node is not marked as deleted yet, the
same error occurs in l_find.
This change three accesses to be atomic.
* optimistic read of key in l_find lf_hash.cc#L117
* read of link for verification lf_hash.cc#L124
* write of key in add_to_purgatory lf_alloc-pin.c#L253
Reviewers: Sergei Vojtovich, Sergei Golubchik
Fixes: MDEV-23510 / d30c1331a18d875e553f3fcf544997e4f33fb943
Use my_thread_var::stack_ends_here inside lf_pinbox_real_free() for address
where thread stack ends.
Remove LF_PINS::stack_ends_here.
It is not safe to assume that mysys_var that was used during pin allocation,
remains correct during free. E.g with binlog group commit in Innodb,
that frees pins for multiple Innodb transactions, it does not work
correctly.
don't allocate all the stack, leave some stack for
function calls.
To test I added the following line:
alloca_size = available_stack_size() - X
at X=4096 or less mysqld crashed, at 8192 mtr test passed.
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
LOCK_THREAD_COUNT
When using the performance schema file io instrumentation in MySQL 5.5,
a thread would loop forever inside lf_pinbox_put_pins, when disconnecting.
It would also hold LOCK_thread_count while doing so, effectively killing the
server.
The root cause of the loop in lf_pinbox_put_pins() is a leak of LF_PINS,
when used with the filename_hash LF_HASH table in the performance schema.
This fix contains the following changes:
1)
Added the missing call to lf_hash_search_unpin(), to prevent the leak.
2)
In mysys/lf_alloc-pin.c, there was some extra debugging code
(MY_LF_EXTRA_DEBUG) written to detect precisely this kind of issues,
but it was never used.
Replaced MY_LF_EXTRA_DEBUG with DBUG_OFF, so that leaks similar to this one
can be always detected in regular debug builds.
3)
Backported the fix for the following bug, from 5.6 to 5.5:
Bug#13417446 - 63339: INCORRECT FILE PATH IN PEFORMANCE_SCHEMA ON WINDOWS
Before this fix, a thread instrumented for the performance schema,
that would perform file io operations, could crash inside the LF_HASH
implementation, in cases when my_thread_init is not called.
The crash itself has not been reported in 5.5 but similar crashes have
been found in 5.6-based development branches, using LF_HASH for
more instrumentation.
The possibility of a crash in 5.5 is confirmed by code analysis.
The problem is that, when my_thread_init() is not called,
which can happen for threads in storage engines or thirs party code,
my_thread_var is NULL.
Using my_thread_var->stacks_ends_here in mysys/lf_alloc-pin.c is unsafe.
Given that my_thread_var is used:
- only for stacks_ends_here
- only on platform with HAVE_ALLOCA
- only when there is enough room on the stack
and given that the LF_HASH implementation has a fallback
algorythm implemented already when using alloca is not possible,
using my_thread_var->stacks_ends_here is in fact not a strict requirement,
and can be relaxed.
The fix is to:
- test explicitly if my_thread_var is NULL, to account for cases
when my_thread_init() is not used by the calling thread.
- not use alloca in this case, and rely on the fall back code already in place.
so that the LF_HASH can be supported even without my_thread_init().
The implementation of mysys/lf_alloc-pin.c has been fixed to support this new usage.
The units tests in unittest/mysys/lf-t.c have been adjusted accordingly.
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.
Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.
Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost.
The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.
Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
client/mysqldump.c:
Pass my_free directly as its signature is compatible with the
callback type -- which wasn't the case for free_table_ent.
Add -Wall to gcc/g++
Fix most warnings reported in dbg and opt mode.
cmd-line-utils/libedit/filecomplete.c:
Remove unused auto variables.
configure.cmake:
Add -Wall to gcc.
extra/comp_err.c:
Cast to correct type.
extra/perror.c:
Fix segfault (but warnings about deprecated features remain)
extra/yassl/taocrypt/include/runtime.hpp:
Comparing two literals was reported as undefined behaviour.
include/my_global.h:
Add a template for aligning character buffers.
mysys/lf_alloc-pin.c:
Initialize pointer.
sql/mysqld.cc:
Use UNINIT_VAR rather than LINT_INIT.
sql/partition_info.cc:
Use UNINIT_VAR rather than LINT_INIT.
sql/rpl_handler.cc:
Use char[] rather than unsigned long[] array for placement buffer.
sql/spatial.cc:
Use char[] rather than unsigned void*[] array for placement buffer.
sql/spatial.h:
Use char[] rather than unsigned void*[] array for placement buffer.
sql/sql_partition.cc:
Initialize auto variable.
sql/sql_table.cc:
Initialize auto variables.
Add parens around assignment within if()
sql/sys_vars.cc:
Use UNINIT_VAR.
storage/innobase/os/os0file.c:
Init first slot in auto variable.
storage/myisam/mi_create.c:
Use UNINIT_VAR rather than LINT_INIT.
storage/myisam/mi_open.c:
Remove (wrong) casting.
storage/myisam/mi_page.c:
Remove (wrong) casting.
storage/myisam/mi_search.c:
Cast to uchar* rather than char*.
strings/ctype-ucs2.c:
Use UNINIT_VAR rather than LINT_INIT.
Add (uchar*) casting.
include/atomic/generic-msvc.h:
prevent possible compiler warnings
include/lf.h:
comments, better definition for LF_HASH_OVERHEAD
include/maria.h:
define MARIA_CANNOT_ROLLBACK here
include/my_pthread.h:
avoid possible name clash
include/waiting_threads.h:
comments, const, move WT_RESOURCE to waiting_threads.c
mysql-test/suite/maria/r/maria_notembedded.result:
new test
mysql-test/suite/maria/t/maria_notembedded.test:
new test - 5-way deadlock
mysys/lf_hash.c:
better definition for LF_HASH_OVERHEAD
mysys/my_static.c:
comment
mysys/my_thr_init.c:
casts
mysys/waiting_threads.c:
comments, asserts, etc
server-tools/instance-manager/parse.cc:
fix my_init_dynamic_array() to follow new calling conventions
sql/mysqld.cc:
call wt_init after set_proper_floating_point_mode
sql/sql_class.h:
comment
storage/maria/ha_maria.cc:
move MARIA_CANNOT_ROLLBACK to a common header
storage/maria/ma_commit.c:
comment
storage/maria/ma_write.c:
comments, check for HA_ERR_FOUND_DUPP_KEY
storage/maria/trnman.c:
comments, assert
storage/maria/trnman.h:
comments
storage/maria/unittest/trnman-t.c:
be paranoid
unittest/mysys/lf-t.c:
comments
unittest/mysys/waiting_threads-t.c:
comments, safety, memory leak
mysys/lf_alloc-pin.c:
workaround for gcc 4.1.0 strict-aliasing bug.
and yes, I mean a *bug* - as union (in alloc_free) is a
documented way to access type-punned pointers. and it helps in
newer gcc, but fails in 4.1.0
client/mysqltest.c:
compiler warnings
configure.in:
remove old tests for unused programs
disable the use of gcc built-ins if smp assembler atomics were selected explictily.
add waiting_threads.o to THREAD_LOBJECTS
include/lf.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
include/my_pthread.h:
shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
several timeout structures with only one my_getsystime() call
include/waiting_threads.h:
waiting threads - wait-for graph and deadlock detection
mysys/Makefile.am:
add waiting_threads.c
mysys/lf_alloc-pin.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
mysys/lf_hash.c:
constructor/destructor in lf-alloc
mysys/my_thr_init.c:
remember end-of-stack pointer in the mysys_var
mysys/waiting_threads.c:
waiting threads - wait-for graph and deadlock detection
storage/maria/ha_maria.cc:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/ma_commit.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman_public.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/unittest/trnman-t.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
unittest/mysys/Makefile.am:
add waiting_threads-t
unittest/mysys/lf-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/my_atomic-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/thr_template.c:
factor out the common code for multi-threaded stress unit tests
unittest/mysys/waiting_threads-t.c:
wt tests
into mysql.com:/home/my/mysql-maria
dbug/dbug.c:
Auto merged
mysys/lf_alloc-pin.c:
Auto merged
storage/maria/lockman.c:
Auto merged
storage/maria/ma_open.c:
Auto merged
storage/maria/ma_recovery.c:
Auto merged
storage/maria/unittest/ma_test_recovery.pl:
Manual merge
Fixed bug in ma_test2 when last row in table is deleted
Fixed that ma_test_recovery.pl works on Solaris (by using digest instead of md5sum)
Fixed some compiler warnings generated by the Forte compiler
dbug/dbug.c:
Added cast to get rid of compiler warning
mysys/lf_alloc-pin.c:
Added cast to get rid of compiler warning
mysys/my_bitmap.c:
Removed impossible DBUG_ASSERT()'s to get rid of compiler warnings
mysys/my_compress.c:
Removed wrong cast to get rid of compiler warning
storage/maria/lockman.c:
Added cast to get rid of compiler warning
storage/maria/ma_open.c:
Added fix from MyISAM to allocate space in key buffer for nod pointer
storage/maria/ma_recovery.c:
Fixed initialization that caused compiler warning
storage/maria/ma_rsame.c:
More DBUG_PRINT
storage/maria/ma_scan.c:
Better comment
storage/maria/ma_statrec.c:
More DBUG_PRINT and comments
Fixed indentation
BitKeeper/etc/ignore:
added storage/maria/unittest/tmp/*
storage/maria/ma_test2.c:
Fixed bug that caused maria_rsame() to fail if test removed last row
Fixed wrong usage of longget(); Should be uint4korr()
storage/maria/unittest/ma_test_recovery.pl:
Use md5sum or digest to calculate md5.
This allows this script to be run on Linux and Solaris
storage/myisam/mi_test2.c:
Fixed wrong usage of longget(); Should be uint4korr()
strings/ctype.c:
Added casts to get rid of compiler warnings
sql-bench/myisam.cnf:
New BitKeeper file ``sql-bench/myisam.cnf''
include/atomic/rwlock.h:
define MY_ATOMIC_MODE_RWLOCKS if this is the way we have to go
mysys/lf_alloc-pin.c:
no semicolon
mysys/lf_hash.c:
no semicolon
storage/maria/lockman.c:
no semicolon
storage/maria/ma_loghandler.c:
no semicolon
unittest/mysys/my_atomic-t.c:
powerpc is no better
(condition could be a bit too broad, but hey, it's just a unit test)
Added debugger hook _my_dbug_put_break_here() that is called if we get a CRC that matches --debug-crc-break (my_crc_dbug_break)
Fixed REDO_REPAIR to use all repair modes (repair, repair_by_sort, repair_paralell
REDO_REPAIR now also logs used key map
Fixed some bugs in REDO logging of key pages
Better error messages from maria_read_log
Added my_readwrite_flags to init_pagecache() to be able to get better error messages and simplify code.
Don't allow pagecaches with less than 8 blocks (Causes strange crashes)
Added EXTRA_DEBUG_KEY_CHANGES. When this is defined some REDO_INDEX entries contains page checksums (these are calculated and checked in DBUG mode, ignored otherwise)
Fixed bug in ma_pagecache unit tests that caused program to sometimes fail
Added some missing calls to MY_INIT() that caused some unit tests to fail
Fixed that TRUNCATE works properly on temporary MyISAM files
Updates some result files to new table checksums results (checksum when NULL fields are ignored)
perl test-insert can be replayed with maria_read_log!
sql/share/Makefile.am:
Change mode to -rw-rw-r--
BitKeeper/etc/ignore:
added storage/maria/unittest/page_cache_test_file_1 storage/maria/unittest/pagecache_debug.log
include/maria.h:
Added maria_tmpdir
include/my_base.h:
Added error HA_ERR_FILE_TOO_SHORT
include/my_sys.h:
Added variable my_crc_dbug_check
Added function my_dbug_put_break_here()
include/myisamchk.h:
Added org_key_map (Needed for writing REDO record for REPAIR)
mysql-test/r/innodb.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/r/mix2_myisam.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/r/myisam.result:
Updated to new checksum algorithm (NULL ignored)
mysql-test/t/myisam.test:
Added used table
mysys/checksum.c:
Added DBUG for checksum results
Added debugger hook so that _my_dbug_put_break_here() is called if we get matching CRC
mysys/lf_alloc-pin.c:
Fixed compiler warning
mysys/my_handler.c:
Added new error message
mysys/my_init.c:
If my_progname is not given, use 'unknown' form my_progname_short
Added debugger function my_debug_put_break_here()
mysys/my_pread.c:
In case of too short file when MY_NABP or MY_FNABP is specified, give error HA_ERR_FILE_TO_SHORT
mysys/my_read.c:
In case of too short file when MY_NABP or MY_FNABP is specified, give error HA_ERR_FILE_TO_SHORT
sql/mysqld.cc:
Added debug option --debug-crc-break
sql/sql_parse.cc:
Trivial optimization
storage/maria/ha_maria.cc:
Renamed variable to be more logical
Ensure that param.testflag is correct when calling repair
Added extra argument to init_pagecache
Set default value for maria_tempdir
storage/maria/ma_blockrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_cache.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_check.c:
Set param->testflag to match how repair is run (needed for REDO logging)
Simple optimization
Moved flag if page is node from pagelength to keypage-flag byte
Log used key map in REDO log.
storage/maria/ma_delete.c:
Remember previous UNDO entry when writing undo (for future CLR records)
Moved flag if page is node from pagelength to keypage-flag byte
Fixed some bugs in redo logging
Added CRC for some translog REDO_INDEX entries
storage/maria/ma_dynrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_ft_update.c:
Fixed call to _ma_store_page_used()
storage/maria/ma_key_recover.c:
Added CRC for some translog REDO_INDEX entries
Removed not needed pagecache_write() in _ma_apply_redo_index()
storage/maria/ma_locking.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/maria/ma_loghandler.c:
Added used key map to REDO_REPAIR_TABLE
storage/maria/ma_loghandler.h:
Added operation for checksum of key pages
storage/maria/ma_open.c:
Allocate storage for undo lsn pointers
storage/maria/ma_pagecache.c:
Remove not needed include file
Change logging to use fd: for file descritors as other code
Added my_readwrite_flags to init_pagecache() to be able to get better error messages for maria_chk/maria_read_log
Don't allow pagecaches with less than 8 blocks
Remove wrong DBUG_ASSERT()
storage/maria/ma_pagecache.h:
Added readwrite_flags
storage/maria/ma_recovery.c:
Better error messages for maria_read_log:
- Added eprint() for printing error messages
- Print extra \n before error message if we are printing %0 %10 ...
Added used key_map to REDO_REPAIR log entry
More DBUG
Call same repair method that was used by mysqld
storage/maria/ma_rt_index.c:
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/ma_rt_key.c:
Fixed call to _ma_store_page_used()
storage/maria/ma_rt_split.c:
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/ma_static.c:
Added maria_tmpdir
storage/maria/ma_test1.c:
Updated call to init_pagecache()
storage/maria/ma_test2.c:
Updated call to init_pagecache()
storage/maria/ma_test3.c:
Updated call to init_pagecache()
storage/maria/ma_write.c:
Removed #ifdef NOT_YET
Moved flag if page is node from pagelength to keypage-flag byte
Fixed bug in _ma_log_del_prefix()
storage/maria/maria_chk.c:
Fixed wrong min limit for page_buffer_size
Updated call to init_pagecache()
storage/maria/maria_def.h:
Added EXTRA_DEBUG_KEY_CHANGES. When this is defined some REDO_INDEX entries contains page checksums
Moved flag if page is node from pagelength to keypage-flag byte
storage/maria/maria_ftdump.c:
Updated call to init_pagecache()
storage/maria/maria_pack.c:
Updated call to init_pagecache()
Reset share->state.create_rename_lsn & share->state.is_of_horizon
storage/maria/maria_read_log.c:
Better error messages
Added --tmpdir option (needed to set temporary directory for REDO_REPAIR)
Added --start-from-lsn
Changed option for --display-only to 'd' (wanted to use -o for 'offset')
storage/maria/unittest/lockman2-t.c:
Added missing call to MY_INIT()
storage/maria/unittest/ma_pagecache_consist.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_pagecache_single.c:
Fixed bug that caused program to sometimes fail
Added some DBUG_ASSERTS()
Changed some calls to malloc()/free() to my_malloc()/my_free()
Create extra file to expose original hard-to-find bug
storage/maria/unittest/ma_test_loghandler-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Updated call to init_pagecache()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Updated call to init_pagecache()
storage/maria/unittest/test_file.c:
Changed malloc()/free() to my_malloc()/my_free()
Fixed memory leak
Changd logic a bit while trying to find bug in reset_file()
storage/maria/unittest/trnman-t.c:
Added missing call to MY_INIT()
storage/myisam/mi_cache.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/myisam/mi_create.c:
Removed O_EXCL to get TRUNCATE to work for temporary files
storage/myisam/mi_dynrec.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
storage/myisam/mi_locking.c:
Test for HA_ERR_FILE_TOO_SHORT instead for -1
mysql-test/r/old-mode.result:
New BitKeeper file ``mysql-test/r/old-mode.result''
mysql-test/t/old-mode-master.opt:
New BitKeeper file ``mysql-test/t/old-mode-master.opt''
mysql-test/t/old-mode.test:
New BitKeeper file ``mysql-test/t/old-mode.test''