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
c4229a8d
Commit
c4229a8d
authored
Oct 20, 2001
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
two bugs in ft_update
parent
ccb7bb48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
17 deletions
+46
-17
myisam/ft_update.c
myisam/ft_update.c
+11
-17
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+16
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+19
-0
No files found.
myisam/ft_update.c
View file @
c4229a8d
...
...
@@ -164,41 +164,35 @@ int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
int
error
=
-
1
;
FT_WORD
*
oldlist
,
*
newlist
,
*
old_word
,
*
new_word
;
uint
key_length
;
int
cmp
;
int
cmp
,
cmp2
;
if
(
!
(
old_word
=
oldlist
=
_mi_ft_parserecord
(
info
,
keynr
,
keybuf
,
oldrec
)))
goto
err0
;
if
(
!
(
new_word
=
newlist
=
_mi_ft_parserecord
(
info
,
keynr
,
keybuf
,
newrec
)))
goto
err1
;
error
=
0
;
while
(
old_word
->
pos
&&
new_word
->
pos
)
{
cmp
=
_mi_compare_text
(
default_charset_info
,
(
uchar
*
)
old_word
->
pos
,
old_word
->
len
,
(
uchar
*
)
new_word
->
pos
,
new_word
->
len
,
0
);
if
(
cmp
==
0
)
cmp
=
sgn
(
old_word
->
weight
-
new_word
->
weight
);
else
cmp
=
sgn
(
cmp
);
cmp2
=
cmp
?
0
:
(
abs
(
old_word
->
weight
-
new_word
->
weight
)
>
1.e-5
);
switch
(
cmp
)
{
case
-
1
:
if
(
cmp
<
0
||
cmp2
)
{
key_length
=
_ft_make_key
(
info
,
keynr
,
keybuf
,
old_word
,
pos
);
if
((
error
=
_mi_ck_delete
(
info
,
keynr
,(
uchar
*
)
keybuf
,
key_length
)))
goto
err2
;
old_word
++
;
break
;
case
0
:
old_word
++
;
new_word
++
;
break
;
case
1
:
}
if
(
cmp
>
0
||
cmp2
)
{
key_length
=
_ft_make_key
(
info
,
keynr
,
keybuf
,
new_word
,
pos
);
if
((
error
=
_mi_ck_write
(
info
,
keynr
,(
uchar
*
)
keybuf
,
key_length
)))
goto
err2
;
new_word
++
;
break
;
}
}
if
(
cmp
<=
0
)
old_word
++
;
if
(
cmp
>=
0
)
new_word
++
;
}
if
(
old_word
->
pos
)
error
=
_mi_ft_erase
(
info
,
keynr
,
keybuf
,
old_word
,
pos
);
...
...
mysql-test/r/fulltext.result
View file @
c4229a8d
...
...
@@ -112,3 +112,19 @@ Can't find FULLTEXT index matching the column list
select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar');
Wrong arguments to MATCH
drop table t1,t2,t3;
CREATE TABLE t1 (
id int(11) auto_increment,
title varchar(100) default '',
PRIMARY KEY (id),
KEY ind5 (title),
FULLTEXT KEY FT1 (title)
) TYPE=MyISAM;
insert into t1 (title) values ('this is a test');
update t1 set title='this is A test' where id=1;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
update t1 set title='this test once revealed a bug' where id=1;
select * from t1;
id title
1 this test once revealed a bug
mysql-test/t/fulltext.test
View file @
c4229a8d
...
...
@@ -92,3 +92,22 @@ select * from t2 where MATCH ticket AGAINST ('foobar');
select
*
from
t2
,
t3
where
MATCH
(
t2
.
inhalt
,
t3
.
inhalt
)
AGAINST
(
'foobar'
);
drop
table
t1
,
t2
,
t3
;
#
# two more bugtests
#
CREATE
TABLE
t1
(
id
int
(
11
)
auto_increment
,
title
varchar
(
100
)
default
''
,
PRIMARY
KEY
(
id
),
KEY
ind5
(
title
),
FULLTEXT
KEY
FT1
(
title
)
)
TYPE
=
MyISAM
;
insert
into
t1
(
title
)
values
(
'this is a test'
);
update
t1
set
title
=
'this is A test'
where
id
=
1
;
check
table
t1
;
update
t1
set
title
=
'this test once revealed a bug'
where
id
=
1
;
select
*
from
t1
;
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