Incorrect table definition

marcus0263 - June 16, 2009 - 04:59
Project:Login Security
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Received this error while updating to the latest rev -

user warning: Incorrect table definition; there can be only one auto column and it must be defined as a key query: ALTER TABLE drupal_login_security_track DROP INDEX id in /xxxxxx/xxxxxxx/drupal-6.12/includes/database.mysql-common.inc on line 448.

The status was -

Failed: ALTER TABLE {login_security_track} DROP INDEX id

Created bug report as "critical" due to effects on security and users

#1

ilo - June 16, 2009 - 23:06

I guess the error was introduced in the 1.9 revision of the install file, in the update_6001 function. Some database tasks were moved and leave the drop operation unfinished: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/login_secur...

the 1.8 revision of the function was something like this:

db_drop_primary_key($ret, 'login_security_track');
db_add_primary_key($ret, 'login_security_track', array('id'));
db_drop_index($ret, 'login_security_track', 'id');

and the 1.9 is

db_drop_primary_key($ret, 'login_security_track');
db_drop_index($ret, 'login_security_track', 'id');

Need to switch back this update function to the 1.8.. Deekayen?

This little patch would do, don't know if should I commit as the file was slightly modified for a D7 aproximation by deekayen, I'll wait for him in this issue.

AttachmentSize
login_security_492800_1.patch 1.08 KB

#2

ilo - June 16, 2009 - 23:07
Status:active» needs review

#3

marcus0263 - June 17, 2009 - 15:57

Excellent, applied the new dev version and the patch, all is well.

Cheers!

#4

deekayen - June 17, 2009 - 18:19
Status:needs review» fixed

committed, but reopening #399390: database schema and operations clean up

#5

System Message - July 1, 2009 - 18:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.