summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-11-04 09:40:36 +0200
committermonty@narttu.mysql.fi <>2003-11-04 09:40:36 +0200
commit4e4725377d27ff0101788fd7ed89670614ed8294 (patch)
treed387df22d5d3ffed50ecd8620f1eb18bc61ead7e /myisam
parent30af2d0f49a203ae4fb97194e899fa5e13a42c1d (diff)
parente1e82a4e00dd2cee2ff56accdd3fdbd5afeadb6a (diff)
downloadmariadb-git-4e4725377d27ff0101788fd7ed89670614ed8294.tar.gz
Merge with 4.0
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c2
-rw-r--r--myisam/mi_extra.c20
-rw-r--r--myisam/mi_locking.c20
-rw-r--r--myisam/myisamchk.c4
4 files changed, 12 insertions, 34 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 95d0149c67d..f3b593f7341 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -362,7 +362,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
- res=ftb->queue.max_elements=1+query_len/(ft_min_word_len+1);
+ res=ftb->queue.max_elements=1+query_len/(min(ft_min_word_len,2)+1);
ftb->queue.root=(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*));
reinit_queue(& ftb->queue, res, 0, 0,
(int (*)(void*,byte*,byte*))FTB_WORD_cmp, 0);
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index 1d57e0c0e18..8c7515550e7 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -336,22 +336,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (share->not_flushed)
{
share->not_flushed=0;
-#if defined(__WIN__)
- if (_commit(share->kfile))
- error=errno;
- if (_commit(info->dfile))
- error=errno;
-#elif defined(HAVE_FDATASYNC)
- if (fdatasync(share->kfile))
- error=errno;
- if (fdatasync(share->dfile))
- error=errno;
-#elif defined(HAVE_FSYNC)
- if ( fsync(share->kfile))
- error=errno;
- if (fsync(share->dfile))
- error=errno;
-#endif
+ if (my_sync(share->kfile, MYF(0)))
+ error= my_errno;
+ if (my_sync(info->dfile, MYF(0)))
+ error= my_errno;
if (error)
{
share->changed=1;
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 785979235ce..6f996ab5abd 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -98,22 +98,10 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->changed=0;
if (myisam_flush)
{
-#if defined(__WIN__)
- if (_commit(share->kfile))
- error=errno;
- if (_commit(info->dfile))
- error=errno;
-#elif defined(HAVE_FDATASYNC)
- if (fdatasync(share->kfile))
- error=errno;
- if (fdatasync(share->dfile))
- error=errno;
-#elif defined(HAVE_FSYNC)
- if (fsync(share->kfile))
- error=errno;
- if (fsync(share->dfile))
- error=errno;
-#endif
+ if (my_sync(share->kfile, MYF(0)))
+ error= my_errno;
+ if (my_sync(info->dfile, MYF(0)))
+ error= my_errno;
}
else
share->not_flushed=1;
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 5a3768c9932..59cc26b198b 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -411,6 +411,8 @@ static void usage(void)
-q, --quick Faster repair by not modifying the data file.\n\
One can give a second '-q' to force myisamchk to\n\
modify the original datafile in case of duplicate keys.\n\
+ NOTE: Tables where the data file is currupted can't be\n\
+ fixed with this option.\n\
-u, --unpack Unpack file packed with myisampack.\n\
");
@@ -1109,7 +1111,7 @@ end2:
filename));
if (param->testflag & T_REP_ANY)
VOID(fprintf(stderr,
- "Try fixing it by using the --safe-recover (-o) or the --force (-f) option\n"));
+ "Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag\n"));
}
else if (!(param->error_printed & 2) &&
!(param->testflag & T_FORCE_CREATE))