Below is the list of changes that have just been committed into a local
5.1 repository of Kristofer Pettersson. When Kristofer Pettersson does a push these
changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-09-20 07:40:56+02:00, Kristofer.Pettersson@naruto. +3 -0
Merge naruto.:C:/cpp/bug20789/my50-bug20789
into naruto.:C:/cpp/bug20789/my51-bug20789
MERGE: 1.1810.2067.3
storage/myisam/mi_locking.c@stripped, 2006-09-20 07:40:49+02:00,
Kristofer.Pettersson@naruto. +0 -0
Auto merged
MERGE: 1.38.4.2
storage/myisam/mi_locking.c@stripped, 2006-09-20 07:40:49+02:00,
Kristofer.Pettersson@naruto. +0 -0
Merge rename: myisam/mi_locking.c -> storage/myisam/mi_locking.c
storage/myisam/myisamdef.h@stripped, 2006-09-20 07:40:50+02:00, Kristofer.Pettersson@naruto.
+0 -0
Auto merged
MERGE: 1.74.10.2
storage/myisam/myisamdef.h@stripped, 2006-09-20 07:40:49+02:00,
Kristofer.Pettersson@naruto. +0 -0
Merge rename: myisam/myisamdef.h -> storage/myisam/myisamdef.h
storage/myisammrg/myrg_locking.c@stripped, 2006-09-20 07:40:50+02:00,
Kristofer.Pettersson@naruto. +0 -0
Auto merged
MERGE: 1.7.1.2
storage/myisammrg/myrg_locking.c@stripped, 2006-09-20 07:40:49+02:00,
Kristofer.Pettersson@naruto. +0 -0
Merge rename: myisammrg/myrg_locking.c -> storage/myisammrg/myrg_locking.c
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: Kristofer.Pettersson
# Host: naruto.
# Root: C:/cpp/bug20789/my51-bug20789/RESYNC
--- 1.38.4.1/myisam/mi_locking.c 2006-09-20 07:41:17 +02:00
+++ 1.48/storage/myisam/mi_locking.c 2006-09-20 07:41:17 +02:00
@@ -21,7 +21,7 @@
isamdatabase.
*/
-#include "myisamdef.h"
+#include "ftdefs.h"
/* lock table by F_UNLCK, F_RDLCK or F_WRLCK */
@@ -38,7 +38,6 @@
share->w_locks,
share->global_changed, share->state.open_count,
share->index_file_name));
-
if (share->options & HA_OPTION_READ_ONLY_DATA ||
info->lock_type == lock_type)
DBUG_RETURN(0);
@@ -56,6 +55,7 @@
{
switch (lock_type) {
case F_UNLCK:
+ ftparser_call_deinitializer(info);
if (info->lock_type == F_RDLCK)
count= --share->r_locks;
else
@@ -84,6 +84,18 @@
(uint) share->changed, share->w_locks));
if (share->changed && !share->w_locks)
{
+#ifdef HAVE_MMAP
+ if ((info->s->mmaped_length != info->s->state.state.data_file_length)
&&
+ (info->s->nonmmaped_inserts > MAX_NONMAPPED_INSERTS))
+ {
+ if (info->s->concurrent_insert)
+ rw_wrlock(&info->s->mmap_lock);
+ mi_remap_file(info, info->s->state.state.data_file_length);
+ info->s->nonmmaped_inserts= 0;
+ if (info->s->concurrent_insert)
+ rw_unlock(&info->s->mmap_lock);
+ }
+#endif
share->state.process= share->last_process=share->this_process;
share->state.unique= info->last_unique= info->this_unique;
share->state.update_count= info->last_loop= ++info->this_loop;
@@ -215,6 +227,7 @@
}
}
VOID(_mi_test_if_changed(info));
+
info->lock_type=lock_type;
info->invalidator=info->s->invalidator;
share->w_locks++;
--- 1.74.10.1/myisam/myisamdef.h 2006-09-20 07:41:17 +02:00
+++ 1.91/storage/myisam/myisamdef.h 2006-09-20 07:41:17 +02:00
@@ -55,7 +55,7 @@
uchar keys; /* number of keys in file */
uchar uniques; /* number of UNIQUE definitions */
uchar language; /* Language for indexes */
- uchar max_block_size; /* max keyblock size */
+ uchar max_block_size_index; /* max keyblock size */
uchar fulltext_keys;
uchar not_used; /* To align to 8 */
} header;
@@ -152,6 +152,7 @@
uchar version;
} MI_PACK;
+#define MAX_NONMAPPED_INSERTS 1000
typedef struct st_mi_isam_share { /* Shared between opens */
MI_STATE_INFO state;
@@ -179,6 +180,8 @@
ha_checksum (*calc_checksum)(struct st_myisam_info*, const byte *);
int (*compare_unique)(struct st_myisam_info*, MI_UNIQUEDEF *,
const byte *record, my_off_t pos);
+ uint (*file_read)(MI_INFO *, byte *, uint, my_off_t, myf);
+ uint (*file_write)(MI_INFO *, byte *, uint, my_off_t, myf);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_process; /* processid */
ulong last_process; /* For table-change-check */
@@ -189,6 +192,7 @@
ulong state_diff_length;
uint rec_reflength; /* rec_reflength in use now */
uint unique_name_length;
+ uint32 ftparsers; /* Number of distinct ftparsers + 1 */
File kfile; /* Shared keyfile */
File data_file; /* Shared data file */
int mode; /* mode of file on open */
@@ -197,6 +201,9 @@
uint blocksize; /* blocksize of keyfile */
myf write_flag;
enum data_file_type data_file_type;
+ /* Below flag is needed to make log tables work with concurrent insert */
+ my_bool is_log_table;
+
my_bool changed, /* If changed since lock */
global_changed, /* If changed since open */
not_flushed,
@@ -207,6 +214,10 @@
pthread_mutex_t intern_lock; /* Locking for use with _locking */
rw_lock_t *key_root_lock;
#endif
+ my_off_t mmaped_length;
+ uint nonmmaped_inserts; /* counter of writing in non-mmaped
+ area */
+ rw_lock_t mmap_lock;
} MYISAM_SHARE;
@@ -227,12 +238,14 @@
/* accumulate indexfile changes between write's */
TREE *bulk_insert;
DYNAMIC_ARRAY *ft1_to_ft2; /* used only in ft1->ft2 conversion */
- char *filename; /* parameter to open filename */
- uchar *buff, /* Temp area for key */
- *lastkey,*lastkey2; /* Last used search key */
- uchar *first_mbr_key; /* Searhed spatial key */
- byte *rec_buff; /* Tempbuff for recordpack */
- uchar *int_keypos, /* Save position for next/previous */
+ MEM_ROOT ft_memroot; /* used by the parser */
+ MYSQL_FTPARSER_PARAM *ftparser_param; /* share info between init/deinit */
+ char *filename; /* parameter to open filename */
+ uchar *buff, /* Temp area for key */
+ *lastkey,*lastkey2; /* Last used search key */
+ uchar *first_mbr_key; /* Searhed spatial key */
+ byte *rec_buff; /* Tempbuff for recordpack */
+ uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */
@@ -319,6 +332,7 @@
uchar **sort_keys;
byte *rec_buff;
void *wordlist, *wordptr;
+ MEM_ROOT wordroot;
char *record;
MY_TMPDIR *tmpdir;
int (*key_cmp)(struct st_mi_sort_param *, const void *, const void *);
@@ -425,7 +439,7 @@
#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH)
-#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer)
(((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/myisam_block_size+1)*myisam_block_size)
+#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer,block_size)
(((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/(block_size)+1)*(block_size))
#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
@@ -688,6 +702,14 @@
extern uint save_pack_length(uint version, byte *block_buff, ulong length);
extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
extern uint calc_pack_length(uint version, ulong length);
+extern uint mi_mmap_pread(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags);
+extern uint mi_mmap_pwrite(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags);
+extern uint mi_nommap_pread(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags);
+extern uint mi_nommap_pwrite(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags);
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
@@ -728,6 +750,8 @@
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
int mi_open_keyfile(MYISAM_SHARE *share);
void mi_setup_functions(register MYISAM_SHARE *share);
+my_bool mi_dynmap_file(MI_INFO *info, my_off_t size);
+void mi_remap_file(MI_INFO *info, my_off_t size);
/* Functions needed by mi_check */
volatile int *killed_ptr(MI_CHECK *param);
| Thread |
|---|
| • bk commit into 5.1 tree (Kristofer.Pettersson:1.2318) | kpettersson | 20 Sep |