diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-04-19 18:48:36 +0300 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-04-19 18:48:36 +0300 |
commit | 6686a3ee53e7260047a2737b854f400f6847b452 (patch) | |
tree | d7e7037c5923ee1fa85396a87975cc6670fb6202 /storage/maria/maria_pack.c | |
parent | ac0f98dd5e361f38767a89bb4623f250db8fb889 (diff) | |
download | mariadb-git-6686a3ee53e7260047a2737b854f400f6847b452.tar.gz |
After merge fixes
Read blocks through page cache in check_block_record()
Don't read first bitmap on ma_open()
Don't require that a files block_size is equal to maria_block_size, if page cache is not setup yet.
Changed ma_test1, ma_test2, maria_chk and maria_pack to always create a page cache.
The above fixes so that ma_test_all now works again
BitKeeper/etc/ignore:
added storage/maria/unittest/ma_pagecache_consist_1k-t-big storage/maria/unittest/ma_pagecache_consist_1kHC-t-big storage/maria/unittest/ma_pagecache_consist_1kRD-t-big storage/maria/unittest/ma_pagecache_consist_1kWR-t-big storage/maria/unittest/ma_pagecache_consist_64k-t-big storage/maria/unittest/ma_pagecache_consist_64kHC-t-big storage/maria/unittest/ma_pagecache_consist_64kRD-t-big storage/maria/unittest/ma_pagecache_consist_64kWR-t-big storage/maria/unittest/ma_pagecache_single_64k-t-big
include/maria.h:
Added MARIA_MIN_PAGE_CACHE_SIZE
include/pagecache.h:
Filedescriptors should be of type File
storage/maria/ma_bitmap.c:
After merge fixes
Create dummy bitmap on startup (can't read first bitmap becasue page cache may not be set up yet)
storage/maria/ma_blockrec.c:
After merge fixes
storage/maria/ma_check.c:
Use page cache to read rows-in-block rows.
Don't initialize page cache; It's now done in maria_chk
storage/maria/ma_dynrec.c:
Trivial code reorganization
storage/maria/ma_open.c:
Don't give error for conflicting block size if page cache is not initalized.
(Needed for maria_chk to be able to work on tables with different page sizes)
After merge fixes
storage/maria/ma_page.c:
Fix compiler warning
Remove net needed asserts (Guranteed by ma_create())
storage/maria/ma_pagecache.c:
Allow one to create a page cache with just one block
(For trivail scan of table)
Trivial code simplication
storage/maria/ma_test1.c:
Always create a page cache (Maria now requires a page cache to work)
storage/maria/ma_test2.c:
Always create a page cache (Maria now requires a page cache to work)
storage/maria/maria_chk.c:
Remove command line options --maria_block_size and --pagecache_block_size.
Set the global maria_block_size from the data file. This allows maria_chk to work with tables of different block sizes.
Simply DESCRIPT handling; Allows us to remove one indentation level in maria_chk().
Always initialize page cache if we are doing check/repair.
(Most of the patch is reindentation of the code)
storage/maria/maria_def.h:
After merge fix
storage/maria/maria_pack.c:
Set maria_block_size based on the files block_size.
Initalize page cache (needed for getting rows-in-blocks to works)
Diffstat (limited to 'storage/maria/maria_pack.c')
-rw-r--r-- | storage/maria/maria_pack.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index 449b6bf7d59..f1b3903c944 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -505,13 +505,21 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) trees=fields=0; huff_trees=0; huff_counts=0; + maria_block_size= isam_file->s->block_size; /* Create temporary or join file */ - if (backup) VOID(fn_format(org_name,isam_file->filename,"",MARIA_NAME_DEXT,2)); else VOID(fn_format(org_name,isam_file->filename,"",MARIA_NAME_DEXT,2+4+16)); + + if (init_pagecache(maria_pagecache, MARIA_MIN_PAGE_CACHE_SIZE, 0, 0, + maria_block_size) == 0) + { + fprintf(stderr, "Can't initialize page cache\n"); + goto err; + } + if (!test_only && result_table) { /* Make a new indexfile based on first file in list */ @@ -681,7 +689,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) { error|=my_close(isam_file->dfile.file, MYF(MY_WME)); isam_file->dfile.file= -1; /* Tell maria_close file is closed */ - isam_file->s->bitmap.file= -1; + isam_file->s->bitmap.file.file= -1; } } @@ -751,6 +759,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) DBUG_RETURN(0); err: + end_pagecache(maria_pagecache, 1); free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields); if (new_file >= 0) VOID(my_close(new_file,MYF(0))); |