diff options
author | Michael Widenius <monty@mysql.com> | 2008-08-25 14:49:47 +0300 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2008-08-25 14:49:47 +0300 |
commit | 1a5de5bc82cee3c2411862b8ef32588b530a780f (patch) | |
tree | 2baced329239d24a26baaa76e655f5c457d9dcbf /storage/maria/ma_pagecache.c | |
parent | d145362edf0c6c640b46eb08db18e2781d128075 (diff) | |
download | mariadb-git-1a5de5bc82cee3c2411862b8ef32588b530a780f.tar.gz |
Changed all file names in maria to LEX_STRING and removed some calls to strlen()
Ensure that pagecache gives correct error number even if error for block happend
mysys/my_pread.c:
Indentation fix
storage/maria/ha_maria.cc:
filenames changed to be of type LEX_STRING
storage/maria/ma_check.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_checkpoint.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_create.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_dbug.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_delete.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_info.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_keycache.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_locking.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_loghandler.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_open.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_pagecache.c:
Store error number for last failed operation in the page block
This should fix some asserts() when errno was not properly set after failure to read block in another thread
storage/maria/ma_recovery.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_update.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_write.c:
filenames changed to be of type LEX_STRING
storage/maria/maria_def.h:
filenames changed to be of type LEX_STRING
storage/maria/maria_ftdump.c:
filenames changed to be of type LEX_STRING
storage/maria/maria_pack.c:
filenames changed to be of type LEX_STRING
Diffstat (limited to 'storage/maria/ma_pagecache.c')
-rw-r--r-- | storage/maria/ma_pagecache.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 3e28835d4a8..cb4b0f0aed1 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -305,12 +305,13 @@ struct st_pagecache_block_link ulonglong last_hit_time; /* timestamp of the last hit */ WQUEUE wqueue[COND_SIZE]; /* queues on waiting requests for new/old pages */ - uint requests; /* number of requests for the block */ - uint status; /* state of the block */ - uint pins; /* pin counter */ - uint wlocks; /* write locks counter */ - uint rlocks; /* read locks counter */ - uint rlocks_queue; /* rd. locks waiting wr. lock of this thread */ + uint32 requests; /* number of requests for the block */ + uint32 pins; /* pin counter */ + uint32 wlocks; /* write locks counter */ + uint32 rlocks; /* read locks counter */ + uint32 rlocks_queue; /* rd. locks waiting wr. lock of this thread */ + uint16 status; /* state of the block */ + int16 error; /* error code for block in case of error */ enum PCBLOCK_TEMPERATURE temperature; /* block temperature: cold, warm, hot*/ enum pagecache_page_type type; /* type of the block */ uint hits_left; /* number of hits left until promotion */ @@ -2068,6 +2069,7 @@ restart: (my_bool)(block->hash_link ? 1 : 0)); PCBLOCK_INFO(block); block->status= error ? PCBLOCK_ERROR : 0; + block->error= error; #ifndef DBUG_OFF block->type= PAGECACHE_EMPTY_PAGE; if (error) @@ -2606,6 +2608,7 @@ static void read_block(PAGECACHE *pagecache, if (error) { block->status|= PCBLOCK_ERROR; + block->error= error; my_debug_put_break_here(); } else @@ -2618,6 +2621,7 @@ static void read_block(PAGECACHE *pagecache, { DBUG_PRINT("error", ("read callback problem")); block->status|= PCBLOCK_ERROR; + block->error= my_errno; my_debug_put_break_here(); } } @@ -3229,6 +3233,8 @@ restart: pagecache_pthread_mutex_lock(&pagecache->cache_lock); #endif } + else + my_errno= block->error; } remove_reader(block); @@ -3313,6 +3319,7 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache, if (error) { block->status|= PCBLOCK_ERROR; + block->error= error; my_debug_put_break_here(); goto err; } @@ -3771,6 +3778,7 @@ restart: { DBUG_PRINT("error", ("read callback problem")); block->status|= PCBLOCK_ERROR; + block->error= my_errno; my_debug_put_break_here(); } KEYCACHE_DBUG_PRINT("key_cache_insert", @@ -4067,6 +4075,7 @@ static int flush_cached_blocks(PAGECACHE *pagecache, if (error) { block->status|= PCBLOCK_ERROR; + block->error= error; my_debug_put_break_here(); if (!*first_errno) *first_errno= my_errno ? my_errno : -1; |