mirror of
https://github.com/MariaDB/server.git
synced 2026-04-28 19:25:32 +02:00
Small bug fixes + code for DELETE QUICK
Docs/manual.texi: Change log + bug fixes from the mailing list configure.in: added mlockall include/config-win.h: Fix to use SAFE_MUTEX include/ft_global.h: Free memory include/my_pthread.h: Fix for SAFE_MUTEX on windows myisam/Makefile.am: Fix modes myisam/ft_static.c: Fix language problem with fulltext myisam/ft_stopwords.c: Free memory at end myisam/mi_create.c: Fix language problem with fulltext myisam/mi_delete.c: Added optimization to not join blocks when using delete with QUICK myisam/mi_panic.c: Added freeing of memorty myisam/mi_test2.c: Added quick mode myisam/myisamchk.c: Fixed help text myisam/myisamdef.h: Added optimization to not join blocks when using delete with QUICK mysys/mf_format.c: Don't change case for extension mysys/my_wincond.c: Fix for safe mutex mysys/thr_mutex.c: Fix for safe mutex sql-bench/test-insert.sh: Split delete test to get more information about the times sql/ChangeLog: Changelog sql/ha_myisam.cc: Better OPTIMIZE handling sql/log.cc: Cleanup sql/mysql_priv.h: Fix for safe mutex sql/mysqld.cc: Added define for --one-thread option sql/sql_class.h: Fixed lock_time in slow_log sql/sql_delete.cc: Fix for safe mutex sql/sql_parse.cc: Fix processlist message for new process sql/sql_table.cc: Fix windows problem med CREATE INDEX sql/sql_yacc.yy: Fix for safe mutex sql/table.cc: Made code simpler strings/bmove512.c: Small speed fix support-files/mysql.server.sh: Fixed awk usage
This commit is contained in:
parent
5a4aa474d8
commit
5a2419eb89
31 changed files with 257 additions and 111 deletions
|
|
@ -104,6 +104,7 @@ SUFFIXES = .sh
|
|||
-e 's!@''PERL_DBD_VERSION''@!@PERL_DBD_VERSION@!' \
|
||||
-e 's!@''PERL_DATA_DUMPER''@!@PERL_DATA_DUMPER@!' \
|
||||
$< > $@-t
|
||||
@CHMOD@ +x $@-t
|
||||
@MV@ $@-t $@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
const MI_KEYSEG ft_keysegs[FT_SEGS]={
|
||||
{
|
||||
HA_KEYTYPE_VARTEXT, /* type */
|
||||
7, /* language */
|
||||
7, /* language (will be overwritten) */
|
||||
0, 0, 0, /* null_bit, bit_start, bit_end */
|
||||
HA_VAR_LENGTH | HA_PACK_KEY, /* flag */
|
||||
HA_FT_MAXLEN, /* length */
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ int ft_init_stopwords(const char **sws)
|
|||
if( (sw.len= (uint) strlen(sw.pos=*sws)) < MIN_WORD_LEN) continue;
|
||||
if(!tree_insert(stopwords3, &sw, 0))
|
||||
{
|
||||
delete_tree(stopwords3);
|
||||
return -1;
|
||||
delete_tree(stopwords3); /* purecov: inspected */
|
||||
return -1; /* purecov: inspected */
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -66,3 +66,12 @@ int is_stopword(char *word, uint len)
|
|||
return tree_search(stopwords3,&sw) != NULL;
|
||||
}
|
||||
|
||||
|
||||
void ft_free_stopwords()
|
||||
{
|
||||
if (stopwords3)
|
||||
{
|
||||
delete_tree(stopwords3); /* purecov: inspected */
|
||||
stopwords3=0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,8 +511,12 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
if (mi_keyseg_write(file, &keydefs[i].seg[j]))
|
||||
goto err;
|
||||
for (j=0 ; j < ft_segs ; j++) /* SerG */
|
||||
if (mi_keyseg_write(file, &ft_keysegs[j]))
|
||||
{
|
||||
MI_KEYSEG seg=ft_keysegs[j];
|
||||
seg.language= keydefs[i].seg[0].language;
|
||||
if (mi_keyseg_write(file, &seg))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
/* Create extra keys for unique definitions */
|
||||
offset=reclength-uniques*MI_UNIQUE_HASH_LENGTH;
|
||||
|
|
|
|||
|
|
@ -247,9 +247,9 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
{ /* On leaf page */
|
||||
if (_mi_write_keypage(info,keyinfo,page,anc_buff))
|
||||
DBUG_RETURN(-1);
|
||||
if (length <= (uint) keyinfo->underflow_block_length)
|
||||
DBUG_RETURN(1); /* Page will be update later */
|
||||
DBUG_RETURN(0);
|
||||
/* Page will be update later if we return 1 */
|
||||
DBUG_RETURN(test(length <= (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
|
||||
(uint) keyinfo->underflow_block_length)));
|
||||
}
|
||||
save_flag=1;
|
||||
ret_value=del(info,keyinfo,key,anc_buff,leaf_page,leaf_buff,keypos,
|
||||
|
|
@ -385,7 +385,9 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
|
|||
_mi_kpointer(info,keypos - share->base.key_reflength,next_block);
|
||||
mi_putint(anc_buff,a_length+length,share->base.key_reflength);
|
||||
|
||||
DBUG_RETURN( mi_getint(leaf_buff) <= (uint) keyinfo->underflow_block_length);
|
||||
DBUG_RETURN( mi_getint(leaf_buff) <=
|
||||
(info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
|
||||
(uint) keyinfo->underflow_block_length));
|
||||
err:
|
||||
DBUG_RETURN(-1);
|
||||
} /* del */
|
||||
|
|
@ -537,7 +539,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
}
|
||||
if (_mi_write_keypage(info,keyinfo,leaf_page,leaf_buff))
|
||||
goto err;
|
||||
DBUG_RETURN(anc_length <= (uint) keyinfo->underflow_block_length);
|
||||
DBUG_RETURN(anc_length <= ((info->quick_mode ? MI_MIN_BLOCK_LENGTH :
|
||||
(uint) keyinfo->underflow_block_length)));
|
||||
}
|
||||
|
||||
DBUG_PRINT("test",("use left page"));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include "myisamdef.h"
|
||||
#include "fulltext.h"
|
||||
|
||||
/* if flag == HA_PANIC_CLOSE then all misam files are closed */
|
||||
/* if flag == HA_PANIC_WRITE then all misam files are unlocked and
|
||||
|
|
@ -103,7 +103,10 @@ int mi_panic(enum ha_panic_function flag)
|
|||
}
|
||||
}
|
||||
if (flag == HA_PANIC_CLOSE)
|
||||
{
|
||||
VOID(mi_log(0)); /* Close log if neaded */
|
||||
ft_free_stopwords();
|
||||
}
|
||||
pthread_mutex_unlock(&THR_LOCK_myisam);
|
||||
if (!error)
|
||||
DBUG_RETURN(0);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ static void copy_key(struct st_myisam_info *info,uint inx,
|
|||
|
||||
static int verbose=0,testflag=0,
|
||||
first_key=0,async_io=0,key_cacheing=0,write_cacheing=0,locking=0,
|
||||
rec_pointer_size=0,pack_fields=1,use_log=0,silent=0;
|
||||
rec_pointer_size=0,pack_fields=1,use_log=0,silent=0,
|
||||
opt_quick_mode=0;
|
||||
static int pack_seg=HA_SPACE_PACK,pack_type=HA_PACK_KEY,remove_count=-1,
|
||||
create_flag=0;
|
||||
static ulong key_cache_size=IO_SIZE*16;
|
||||
|
|
@ -212,6 +213,8 @@ int main(int argc, char **argv)
|
|||
mi_lock_database(file,F_WRLCK);
|
||||
if (write_cacheing)
|
||||
mi_extra(file,HA_EXTRA_WRITE_CACHE);
|
||||
if (opt_quick_mode)
|
||||
mi_extra(file,HA_EXTRA_QUICK);
|
||||
|
||||
for (i=0 ; i < recant ; i++)
|
||||
{
|
||||
|
|
@ -778,6 +781,8 @@ end:
|
|||
puts("Key cacheing used");
|
||||
if (write_cacheing)
|
||||
puts("Write cacheing used");
|
||||
if (write_cacheing)
|
||||
puts("quick mode");
|
||||
if (async_io && locking)
|
||||
puts("Asyncron io with locking used");
|
||||
else if (locking)
|
||||
|
|
@ -885,6 +890,9 @@ static void get_options(int argc, char **argv)
|
|||
case 't':
|
||||
testflag=atoi(++pos); /* testmod */
|
||||
break;
|
||||
case 'q':
|
||||
opt_quick_mode=1;
|
||||
break;
|
||||
case 'c':
|
||||
create_flag|= HA_CREATE_CHECKSUM;
|
||||
break;
|
||||
|
|
@ -894,9 +902,9 @@ static void get_options(int argc, char **argv)
|
|||
case '?':
|
||||
case 'I':
|
||||
case 'V':
|
||||
printf("%s Ver 1.1 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE);
|
||||
printf("%s Ver 1.2 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE);
|
||||
puts("By Monty, for your professional use\n");
|
||||
printf("Usage: %s [-?AbBcDIKLPRSsVWltv] [-k#] [-f#] [-m#] [-t#]\n",
|
||||
printf("Usage: %s [-?AbBcDIKLPRqSsVWltv] [-k#] [-f#] [-m#] [-t#]\n",
|
||||
progname);
|
||||
exit(0);
|
||||
case '#':
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ static void usage(void)
|
|||
extreme cases as myisamchk should normally be able to\n\
|
||||
find out if the table is ok even without this switch\n\
|
||||
-F, --fast Check only tables that hasn't been closed properly\n\
|
||||
-C, --check-changed-tables\n\
|
||||
-C, --check-only-changed\n\
|
||||
Check only tables that has changed since last check\n\
|
||||
-f, --force Restart with -r if there are any errors in the table\n\
|
||||
-i, --information Print statistics information about table that is checked\n\
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ struct st_myisam_info {
|
|||
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_KEY_BLOCK_LENGTH)
|
||||
#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/MI_KEY_BLOCK_LENGTH+1)*MI_KEY_BLOCK_LENGTH)
|
||||
#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
|
||||
#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
|
||||
|
||||
/* The UNIQUE check is done with a hashed long key */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue