‘CREATE INDEX’ for mysql Table if field is BLOBBy admin, written on February 28, 2010 |
howto |
- admin
- Email: uwarov@gmx.de
- Join date: 07-21-07
- Posts: 1
Which SQL implementations are mostly used in your projects?
- MySQL (44%, 4 Votes)
- We don't use SQL (44%, 4 Votes)
- MS SQL Server (22%, 2 Votes)
- Oracle (11%, 1 Votes)
- Standard (0%, 0 Votes)
- PostgreSQL (0%, 0 Votes)
- DB2 (0%, 0 Votes)
- mSQL (0%, 0 Votes)
- Informix (0%, 0 Votes)
- Something else (0%, 0 Votes)
Total Voters: 9
Loading ...
Mysql allows the fulltext search. To do that, there must be an index
For example, you have two fields which you want to be searched:
my_correct_column of TEXT type
my_column of BLOB type
You try:
ALTER TABLE my_table ADD FULLTEXT `related_index` ( `my_correct_column` , `my_column` )
and get something like this:
ERROR 1170 (42000): BLOB/TEXT column ‘my_column’ used in key specification without a key length
or maybe
ERROR 1283 (HY000): Column ‘my_column’ cannot be part of FULLTEXT index
Problem is, that many text fields are stored in mysql not in TEXT format, but as BLOB (my_column).
MYSQL doesn’t allow indexing BLOB’s. The reason might be simple, that binary format should not be searched.
To add the index, format of field should be changed:
ALTER TABLE my_table MODIFY my_column TEXT;
Remark: It also fixes the issue with many Wordpress plugins, particularly of “what is related” type, complaining that they fail to create an index.
I had this problem with “Yet Another Related Posts Plugin (YARPP)”
|
LEARN MORE (amazon bookstore)
|
|
TAGS
|
|
RELATED
|
Pages
Posts
|
|
SOCIAL
|


















