Comments: Data truncated for column 'ip_address' when using IPv6
|Reported by:||Kenneth Falck||Owned by:||nobody|
|Severity:||Keywords:||comments ipv6 address|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The contrib.comments system creates the django_comments.ip_address field as a char(15), which doesn't fit an IPv6 REMOTE_ADDR. Entering a comment causes the MySQL error "Data truncated for column 'ip_address'."
I believe IPv6 needs at least 39 characters to store any IP address. After manually modifying the field length in MySQL, the comment system works again.