-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DatabaseError: (1170, "BLOB/TEXT column 'tree_path' used in key specification without a key length") #48
Comments
This had something to do with the use of the text model field for tree_path. I resolved it by changing its type to CharField(max_length=255) - in theory you should be able to use any length you like though. |
The error is coming because MySQL can index only the first N chars of a BLOB or TEXT column. So you must be having a field/column type of TEXT or BLOB that you are trying to make as primary key or index. With full BLOB or TEXT without the length value, MySQL will be unable to guarantee the uniqueness of the column as it’s of variable and dynamic size. So, when using BLOB or TEXT types as index, the value of N must be supplied so that MySQL can determine the key length. |
I saw this, it looked like ThreadedComments module was doing this? The error was around the ThreadedComments - Tree_path field? |
Exactly, with regard to mysql |
Same issue here |
Same issue here with mysql. Is it fair to say this package is broken for mysql users? I tried changing the tree_path to CharField(max_length=255) but that produces this warning:
Edit: Have gone for a custom solution as I can't work out what's going wrong and I don't want problems down the line. |
I am running into the same issue when trying to run the test for the app - FATAL ERROR - The following SQL query failed: CREATE INDEX any solution for this? |
I'm having the same issue too. |
This is now fixed in django-threadedcomments 1.0b1. We've replaced the TextField with a CharField, that MySQL can apply indexes at. |
We are getting the following error when running south migrations after implementing threadedcomments. I see a much older bug like this logged, and the problem at that time was Django indexing. Has this been resolved since?
The text was updated successfully, but these errors were encountered: