Page MenuHomePhabricator

confirmaccount.sql error: column 'acr_email' used in key specification without a key length
Closed, ResolvedPublic

Description

Hi when I try to upload confirmaccount.sql manualy it comes up with this error

SQL query:
CREATE INDEX /*i*/acr_email_token ON /*_*/account_requests(acr_email_token);
MySQL said: Documentation #1170 - BLOB/TEXT column 'acr_email' used in key specification without a key length

It seems to have started recently because it was working a few weeks ago.

the file is at https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FConfirmAccount/129fd7a728be13f9356d86f6a4eafee2ec0c1532/backend%2Fschema%2Fmysql%2FConfirmAccount.sql

It seems to be only when manually uploading it the error comes up if you do it through the web install it works.

Event Timeline

Paladox raised the priority of this task from to Unbreak Now!.
Paladox updated the task description. (Show Details)
Paladox changed Security from none to None.
Paladox added a subscriber: Paladox.
Paladox lowered the priority of this task from Unbreak Now! to High.Dec 19 2014, 2:42 PM
Paladox updated the task description. (Show Details)

Please provide a summary of the actual error in a task summary, instead of just writing "error". Thanks.

upload confirmaccount.sql manualy

There is no file with such a name. It looks like you refer to ConfirmAccount.sql instead.

I assume by "upload" you actually mean "execute" instead.

Problem is covered in http://stackoverflow.com/questions/1827063/mysql-error-key-specification-without-a-key-length

Aklapper renamed this task from Error in confirmaccount.sql to confirmaccount.sql error: column 'acr_email' used in key specification without a key length.Dec 19 2014, 7:22 PM
Aklapper lowered the priority of this task from High to Medium.

I'm not sure what is "Ok." here. You might want to elaborate and avoid extremely short comments.

I have written ok to tell that I have read your comment/change.

No need to announce that (just creates mail).
If you're interested in getting your issue fixed I assume you follow your own tickets and their comments anyway. :)

Aklapper lowered the priority of this task from Medium to Low.Dec 29 2014, 12:30 AM
This comment was removed by Paladox.

Should I change varbinary to binary on acr_email_token_expires varbinary(14),

Should I also change CREATE TABLE IF NOT EXISTS to CREATE TABLE

and should I change CREATE UNIQUE INDEX /*i*/acr_email ON /*_*/account_requests (acr_email(255)); to CREATE UNIQUE INDEX /*i*/acr_email ON /*_*/account_requests (acr_email);

Paladox raised the priority of this task from Low to Medium.Feb 2 2015, 8:58 AM
Paladox updated the task description. (Show Details)
Paladox added a subscriber: aaron.

Or should I change CREATE INDEX /*i*/acr_email_token ON /*_*/account_requests (acr_email_token); to CREATE INDEX /*i*/acr_email_token ON /*_*/account_requests (acr_email_token(255));

Aklapper lowered the priority of this task from Medium to Low.Feb 2 2015, 6:07 PM

(Please keep the priority intact. Thank you.)

I think the error only occurs if you try doing confirmaccount.sql manually. not through the web updater.

Change 206173 had a related patch set uploaded (by Paladox):
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206173

I got the same error and found the solution, which is:

Commented out the ConfirmAccount Extension in LocalSettings
ALTER TABLE account_requests MODIFY acr_email VARCHAR(255);
Uncommented the ConfirmAccount Extension in LocaSettings
Re-run update.php

It works (so far)
That's it!

This comment was removed by Paladox.

Paladox,
it's not an error but a message.
You got something like that:


*<br />*
*<b>Notice</b>: Uncommitted DB writes (transaction from
DatabaseUpdater::doUpdat

es). in <b>/home/tunearch/public_html/w/includes/db/Database.php</b> on

line <b> 4266</b><br />*
*es). in <b>/home/tunearch/public_html/w/includes/db/Database.php</b> on
line <b> *


The error is in the "*UNSPECIFIED LENGHT OF A UNIQUE KEY*"; in this case
"ACR_EMAIL"
All you have to do is to *ALTER *the table "account_request" changing the
type of the column "acr_email" from type "TINYTEXT" to type "VARCHAR(255)"
(*the needed lenght*).
Doing this, when you re-run update.php, anything goes...
Good luck.
V

Hi yes it works. Uploaded a patch to fix this problem.

Change 206173 merged by jenkins-bot:
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206173

Change 206428 had a related patch set uploaded (by Paladox):
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206428

Change 206430 had a related patch set uploaded (by Paladox):
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206430

Change 206431 had a related patch set uploaded (by Paladox):
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206431

Paladox claimed this task.

Change 206431 merged by jenkins-bot:
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206431

Change 206430 merged by jenkins-bot:
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206430

Change 206428 merged by jenkins-bot:
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206428

Change 206517 had a related patch set uploaded (by Paladox):
Fix sql problem in acr_email

https://gerrit.wikimedia.org/r/206517