22006-11-15 17:34:52,778 ERROR   mmbase.module.core.MMObjectBuilder - BLOB/TEXT
column 'naam' used in key specification without a key length in query:ALTER
TABLE mm_artikel ADD INDEX mm_artikel_main_idx
(naam)org.mmbase.storage.StorageException: BLOB/TEXT column 'naam' used in key
specification without a key length in query:ALTER TABLE mm_artikel ADD INDEX
mm_artikel_main_idx (naam)

From the mysql documentation:

For CHAR, VARCHAR, BINARY, and VARBINARY columns, indexes can be
created that use only the leading part of column values, using
col_name(length) syntax to specify an index prefix length.

BLOB and TEXT columns also can be indexed, but a prefix length
__must__ be given.

Prefix lengths are given in characters for non-binary string types and
in bytes for binary string types. That is, index entries consist of
the first length characters of each column value for CHAR, VARCHAR,
and TEXT columns, and the first length bytes of each column value for
BINARY, VARBINARY, and BLOB columns.

I wonder if it is wise to key on a blob-field; as a rule of thumb I
would only create keys on fields with sizes that would fit into a
VARCHAR.

Johannes
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to