[aur-dev] [PATCH] Store last login address as plain text

Marcel Korpel marcel.korpel at gmail.com
Mon Mar 14 21:38:47 UTC 2016


* Mark Weiman <mark.weiman at markzz.com> (Mon, 14 Mar 2016 13:09:09
-0400):
> On Mon, 2016-03-14 at 10:12 +0100, Marcel Korpel wrote:
>> VARCHAR(40) is too short, I think, see
>> http://stackoverflow.com/q/166132/258127
>> 
>> According to Linux header files, the maximum length of an IPv6
>> address
>> is 45 characters.
> 
> I'm not 100% sure how this actually stores the address, but if it's
> stored in its hex form, it can only be as large as 39 characters
> (4*8+7) making 40 characters more than enough.

Plain text:

$q.= "LastLoginIPAddress = " . $dbh->quote($_SERVER['REMOTE_ADDR']) . "
";

Anyway, consumer-wise it doesn't matter whether it's a VARCHAR(39) or
VARCHAR(48), see
https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html#idm139690483643168

Marcel


More information about the aur-dev mailing list