Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6236dfc7
Commit
6236dfc7
authored
Aug 25, 2000
by
serg@infomag.ape.relarn.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stopwords (English only); fulltext keys now can be repaired
parent
9349bf7e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
39 deletions
+66
-39
include/Makefile.am
include/Makefile.am
+1
-0
include/ft_global.h
include/ft_global.h
+2
-0
myisam/fulltext.h
myisam/fulltext.h
+3
-5
myisam/mi_check.c
myisam/mi_check.c
+36
-11
sql/ha_myisam.cc
sql/ha_myisam.cc
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+23
-23
No files found.
include/Makefile.am
View file @
6236dfc7
...
@@ -45,6 +45,7 @@ my_config.h: ../config.h
...
@@ -45,6 +45,7 @@ my_config.h: ../config.h
# This should be changed in the source and removed.
# This should be changed in the source and removed.
my_global.h
:
global.h
my_global.h
:
global.h
-
$(RM)
my_global.h
$(CP)
global.h my_global.h
$(CP)
global.h my_global.h
# These files should not be included in distributions since they are
# These files should not be included in distributions since they are
...
...
include/ft_global.h
View file @
6236dfc7
...
@@ -40,6 +40,8 @@ typedef struct st_ft_doclist {
...
@@ -40,6 +40,8 @@ typedef struct st_ft_doclist {
FT_DOC
doc
[
1
];
FT_DOC
doc
[
1
];
}
FT_DOCLIST
;
}
FT_DOCLIST
;
extern
const
char
*
ft_precompiled_stopwords
[];
int
ft_init_stopwords
(
const
char
**
);
int
ft_init_stopwords
(
const
char
**
);
FT_DOCLIST
*
ft_init_search
(
void
*
,
uint
,
byte
*
,
uint
,
my_bool
);
FT_DOCLIST
*
ft_init_search
(
void
*
,
uint
,
byte
*
,
uint
,
my_bool
);
...
...
myisam/fulltext.h
View file @
6236dfc7
...
@@ -35,8 +35,6 @@
...
@@ -35,8 +35,6 @@
extern
const
MI_KEYSEG
ft_keysegs
[
FT_SEGS
];
extern
const
MI_KEYSEG
ft_keysegs
[
FT_SEGS
];
extern
const
char
*
ft_precompiled_stopwords
[];
int
_mi_ft_cmp
(
MI_INFO
*
,
uint
,
const
byte
*
,
const
byte
*
);
int
_mi_ft_cmp
(
MI_INFO
*
,
uint
,
const
byte
*
,
const
byte
*
);
int
_mi_ft_add
(
MI_INFO
*
,
uint
,
byte
*
,
const
byte
*
,
my_off_t
);
int
_mi_ft_add
(
MI_INFO
*
,
uint
,
byte
*
,
const
byte
*
,
my_off_t
);
int
_mi_ft_del
(
MI_INFO
*
,
uint
,
byte
*
,
const
byte
*
,
my_off_t
);
int
_mi_ft_del
(
MI_INFO
*
,
uint
,
byte
*
,
const
byte
*
,
my_off_t
);
myisam/mi_check.c
View file @
6236dfc7
...
@@ -1083,7 +1083,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
...
@@ -1083,7 +1083,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
if
(
!
(
sort_info
->
record
=
(
byte
*
)
my_malloc
((
uint
)
share
->
base
.
pack_reclength
,
if
(
!
(
sort_info
->
record
=
(
byte
*
)
my_malloc
((
uint
)
share
->
base
.
pack_reclength
,
MYF
(
0
))))
MYF
(
0
))))
{
{
mi_check_print_error
(
param
,
"Not
E
nough memory for extra record"
);
mi_check_print_error
(
param
,
"Not
e
nough memory for extra record"
);
goto
err
;
goto
err
;
}
}
...
@@ -1141,6 +1141,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
...
@@ -1141,6 +1141,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
for
(
i
=
0
;
i
<
share
->
state
.
header
.
max_block_size
;
i
++
)
for
(
i
=
0
;
i
<
share
->
state
.
header
.
max_block_size
;
i
++
)
share
->
state
.
key_del
[
i
]
=
HA_OFFSET_ERROR
;
share
->
state
.
key_del
[
i
]
=
HA_OFFSET_ERROR
;
share
->
state
.
key_map
=
((
ulonglong
)
1L
<<
share
->
base
.
keys
)
-
1
;
/* Should I ? */
info
->
state
->
key_file_length
=
share
->
base
.
keystart
;
info
->
state
->
key_file_length
=
share
->
base
.
keystart
;
lock_memory
(
param
);
/* Everything is alloced */
lock_memory
(
param
);
/* Everything is alloced */
...
@@ -1270,11 +1272,18 @@ static int writekeys(register MI_INFO *info,byte *buff,my_off_t filepos)
...
@@ -1270,11 +1272,18 @@ static int writekeys(register MI_INFO *info,byte *buff,my_off_t filepos)
for
(
i
=
0
;
i
<
info
->
s
->
base
.
keys
;
i
++
)
for
(
i
=
0
;
i
<
info
->
s
->
base
.
keys
;
i
++
)
{
{
if
(((
ulonglong
)
1
<<
i
)
&
info
->
s
->
state
.
key_map
)
if
(((
ulonglong
)
1
<<
i
)
&
info
->
s
->
state
.
key_map
)
{
if
(
info
->
s
->
keyinfo
[
i
].
flag
&
HA_FULLTEXT
)
{
if
(
_mi_ft_add
(
info
,
i
,(
char
*
)
key
,
buff
,
filepos
))
goto
err
;
}
else
{
{
uint
key_length
=
_mi_make_key
(
info
,
i
,
key
,
buff
,
filepos
);
uint
key_length
=
_mi_make_key
(
info
,
i
,
key
,
buff
,
filepos
);
if
(
_mi_ck_write
(
info
,
i
,
key
,
key_length
))
goto
err
;
if
(
_mi_ck_write
(
info
,
i
,
key
,
key_length
))
goto
err
;
}
}
}
}
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
err:
err:
...
@@ -1284,12 +1293,19 @@ static int writekeys(register MI_INFO *info,byte *buff,my_off_t filepos)
...
@@ -1284,12 +1293,19 @@ static int writekeys(register MI_INFO *info,byte *buff,my_off_t filepos)
while
(
i
--
>
0
)
while
(
i
--
>
0
)
{
{
if
(((
ulonglong
)
1
<<
i
)
&
info
->
s
->
state
.
key_map
)
if
(((
ulonglong
)
1
<<
i
)
&
info
->
s
->
state
.
key_map
)
{
if
(
info
->
s
->
keyinfo
[
i
].
flag
&
HA_FULLTEXT
)
{
if
(
_mi_ft_del
(
info
,
i
,(
char
*
)
key
,
buff
,
filepos
))
break
;
}
else
{
{
uint
key_length
=
_mi_make_key
(
info
,
i
,
key
,
buff
,
filepos
);
uint
key_length
=
_mi_make_key
(
info
,
i
,
key
,
buff
,
filepos
);
if
(
_mi_ck_delete
(
info
,
i
,
key
,
key_length
))
break
;
if
(
_mi_ck_delete
(
info
,
i
,
key
,
key_length
))
break
;
}
}
}
}
}
}
}
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
my_errno
));
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
my_errno
));
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
/* writekeys */
}
/* writekeys */
...
@@ -1919,8 +1935,17 @@ static int sort_key_read(SORT_INFO *sort_info, void *key)
...
@@ -1919,8 +1935,17 @@ static int sort_key_read(SORT_INFO *sort_info, void *key)
"Found too many records; Can`t continue"
);
"Found too many records; Can`t continue"
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
sort_info
->
keyinfo
->
flag
&
HA_FULLTEXT
)
{
mi_check_print_error
(
sort_info
->
param
,
"Can`t use repair_by_sort with FULLTEXT key"
);
DBUG_RETURN
(
1
);
}
else
{
VOID
(
_mi_make_key
(
info
,
sort_info
->
key
,
key
,
sort_info
->
record
,
VOID
(
_mi_make_key
(
info
,
sort_info
->
key
,
key
,
sort_info
->
record
,
sort_info
->
filepos
));
sort_info
->
filepos
));
}
DBUG_RETURN
(
sort_write_record
(
sort_info
));
DBUG_RETURN
(
sort_write_record
(
sort_info
));
}
/* sort_key_read */
}
/* sort_key_read */
...
@@ -2984,7 +3009,7 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows)
...
@@ -2984,7 +3009,7 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows)
return
FALSE
;
/* Can't use sort */
return
FALSE
;
/* Can't use sort */
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
)
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
)
{
{
if
(
mi_too_big_key_for_sort
(
key
,
rows
))
if
(
mi_too_big_key_for_sort
(
key
,
rows
)
||
(
key
->
flag
&
HA_FULLTEXT
)
)
return
FALSE
;
return
FALSE
;
}
}
return
TRUE
;
return
TRUE
;
...
...
sql/ha_myisam.cc
View file @
6236dfc7
...
@@ -372,6 +372,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m)
...
@@ -372,6 +372,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m)
param
.
table_name
=
table
->
table_name
;
param
.
table_name
=
table
->
table_name
;
param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
param
.
using_global_keycache
=
1
;
param
.
using_global_keycache
=
1
;
param
.
thd
=
thd
;
VOID
(
fn_format
(
fixed_name
,
file
->
filename
,
""
,
MI_NAME_IEXT
,
VOID
(
fn_format
(
fixed_name
,
file
->
filename
,
""
,
MI_NAME_IEXT
,
4
+
(
param
.
opt_follow_links
?
16
:
0
)));
4
+
(
param
.
opt_follow_links
?
16
:
0
)));
...
...
sql/mysqld.cc
View file @
6236dfc7
...
@@ -1455,7 +1455,7 @@ int main(int argc, char **argv)
...
@@ -1455,7 +1455,7 @@ int main(int argc, char **argv)
sql_print_error
(
"Can't init databases"
);
sql_print_error
(
"Can't init databases"
);
exit
(
1
);
exit
(
1
);
}
}
ft_init_stopwords
(
NULL
);
/* SerG */
ft_init_stopwords
(
ft_precompiled_stopwords
);
/* SerG */
#ifdef __WIN__
#ifdef __WIN__
#define MYSQL_ERR_FILE "mysql.err"
#define MYSQL_ERR_FILE "mysql.err"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment