summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/manual.texi3
-rw-r--r--myisam/mi_check.c6
-rw-r--r--mysql-test/r/fulltext.result9
-rw-r--r--mysql-test/t/fulltext.test12
4 files changed, 28 insertions, 2 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index f24f9ce5eb2..7556aa7e1ac 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -50801,6 +50801,9 @@ each individual 4.0.x release.
Updated source tree to be built using @code{automake 1.5} and
@code{libtool 1.4}.
@item
+Fixed bug that made @code{REPAIR TABLE} and @code{myisamchk}
+to corrupt @code{FULLTEXT} indexes.
+@item
Fixed bug with caching system database ('mysql'). Now query to system
database is not cached by query cache.
@item
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 4669566fc8f..9e591325c1c 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -2529,7 +2529,7 @@ static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key)
if (!sort_param->wordlist)
{
- do
+ for (;;)
{
my_free((char*) wptr, MYF(MY_ALLOW_ZERO_PTR));
if ((error=sort_get_next_record(sort_param)))
@@ -2537,9 +2537,10 @@ static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key)
if (!(wptr=_mi_ft_parserecord(info,sort_param->key,
key,sort_param->record)))
DBUG_RETURN(1);
+ if (wptr->pos)
+ break;
error=sort_write_record(sort_param);
}
- while (!wptr->pos);
sort_param->wordptr=sort_param->wordlist=wptr;
}
else
@@ -2560,6 +2561,7 @@ static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key)
{
my_free((char*) sort_param->wordlist, MYF(0));
sort_param->wordlist=0;
+ error=sort_write_record(sort_param);
}
else
sort_param->wordptr=(void*)wptr;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index b312f5fbc3d..ab227687265 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -203,3 +203,12 @@ select 8 from t1;
8
8
drop table t1;
+drop table if exists t1;
+create table t1 (a text, fulltext key (a));
+insert into t1 values ('aaaa');
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+select * from t1 where match (a) against ('aaaa');
+a
+drop table t1;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 65d5381d725..6483045f4ed 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -160,3 +160,15 @@ INSERT INTO t1 VALUES (1,'my small mouse'),(2,'la-la-la'),(3,'It is so funny'),(
select 8 from t1;
drop table t1;
+#
+# Check bug reported by Julian Ladisch
+# ERROR 1030: Got error 127 from table handler
+#
+
+drop table if exists t1;
+create table t1 (a text, fulltext key (a));
+insert into t1 values ('aaaa');
+repair table t1;
+select * from t1 where match (a) against ('aaaa');
+drop table t1;
+