Active
Project:
Document Import API
Version:
6.x-2.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2009 at 12:16 UTC
Updated:
22 Mar 2010 at 05:17 UTC
When trying to enable the docapi module I got this warning.
user warning: Specified key was too long; max key length is [error]
1000 bytes
query: CREATE TABLE docapi_library (
`doc_id` INT unsigned NOT NULL auto_increment,
`plugin_id` INT unsigned NOT NULL,
`uid` INT unsigned NOT NULL,
`filemime` VARCHAR(255) NOT NULL DEFAULT
'text/plain',
`filename` VARCHAR(255) NOT NULL DEFAULT '',
`filepath` VARCHAR(255) NOT NULL,
`filesize` INT unsigned NOT NULL,
`created` DATETIME NOT NULL,
`changed` DATETIME NOT NULL,
PRIMARY KEY (doc_id),
INDEX filepath_name (filepath, filename)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ in
/home/kris/workspace/drupal6/includes/database.inc on line 517.
Obviously, there's something wrong with the SQL syntax.
Comments
Comment #1
kriskras commentedI should add that when I just run the code through mysql, I got no error at all!
Comment #2
xell commentedI got the same problem and it seems to be a bug of MySQL. In docapi.install you can find for this table there is a key defined:
If you are using UTF-8 as default encoding, each character holds up to 3 bytes. So for this key, length of both fields is 255. Total length is 3*(255+255) = 1530, which is longer than 1000.
One solution is not to use UTF-8 if you do not need it.
I changed the code above to:
which also make it successful to install. But who can tell me if this change leads any problem? (sorry I do not understand how database index works...)
Comment #3
zet commentedSame:
not to use utf-8 is not a solution for me