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
fa456991
Commit
fa456991
authored
Apr 23, 2003
by
serg@sergbook.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug 283: FULLTEXT index on a TEXT filed converted to a CHAR field doesn't work anymore
parent
0bfb2d3d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
9 deletions
+36
-9
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+11
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+13
-0
sql/sql_table.cc
sql/sql_table.cc
+12
-9
No files found.
mysql-test/r/fulltext.result
View file @
fa456991
...
...
@@ -215,3 +215,14 @@ test.t1 repair status OK
select * from t1 where match (a) against ('aaaa');
a
drop table t1;
drop table if exists t1;
create table t1 ( ref_mag text not null, fulltext (ref_mag));
insert into t1 values ('test');
select ref_mag from t1 where match ref_mag against ('+test' in boolean mode);
ref_mag
test
alter table t1 change ref_mag ref_mag char (255) not null;
select ref_mag from t1 where match ref_mag against ('+test' in boolean mode);
ref_mag
test
drop table t1;
mysql-test/t/fulltext.test
View file @
fa456991
...
...
@@ -173,3 +173,16 @@ repair table t1;
select
*
from
t1
where
match
(
a
)
against
(
'aaaa'
);
drop
table
t1
;
#
# bug 283 by jocelyn fournier <joc@presence-pc.com>
# FULLTEXT index on a TEXT filed converted to a CHAR field doesn't work anymore
#
drop
table
if
exists
t1
;
create
table
t1
(
ref_mag
text
not
null
,
fulltext
(
ref_mag
));
insert
into
t1
values
(
'test'
);
select
ref_mag
from
t1
where
match
ref_mag
against
(
'+test'
in
boolean
mode
);
alter
table
t1
change
ref_mag
ref_mag
char
(
255
)
not
null
;
select
ref_mag
from
t1
where
match
ref_mag
against
(
'+test'
in
boolean
mode
);
drop
table
t1
;
sql/sql_table.cc
View file @
fa456991
...
...
@@ -569,6 +569,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
column
->
field_name
);
DBUG_RETURN
(
-
1
);
}
/* for fulltext keys keyseg length is 1 for blobs (it's ignored in
ft code anyway, and 0 (set to column width later) for char's.
it has to be correct col width for char's, as char data are not
prefixed with length (unlike blobs, where ft code takes data length
from a data prefix, ignoring column->length).
*/
if
(
key
->
type
==
Key
::
FULLTEXT
)
column
->
length
=
test
(
f_is_blob
(
sql_field
->
pack_flag
));
if
(
f_is_blob
(
sql_field
->
pack_flag
))
{
if
(
!
(
file
->
table_flags
()
&
HA_BLOB_KEY
))
...
...
@@ -578,10 +586,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
if
(
!
column
->
length
)
{
if
(
key
->
type
==
Key
::
FULLTEXT
)
column
->
length
=
1
;
/* ft-code ignores it anyway :-) */
else
{
my_printf_error
(
ER_BLOB_KEY_WITHOUT_LENGTH
,
ER
(
ER_BLOB_KEY_WITHOUT_LENGTH
),
MYF
(
0
),
...
...
@@ -589,7 +593,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
}
}
if
(
!
(
sql_field
->
flags
&
NOT_NULL_FLAG
))
{
if
(
key
->
type
==
Key
::
PRIMARY
)
...
...
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