Below is the list of changes that have just been committed into a local
5.0-hp repository of vtkachenko. When vtkachenko 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
1.1878 05/06/04 13:16:27 vtkachenko@stripped +15 -0
Many files:
WL#2596 mmap for read/write MyISAM tables
sql/set_var.cc
1.117 05/06/04 13:15:47 vtkachenko@stripped +3 -0
WL#2596 mmap for read/write MyISAM tables
sql/mysqld.cc
1.462 05/06/04 13:15:47 vtkachenko@stripped +7 -0
WL#2596 mmap for read/write MyISAM tables
sql/mysql_priv.h
1.302 05/06/04 13:15:46 vtkachenko@stripped +1 -1
WL#2596 mmap for read/write MyISAM tables
sql/ha_myisam.cc
1.153 05/06/04 13:15:46 vtkachenko@stripped +4 -0
WL#2596 mmap for read/write MyISAM tables
myisam/myisamdef.h
1.81 05/06/04 13:15:46 vtkachenko@stripped +13 -0
WL#2596 mmap for read/write MyISAM tables
myisam/mi_statrec.c
1.16 05/06/04 13:15:46 vtkachenko@stripped +11 -12
WL#2596 mmap for read/write MyISAM tables
myisam/mi_packrec.c
1.33 05/06/04 13:15:45 vtkachenko@stripped +2 -2
WL#2596 mmap for read/write MyISAM tables
myisam/mi_open.c
1.93 05/06/04 13:15:45 vtkachenko@stripped +31 -26
WL#2596 mmap for read/write MyISAM tables
myisam/mi_locking.c
1.40 05/06/04 13:15:45 vtkachenko@stripped +6 -0
WL#2596 mmap for read/write MyISAM tables
myisam/mi_extra.c
1.49 05/06/04 13:15:45 vtkachenko@stripped +21 -0
WL#2596 mmap for read/write MyISAM tables
myisam/mi_dynrec.c
1.44 05/06/04 13:15:44 vtkachenko@stripped +83 -7
WL#2596 mmap for read/write MyISAM tables
myisam/mi_delete_all.c
1.16 05/06/04 13:15:44 vtkachenko@stripped +4 -0
WL#2596 mmap for read/write MyISAM tables
include/my_sys.h
1.160 05/06/04 13:15:44 vtkachenko@stripped +5 -0
WL#2596 mmap for read/write MyISAM tables
include/my_base.h
1.74 05/06/04 13:15:43 vtkachenko@stripped +2 -1
WL#2596 mmap for read/write MyISAM tables
configure.in
1.316 05/06/04 13:15:43 vtkachenko@stripped +1 -1
WL#2596 mmap for read/write MyISAM tables
# 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: vtkachenko
# Host: quadxeon.mysql.com
# Root: /users/vtkachenko/bk/HP/mysql-5.0-hp2
--- 1.315/configure.in 2005-06-04 11:24:59 +02:00
+++ 1.316/configure.in 2005-06-04 13:15:43 +02:00
@@ -1920,7 +1920,7 @@
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
- mkstemp mlockall perror poll pread pthread_attr_create mmap getpagesize \
+ mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
--- 1.73/include/my_base.h 2005-06-04 11:25:00 +02:00
+++ 1.74/include/my_base.h 2005-06-04 13:15:43 +02:00
@@ -152,7 +152,8 @@
other fields intact. When this is off (by default) InnoDB will use memcpy
to overwrite entire row.
*/
- HA_EXTRA_KEYREAD_PRESERVE_FIELDS
+ HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
+ HA_EXTRA_MMAP
};
/* The following is parameter to ha_panic() */
--- 1.159/include/my_sys.h 2005-06-04 11:25:00 +02:00
+++ 1.160/include/my_sys.h 2005-06-04 13:15:44 +02:00
@@ -378,6 +378,7 @@
/* the non-inclusive boundary in the buffer for the currently valid read */
byte *read_end;
byte *buffer; /* The read buffer */
+ void *mmaparea; /* mmap address */
/* Used in ASYNC_IO */
byte *request_pos;
@@ -815,6 +816,10 @@
#endif
#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
+#ifdef HAVE_MMAP64
+#undef my_mmap
+#define my_mmap(a,b,c,d,e,f) mmap64(a,b,c,d,e,f)
+#endif
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize() getpagesize()
#else
--- 1.15/myisam/mi_delete_all.c 2003-11-20 21:06:18 +01:00
+++ 1.16/myisam/mi_delete_all.c 2005-06-04 13:15:44 +02:00
@@ -59,6 +59,10 @@
goto err;
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
allow_break(); /* Allow SIGHUP & SIGINT */
+#ifdef HAVE_MMAP
+ /* Resize mmaped area */
+ info->s->need_remap= 1;
+#endif
DBUG_RETURN(0);
err:
--- 1.43/myisam/mi_dynrec.c 2005-06-04 11:25:01 +02:00
+++ 1.44/myisam/mi_dynrec.c 2005-06-04 13:15:44 +02:00
@@ -50,6 +50,82 @@
/* Interface function from MI_INFO */
+#ifdef HAVE_MMAP
+my_bool _mi_dynmap_file(MI_INFO *info)
+{
+ DBUG_ENTER("_mi_dynmap_file");
+ info->s->file_map= (byte*)
+ my_mmap(0, (size_t)(info->s->state.state.data_file_length
+ + MEMMAP_EXTRA_MARGIN),
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_NORESERVE,
+ info->dfile, 0L);
+ if (info->s->file_map == (byte*) MAP_FAILED)
+ {
+ info->s->file_map= NULL;
+ DBUG_RETURN(1);
+ }
+#if defined(HAVE_MADVISE)
+ madvise(info->s->file_map, info->s->state.state.data_file_length, MADV_RANDOM);
+#endif
+ info->s->mmaped_length= info->s->state.state.data_file_length;
+ DBUG_RETURN(0);
+}
+
+/* resize mmaped area */
+void _mi_remap_file(MI_INFO *info)
+{
+ if (info->s->file_map)
+ {
+ VOID(my_munmap(info->s->file_map,
+ (size_t) info->s->mmaped_length));
+ _mi_dynmap_file(info);
+ }
+}
+#endif
+
+uint _mi_mmap_pread(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags)
+{
+ DBUG_PRINT("info", ("_mi_read with mmap %d\n", info->dfile));
+ if (min(info->s->mmaped_length, info->s->state.state.data_file_length) >= offset + Count)
+ {
+ memcpy(Buffer, info->s->file_map + offset, Count);
+ return 0;
+ }
+ else
+ return my_pread(info->dfile, Buffer, Count, offset, MyFlags);
+}
+
+uint _mi_nommap_pread(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags)
+{
+ return my_pread(info->dfile, Buffer, Count, offset, MyFlags);
+}
+
+uint _mi_mmap_pwrite(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags)
+{
+ DBUG_PRINT("info", ("_mi_write with mmap %d\n", info->dfile));
+ if (min(info->s->mmaped_length, info->s->state.state.data_file_length) >= offset + Count)
+ {
+ memcpy(info->s->file_map + offset, Buffer, Count);
+ return 0;
+ }
+ else
+ {
+ info->s->need_remap= 1;
+ return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
+ }
+
+}
+
+uint _mi_nommap_pwrite(MI_INFO *info, byte *Buffer,
+ uint Count, my_off_t offset, myf MyFlags)
+{
+ return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
+}
+
int _mi_write_dynamic_record(MI_INFO *info, const byte *record)
{
ulong reclength=_mi_rec_pack(info,info->rec_buff,record);
@@ -243,7 +319,7 @@
& BLOCK_DELETED))
DBUG_RETURN(1); /* Something is wrong */
mi_sizestore(tmp.header+4,block_info->next_filepos);
- if (my_pwrite(info->dfile,(char*) tmp.header+4,8,
+ if (info->s->file_write(info,(char*) tmp.header+4,8,
block_info->prev_filepos+4, MYF(MY_NABP)))
DBUG_RETURN(1);
/* Unlink block from next block */
@@ -253,7 +329,7 @@
& BLOCK_DELETED))
DBUG_RETURN(1); /* Something is wrong */
mi_sizestore(tmp.header+12,block_info->prev_filepos);
- if (my_pwrite(info->dfile,(char*) tmp.header+12,8,
+ if (info->s->file_write(info,(char*) tmp.header+12,8,
block_info->next_filepos+12,
MYF(MY_NABP)))
DBUG_RETURN(1);
@@ -304,7 +380,7 @@
{
char buff[8];
mi_sizestore(buff,filepos);
- if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
+ if (info->s->file_write(info,buff, 8, delete_block+12, MYF(MY_NABP)))
DBUG_RETURN(1); /* Error on write */
}
else
@@ -362,7 +438,7 @@
bfill(block_info.header+12,8,255);
else
mi_sizestore(block_info.header+12,block_info.next_filepos);
- if (my_pwrite(info->dfile,(byte*) block_info.header,20,filepos,
+ if (info->s->file_write(info,(byte*) block_info.header,20,filepos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink = filepos;
@@ -545,7 +621,7 @@
else
{
info->rec_cache.seek_not_done=1;
- if (my_pwrite(info->dfile,(byte*) *record-head_length,length+extra_length+
+ if (info->s->file_write(info,(byte*) *record-head_length,length+extra_length+
del_length,filepos,info->s->write_flag))
goto err;
}
@@ -655,7 +731,7 @@
mi_int3store(del_block.header+1, rest_length);
mi_sizestore(del_block.header+4,info->s->state.dellink);
bfill(del_block.header+12,8,255);
- if (my_pwrite(info->dfile,(byte*) del_block.header,20, next_pos,
+ if (info->s->file_write(info,(byte*) del_block.header,20, next_pos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink= next_pos;
@@ -1182,7 +1258,7 @@
}
if (left_length < block_info.data_len || ! block_info.data_len)
goto panic; /* Wrong linked record */
- if (my_pread(file,(byte*) to,block_info.data_len,block_info.filepos,
+ if (info->s->file_read(info,(byte*) to,block_info.data_len,block_info.filepos,
MYF(MY_NABP)))
goto panic;
left_length-=block_info.data_len;
--- 1.48/myisam/mi_extra.c 2005-06-04 11:25:01 +02:00
+++ 1.49/myisam/mi_extra.c 2005-06-04 13:15:45 +02:00
@@ -93,6 +93,8 @@
my_errno=EACCES;
break;
}
+ if (info->s->file_map) /* Don't use cache if mmap */
+ break;
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE)
if ((share->options & HA_OPTION_COMPRESS_RECORD))
{
@@ -150,6 +152,8 @@
error=1; /* Not possibly if not locked */
break;
}
+ if (info->s->file_map) /* Don't use cache if mmap */
+ break;
cache_size= (extra_arg ? *(ulong*) extra_arg :
my_default_record_cache_size);
if (!(info->opt_flag &
@@ -366,6 +370,23 @@
case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
case HA_EXTRA_CHANGE_KEY_TO_DUP:
mi_extra_keyflag(info, function);
+ break;
+ case HA_EXTRA_MMAP:
+#ifdef HAVE_MMAP
+ pthread_mutex_lock(&share->intern_lock);
+ if (!share->file_map)
+ if (_mi_dynmap_file(info, share->state.state.data_file_length))
+ {
+ DBUG_PRINT("warning",("mmap failed: errno: %d",errno));
+ error= my_errno= errno;
+ }
+ else
+ {
+ share->file_read= _mi_mmap_pread;
+ share->file_write= _mi_mmap_pwrite;
+ }
+ pthread_mutex_unlock(&share->intern_lock);
+#endif
break;
case HA_EXTRA_KEY_CACHE:
case HA_EXTRA_NO_KEY_CACHE:
--- 1.39/myisam/mi_locking.c 2005-05-13 11:08:02 +02:00
+++ 1.40/myisam/mi_locking.c 2005-06-04 13:15:45 +02:00
@@ -215,6 +215,12 @@
}
}
VOID(_mi_test_if_changed(info));
+ if (info->s->need_remap)
+ {
+ _mi_remap_file(info, info->s->state.state.data_file_length);
+ info->s->need_remap= 0;
+ }
+
info->lock_type=lock_type;
info->invalidator=info->s->invalidator;
share->w_locks++;
--- 1.92/myisam/mi_open.c 2005-05-27 12:00:24 +02:00
+++ 1.93/myisam/mi_open.c 2005-06-04 13:15:45 +02:00
@@ -702,38 +702,43 @@
else
share->calc_checksum= mi_static_checksum;
}
- else if (share->options & HA_OPTION_PACK_RECORD)
+ else
{
- share->read_record=_mi_read_dynamic_record;
- share->read_rnd=_mi_read_rnd_dynamic_record;
- share->delete_record=_mi_delete_dynamic_record;
- share->compare_record=_mi_cmp_dynamic_record;
- share->compare_unique=_mi_cmp_dynamic_unique;
- share->calc_checksum= mi_checksum;
-
- /* add bits used to pack data to pack_reclength for faster allocation */
- share->base.pack_reclength+= share->base.pack_bits;
- if (share->base.blobs)
+ if (share->options & HA_OPTION_PACK_RECORD)
{
- share->update_record=_mi_update_blob_record;
- share->write_record=_mi_write_blob_record;
+ share->read_record=_mi_read_dynamic_record;
+ share->read_rnd=_mi_read_rnd_dynamic_record;
+ share->delete_record=_mi_delete_dynamic_record;
+ share->compare_record=_mi_cmp_dynamic_record;
+ share->compare_unique=_mi_cmp_dynamic_unique;
+ share->calc_checksum= mi_checksum;
+
+ /* add bits used to pack data to pack_reclength for faster allocation */
+ share->base.pack_reclength+= share->base.pack_bits;
+ if (share->base.blobs)
+ {
+ share->update_record=_mi_update_blob_record;
+ share->write_record=_mi_write_blob_record;
+ }
+ else
+ {
+ share->write_record=_mi_write_dynamic_record;
+ share->update_record=_mi_update_dynamic_record;
+ }
}
else
{
- share->write_record=_mi_write_dynamic_record;
- share->update_record=_mi_update_dynamic_record;
+ share->read_record=_mi_read_static_record;
+ share->read_rnd=_mi_read_rnd_static_record;
+ share->delete_record=_mi_delete_static_record;
+ share->compare_record=_mi_cmp_static_record;
+ share->update_record=_mi_update_static_record;
+ share->write_record=_mi_write_static_record;
+ share->compare_unique=_mi_cmp_static_unique;
+ share->calc_checksum= mi_static_checksum;
}
- }
- else
- {
- share->read_record=_mi_read_static_record;
- share->read_rnd=_mi_read_rnd_static_record;
- share->delete_record=_mi_delete_static_record;
- share->compare_record=_mi_cmp_static_record;
- share->update_record=_mi_update_static_record;
- share->write_record=_mi_write_static_record;
- share->compare_unique=_mi_cmp_static_unique;
- share->calc_checksum= mi_static_checksum;
+ share->file_read= _mi_nommap_pread;
+ share->file_write= _mi_nommap_pwrite;
}
if (!(share->options & HA_OPTION_CHECKSUM))
share->calc_checksum=0;
--- 1.32/myisam/mi_packrec.c 2005-06-04 11:25:02 +02:00
+++ 1.33/myisam/mi_packrec.c 2005-06-04 13:15:45 +02:00
@@ -1221,6 +1221,7 @@
DBUG_RETURN(0);
}
info->s->file_map=file_map;
+ info->s->mmaped_length= share->state.state.data_file_length;
}
info->opt_flag|= MEMMAP_USED;
info->read_record=share->read_record=_mi_read_mempack_record;
@@ -1232,8 +1233,7 @@
void _mi_unmap_file(MI_INFO *info)
{
VOID(my_munmap(info->s->file_map,
- (size_t) info->s->state.state.data_file_length+
- MEMMAP_EXTRA_MARGIN));
+ (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
}
--- 1.15/myisam/mi_statrec.c 2005-06-04 11:25:02 +02:00
+++ 1.16/myisam/mi_statrec.c 2005-06-04 13:15:46 +02:00
@@ -22,20 +22,19 @@
int _mi_write_static_record(MI_INFO *info, const byte *record)
{
uchar temp[8]; /* max pointer length */
-
if (info->s->state.dellink != HA_OFFSET_ERROR &&
!info->append_insert_at_end)
{
my_off_t filepos=info->s->state.dellink;
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (my_pread(info->dfile,(char*) &temp[0],info->s->base.rec_reflength,
+ if (info->s->file_read(info,(char*) &temp[0],info->s->base.rec_reflength,
info->s->state.dellink+1,
MYF(MY_NABP)))
goto err;
info->s->state.dellink= _mi_rec_pos(info->s,temp);
info->state->del--;
info->state->empty-=info->s->base.pack_reclength;
- if (my_pwrite(info->dfile, (char*) record, info->s->base.reclength,
+ if (info->s->file_write(info, (char*) record, info->s->base.reclength,
filepos,
MYF(MY_NABP)))
goto err;
@@ -64,19 +63,19 @@
else
{
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (my_pwrite(info->dfile,(char*) record,info->s->base.reclength,
+ if (info->s->file_write(info,(char*) record,info->s->base.reclength,
info->state->data_file_length,
info->s->write_flag))
- goto err;
+ goto err;
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
bzero((char*) temp,length);
- if (my_pwrite(info->dfile, (byte*) temp,length,
+ if (info->s->file_write(info, (byte*) temp,length,
info->state->data_file_length+
info->s->base.reclength,
info->s->write_flag))
- goto err;
+ goto err;
}
}
info->state->data_file_length+=info->s->base.pack_reclength;
@@ -90,7 +89,7 @@
int _mi_update_static_record(MI_INFO *info, my_off_t pos, const byte *record)
{
info->rec_cache.seek_not_done=1; /* We have done a seek */
- return (my_pwrite(info->dfile,
+ return (info->s->file_write(info,
(char*) record,info->s->base.reclength,
pos,
MYF(MY_NABP)) != 0);
@@ -107,7 +106,7 @@
_mi_dpointer(info,temp+1,info->s->state.dellink);
info->s->state.dellink = info->lastpos;
info->rec_cache.seek_not_done=1;
- return (my_pwrite(info->dfile,(byte*) temp, 1+info->s->rec_reflength,
+ return (info->s->file_write(info,(byte*) temp, 1+info->s->rec_reflength,
info->lastpos, MYF(MY_NABP)) != 0);
}
@@ -131,7 +130,7 @@
if ((info->opt_flag & READ_CHECK_USED))
{ /* If check isn't disabled */
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength,
+ if (info->s->file_read(info, (char*) info->rec_buff, info->s->base.reclength,
info->lastpos,
MYF(MY_NABP)))
DBUG_RETURN(-1);
@@ -154,7 +153,7 @@
DBUG_ENTER("_mi_cmp_static_unique");
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength,
+ if (info->s->file_read(info, (char*) info->rec_buff, info->s->base.reclength,
pos, MYF(MY_NABP)))
DBUG_RETURN(-1);
DBUG_RETURN(mi_unique_comp(def, record, info->rec_buff,
@@ -180,7 +179,7 @@
return(-1);
info->rec_cache.seek_not_done=1; /* We have done a seek */
- error=my_pread(info->dfile,(char*) record,info->s->base.reclength,
+ error=info->s->file_read(info,(char*) record,info->s->base.reclength,
pos,MYF(MY_NABP)) != 0;
fast_mi_writeinfo(info);
if (! error)
--- 1.80/myisam/myisamdef.h 2005-06-04 11:25:03 +02:00
+++ 1.81/myisam/myisamdef.h 2005-06-04 13:15:46 +02:00
@@ -178,6 +178,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 */
@@ -206,6 +208,8 @@
pthread_mutex_t intern_lock; /* Locking for use with _locking */
rw_lock_t *key_root_lock;
#endif
+ my_off_t mmaped_length;
+ my_bool need_remap;
} MYISAM_SHARE;
@@ -674,6 +678,15 @@
extern my_bool _mi_memmap_file(MI_INFO *info);
extern void _mi_unmap_file(MI_INFO *info);
extern uint save_pack_length(byte *block_buff,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);
char *mi_state_info_read(char *ptr, MI_STATE_INFO *state);
--- 1.152/sql/ha_myisam.cc 2005-06-04 11:25:03 +02:00
+++ 1.153/sql/ha_myisam.cc 2005-06-04 13:15:46 +02:00
@@ -238,6 +238,10 @@
if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE))
VOID(mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0));
+
+ if (opt_myisam_use_mmap)
+ VOID(mi_extra(file, HA_EXTRA_MMAP, 0));
+
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
VOID(mi_extra(file, HA_EXTRA_WAIT_LOCK, 0));
--- 1.301/sql/mysql_priv.h 2005-06-04 11:25:04 +02:00
+++ 1.302/sql/mysql_priv.h 2005-06-04 13:15:46 +02:00
@@ -1092,7 +1092,7 @@
extern bool mysql_proc_table_exists;
extern uint volatile thread_count, thread_running, global_read_lock;
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
-extern my_bool opt_safe_show_db, opt_local_infile;
+extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_readonly, lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
--- 1.461/sql/mysqld.cc 2005-06-04 11:25:05 +02:00
+++ 1.462/sql/mysqld.cc 2005-06-04 13:15:47 +02:00
@@ -328,6 +328,7 @@
my_bool opt_secure_auth= 0;
my_bool lower_case_file_system= 0;
my_bool opt_large_pages= 0;
+my_bool opt_myisam_use_mmap= 0;
uint opt_large_page_size= 0;
my_bool opt_old_style_user_limits= 0, trust_routine_creators= 0;
/*
@@ -4232,6 +4233,7 @@
OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE,
OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
+ OPT_MYISAM_USE_MMAP,
OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
OPT_OPEN_FILES_LIMIT,
@@ -5368,6 +5370,11 @@
(gptr*) &global_system_variables.myisam_sort_buff_size,
(gptr*) &max_system_variables.myisam_sort_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
+ {"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
+ "Use mmap/mmap64 for read/write MyISAM tables.",
+ (gptr*) &opt_myisam_use_mmap,
+ (gptr*) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0,
+ 0, 0, 0, 0, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"Buffer length for TCP/IP and socket communication.",
(gptr*) &global_system_variables.net_buffer_length,
--- 1.116/sql/set_var.cc 2005-06-04 11:25:06 +02:00
+++ 1.117/sql/set_var.cc 2005-06-04 13:15:47 +02:00
@@ -272,6 +272,7 @@
sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads);
sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
+sys_var_bool_ptr sys_myisam_use_mmap("myisam_use_mmap", &opt_myisam_use_mmap);
sys_var_thd_ulong sys_net_buffer_length("net_buffer_length",
&SV::net_buffer_length);
sys_var_thd_ulong sys_net_read_timeout("net_read_timeout",
@@ -623,6 +624,7 @@
&sys_myisam_data_pointer_size,
&sys_myisam_max_sort_file_size,
&sys_myisam_repair_threads,
+ &sys_myisam_use_mmap,
&sys_myisam_sort_buffer_size,
&sys_net_buffer_length,
&sys_net_read_timeout,
@@ -885,6 +887,7 @@
{sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads,
SHOW_SYS},
{sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
+ {sys_myisam_use_mmap.name, (char*) &sys_myisam_use_mmap, SHOW_SYS},
#ifdef __NT__
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
#endif
| Thread |
|---|
| • bk commit into 5.0-hp tree (vtkachenko:1.1878) | Vadim Tkachenko | 4 Jun |