diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-12-10 14:21:45 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-12-10 14:21:45 +0200 |
commit | b8f47f1fc68d746f190bd2e4e18112a3fdcef46d (patch) | |
tree | 7a669fdad51afca1bee84c79b03faf4fa0dc1ae3 | |
parent | 2b63a59114a7e693a75f0c79238bcfddf80c76f4 (diff) | |
download | mariadb-git-b8f47f1fc68d746f190bd2e4e18112a3fdcef46d.tar.gz |
Fixed bug in allocation of dynamic record buffer in Maria
Unified printing of mutex addresses to make them easier to compare
mysys/thr_mutex.c:
Unified printing of mutex addresses to make them easier to compare
storage/maria/ma_dynrec.c:
Fixed indentation
storage/maria/ma_open.c:
Fixed bug in allocation of dynamic record buffer
-rw-r--r-- | mysys/thr_mutex.c | 6 | ||||
-rw-r--r-- | storage/maria/ma_dynrec.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_open.c | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 839cbc133df..48d61a48c62 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -96,7 +96,7 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line) int error; #ifndef DBUG_OFF if (my_thread_var_get_dbug((my_bool*) 0)) - DBUG_PRINT("mutex", ("Locking mutex: 0x%lx", (ulong) mp)); + DBUG_PRINT("mutex", ("0x%lx locking", (ulong) mp)); #endif if (!mp->file) { @@ -137,7 +137,7 @@ line %d more than 1 time\n", file,line); pthread_mutex_unlock(&mp->global); #ifndef DBUG_OFF if (my_thread_var_get_dbug((my_bool*) 0)) - DBUG_PRINT("mutex", ("mutex: 0x%lx locked", (ulong) mp)); + DBUG_PRINT("mutex", ("0x%lx locked", (ulong) mp)); #endif return error; } @@ -148,7 +148,7 @@ int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line) int error; #ifndef DBUG_OFF if (my_thread_var_get_dbug((my_bool*) 0)) - DBUG_PRINT("mutex", ("Unlocking mutex 0x%lx", (ulong) mp)); + DBUG_PRINT("mutex", ("0x%lx unlocking", (ulong) mp)); #endif pthread_mutex_lock(&mp->global); if (mp->count == 0) diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c index f12344e3474..9f42f2beaa2 100644 --- a/storage/maria/ma_dynrec.c +++ b/storage/maria/ma_dynrec.c @@ -932,7 +932,8 @@ uint _ma_rec_pack(MARIA_HA *info, register uchar *to, flag|=bit; else { - memcpy((uchar*) to,from,(size_t) length); to+=length; + memcpy((uchar*) to,from,(size_t) length); + to+=length; } } else if (type == FIELD_SKIP_ENDSPACE || diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index e679f5a0831..7888a6f3d94 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -668,15 +668,18 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->page_type= PAGECACHE_PLAIN_PAGE; share->now_transactional= share->base.born_transactional; - share->base.default_rec_buff_size= max(share->base.pack_reclength, - share->base.max_key_length); if (share->data_file_type == DYNAMIC_RECORD) { + /* add bits used to pack data to pack_reclength for faster allocation */ + share->base.pack_reclength+= share->base.pack_bytes; share->base.extra_rec_buff_size= (ALIGN_SIZE(MARIA_MAX_DYN_BLOCK_HEADER) + MARIA_SPLIT_LENGTH + MARIA_REC_BUFF_OFFSET); - share->base.default_rec_buff_size+= share->base.extra_rec_buff_size; } + share->base.default_rec_buff_size= (max(share->base.pack_reclength, + share->base.max_key_length) + + share->base.extra_rec_buff_size); + if (share->data_file_type == COMPRESSED_RECORD) { /* Need some extra bytes for decode_bytes */ @@ -897,8 +900,6 @@ void _ma_setup_functions(register MARIA_SHARE *share) share->compare_record= _ma_cmp_dynamic_record; share->compare_unique= _ma_cmp_dynamic_unique; share->calc_checksum= share->calc_write_checksum= _ma_checksum; - /* add bits used to pack data to pack_reclength for faster allocation */ - share->base.pack_reclength+= share->base.pack_bytes; if (share->base.blobs) { share->update_record= _ma_update_blob_record; |