From a3fab0edade68b9748d40b04bc7b48ee69b7fe3e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 13 Nov 2010 17:40:09 +0000 Subject: #575280 follow-up by mfb, carlos8f: Empty session IDs break Drupal. (courtesty of BADCamp 2010 woo) --- modules/system/system.install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index 94c0bb2ee..ad76e11be 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2911,7 +2911,10 @@ function system_update_7065() { 'length' => 128, 'not null' => TRUE, ); - db_change_field('sessions', 'sid', 'sid', $spec); + db_drop_primary_key('sessions'); + db_change_field('sessions', 'sid', 'sid', $spec, array('primary key' => array('sid', 'ssid'))); + // Delete any sessions with empty session ID. + db_delete('sessions')->condition('sid', '')->execute(); } /** -- cgit v1.2.3