You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this error in the mybb logfile today. Any ideas why the IP address (redacted, but same length) might be too long? The DB column seems to be varbinary(16) while the PHP method used to convert IP into a binary representation can return 32bit or 128bit strings (https://www.php.net/manual/en/function.inet-pton.php). Is the DB field simply way too small in general? But this error doesn't occur all the time, just randomly it seems. And what's with the X before the actual IP value?
specs:
MyBB 1.8.33
PHP 7.4.33
MySQL 8.0.32
View Unread Posts 1.14
<error>
<dateline>1682496541</dateline>
<script></script>
<line>0</line>
<type>20</type>
<friendly_type>MyBB SQL Error</friendly_type>
<message>SQL Error: 1406 - Data too long for column 'ipaddress' at row 1
Query:
INSERT
INTO mybb_searchlog (`sid`,`uid`,`dateline`,`ipaddress`,`threads`,`posts`,`resulttype`,`querycache`,`keywords`)
VALUES ('a9cd5f5016b36493e59067f2070b66a3','0000000',1682496541,X'0000000000000f0c000c0c00cc000f0f000f','','','threads','1 < 0','')
</message>
<back_trace>#0 errorHandler->error() called at [/inc/db_mysqli.php:606]
#1 DB_MySQLi->error() called at [/inc/db_mysqli.php:342]
#2 DB_MySQLi->query() called at [/inc/db_mysqli.php:375]
#3 DB_MySQLi->write_query() called at [/inc/db_mysqli.php:839]
#4 DB_MySQLi->insert_query() called at [/inc/plugins/unreadPosts.php:493]
#5 unreadPosts::doSearch() called at [/inc/class_plugins.php:136]
#6 pluginSystem->run_hooks() called at [/search.php:1747]
</back_trace>
</error>
The text was updated successfully, but these errors were encountered:
The DB column seems to be varbinary(16) while the PHP method used to convert IP into a binary representation can return 32bit or 128bit strings (https://www.php.net/manual/en/function.inet-pton.php). Is the DB field simply way too small in general?
A varbinary(16) field can store 16 bytes, which corresponds to 128 bits. Valid IP addresses cannot be longer than that.
which means that it had to be an invalid IP? Or that PHP created an invalid return value? The preceding X seems a bit odd, unless that is a marker added by MySQL to highlight the affected value?
I came across this error in the mybb logfile today. Any ideas why the IP address (redacted, but same length) might be too long? The DB column seems to be
varbinary(16)
while the PHP method used to convert IP into a binary representation can return 32bit or 128bit strings (https://www.php.net/manual/en/function.inet-pton.php). Is the DB field simply way too small in general? But this error doesn't occur all the time, just randomly it seems. And what's with theX
before the actual IP value?specs:
The text was updated successfully, but these errors were encountered: