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
f4c648af
Commit
f4c648af
authored
Dec 09, 2008
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
5168c2ac
d4adb110
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
8 deletions
+65
-8
client/mysql_upgrade.c
client/mysql_upgrade.c
+14
-1
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+9
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+9
-0
sql/field.cc
sql/field.cc
+1
-1
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+32
-6
No files found.
client/mysql_upgrade.c
View file @
f4c648af
...
...
@@ -616,6 +616,18 @@ static int run_mysqlcheck_upgrade(void)
"--check-upgrade"
,
"--all-databases"
,
"--auto-repair"
,
NULL
);
}
static
int
run_mysqlcheck_fixnames
(
void
)
{
verbose
(
"Running 'mysqlcheck'..."
);
return
run_tool
(
mysqlcheck_path
,
NULL
,
/* Send output from mysqlcheck directly to screen */
"--no-defaults"
,
ds_args
.
str
,
"--all-databases"
,
"--fix-db-names"
,
"--fix-table-names"
,
NULL
);
...
...
@@ -784,7 +796,8 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
if
(
run_mysqlcheck_upgrade
()
||
if
(
run_mysqlcheck_fixnames
()
||
run_mysqlcheck_upgrade
()
||
run_sql_fix_privilege_tables
())
{
/*
...
...
mysql-test/r/fulltext.result
View file @
f4c648af
...
...
@@ -522,3 +522,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
DROP TABLE t1;
CREATE TABLE t1(a CHAR(10));
INSERT INTO t1 VALUES('aaa15');
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE)
1
SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
2
DROP TABLE t1;
mysql-test/t/fulltext.test
View file @
f4c648af
...
...
@@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
WHERE
MATCH
(
a
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
)
AND
b
=
1
;
DROP
TABLE
t1
;
#
# BUG#37245 - Full text search problem
#
CREATE
TABLE
t1
(
a
CHAR
(
10
));
INSERT
INTO
t1
VALUES
(
'aaa15'
);
SELECT
MATCH
(
a
)
AGAINST
(
'aaa1* aaa14 aaa16'
IN
BOOLEAN
MODE
)
FROM
t1
;
SELECT
MATCH
(
a
)
AGAINST
(
'aaa1* aaa14 aaa15 aaa16'
IN
BOOLEAN
MODE
)
FROM
t1
;
DROP
TABLE
t1
;
sql/field.cc
View file @
f4c648af
...
...
@@ -3835,7 +3835,7 @@ int Field_longlong::store(double nr)
error
=
1
;
}
else
res
=
(
longlong
)
(
ulonglong
)
nr
;
res
=
(
longlong
)
double2ulonglong
(
nr
)
;
}
else
{
...
...
storage/myisam/ft_boolean_search.c
View file @
f4c648af
...
...
@@ -161,11 +161,11 @@ static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b)
static
int
FTB_WORD_cmp_list
(
CHARSET_INFO
*
cs
,
FTB_WORD
**
a
,
FTB_WORD
**
b
)
{
/* ORDER BY word
DESC, ndepth DESC
*/
int
i
=
ha_compare_text
(
cs
,
(
uchar
*
)
(
*
b
)
->
word
+
1
,(
*
b
)
->
len
-
1
,
(
uchar
*
)
(
*
a
)
->
word
+
1
,(
*
a
)
->
len
-
1
,
0
,
0
);
/* ORDER BY word
, ndepth
*/
int
i
=
ha_compare_text
(
cs
,
(
uchar
*
)
(
*
a
)
->
word
+
1
,
(
*
a
)
->
len
-
1
,
(
uchar
*
)
(
*
b
)
->
word
+
1
,
(
*
b
)
->
len
-
1
,
0
,
0
);
if
(
!
i
)
i
=
CMP_NUM
((
*
b
)
->
ndepth
,(
*
a
)
->
ndepth
);
i
=
CMP_NUM
((
*
a
)
->
ndepth
,
(
*
b
)
->
ndepth
);
return
i
;
}
...
...
@@ -865,23 +865,49 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
FT_INFO
*
ftb
=
ftb_param
->
ftb
;
FTB_WORD
*
ftbw
;
int
a
,
b
,
c
;
/*
Find right-most element in the array of query words matching this
word from a document.
*/
for
(
a
=
0
,
b
=
ftb
->
queue
.
elements
,
c
=
(
a
+
b
)
/
2
;
b
-
a
>
1
;
c
=
(
a
+
b
)
/
2
)
{
ftbw
=
ftb
->
list
[
c
];
if
(
ha_compare_text
(
ftb
->
charset
,
(
uchar
*
)
word
,
len
,
(
uchar
*
)
ftbw
->
word
+
1
,
ftbw
->
len
-
1
,
(
my_bool
)
(
ftbw
->
flags
&
FTB_FLAG_TRUNC
),
0
)
>
0
)
(
my_bool
)
(
ftbw
->
flags
&
FTB_FLAG_TRUNC
),
0
)
<
0
)
b
=
c
;
else
a
=
c
;
}
/*
If there were no words with truncation operator, we iterate to the
beginning of an array until array element is equal to the word from
a document. This is done mainly because the same word may be
mentioned twice (or more) in the query.
In case query has words with truncation operator we must iterate
to the beginning of the array. There may be non-matching query words
between matching word with truncation operator and the right-most
matching element. E.g., if we're looking for 'aaa15' in an array of
'aaa1* aaa14 aaa15 aaa16'.
Worse of that there still may be match even if the binary search
above didn't find matching element. E.g., if we're looking for
'aaa15' in an array of 'aaa1* aaa14 aaa16'. The binary search will
stop at 'aaa16'.
*/
for
(;
c
>=
0
;
c
--
)
{
ftbw
=
ftb
->
list
[
c
];
if
(
ha_compare_text
(
ftb
->
charset
,
(
uchar
*
)
word
,
len
,
(
uchar
*
)
ftbw
->
word
+
1
,
ftbw
->
len
-
1
,
(
my_bool
)(
ftbw
->
flags
&
FTB_FLAG_TRUNC
),
0
))
break
;
{
if
(
ftb
->
with_scan
&
FTB_FLAG_TRUNC
)
continue
;
else
break
;
}
if
(
ftbw
->
docid
[
1
]
==
ftb
->
info
->
lastpos
)
continue
;
ftbw
->
docid
[
1
]
=
ftb
->
info
->
lastpos
;
...
...
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