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
38c8be9c
Commit
38c8be9c
authored
Nov 03, 2000
by
tim@threads.polyesthetic.msg
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql
into threads.polyesthetic.msg:/usr/local/src/my/work
parents
430cbbdf
df3c60a6
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
74 deletions
+59
-74
Docs/manual.texi
Docs/manual.texi
+15
-0
myisam/ft_search.c
myisam/ft_search.c
+0
-4
sql/ha_myisam.cc
sql/ha_myisam.cc
+8
-22
sql/ha_myisam.h
sql/ha_myisam.h
+3
-2
sql/handler.h
sql/handler.h
+3
-3
sql/item_func.cc
sql/item_func.cc
+11
-16
sql/item_func.h
sql/item_func.h
+1
-1
sql/opt_ft.h
sql/opt_ft.h
+1
-10
sql/opt_range.h
sql/opt_range.h
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+16
-15
No files found.
Docs/manual.texi
View file @
38c8be9c
...
...
@@ -4149,11 +4149,26 @@ USA [LinuxWired/Scottsdale, AZ] @
@uref{http://mysql.linuxwired.net/, WWW}
@uref{ftp://ftp.linuxwired.net/pub/mirrors/mysql/, FTP}
@item
@c EMAIL: dan@surfsouth.com (Dan Muntz)
@c @image{Flags/usa}
USA [Venoma.Org/Valdosta, GA] @
@uref{http://mysql.venoma.org/, WWW}
@end itemize
@strong{South America:}
@itemize @bullet
@item
@c Added 20001102
@c EMAIL: nico@bannerlandia.com (Nicolas Moldavsky)
@c @image{Flags/argentina}
Argentina [bannerlandia.com] @
@uref{http://mysql.bannerlandia.com.ar/, WWW}
@uref{ftp://mysql.bannerlandia.com.ar/mirrors/mysql/, FTP}
@c @item
@c Not ok 20000919; Non-existent (Matt)
@c EMAIL: gaiser@matrix.com.br (Roberto Gaiser)
myisam/ft_search.c
View file @
38c8be9c
...
...
@@ -158,7 +158,6 @@ FT_DOCLIST * ft_init_search(void *info, uint keynr, byte *key,
ALL_IN_ONE
aio
;
FT_DOCLIST
*
dlist
;
FT_DOC
*
dptr
;
my_off_t
saved_lastpos
;
/* black magic ON */
if
((
int
)
(
keynr
=
_mi_check_index
((
MI_INFO
*
)
info
,
keynr
))
<
0
)
...
...
@@ -174,8 +173,6 @@ FT_DOCLIST * ft_init_search(void *info, uint keynr, byte *key,
aio
.
keyinfo
=
aio
.
info
->
s
->
keyinfo
+
keynr
;
aio
.
key_root
=
aio
.
info
->
s
->
state
.
key_root
[
keynr
];
saved_lastpos
=
aio
.
info
->
lastpos
;
if
(
!
(
wtree
=
ft_parse
(
NULL
,
key
,
key_len
)))
return
NULL
;
init_tree
(
&
aio
.
dtree
,
0
,
sizeof
(
FT_SUPERDOC
),(
qsort_cmp
)
&
FT_SUPERDOC_cmp
,
0
,
...
...
@@ -204,7 +201,6 @@ FT_DOCLIST * ft_init_search(void *info, uint keynr, byte *key,
}
err:
aio
.
info
->
lastpos
=
saved_lastpos
;
delete_tree
(
&
aio
.
dtree
);
delete_tree
(
wtree
);
my_free
((
char
*
)
wtree
,
MYF
(
0
));
...
...
sql/ha_myisam.cc
View file @
38c8be9c
...
...
@@ -1079,20 +1079,6 @@ ha_rows ha_myisam::records_in_range(int inx,
end_search_flag
);
}
int
ha_myisam
::
ft_init
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
)
{
if
(
ft_handler
)
return
-
1
;
// Do the search!
ft_handler
=
ft_init_search
(
file
,
inx
,(
byte
*
)
key
,
keylen
,
presort
);
if
(
!
ft_handler
)
return
(
my_errno
?
my_errno
:
-
1
);
return
0
;
}
int
ha_myisam
::
ft_read
(
byte
*
buf
)
{
int
error
;
...
...
sql/ha_myisam.h
View file @
38c8be9c
...
...
@@ -71,8 +71,9 @@ class ha_myisam: public handler
int
index_first
(
byte
*
buf
);
int
index_last
(
byte
*
buf
);
int
index_next_same
(
byte
*
buf
,
const
byte
*
key
,
uint
keylen
);
int
ft_init
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
=
1
);
void
*
ft_init_ext
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
=
0
)
int
ft_init
()
{
if
(
!
ft_handler
)
return
1
;
ft_reinit_search
(
ft_handler
);
return
0
;
}
void
*
ft_init_ext
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
)
{
return
ft_init_search
(
file
,
inx
,(
byte
*
)
key
,
keylen
,
presort
);
}
int
ft_read
(
byte
*
buf
);
int
rnd_init
(
bool
scan
=
1
);
...
...
sql/handler.h
View file @
38c8be9c
...
...
@@ -222,9 +222,9 @@ public:
virtual
int
index_first
(
byte
*
buf
)
=
0
;
virtual
int
index_last
(
byte
*
buf
)
=
0
;
virtual
int
index_next_same
(
byte
*
buf
,
const
byte
*
key
,
uint
keylen
);
virtual
int
ft_init
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
=
1
)
virtual
int
ft_init
()
{
return
-
1
;
}
virtual
void
*
ft_init_ext
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
=
0
)
virtual
void
*
ft_init_ext
(
uint
inx
,
const
byte
*
key
,
uint
keylen
,
bool
presort
)
{
return
(
void
*
)
NULL
;
}
virtual
int
ft_read
(
byte
*
buf
)
{
return
-
1
;
}
virtual
int
rnd_init
(
bool
scan
=
1
)
=
0
;
...
...
sql/item_func.cc
View file @
38c8be9c
...
...
@@ -1840,9 +1840,6 @@ err:
double
Item_func_match
::
val
()
{
if
(
first_call
)
init_search
();
// Don't know how to return an error from val(), so NULL will be returned
if
((
null_value
=
(
ft_handler
==
NULL
)))
return
0.0
;
...
...
@@ -1853,8 +1850,7 @@ double Item_func_match::val()
}
else
{
/* implicit initialization was done, so we'll have to find
ft_relevance manually in ft_handler array */
/* we'll have to find ft_relevance manually in ft_handler array */
int
a
,
b
,
c
;
FT_DOC
*
docs
=
ft_handler
->
doc
;
...
...
@@ -1881,9 +1877,8 @@ double Item_func_match::val()
void
Item_func_match
::
init_search
()
{
if
(
!
first_call
)
if
(
ft_handler
)
return
;
first_call
=
false
;
if
(
master
)
{
...
...
@@ -1893,20 +1888,19 @@ void Item_func_match::init_search()
return
;
}
if
(
join_key
)
{
ft_handler
=
((
FT_DOCLIST
*
)
table
->
file
->
ft_handler
);
return
;
}
/* join won't use this ft-key, but we must to init it anyway */
String
*
ft_tmp
=
0
;
char
tmp1
[
FT_QUERY_MAXLEN
];
String
tmp2
(
tmp1
,
sizeof
(
tmp1
));
ft_tmp
=
key_item
()
->
val_str
(
&
tmp2
);
ft_handler
=
(
FT_DOCLIST
*
)
table
->
file
->
ft_init_ext
(
key
,
(
byte
*
)
ft_tmp
->
ptr
(),
ft_tmp
->
length
());
table
->
file
->
ft_init_ext
(
key
,
(
byte
*
)
ft_tmp
->
ptr
(),
ft_tmp
->
length
(),
join_key
);
if
(
join_key
)
{
table
->
file
->
ft_handler
=
ft_handler
;
return
;
}
}
bool
Item_func_match
::
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
tlist
)
...
...
@@ -1917,6 +1911,8 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
/* Why testing for const_item ? Monty */
/* I'll remove it later, but this should include modifications to
find_best and auto_close as complement to auto_init code above. SerG */
/* I'd rather say now that const_item is assumed in quite a bit of
places, so it would be difficult to remove. SerG */
if
(
Item_func
::
fix_fields
(
thd
,
tlist
)
||
!
const_item
())
return
1
;
...
...
@@ -1996,7 +1992,6 @@ bool Item_func_match::fix_index()
}
this
->
key
=
max_key
;
first_call
=
1
;
maybe_null
=
1
;
join_key
=
0
;
...
...
sql/item_func.h
View file @
38c8be9c
...
...
@@ -838,7 +838,7 @@ public:
List
<
Item
>
fields
;
TABLE
*
table
;
uint
key
;
bool
first_call
,
join_key
;
bool
join_key
;
Item_func_match
*
master
;
FT_DOCLIST
*
ft_handler
;
...
...
sql/opt_ft.h
View file @
38c8be9c
...
...
@@ -31,16 +31,7 @@ public:
FT_SELECT
(
TABLE
*
table
,
TABLE_REF
*
tref
)
:
QUICK_SELECT
(
table
,
tref
->
key
,
1
),
ref
(
tref
)
{}
int
init
()
{
#if 0
if (cp_buffer_from_ref(ref)) // as ft-key doesn't use store_key's
return -1;
#endif
return
error
=
file
->
ft_init
(
ref
->
key
,
ref
->
key_buff
,
ref
->
key_length
);
}
int
init
()
{
return
error
=
file
->
ft_init
();
}
int
get_next
()
{
return
error
=
file
->
ft_read
(
record
);
}
};
...
...
sql/opt_range.h
View file @
38c8be9c
...
...
@@ -71,7 +71,7 @@ public:
double
read_time
;
QUICK_SELECT
(
TABLE
*
table
,
uint
index_arg
,
bool
no_alloc
=
0
);
virtual
~
QUICK_SELECT
();
// fixed by Sasha needs to be virtual
virtual
~
QUICK_SELECT
();
void
reset
(
void
)
{
next
=
0
;
it
.
rewind
();
}
virtual
int
init
()
{
return
0
;
}
virtual
int
get_next
();
...
...
sql/sql_select.cc
View file @
38c8be9c
...
...
@@ -486,7 +486,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
as in other cases the join is done before the sort.
*/
if
((
order
||
group
)
&&
join
.
join_tab
[
join
.
const_tables
].
type
!=
JT_ALL
&&
join
.
join_tab
[
join
.
const_tables
].
type
!=
JT_FT
&&
/* Beware! SerG */
join
.
join_tab
[
join
.
const_tables
].
type
!=
JT_FT
&&
(
order
&&
simple_order
||
group
&&
simple_group
))
{
if
(
add_ref_to_table_cond
(
thd
,
&
join
.
join_tab
[
join
.
const_tables
]))
...
...
@@ -522,6 +522,19 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
goto
err
;
}
/* Perform FULLTEXT search before all regular searches */
if
(
ftfuncs
.
elements
)
{
List_iterator
<
Item_func_match
>
li
(
ftfuncs
);
Item_func_match
*
ifm
;
DBUG_PRINT
(
"info"
,(
"Performing FULLTEXT search"
));
thd
->
proc_info
=
"FULLTEXT searching"
;
while
((
ifm
=
li
++
))
{
ifm
->
init_search
();
}
}
/* Create a tmp table if distinct or if the sort is too complicated */
if
(
need_tmp
)
{
...
...
@@ -4438,26 +4451,14 @@ join_ft_read_first(JOIN_TAB *tab)
if (cp_buffer_from_ref(&tab->ref)) // as ft-key doesn't use store_key's
return -1; // see also FT_SELECT::init()
#endif
if
((
error
=
table
->
file
->
ft_init
(
tab
->
ref
.
key
,
tab
->
ref
.
key_buff
,
tab
->
ref
.
key_length
)))
{
if
(
error
!=
HA_ERR_KEY_NOT_FOUND
)
{
sql_print_error
(
"ft_read_first/init: Got error %d when reading table %s"
,
error
,
table
->
path
);
table
->
file
->
print_error
(
error
,
MYF
(
0
));
return
1
;
}
return
-
1
;
}
table
->
file
->
ft_init
();
error
=
table
->
file
->
ft_read
(
table
->
record
[
0
]);
if
(
error
)
{
if
(
error
!=
HA_ERR_END_OF_FILE
)
{
sql_print_error
(
"ft_read_first
/read
: Got error %d when reading table %s"
,
sql_print_error
(
"ft_read_first: Got error %d when reading table %s"
,
error
,
table
->
path
);
table
->
file
->
print_error
(
error
,
MYF
(
0
));
return
1
;
...
...
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