From 79513c6d29ffbbfb3568fba73b040078d64ac66c Mon Sep 17 00:00:00 2001 From: james Date: Thu, 30 Dec 2010 13:56:50 +0000 Subject: [PATCH] Add a fix for new MySQL 5.1 where it doesnt truncate at 16 characters before comparing, so all our long usernames were failing (mysql internally only supports 16 characters) --- common.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.inc.php b/common.inc.php index 242c584..d3ae75e 100644 --- a/common.inc.php +++ b/common.inc.php @@ -80,6 +80,15 @@ else exit; } +/* +difference between MySQL <5.1 and 5.1: +in <5.1 in must have internall truncated it at 16 before comparing with the hard-coded 16 character database limit +in 5.1 it doesnt truncate and compares the full string with the hardcoded 16 character limit, so all our very long usernames +are now failing +James - Dec 30 2010 +*/ +$DBUSER=substr($DBUSER,0,16); + if(!mysql_connect($DBHOST,$DBUSER,$DBPASS)) { echo "SFIAB ERROR";