MediaWiki indeed doesn't store IP-addresses directly. This is for a few
reasons, one of which is sorting them from MySQL for block ranges.
It uses ip2long [1] for IPv4 addresses and a base conversion of raw HEX for
IPv6 [2].
See also the source of MediaWiki's IP.php class [3]
--
Krinkle
[1]
On Jun 21, 2011 9:29 AM, "Ryan Chan"
<ryanchan404(a)gmail.com> wrote:
According to this:
http://www.mediawiki.org/wiki/Manual:User_newtalk_table, IP was stored
using varchar(40) .
But seems 45 should be the safe instead of 39?
http://stackoverflow.com/questions/4982701/best-way-to-store-ip-in-database
The 45-char version is for the dotted-quad variant of an ipv4 mixed
address.
I think we're normalizing to the canonical grouped hex form with elided
zeroes so that format wouldn't get stored.
-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l