On fresh install session table is empty and session.inc tries to insert a row. But it ommits uid field which is NOT NULL and inserting fails. Attached patch makes it to have the same behaviour as 4.6

CommentFileSizeAuthor
#2 session-uid.inc.diff955 bytesCvbge
session-uid.inc955 bytesCvbge
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Patch doesn't apply because it ends with '.inc'. Maybe better to use uid int(11) NOT NULL default '0' in the table definition?

Cvbge’s picture

FileSize
955 bytes

I can't change schema definition because that'd mean that db update is needed when upgrading from 4.5.5 to 4.5.6.
As I said (although not directly) 4.6 and later does not have this bug.

Heh, at first I didn't understand what's with the .inc extension...

chx’s picture

You can change schema IMO. It has happened already, we extended locale field size in a minor release. Just nothing major. If you need a rule of thumb: column attribute changes are OK but nothing else.

Cvbge’s picture

I believe the SQL query change is better in this case, because it fixes the problem, does not need schema change and makes 4.5 version the same as 4.6.

Cvbge’s picture

Status: Needs review » Reviewed & tested by the community

A person proposed almost identical patch in http://drupal.org/node/30268

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to DRUPAL-4-5. Thanks.

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)