View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
09993Bug reportsComfortUpdatepublic2015-10-26 12:31
Reporterjri Assigned Toc_schmitz  
PriorityurgentSeveritypartial_block 
Status closedResolutionwon't fix 
Product Version2.06+ 
Summary09993: SQL Problem during database upgrade
Description

I'm trying to update my Limesurvey instance from 2.05+ (150520) to 2.06+ (151018) due to the security issue.

The code update seems to be alright, but when I try to upgrade de database throuth the wizard, I get:
"La base de données de LimeSurvey est en train d’être mise à jour (2015-10-23 14:33:08) .

Veuillez patienter ...

Erreur non récupérable durant la mise à jour. Détails de cette erreur :

CDbCommand n'a pas pu exécuter la commande SQL : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

Veuillez corriger cette erreur dans la base de données et recommencer."

And no info about which SQL Statement cause this error..

Steps To Reproduce

Update from production Limesurvey 2.05+ (150520) to 2.06+ (151018)

Additional Information

Using automatic update or manual update gave me the same error.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)150520
I will donate to the project if issue is resolvedNo
BrowserFirefox 41
Database type & versionMysqlserver 5.1.73, Limesurvey database version 177
Server OS (if known)CentOS 6
Webserver software & version (if known)Nginx 1.0.15
PHP VersionPHO 5.5.15
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2015-10-23 17:00

administrator   ~33442

Try activating debug mode in /application/config/config.php and see if you get a more detailed error.

jri

jri

2015-10-23 17:05

reporter   ~33444

Last edited: 2015-10-23 17:06

Yes !

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes. The SQL statement executed was: ALTER TABLE lime_tokens_16277_20111114 CHANGE lastname lastname varchar(150)

Is it useful ?

c_schmitz

c_schmitz

2015-10-23 17:13

administrator   ~33446

Yes, probably there is a non-standard key on that table which includes the 'lastname' field or you probably edited a field length manually. Use a table editor to inspect the related table and maby rememoce it. The table name looks non-standard, too.

jri

jri

2015-10-23 17:31

reporter   ~33447

Last edited: 2015-10-23 17:32

Hum here is a CREATE TABLE dump from the DB:
CREATE TABLE lime_tokens_16277_20111114 (
tid int(11) NOT NULL AUTO_INCREMENT,
firstname varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
lastname varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
email varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL,
emailstatus text COLLATE utf8_unicode_ci,
token varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
language varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
sent varchar(17) COLLATE utf8_unicode_ci DEFAULT 'N',
remindersent varchar(17) COLLATE utf8_unicode_ci DEFAULT 'N',
remindercount int(11) DEFAULT '0',
completed varchar(17) COLLATE utf8_unicode_ci DEFAULT 'N',
validfrom datetime DEFAULT NULL,
validuntil datetime DEFAULT NULL,
mpid int(11) DEFAULT NULL,
usesleft int(11) NOT NULL DEFAULT '1',
participant_id varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
blacklisted varchar(17) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (tid),
KEY lime_tokens_16277_idx (token),
KEY idx_lime_tokens_16277_efl (email(120),firstname,lastname)
) ENGINE=MyISAM AUTO_INCREMENT=61 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/!40101 SET character_set_client = @saved_cs_client /;

So, there is a KEY with lastname, but I don't know/understand what is wrong. If the field has been manualy edited, it's not me and I don't know who is it and why...

What could I do ? It seems there are many others tables like this one in the DB :(

jri

jri

2015-10-26 12:27

reporter   ~33453

Me again..

I have a question: is it Limesurvey himself that creates indexes ? like that kind of names: 'idx_lime_tokens_26787_efl'
Or it is possibly created by a survey developper ?

Is it bad if I delete all of the indexes for concerned tables but keep the tables ?

c_schmitz

c_schmitz

2015-10-26 12:28

administrator   ~33454

There is no harm done if you delete the _efl indexes - they will be re-created by the update script.

c_schmitz

c_schmitz

2015-10-26 12:30

administrator   ~33455

Last edited: 2015-10-26 12:31

I just checked the source - LimeSurvey actually tries to delete the index beforehand, but since your table has a nonstandard-naming it cannot properly find out the correct index name and so the deletion fails.
Anyway, this is not a LimeSurvey bug since someone manualyl renamed a table in the database.

Issue History

Date Modified Username Field Change
2015-10-23 16:37 jri New Issue
2015-10-23 16:37 jri Status new => assigned
2015-10-23 16:37 jri Assigned To => c_schmitz
2015-10-23 17:00 c_schmitz Note Added: 33442
2015-10-23 17:00 c_schmitz Status assigned => feedback
2015-10-23 17:05 jri Note Added: 33444
2015-10-23 17:05 jri Status feedback => assigned
2015-10-23 17:06 jri Note Edited: 33444
2015-10-23 17:13 c_schmitz Note Added: 33446
2015-10-23 17:31 jri Note Added: 33447
2015-10-23 17:32 jri Note Edited: 33447
2015-10-26 12:27 jri Note Added: 33453
2015-10-26 12:28 c_schmitz Note Added: 33454
2015-10-26 12:30 c_schmitz Note Added: 33455
2015-10-26 12:30 c_schmitz Note Edited: 33455
2015-10-26 12:31 c_schmitz Note Edited: 33455
2015-10-26 12:31 c_schmitz Status assigned => closed
2015-10-26 12:31 c_schmitz Resolution open => won't fix