Hello,
I was able to make some changes to dev branch in my forked repo (
https://github.com/alakuapark/question2answer) for getting ipv6 working in q2a.
All ip storing fields in database where changed to varbinary(16) and read/writes to this fields are made with the following stored procedures:
CREATE FUNCTION `IpToString`(`ip` VARBINARY(16)) RETURNS varchar(39) BEGIN
IF IS_IPV6(INET6_NTOA(ip)) THEN RETURN INET6_NTOA(ip);
ELSE RETURN INET_NTOA(ip);
END IF;
END'
CREATE FUNCTION `StringToIp`(`ip` VARCHAR(39)) RETURNS VARBINARY(16)
BEGIN
DECLARE s VARBINARY(16);
IF IS_IPV6(ip) THEN set s=INET6_ATON(ip);
ELSE set s=INET_ATON(ip);
END IF;
RETURN s;
END;
Changed files:
qa-include/db/admin.php
qa-include/db/blobs.php
qa-include/db/cookies.php
qa-include/db/hotness.php
qa-include/db/install.php
qa-include/db/limits.php
qa-include/db/post-create.php
qa-include/db/post-update.php
qa-include/db/selects.php
qa-include/db/users.php
I would like to discuss about this feature with maintainers before asking a pull request.
Best regards,